/* Election Judge Manual training site.
   Colors and type follow docs/STYLE-GUIDE.md (same palette and Arial as the printed manual).
   Body text is at least 16 px; text colors meet WCAG AA contrast on their backgrounds. */

:root {
    --pink: #EED9DB;
    --blue: #CCDFEE;
    --callout: #EAF4FB;
    --callout-border: #B7D3E8;
    --yellow: #FFF6C8;
    --yellow-border: #D9C36A;
    --text: #231F20;
    --red: #D22027;
    --note: #981720;
    --navy: #2E3192;
    --muted: #4A4A4A;
    --line: #D6D6D6;
    --page: #FFFFFF;
    --wash: #F6F7F9;
    --radius: 6px;
    --wrap: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 100%; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.0625rem;              /* 17 px */
    line-height: 1.55;
    color: var(--text);
    background: var(--page);
}

/* Interactive parts appear only when JavaScript is on (site.js adds the "js" class);
   the no-JavaScript fallback shows everything as one readable page. */
html:not(.js) .js-only { display: none !important; }
html.js .nojs-only { display: none !important; }

a { color: var(--navy); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
main:focus { outline: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--text); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0; }

/* ---- header and footer ---------------------------------------------------------------- */

.site-header { background: var(--blue); border-bottom: 3px solid var(--text); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { color: var(--text); text-decoration: none; display: flex; flex-direction: column; }
.brand-title { font-weight: bold; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .02em; }
.brand-cycle { font-size: .9375rem; }
.site-header nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: var(--text); font-weight: bold; }

main { padding-top: 1.5rem; padding-bottom: 3rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--wash); font-size: .9375rem; color: var(--muted); }
.site-footer .wrap { padding-top: 1rem; padding-bottom: 1.5rem; }
.site-footer p { margin: .25rem 0; }

/* ---- headings and general text -------------------------------------------------------- */

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.875rem; margin: 0 0 .5rem; }
h2 { font-size: 1.375rem; }
.lede { font-size: 1.1875rem; max-width: 46rem; margin-top: 0; }

/* Module title: echoes the printed manual's colored title bar with the dark rule beneath. */
.module-heading {
    background: var(--blue); border-bottom: 3px solid var(--text);
    padding: .5rem .75rem; text-transform: uppercase; font-size: 1.5rem; margin: .25rem 0 1rem;
}
.breadcrumb { font-size: .9375rem; color: var(--muted); }
.breadcrumb a { color: var(--navy); }

.notice { background: var(--callout); border: 1px solid var(--callout-border); border-radius: var(--radius); padding: .625rem .875rem; }
.notice.draft { background: var(--yellow); border-color: var(--yellow-border); color: var(--note); font-weight: bold; }
.equipment-mismatch { background: var(--yellow); border-color: var(--yellow-border); }

/* ---- buttons --------------------------------------------------------------------------- */

.button {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 2.75rem; padding: .5rem 1.25rem;
    font: inherit; font-weight: bold; text-decoration: none; cursor: pointer;
    color: #fff; background: var(--navy); border: 2px solid var(--navy); border-radius: var(--radius);
}
.button:hover { background: #1F2270; border-color: #1F2270; }
.button.secondary { color: var(--navy); background: #fff; }
.button.secondary:hover { background: var(--callout); }
.button:disabled { opacity: .45; cursor: default; }
.link-button { font: inherit; color: var(--navy); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---- panels: equipment picker, downloads ------------------------------------------------ */

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin: 1.5rem 0; background: var(--wash); }
.panel-title { margin-top: .25rem; }
.question { border: 0; margin: 1.25rem 0 0; padding: 0; }
.question legend { font-weight: bold; font-size: 1.125rem; padding: 0; }
.help { margin: .25rem 0 .5rem; color: var(--muted); }
.choices { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.choice {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .375rem;
    min-width: 11rem; min-height: 3.25rem; padding: .625rem .875rem;
    background: #fff; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: center;
}
.choice:hover { border-color: var(--navy); }
.choice:has(input:checked) { border-color: var(--navy); background: var(--callout); box-shadow: 0 0 0 1px var(--navy); }
.choice:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 2px; }
.choice input { margin: 0; width: 1.125rem; height: 1.125rem; accent-color: var(--navy); }
.choice img { width: 160px; height: 110px; object-fit: contain; }
.choice span { font-weight: bold; }
.choice.unsure span { font-weight: normal; }
.form-error { color: var(--red); font-weight: bold; }
.equipment-form .button { margin-top: 1.25rem; }
.equipment-chosen { font-size: 1.125rem; font-weight: bold; }

.downloads { padding-left: 1.25rem; }
.downloads li { margin: .375rem 0; }
.downloads .size { color: var(--muted); font-size: .9375rem; }

/* ---- module list ----------------------------------------------------------------------- */

.group-title { margin: 1.5rem 0 .5rem; padding: .25rem .625rem; background: var(--pink); border-bottom: 2px solid var(--text); text-transform: uppercase; font-size: 1.0625rem; }
.module-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .875rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.module-card a {
    display: flex; flex-direction: column; gap: .375rem; height: 100%;
    padding: 1rem 1.125rem; color: var(--text); text-decoration: none;
    border: 2px solid var(--line); border-radius: var(--radius); background: #fff;
}
.module-card a:hover { border-color: var(--navy); }
/* Course not built yet: same card shape, but not a link, so the title isn't underlined. */
.course-card .card-body {
    display: flex; flex-direction: column; gap: .375rem; height: 100%;
    padding: 1rem 1.125rem; border: 2px dashed var(--line); border-radius: var(--radius); background: #fff;
}
.course-card .card-body .module-title { text-decoration: none; color: var(--text); }
.module-title { font-weight: bold; font-size: 1.1875rem; color: var(--navy); text-decoration: underline; }
.module-meta { font-size: .9375rem; color: var(--muted); }
.progress-badge { align-self: flex-start; font-size: .875rem; font-weight: bold; padding: .125rem .5rem; border-radius: 999px; background: var(--yellow); }
.progress-badge.done { background: var(--callout); color: var(--navy); }
.hidden-note { color: var(--muted); }
.coming-soon { color: var(--muted); font-style: italic; margin-top: 1.25rem; }

/* ---- training videos ------------------------------------------------------------------- */

.video-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.video-card { border: 2px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1rem 1.125rem; }
.video-title { margin: 0 0 .25rem; font-size: 1.1875rem; color: var(--navy); }
.video-duration { font-weight: normal; color: var(--muted); font-size: 1rem; }
.video-summary { margin: 0 0 .75rem; }
.video-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: calc(var(--radius) / 2); }
.video-note { margin: .5rem 0 0; font-size: .9375rem; color: var(--muted); }
.course-audience { color: var(--muted); }

/* ---- step player ----------------------------------------------------------------------- */

.player-status { display: flex; align-items: center; gap: 1rem; margin: .5rem 0 1rem; }
.position { margin: 0; font-weight: bold; white-space: nowrap; }
.progress { flex: 1; height: .75rem; border: 0; border-radius: 999px; background: #E3E6EA; overflow: hidden; accent-color: var(--navy); }
.progress::-webkit-progress-bar { background: #E3E6EA; border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--navy); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--navy); border-radius: 999px; }

.screens { list-style: none; padding: 0; margin: 0; }
html:not(.js) .screen { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.screen-section { margin: 0 0 .5rem; font-size: .9375rem; font-weight: bold; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }

.screen-body { display: grid; gap: 1.25rem; }
/* Narrow figures sit beside the text on wide screens; wide figures go below it. */
@media (min-width: 56rem) {
    .screen.figure-beside .screen-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

.step { display: flex; align-items: flex-start; gap: 1rem; }
.step-heading { margin: 0; }
/* Headings receive focus only so screen readers announce the new screen; they aren't controls, so no outline. */
.step-heading:focus, .step-heading:focus-visible { outline: none; }
.step-number {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 3rem; height: 3rem; border-radius: 50%;
    background: var(--navy); color: #fff; font-size: 1.5rem; font-weight: bold;
}
.step-text { margin: .3rem 0 0; font-size: 1.3125rem; line-height: 1.5; max-width: 42rem; }
.content-heading { font-size: 1.5rem; margin-bottom: .75rem; }

.screen-text .button.speak { margin-top: 1rem; }
.screen-figures { display: grid; gap: 1rem; }
.figure { margin: 0; }
.figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.figure figcaption { font-size: .875rem; color: var(--muted); margin-top: .25rem; }
.figure-zoom { display: block; }
.figure-zoom:hover img { border-color: var(--navy); }
.zoom-hint { font-size: .875rem; }
.source { font-size: .875rem; color: var(--muted); margin: 1rem 0 0; }

.player-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.player-nav [data-action="next"] { margin-left: auto; }
.keyboard-hint { font-size: .875rem; color: var(--muted); text-align: right; margin: .5rem 0 0; }
kbd { font-family: inherit; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: #fff; }
.resume-note { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* On phones the Back/Next buttons stay at the bottom of the screen. */
@media (max-width: 40rem) {
    .player-nav { position: sticky; bottom: 0; background: #fff; margin: 1rem -1rem 0; padding: .75rem 1rem; box-shadow: 0 -2px 6px rgba(0,0,0,.08); }
    .player-nav .button { flex: 1; justify-content: center; }
    .keyboard-hint { display: none; }
    .step-text { font-size: 1.1875rem; }
    .module-heading { font-size: 1.25rem; }
    h1 { font-size: 1.5rem; }
    /* Keep the header compact so the step is visible without scrolling. */
    .header-inner { padding-top: .5rem; padding-bottom: .5rem; }
    .brand-title { font-size: 1rem; }
    .brand-cycle { font-size: .8125rem; }
    .site-header nav { gap: .25rem 1rem; font-size: .9375rem; }
}

/* ---- manual content on screen ----------------------------------------------------------- */

.p { margin: .75rem 0; }
.p.small { font-size: .9375rem; }
.p.center { text-align: center; }
.note { color: var(--note); font-style: italic; }
.subtitle { color: var(--muted); font-style: italic; }
.heading { font-size: 1.125rem; text-transform: uppercase; margin: 1.25rem 0 .5rem; }
.bar { padding: .25rem .625rem; border-bottom: 2px solid var(--text); text-transform: uppercase; font-size: 1.125rem; }
.bar-pink, .shade-pink { background: var(--pink); }
.bar-blue, .shade-blue { background: var(--blue); }
.shade-callout { background: var(--callout); padding: .5rem .75rem; }
.callout { background: var(--callout); border: 1px solid var(--callout-border); border-radius: var(--radius); padding: .25rem 1rem; margin: 1rem 0; }
.important { background: var(--yellow); border: 2px solid var(--yellow-border); border-radius: var(--radius); padding: .25rem 1rem; margin: 1rem 0; color: var(--note); font-weight: bold; }
.important-pink { background: var(--pink); border-color: #C9A0A5; }
.callout p, .important p { margin: .625rem 0; }
.bullets, .bullets ul { padding-left: 1.5rem; }
.bullets li { margin: .25rem 0; }
.subitems { list-style: none; padding-left: 1.5rem; }
.subitems li { margin: .375rem 0; padding-left: 2.25rem; text-indent: -2.25rem; }
.subitems .marker { display: inline-block; min-width: 2rem; text-indent: 0; font-weight: bold; }
.fill { display: flex; gap: .5rem; align-items: baseline; }
.fill-line { flex: 1; border-bottom: 1px solid var(--text); min-width: 4rem; }
.columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: center; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.data { border-collapse: collapse; width: 100%; font-size: .9375rem; }
table.data th, table.data td { border: 1px solid #808080; padding: .5rem .625rem; text-align: left; vertical-align: top; }
table.data thead th { background: var(--blue); }
table.data tbody th { background: var(--blue); font-weight: normal; }

/* Inline markup from the content (see InlineMarkup.ToHtml). ~~text~~ is underline, not strikethrough. */
.mk-red { color: var(--red); }
.mk-note { color: var(--note); }
.mk-navy { color: var(--navy); }
.mk-tab { display: inline-block; width: 2em; }

/* ---- quiz ------------------------------------------------------------------------------- */

.quiz-question { border: 2px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; background: #fff; }
.quiz-question legend { font-weight: bold; font-size: 1.125rem; padding: 0 .25rem; }
.q-number { color: var(--navy); }
.quiz-option { display: flex; gap: .625rem; align-items: flex-start; padding: .5rem .625rem; margin: .25rem 0; border-radius: var(--radius); cursor: pointer; }
.quiz-option:hover { background: var(--wash); }
.quiz-option input { margin-top: .3rem; width: 1.125rem; height: 1.125rem; accent-color: var(--navy); flex: none; }
.quiz-question.is-correct { border-color: var(--navy); }
.quiz-question.is-wrong { border-color: var(--red); }
.quiz-option.correct-answer { background: var(--callout); font-weight: bold; }
.quiz-feedback { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .5rem; }
.is-correct .verdict { color: var(--navy); font-weight: bold; }
.is-wrong .verdict { color: var(--red); font-weight: bold; }
.explanation { margin: .375rem 0 0; }
.quiz-result { font-size: 1.125rem; font-weight: bold; }
.quiz-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---- printing a module: show every step ------------------------------------------------- */

@media print {
    .site-header nav, .player-nav, .player-status, .keyboard-hint, .button, .skip-link { display: none !important; }
    .screen[hidden] { display: block !important; }
    .screen { break-inside: avoid; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
}

/* Text that introduces a step ("Course of Action:", "…announce the following:") sits above it. */
.lead-in .p { margin: 0 0 .75rem; font-weight: bold; }
