/**
 * TOP 100 pages (/site/{module}-ratings): the podium for the first three and the ranked list after it.
 * Markup: resources/views/site/partials/top-ratings.blade.php. Band, module nav, covers and the score
 * display come from media-kit.css.
 *
 * Uses only the semantic tokens declared in layout-site/master.css, so it renders in every theme.
 */

.top100-page {
    --top100-heart: #ff6b8a;
    padding-bottom: clamp(40px, 4vw, 64px);
}

/* ================== PODIUM ================== */
.top100-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding-top: 40px;
    list-style: none;
}

.top100-podium-item {
    --medal: var(--accent);
    position: relative;
    display: flex;
    gap: 20px;
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius);
    background-color: var(--surface-1);
    background-image: radial-gradient(420px 260px at 100% 0%, color-mix(in srgb, var(--medal) 13%, transparent) 0%, transparent 70%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--medal) 32%, var(--line));
    overflow: hidden;
}

.top100-podium-item.is-rank-2 {
    --medal: #d6d2da;
}

.top100-podium-item.is-rank-3 {
    --medal: #cd8a4e;
}

.top100-cover {
    flex: none;
    width: 128px;
    align-self: flex-start;
}

.top100-podium-body {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top100-podium-rank {
    position: absolute;
    top: -18px;
    right: -6px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 112px;
    line-height: 1;
    color: var(--medal);
    pointer-events: none;
}

.top100-podium-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    margin: 0;
    padding-right: 64px;
    overflow: hidden;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.top100-podium-title a {
    color: var(--text-1);
    text-decoration: none;
}

.top100-podium-title a:hover {
    color: var(--accent);
}

.top100-podium-title a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* The media kit score display, sized for a card */
.top100-podium .score-display {
    align-items: flex-start;
    margin-top: auto;
    text-align: left;
}

.top100-podium .score-display-value {
    gap: 8px;
    margin-top: 4px;
}

.top100-podium .score-display-value i {
    margin-top: 16px;
    font-size: 16px;
}

.top100-podium .score-display-number {
    font-size: 64px;
    line-height: 54px;
}

.top100-podium .score-display-max {
    padding-top: 30px;
    font-size: 22px;
    line-height: 22px;
}

.top100-podium .score-display-count {
    margin-top: 2px;
    font-size: 13px;
}

.top100-favorites {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    color: var(--text-2);
}

.top100-favorites i {
    font-size: 12px;
    color: var(--top100-heart);
}

/* ================== LIST (4 to 100) ================== */
/* Two columns on wide screens; the ranking runs down the first column, then the second */
.top100-list {
    margin: 0;
    padding-top: 36px;
    list-style: none;
    column-count: 2;
    column-gap: 64px;
}

.top100-row {
    position: relative;
    display: grid;
    grid-template-columns: 52px 44px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    break-inside: avoid;
}

.top100-row-rank {
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0.02em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

.top100-row-cover {
    width: 44px;
    border-radius: 4px;
    box-shadow: none;
}

/* Too small for the typographic cover: the module tint and bar are enough */
.top100-row-cover .poster-fallback {
    justify-content: center;
    padding: 0;
    align-items: center;
}

.top100-row-cover .poster-fallback-title {
    display: none;
}

.top100-row-main {
    min-width: 0;
}

.top100-row-title {
    margin: 0;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.top100-row-link {
    color: var(--text-1);
    text-decoration: none;
    transition: color 0.15s ease;
}

/* The whole row opens the item; the add button sits above the stretched link */
.top100-row-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.top100-row:hover .top100-row-link {
    color: var(--accent);
}

.top100-row-link:focus-visible {
    outline: none;
}

.top100-row:has(.top100-row-link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.top100-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 2px 0 0;
    font-size: 12.5px;
    line-height: 18px;
    color: var(--text-2);
}

.top100-row-meta i {
    margin-right: 5px;
    font-size: 10px;
    color: var(--top100-heart);
}

.top100-row-score {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 30px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}

.top100-row-score i {
    font-size: 13px;
    color: var(--accent);
}

/* An average past 10: only masterpieces (11) get it there */
.top100-row-score.is-masterpiece,
.top100-row-score.is-masterpiece i,
.top100-row-meta .masterpiece-mark i {
    color: var(--masterpiece);
}

.top100-row-meta .masterpiece-mark i {
    margin-right: 0;
}

.top100-row-action {
    position: relative;
    z-index: 2;
}

/* ================== EMPTY ================== */
.top100-empty {
    padding-top: 48px;
}

.top100-empty-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 32px;
    line-height: 1.05;
    color: var(--text-1);
}

.top100-empty-text {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--text-2);
}

/* ================== RESPONSIVE ================== */
@media (max-width: 1199.98px) {
    .top100-podium {
        grid-template-columns: minmax(0, 1fr);
        max-width: 720px;
    }

    .top100-list {
        column-count: 1;
    }
}

@media (max-width: 767.98px) {
    .top100-podium {
        gap: 14px;
        padding-top: 24px;
    }

    .top100-podium-item {
        gap: 14px;
        padding: 14px;
    }

    .top100-cover {
        width: 92px;
    }

    .top100-podium-rank {
        top: -10px;
        right: -2px;
        font-size: 76px;
    }

    .top100-podium-title {
        padding-right: 44px;
        font-size: 16px;
    }

    .top100-podium .score-display-number {
        font-size: 48px;
        line-height: 42px;
    }

    .top100-podium .score-display-max {
        padding-top: 22px;
        font-size: 18px;
    }

    .top100-podium .score-display-value i {
        margin-top: 12px;
    }

    .top100-list {
        padding-top: 24px;
    }

    .top100-row {
        grid-template-columns: 34px 40px minmax(0, 1fr) auto auto;
        gap: 12px;
    }

    .top100-row-rank {
        font-size: 24px;
    }

    .top100-row-cover {
        width: 40px;
    }

    .top100-row-title {
        font-size: 14px;
    }

    .top100-row-score {
        font-size: 24px;
    }
}
