/* Homepage worked marking example (templates/_home_marked_example.html).
 *
 * The app's annotated marking, drawn statically. The finished state is the
 * default; home-example.js only adds an optional entrance. Marking colours
 * follow the annotated quiz; typography uses the current study-app sans-serif
 * under section-local tokens.
 */
.hs-example {
    --hx-page: #111113; --hx-raised: #18181b; --hx-rule: #2a2a30;
    --hx-ink: #f5f5f7; --hx-ink-2: #b5b5bf; --hx-ink-3: #8e8e99;
    --hx-link: #b6a6ff; --hx-action: #5940d6;
    --hx-earned: #9ddbb5; --hx-partial: #f0c779; --hx-missed: #f3aba3;
    --hx-sans: var(--ds-font-text, 'Plus Jakarta Sans', system-ui, sans-serif);
    color: var(--hx-ink); scroll-margin-top: var(--hx-header, 80px);
    padding: clamp(56px, 7vw, 96px) 0;
    border-bottom: 1px solid var(--hx-rule);
}
.hx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hx-eyebrow { margin: 0 0 16px; font: 500 .75rem/1.3 var(--hx-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--hx-ink-3); }
.hx-title { margin: 0; max-width: 22ch; font: 500 clamp(30px, 3.4vw, 44px)/1.1 var(--hx-sans); letter-spacing: -.01em; color: var(--hx-ink); }
.hx-sub { margin: 18px 0 0; max-width: 56ch; font: 400 1.0625rem/1.6 var(--hx-sans); color: var(--hx-ink-2); }
.hx-caption { margin: 14px 0 0; font: 400 .8125rem/1.5 var(--hx-sans); color: var(--hx-ink-3); }

.hs-example-sheet {
    display: grid; grid-template-columns: minmax(0, 1fr) 357px; grid-template-areas: "paper rail"; align-items: start;
    margin-top: 32px; padding: 40px; background: var(--hx-raised); border: 1px solid var(--hx-rule); border-radius: 12px;
}
.hs-example-paper { grid-area: paper; min-width: 0; padding-right: 56px; }
.hs-example-rail { grid-area: rail; min-width: 0; padding-left: 56px; border-left: 1px solid var(--hx-rule); }

.hx-label { margin: 0; font: 500 .6875rem/1.3 var(--hx-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--hx-ink-3); }
.hx-label--link { color: var(--hx-link); }
.hx-meta { margin: 0; font: 500 .75rem/1.3 var(--hx-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--hx-ink-3); }
.hx-q { margin: 8px 0 24px; font: 400 1.375rem/1.35 var(--hx-sans); color: var(--hx-ink); }
.hx-text { margin: 10px 0 0; font: 400 1.0625rem/1.8 var(--hx-sans); color: var(--hx-ink); overflow-wrap: anywhere; }

/* Style, not only colour: solid earned, dashed partly earned. */
.hx-passage {
    text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
    box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hx-passage[data-status="earned"] { text-decoration-style: solid; text-decoration-color: var(--hx-earned); }
.hx-passage[data-status="partial"] { text-decoration-style: dashed; text-decoration-color: var(--hx-partial); }
.hx-passage[data-status="missed"] { text-decoration-style: dotted; text-decoration-color: var(--hx-missed); }

.hx-m {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex: none;
    width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%;
    font: 500 .6875rem/1 var(--hx-sans); vertical-align: middle;
}
.hx-text .hx-m { margin-left: 4px; }
.hx-m:empty { visibility: hidden; }
.hx-m[data-status="earned"], .hx-note[data-status="earned"] .hx-m { color: var(--hx-earned); }
.hx-m[data-status="partial"], .hx-note[data-status="partial"] .hx-m { color: var(--hx-partial); }
.hx-m[data-status="missed"], .hx-note[data-status="missed"] .hx-m { color: var(--hx-missed); }

.hs-example-notes { list-style: none; display: grid; grid-template-columns: auto max-content minmax(0, 1fr); column-gap: 24px; gap: 16px 24px; margin: 24px 0 0; padding: 24px 0 0; border-top: 1px solid var(--hx-rule); }
.hx-note { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: baseline; }
.hx-note .hx-m { align-self: start; }
.hx-status { display: block; font: 600 .8125rem/1.4 var(--hx-sans); white-space: nowrap; }
.hx-note[data-status="earned"] .hx-status { color: var(--hx-earned); }
.hx-note[data-status="partial"] .hx-status { color: var(--hx-partial); }
.hx-note[data-status="missed"] .hx-status { color: var(--hx-missed); }
.hx-icon { width: 12px; height: 12px; flex: none; }
.hx-status .hx-icon { display: inline-block; margin-right: 7px; vertical-align: -1px; }
.hx-note-text { font: 400 1rem/1.5 var(--hx-sans); color: var(--hx-ink-2); }
.hx-label--absent { margin-top: 28px; }
.hs-example-notes--absent { margin-top: 12px; padding-top: 0; border-top: 0; }
.hx-absent-line { margin: 14px 0 0; font: 400 .8125rem/1.5 var(--hx-sans); color: var(--hx-ink-3); }

/* The rail: the mark, then the one correction worth the most. */
.hx-mark-row { display: grid; gap: 10px; margin-top: 8px; }
.hx-score { margin: 0; font-family: var(--hx-sans); font-weight: 400; line-height: 1; color: var(--hx-ink); }
.hx-score-n { font-size: 4rem; }
.hx-score-of { font-size: 1.75rem; color: var(--hx-ink-3); }
.hx-verdict { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 600 .875rem/1.3 var(--hx-sans); }
.hx-verdict[data-status="earned"] { color: var(--hx-earned); }
.hx-verdict[data-status="partial"] { color: var(--hx-partial); }
.hx-verdict[data-status="missed"] { color: var(--hx-missed); }
.hx-verdict .hx-icon { width: 14px; height: 14px; }
.hx-first { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--hx-rule); }
.hx-first-text { margin: 12px 0 0; font: 400 1.1875rem/1.45 var(--hx-sans); color: var(--hx-ink); }
.hx-examiner { margin: 16px 0 0; font: 400 .875rem/1.6 var(--hx-sans); color: var(--hx-ink-3); }
.hx-button {
    display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 44px; margin-top: 24px; padding: 0 18px;
    border-radius: 8px; background: var(--hx-action); color: #fff; font: 600 .9375rem/1 var(--hx-sans); text-decoration: none;
}
.hx-button:hover { background: #4932b8; }
.hx-button:focus-visible { outline: 2px solid var(--hx-link); outline-offset: 3px; }

/* Optional entrance: armed and played only by home-example.js. */
@media (prefers-reduced-motion: no-preference) {
    .hs-example.hx-armed .hx-passage { text-decoration-color: transparent; }
    .hs-example.hx-armed .hx-m, .hs-example.hx-armed .hx-score { opacity: 0; }
    .hs-example.hx-play .hx-passage { transition: text-decoration-color 320ms cubic-bezier(.16, 1, .3, 1) calc(var(--hx-i, 0) * 120ms); }
    .hs-example.hx-play .hx-passage[data-status="earned"] { text-decoration-color: var(--hx-earned); }
    .hs-example.hx-play .hx-passage[data-status="partial"] { text-decoration-color: var(--hx-partial); }
    .hs-example.hx-play .hx-m, .hs-example.hx-play .hx-score { opacity: 1; transition: opacity 200ms ease-out 480ms; }
}

@media (max-width: 999px) {
    .hs-example-sheet { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rail" "paper"; padding: 20px; }
    .hs-example-rail { padding: 0 0 16px; border-left: 0; border-bottom: 1px solid var(--hx-rule); }
    .hs-example-paper { padding: 16px 0 0; }
    .hx-mark-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .hx-score-n { font-size: 2.75rem; }
    .hx-first { margin-top: 12px; padding-top: 14px; }
    .hx-q { font-size: 1.1875rem; margin-bottom: 10px; }
    .hx-caption { margin-top: 10px; }
    .hx-text { font-size: 1rem; line-height: 1.7; }
    .hx-button { margin-top: 14px; }
    .hs-example-notes { margin-top: 14px; padding-top: 14px; gap: 14px; }
    .hs-example-notes { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .hx-note { grid-template-columns: auto minmax(0, 1fr); grid-column: auto; column-gap: 12px; row-gap: 2px; }
    .hx-note-text { grid-column: 1 / -1; font: 400 .9375rem/1.45 var(--hx-sans); }
    .hx-first-text { font-size: 1.0625rem; }
    .hx-absent-line { display: none; }
    .hx-sub { max-width: none; }
    .hx-first-text { margin-top: 8px; }
    .hx-mark-row { margin-top: 4px; }
    .hx-eyebrow { font-size: .6875rem; }
    .hs-example-notes.hs-example-notes--absent { margin-top: 10px; padding-top: 0; }
    .hs-example { scroll-margin-top: 68px; }
    .hx-label--absent { margin-top: 14px; }
    .hx-m:empty { display: none; }
    .hx-examiner { display: none; }
    .hs-example { padding: 28px 0 28px; }
    .hx-eyebrow { margin-bottom: 12px; }
    .hx-sub { margin-top: 10px; font-size: .9375rem; line-height: 1.55; }
    .hs-example-sheet { margin-top: 20px; }
}
@media (forced-colors: active) {
    .hx-m { border-color: CanvasText; }
}
