/* Community Leaderboard — /leaderboard/ */

.lb-page {
    --lb-border: #eef2f7;
    --lb-surface: #f8fafc;
    --lb-gold: #f0b429;
    --lb-silver: #adb5bd;
    --lb-bronze: #cd7f32;
}

/* ---------- Period tabs ---------- */
.lb-period-tab {
    display: inline-block;
    padding: .45rem 1.1rem;
    border: 1px solid var(--lb-border);
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.lb-period-tab:hover {
    background: var(--lb-surface);
    color: #1f2937;
}
.lb-period-tab.active {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}
/* Live dot. Sits on the current-month tab and on the in-progress label so the
   two read as the same state. Hidden inside archive tabs. */
.lb-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: .4rem;
    border-radius: 50%;
    background: #16a34a;
    vertical-align: 1px;
}
.lb-period-tab.active .lb-live-dot { background: #4ade80; }

/* ---------- In-progress meter ---------- */
.lb-progress {
    max-width: 34rem;
    padding: .9rem 1.1rem;
    background: var(--lb-surface);
    border: 1px solid var(--lb-border);
    border-radius: 14px;
}
.lb-progress-label {
    font-size: .85rem;
    font-weight: 600;
    color: #1f2937;
}
.lb-progress-note {
    font-size: .78rem;
    font-weight: 600;
    color: #16a34a;
    white-space: nowrap;
}
.lb-progress-track {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.lb-progress-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}
.lb-progress-sub {
    margin-top: .5rem;
    font-size: .74rem;
    line-height: 1.4;
    color: #6b7280;
}

/* ---------- Stat strip ---------- */
.lb-stat-strip {
    gap: 1rem 2.5rem;
    padding: 1rem 1.25rem;
    background: var(--lb-surface);
    border: 1px solid var(--lb-border);
    border-radius: 14px;
}
.lb-stat {
    text-align: center;
    min-width: 8rem;
}
.lb-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: #1f2937;
}
.lb-stat-label {
    display: block;
    font-size: .78rem;
    color: #6b7280;
    margin-top: .15rem;
}

/* ---------- Experts / Shows pills ---------- */
.lb-pills {
    display: inline-flex;
    padding: .25rem;
    background: var(--lb-surface);
    border: 1px solid var(--lb-border);
    border-radius: 999px;
}
.lb-pill {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .4rem 1.4rem;
    font-size: .9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}
.lb-pill.active {
    background: #fff;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* ---------- Podium ---------- */
.lb-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 1rem;
    padding: 1.75rem 1rem 1.25rem;
    background: linear-gradient(180deg, #fffdf5 0%, #fff 100%);
    border: 1px solid var(--lb-border);
    border-radius: 16px;
}
.lb-podium-item {
    text-align: center;
    min-width: 0;
}
.lb-podium-avatar-wrap {
    position: relative;
    display: inline-block;
}
.lb-podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.lb-podium-1 .lb-podium-avatar {
    width: 84px;
    height: 84px;
    border-color: var(--lb-gold);
}
.lb-podium-medal {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    border: 2px solid #fff;
}
.lb-podium-name {
    margin-top: .5rem;
    font-weight: 600;
    color: #1f2937;
    font-size: .92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lb-podium-1 .lb-podium-name { font-size: 1.02rem; }
.lb-podium-points {
    font-weight: 700;
    color: #1f2937;
    font-size: .9rem;
    margin-top: .15rem;
}
.lb-podium-sub {
    font-size: .75rem;
    color: #6b7280;
}

/* ---------- Board card ---------- */
.lb-board {
    border: 1px solid var(--lb-border);
    border-radius: 14px;
}
.lb-empty {
    padding: 1.25rem 0;
}
.lb-list > li + li {
    border-top: 1px solid var(--lb-border);
}
.lb-row {
    gap: .75rem;
    padding: .6rem 0;
}
.lb-row-me {
    background: #eef6ff;
    border-radius: 8px;
    padding-left: .5rem;
    padding-right: .5rem;
    margin: 0 -.5rem;
}

.lb-rank {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--lb-surface);
    color: #6b7280;
    font-size: .78rem;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}
.lb-rank-1 { background: var(--lb-gold);   color: #fff; }
.lb-rank-2 { background: var(--lb-silver); color: #fff; }
.lb-rank-3 { background: var(--lb-bronze); color: #fff; }

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.lb-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
}
.lb-podium-avatar.lb-avatar-initials { font-size: 1.6rem; }

/* min-width:0 is what actually lets the truncation below work inside flex */
.min-w-0 { min-width: 0; }

.lb-name a {
    color: #1f2937;
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lb-name a:hover { text-decoration: underline; }
.lb-sub {
    font-size: .74rem;
    line-height: 1.3;
}

.lb-metric-value {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1f2937;
}
.lb-metric-unit {
    display: block;
    font-size: .7rem;
    color: #6b7280;
    margin-top: -2px;
}

/* ---------- Review wall ---------- */
.lb-review {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 1.1rem 1.2rem;
    background: #fff;
    border: 1px solid var(--lb-border);
    border-radius: 14px;
}
.lb-review .lb-avatar {
    width: 40px;
    height: 40px;
}
.lb-review-name {
    display: block;
    color: #1f2937;
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.25;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lb-review-name:hover { text-decoration: underline; }

.lb-stars {
    line-height: 1;
    margin-top: .15rem;
}
.lb-star {
    color: #dfe3e8;
    font-size: .82rem;
    letter-spacing: .02em;
}
.lb-star.on { color: var(--lb-gold); }

.lb-review-text {
    flex: 1 1 auto;
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: #374151;
    /* Reviews run to ~900 chars; clamp so the grid stays even, full text is on
       the profile page anyway. */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lb-review-by {
    font-size: .76rem;
    margin-top: .65rem;
    padding-top: .55rem;
    border-top: 1px solid var(--lb-border);
}
.lb-review-by a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}
.lb-review-by a:hover { text-decoration: underline; }

/* ---------- Membership badge ----------
   Appearance comes entirely from .badge / .badge-xs / .badge-pro, shared with
   the search listing cards and defined globally in theme/head.php. Only the
   spacing is local — these badges sit inline next to text rather than pinned to
   a card corner. Only paying members get one. */
.lb-plan {
    margin-right: .4rem;
    vertical-align: 1px;
    white-space: nowrap;
}
.lb-stars .lb-plan { margin-right: 0; margin-left: .4rem; }
.lb-podium-plan { margin-top: .25rem; }
.lb-podium-plan .lb-plan { margin-right: 0; }

/* ---------- Explainer ---------- */
.lb-explainer {
    background: var(--lb-surface);
    border: 1px solid var(--lb-border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
    .lb-podium {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: .75rem;
        padding: 1rem;
    }
    /* Flatten to a plain 1-2-3 list rather than a squashed podium */
    .lb-podium-item {
        display: flex;
        align-items: center;
        gap: .75rem;
        text-align: left;
    }
    .lb-podium-1 { order: -1; }
    .lb-podium-2 { order:  0; }
    .lb-podium-3 { order:  1; }
    .lb-podium-avatar,
    .lb-podium-1 .lb-podium-avatar {
        width: 48px;
        height: 48px;
    }
    .lb-podium-name,
    .lb-podium-1 .lb-podium-name {
        margin-top: 0;
        font-size: .92rem;
    }
    .lb-stat-strip { gap: .75rem 1.25rem; }
    .lb-stat { min-width: 6.5rem; }
    .lb-stat-value { font-size: 1.3rem; }
}

/* ---------- Intro prose ---------- */
.lb-intro {
    max-width: 46rem;
    margin: 0 auto;
    font-size: .95rem;
    line-height: 1.6;
}
.lb-intro a { color: inherit; font-weight: 600; }
