/* Earth and Space Sciences Regents practice. Phone first, 360 px and up. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/site/fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/site/fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/site/fonts/AtkinsonHyperlegible-Italic.woff2") format("woff2"); }

:root {
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 6px;
  --btn-h: 48px;
  --gutter: 16px;
  --maxw: 760px;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #17202e;
  --muted: #4f5968;
  --line: #c3cad5;
  --control-edge: #848e9d; /* answer-button outline: 3.3:1 on white, 3.1:1 on --bg (WCAG 1.4.11) */
  --primary: #1f3a68;
  --primary-text: #ffffff;
  --chip: #eef1f6;
  --good: #146c3a;
  --good-bg: #e6f4ec;
  --bad: #a52a1f;
  --bad-bg: #fbece9;
  --focus: #1a5fd0;
  --select: #1a5fd0;
  --select-bg: #eaf1fd;
  --q-ink: #0b2350;
  --q-bg: #eef3fc;
  --q-edge: #1a5fd0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 18px; line-height: 1.55;
  display: flex; flex-direction: column; min-height: 100vh;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; font-weight: 700; margin: 0 0 0.5em; }
h1 { font-size: 1.5em; }
h2 { font-size: 1.2em; margin-top: 1.3em; }
p { margin: 0 0 0.8em; }
a { color: #14437f; text-underline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); margin: 0.4em 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 10px 14px; z-index: 10; }
.skip:focus { left: 0; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .view, .footer-inner {
  max-width: var(--maxw); margin-left: auto; margin-right: auto;
  padding-left: var(--gutter); padding-right: var(--gutter);
}
.topbar-inner { padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; color: var(--primary); text-decoration: none; }
.brand:hover { text-decoration: underline; }
/* Top bar: the name, then two links; they wrap under the name on a narrow screen. */
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.topnav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.topnav a { display: inline-block; padding: 8px 0; min-height: 24px; }
.view { flex: 1 0 auto; width: 100%; padding-top: 20px; padding-bottom: 36px; overflow-wrap: break-word; }

.crumbs { margin: 0 0 8px; color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 8px 18px;
  font: inherit; font-weight: 700; color: var(--primary); background: var(--surface);
  border: 2px solid var(--primary); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; text-align: center; touch-action: manipulation;
}
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: #17305a; }
.btn.big { min-height: 56px; padding: 10px 28px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }

/* Figures */
.figs { margin: 0 0 12px; }
.qfig { margin: 0 0 10px; }
.qfig img { display: block; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

.note { background: var(--chip); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.note h2 { margin: 0 0 0.3em; font-size: 1.1em; }
.note p:last-child { margin-bottom: 0; }
details.note summary { font-weight: 700; font-size: 1.1em; cursor: pointer; min-height: 32px; }
details.note p { margin-top: 0.5em; }

/* Question panel */
.stem {
  font-size: 1.2em; line-height: 1.45; font-weight: 700; color: var(--q-ink);
  background: var(--q-bg); border-left: 5px solid var(--q-edge); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.choices { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--btn-h);
  padding: 10px 14px; font: inherit; font-size: 1.05em; text-align: left; color: var(--q-ink);
  background: var(--surface); border: 2px solid var(--control-edge); border-radius: var(--radius); cursor: pointer;
}
.choice .letter {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--chip); font-weight: 700;
}
.choice-text { flex: 1; overflow-wrap: anywhere; }
.choices.numbered { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choices.numbered .choice { justify-content: center; padding: 10px 4px; }
.choices.numbered .letter { background: transparent; font-size: 1.1em; }
.choices.numbered .choice[aria-pressed="true"] .letter,
.choices.numbered .choice.is-right .letter,
.choices.numbered .choice.is-wrong .letter { background: transparent; color: inherit; }
.choice[aria-pressed="true"] { border-color: var(--select); background: var(--select-bg); box-shadow: inset 0 0 0 1px var(--select); }
.choice[aria-pressed="true"] .letter { background: var(--select); color: #fff; }
.choice.is-right { border-color: var(--good); background: var(--good-bg); box-shadow: inset 0 0 0 1px var(--good); }
.choice.is-right .letter { background: var(--good); color: #fff; }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: inset 0 0 0 1px var(--bad); }
.choice.is-wrong .letter { background: var(--bad); color: #fff; }
.choice:disabled { cursor: default; }

.feedback:empty { display: none; }
.feedback { margin: 12px 0 0; }
.fb-line { font-size: 1.15em; font-weight: 700; margin: 0 0 0.5em; }
.fb-line.good { color: var(--good); }
.fb-line.bad { color: var(--bad); }
.fb-box { border-left: 5px solid var(--line); background: var(--chip); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
.fb-box.right { border-left-color: var(--good); background: var(--good-bg); }
.fb-box.wrong { border-left-color: var(--bad); background: var(--bad-bg); }
.fb-box h3 { margin: 0 0 0.25em; font-size: 1em; }
.fb-box p { margin: 0; }

.table-link { margin: 14px 0 0; }
.qnav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.qnav .btn { flex: 1 1 140px; }
.report-link { display: inline-block; padding: 10px 0; }

/* Lists */
.sittings, .qlist { list-style: none; margin: 0 0 20px; padding: 0; }
.sittings li { margin: 0 0 10px; }
.sitting-link { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
.qlist li { margin: 0 0 8px; }
.qlist a {
  display: block; padding: 10px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
}
.qlist a:hover { border-color: var(--primary); }
.qn { font-weight: 700; color: var(--primary); display: block; }

/* Footer: body size on purpose, never fine print */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 16px 0 24px; }
.footer p { margin: 0 0 0.6em; }
.footer-links a { margin-right: 16px; display: inline-block; padding: 6px 0; }

@media (min-width: 700px) {
  .view { padding-top: 28px; }
}

/* Motion only for people who have not asked for less */
@media (prefers-reduced-motion: no-preference) {
  .btn, .choice, .qlist a { transition: background-color 0.15s ease, border-color 0.15s ease; }
}

@media print {
  .topbar, .qnav, .row, .skip, .crumbs, .zoom-hint, .report-link, .footer-links, .print-hide { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .view { padding-top: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  /* Never split a figure, a choice or a list row across two sheets; keep each image within one page. */
  .qfig, .choice, .fb-box, .note, .qlist li { break-inside: avoid; page-break-inside: avoid; }
  .qfig img { max-height: 9in; width: auto; }
  h1, h2, h3, .stem, summary { break-after: avoid; page-break-after: avoid; }
  .choices { break-inside: avoid; page-break-inside: avoid; }
  /* Backgrounds do not print, so the white number on a coloured circle would vanish. */
  .choice .letter { background: none !important; color: #000 !important; border: 1px solid #000; }
  .choices.numbered .letter { border: 0; }
  .footer { border-top: 1px solid #000; padding-bottom: 0; }
}

/* 200% zoom on a phone leaves about 195 CSS px: give the words the room instead of the padding. */
@media (max-width: 300px) {
  :root { --gutter: 8px; }
  .card { padding: 10px 8px; }
  .stem { font-size: 1.1em; padding: 10px 10px; border-left-width: 4px; }
  .choice { padding: 8px 8px; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
  .choice .choice-text { flex: 1 1 100%; }  /* number above the words, so a long word keeps the full width */
  .choices.numbered { grid-template-columns: repeat(2, 1fr); }
}
.stem, .choice-text, .fb-box p, .note p { hyphens: auto; -webkit-hyphens: auto; }

.zoom { display: block; }
.zoom-hint { margin: 0 0 12px; }
