﻿/* grade.css — /about-grade. Chart + stat blocks; article typography comes from
   library-article.css. */

/* ---- headline ---- */
.grade-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    margin: 22px 0 26px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.grade-headline-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    color: var(--positive, #0F8A3B);
    font-variant-numeric: tabular-nums;
}

.grade-headline-label {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 42ch;
    line-height: 1.45;
}

/* (Chart styles live inline in Views/Shared/_GradeChart.cshtml — the chart is
   shared with the home-page promo rotation and must be self-contained.) */

/* ---- paired stat boxes ---- */
.grade-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0 6px;
}

@media (max-width: 560px) {
    .grade-pair {
        grid-template-columns: 1fr;
    }
}

.grade-pair-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 16px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-align: center;
}

.grade-pair-cap {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.grade-pair-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

    .grade-pair-value.is-pos {
        color: var(--positive, #0F8A3B);
    }

.grade-pair-label {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---- CTA ---- */
.grade-cta-wrap {
    text-align: center;
    margin: 26px 0;
}

.grade-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 10px;
    /* The gold is fixed rather than inherited. --ew-gold is redefined per theme, and
       when it resolved dark the button became gold-on-dark text with no contrast.
       A primary call to action should not change legibility with the theme. */
    background: #DDB785;
    color: #1A1205;
    font-weight: 800;
    font-size: 14.5px;
    text-decoration: none;
    border: 1px solid transparent;
}

    /* brightness(1.05) lightened the gold toward the near-black label rather than away
       from it, so the text lost contrast exactly when the pointer was on it. Darkening
       the background pushes the two apart instead. */
    .grade-cta:hover,
    .grade-cta:focus-visible {
        background: #C9A268;
        color: #140E03;
    }

    .grade-cta:focus-visible {
        outline: 2px solid #DDB785;
        outline-offset: 3px;
    }

.grade-cta-mark {
    flex: 0 0 auto;
}

/* ---- live A+ record variant of the headline block ---- */
.grade-live .grade-headline-value {
    color: var(--ew-gold, #DDB785);
}

/* ---- slot for the separately-built A+ performance chart ---- */
.grade-aplus-fig {
    margin: 22px 0;
}

.grade-aplus-chart {
    position: relative;
    min-height: 340px;
    border-radius: 10px;
}

/* The caption above the chart carries the claim, so it reads as a heading rather
   than an afterthought. */
.grade-aplus-cap {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    text-align: left;
}

.aplus-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* The chart's overlays are styled on the A+ page; repeated here, scoped to this
   mount, because this page does not load that stylesheet. */
#aplusPerf .aplus-returns-wm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34%;
    max-width: 220px;
    transform: translate(-50%, -50%);
    opacity: 0.06;
    pointer-events: none;
    z-index: 1;
}

#aplusPerf .aplus-returns-badge {
    position: absolute;
    top: 14%;
    left: 12%;
    width: 42px;
    height: 42px;
    color: var(--ew-gold, #DDB785);
    opacity: 0.28;
    pointer-events: none;
    z-index: 1;
}

    #aplusPerf .aplus-returns-badge svg {
        width: 100%;
        height: 100%;
    }

#aplusPerf .aplus-returns-legend {
    position: absolute;
    top: 10px;
    left: 58px;
    z-index: 2;
    display: flex;
    gap: 18px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    pointer-events: none;
}

#aplusPerf .arl-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#aplusPerf .arl-sw {
    display: inline-block;
    width: 18px;
    height: 3px;
    border-radius: 2px;
}

#aplusPerf .aplus-returns-stats {
    position: absolute;
    top: 78px;
    left: 58px;
    z-index: 2;
    min-width: 218px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    /* The stats box still needs to sit ON something to stay legible over the plot,
       but a lighter wash keeps it from reading as a second panel now the chart
       itself is transparent. */
    background: color-mix(in srgb, var(--surface, #fff) 78%, transparent);
    backdrop-filter: blur(2px);
    font-size: 13px;
    pointer-events: none;
}

#aplusPerf .ars-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 3px 0;
}

#aplusPerf .ars-compare {
    margin-top: 4px;
    padding-top: 7px;
    border-top: 1px solid var(--border);
    font-weight: 800;
}

#aplusPerf .ars-lbl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: var(--text);
}

#aplusPerf .ars-sw {
    display: inline-block;
    width: 18px;
    height: 3px;
    border-radius: 2px;
}

#aplusPerf .ars-val {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

    #aplusPerf .ars-val.up {
        color: var(--positive, #0F8A3B);
    }

    #aplusPerf .ars-val.down {
        color: var(--negative, #c62828);
    }

@media (max-width: 620px) {
    #aplusPerf .aplus-returns-stats {
        display: none;
    }

    #aplusPerf .aplus-returns-legend {
        left: 12px;
    }
}
