/*
 * Fold Certification — Midnight Sapphire + Gold Identity v0.8.389
 * Presentation only. No score, rank, classification, gate, or data behavior lives here.
 *
 * Visual ratio:
 *   80% midnight/black surfaces
 *   15% sapphire/icy-blue information color
 *    5% restrained gold trust and selection accents
 */

:root {
    --fold-sg-midnight: #02070e;
    --fold-sg-black: #000000;
    --fold-sg-sapphire: #0d2947;
    --fold-sg-sapphire-hover: #12375e;
    --fold-sg-blue-border: #315b87;
    --fold-sg-blue-link: #bfdbfe;
    --fold-sg-gold: #d2a84a;
    --fold-sg-gold-soft: #e7c979;
    --fold-sg-failure: #641c25;
}

/* ------------------------------------------------
   PUBLIC LEADERBOARD — ONE COLOR FAMILY
   ------------------------------------------------ */

html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-stack {
    display: grid !important;
    gap: 9px !important;
    min-width: 168px !important;
    background: transparent !important;
}

/* Evaluation, Probe A, and Probe B deliberately share one solid sapphire. */
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line:nth-child(1),
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line:nth-child(2),
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line:nth-child(3) {
    display: grid !important;
    grid-template-columns: minmax(86px, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 9px 11px !important;
    border-radius: 11px !important;
    background: var(--fold-sg-sapphire) !important;
    background-color: var(--fold-sg-sapphire) !important;
    background-image: none !important;
    border: 1px solid var(--fold-sg-blue-border) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-label,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-value,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line span,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-line strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-label {
    font-size: 10.5px !important;
    font-weight: 900 !important;
    letter-spacing: .065em !important;
    text-transform: uppercase !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-value {
    font-size: 15px !important;
    font-weight: 900 !important;
    font-variant-numeric: tabular-nums !important;
}

/* Verified is trustworthy and distinct without becoming a second color block. */
html body:not(.wp-admin) .fold-leaderboard-polished .fold-verified-result-seal,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-status.verified,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 84px !important;
    min-height: 44px !important;
    padding: 7px 9px !important;
    border-radius: 12px !important;
    background: var(--fold-sg-sapphire) !important;
    background-color: var(--fold-sg-sapphire) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid var(--fold-sg-gold) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-status.pending {
    background: var(--fold-sg-sapphire) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: var(--fold-sg-blue-border) !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-status.rejected {
    background: var(--fold-sg-failure) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #f87171 !important;
    text-shadow: none !important;
}

/* Integrity failure remains the only strong red pill. */
html body:not(.wp-admin) .fold-leaderboard-polished .fold-failure-reason-label {
    display: inline-block !important;
    max-width: 100% !important;
    margin-top: 8px !important;
    padding: 7px 10px !important;
    border-radius: 11px !important;
    background: var(--fold-sg-failure) !important;
    background-color: var(--fold-sg-failure) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid #f87171 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-classification-hover:has(~ .fold-failure-reason-label) .fold-classification-hover-text {
    color: #fecaca !important;
    -webkit-text-fill-color: #fecaca !important;
}

/* First place receives the only gold row/rank cue; every other medal is sapphire. */
html body:not(.wp-admin) .fold-leaderboard-polished tbody tr.fold-top-entry td {
    border-top-color: rgba(210, 168, 74, .72) !important;
    border-bottom-color: rgba(210, 168, 74, .72) !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished tbody tr.fold-top-entry td:first-child {
    border-left-color: rgba(210, 168, 74, .72) !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished tbody tr.fold-top-entry td:last-child {
    border-right-color: rgba(210, 168, 74, .72) !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-badge.rank-hypercube,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-badge.rank-gold {
    background: rgba(210, 168, 74, .09) !important;
    background-image: none !important;
    border-color: rgba(210, 168, 74, .78) !important;
    color: var(--fold-sg-gold-soft) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) !important;
    animation: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-cube::before,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-cube::after {
    border-color: var(--fold-sg-gold-soft) !important;
    box-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-cube i {
    background: var(--fold-sg-gold-soft) !important;
    box-shadow: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-badge.rank-silver,
html body:not(.wp-admin) .fold-leaderboard-polished .fold-rank-badge.rank-bronze {
    background: var(--fold-sg-sapphire) !important;
    background-image: none !important;
    border-color: var(--fold-sg-blue-border) !important;
    color: #dbeafe !important;
    box-shadow: none !important;
}

/* The top score remains white; gold describes placement, not numerical value. */
html body:not(.wp-admin) .fold-leaderboard-polished tr.fold-top-entry td:nth-child(6) strong {
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
    animation: none !important;
}

html body:not(.wp-admin) .fold-leaderboard-polished a:hover,
html body:not(.wp-admin) .fold-leaderboard-polished a:focus {
    color: var(--fold-sg-blue-link) !important;
    -webkit-text-fill-color: var(--fold-sg-blue-link) !important;
}

/* ------------------------------------------------
   SITE-WIDE RESTRAINED GOLD ACCENTS
   ------------------------------------------------ */

/* Selected navigation keeps white text and gains a quiet gold trace. */
html body:not(.wp-admin) .main-header-menu > .current-menu-item > .menu-link,
html body:not(.wp-admin) .main-header-menu > .current-menu-ancestor > .menu-link,
html body:not(.wp-admin) .main-header-menu .sub-menu .current-menu-item > .menu-link {
    color: #ffffff !important;
}

html body:not(.wp-admin) .ast-desktop .main-header-menu > .current-menu-item > .menu-link::after,
html body:not(.wp-admin) .ast-desktop .main-header-menu > .current-menu-ancestor > .menu-link::after {
    background: linear-gradient(90deg, transparent, var(--fold-sg-gold) 28%, var(--fold-sg-gold-soft) 72%, transparent) !important;
    box-shadow: none !important;
}

/* Primary actions remain blue; gold is only the confidence edge. */
html body:not(.wp-admin) .fold-button.fold-primary-cta {
    background: var(--fold-sg-sapphire-hover) !important;
    background-color: var(--fold-sg-sapphire-hover) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid var(--fold-sg-gold) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24) !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) .fold-button.fold-primary-cta:hover,
html body:not(.wp-admin) .fold-button.fold-primary-cta:focus {
    background: #174a7b !important;
    background-color: #174a7b !important;
    border-color: var(--fold-sg-gold-soft) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .30) !important;
}

/* Small editorial labels carry the gold identity without repainting body copy. */
html body:not(.wp-admin) .fold-home-kicker,
html body:not(.wp-admin) .fold-home-section-kicker {
    color: var(--fold-sg-gold-soft) !important;
}

html body:not(.wp-admin) .fold-path-professional .fold-path-label {
    background: rgba(210, 168, 74, .07) !important;
    background-image: none !important;
    color: var(--fold-sg-gold-soft) !important;
    border-color: rgba(210, 168, 74, .54) !important;
    box-shadow: none !important;
}

@media (max-width: 800px) {
    html body:not(.wp-admin) .fold-leaderboard-polished .fold-score-stack {
        min-width: 0 !important;
        width: 100% !important;
    }

    html body:not(.wp-admin) .fold-leaderboard-polished .fold-verified-result-seal {
        width: auto !important;
        min-width: 120px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body:not(.wp-admin) .fold-leaderboard-polished *,
    html body:not(.wp-admin) .fold-button.fold-primary-cta {
        animation: none !important;
        transition: none !important;
    }
}
