/* The three school pages: school.html (the front door and the region list), school-region.html (a brief,
   for pupils) and school-teacher.html (today's region, the one-page sheet, the check).

   Same tokens as regions.html and feed.html so a pupil who steps from the map into a brief has not
   changed rooms. Colour is never the only carrier of meaning: the right answer in the key is marked
   with a word as well as a tint. Body text is 18px or larger and every control is at least 44px tall,
   because these pages are read on a classroom projector and tapped on a shared tablet. */

:root {
  --ink: #F4F6F0; --dim: #B4BCA9; --bg: #080A07; --panel: #101510; --line: #2A3224;
  --gold: #C9A55C; --green: #8FC9A8; --warn: #E8B86A;
  --serif: "EB Garamond", Georgia, serif;
  --ui: "Jost", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.125rem/1.55 var(--serif); }
a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sc-wrap { max-width: 68rem; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.sc-top { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; justify-content: space-between;
  padding-bottom: .9rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.sc-brand { font: 700 .8rem/1 var(--ui); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
.sc-brand span { color: var(--ink); margin-left: .5rem; }
.sc-links { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
/* THE LANGUAGE BUTTON IS ADDED BY SCRIPT AFTER THE FIRST PAINT, and it used to take its place in this row. With the lesson link the row is
   977 px of 1,056 at 1440, so the button tipped it over and the row wrapped: the whole page moved 33 px down (layout shift 0.46 at 1440, 0.80
   at 1100; the start-week section was 0.02 of the 0.484 measured). Where the row has room, the button is taken out of the flow and its
   column is held in advance, so the row is the same with it and without it, in any language. Below 44rem the row wraps on its own and the
   shift is under 0.08, so it keeps flowing. */
@media (min-width: 44rem) {
  .sc-top { position: relative; padding-inline-end: 5.5rem; }
  .sc-top .sc-links { gap: .2rem .9rem; }
  header.sc-top .i18n-in-top { position: absolute; inset-inline-end: 0; top: 8px; margin: 0; }
}
.sc-links a { font: 600 .74rem/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  color: var(--dim); padding: .8rem 0; min-height: 44px; display: inline-flex; align-items: center; }
.sc-links a:hover, .sc-links a[aria-current] { color: var(--ink); }

h1 { font: 800 clamp(2rem, 6vw, 3.4rem)/1.05 var(--ui); letter-spacing: -.025em; margin: 0 0 .6rem; text-wrap: balance; }
h2 { font: 700 1.35rem/1.2 var(--ui); letter-spacing: -.01em; margin: 2.2rem 0 .6rem; }
h3 { font: 700 .72rem/1.2 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0 0 .35rem; }
p { margin: 0 0 .8rem; }
.sc-lede { font-size: 1.3rem; color: var(--dim); max-width: 40rem; }
.sc-note { font-size: .98rem; color: var(--dim); }

.sc-btns { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0 .4rem; }
.sc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.25rem;
  border-radius: 999px; border: 1.5px solid var(--gold); background: transparent; color: var(--ink);
  font: 700 .86rem/1 var(--ui); letter-spacing: .09em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.sc-btn.primary { background: var(--gold); color: #080A07; }
.sc-btn:hover { filter: brightness(1.12); }
.sc-btn[disabled] { opacity: .45; cursor: default; }

.sc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.sc-cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1rem; }
.sc-off { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem 1.4rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.sc-off li { padding-left: 1.5rem; position: relative; }
.sc-off li::before { content: "\2715"; position: absolute; left: 0; color: var(--warn); font-family: var(--ui); font-weight: 700; }
.sc-blocked { border-color: var(--warn); }

/* the region list on school.html */
.sc-find { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.sc-find input, .sc-find select, .sc-pick input {
  min-height: 48px; padding: .5rem .9rem; border-radius: 10px; border: 1.5px solid var(--line);
  background: #0C100B; color: var(--ink); font: 500 1rem var(--ui); min-width: 0; }
.sc-find input { flex: 1 1 16rem; }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.sc-list a { display: block; text-decoration: none; color: var(--ink); padding: .55rem .2rem; min-height: 44px; border-bottom: 1px solid var(--line); }
.sc-list a small { display: block; font: 500 .72rem/1.3 var(--ui); letter-spacing: .06em; color: var(--dim); }
.sc-list a:hover { color: var(--gold); }

/* today's region (teacher) */
.sc-today { text-align: left; padding: 1.4rem 1.2rem 1.6rem; }
.sc-today .when { font: 700 .8rem/1 var(--ui); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 0 0 .7rem; }
.sc-today .big { font: 800 clamp(2.6rem, 9vw, 6rem)/1.0 var(--ui); letter-spacing: -.03em; margin: 0 0 .6rem; text-wrap: balance; }
.sc-today .sub { font: 500 clamp(1.1rem, 3vw, 1.7rem)/1.35 var(--ui); color: var(--dim); margin: 0 0 .7rem; }
.sc-today .one { font-size: clamp(1.2rem, 3vw, 1.8rem); line-height: 1.4; max-width: 46rem; margin: 0 0 1rem; }
.sc-pick { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.sc-pick input { flex: 1 1 18rem; }

/* the brief (sb-*) */
.sb-head { margin-bottom: 1.1rem; }
.sb-kicker { font: 700 .74rem/1 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0 0 .5rem; }
.sb-title { margin-bottom: .3rem; }
.sb-nnh { font: 500 1rem var(--ui); color: var(--dim); }
.sb-grid { display: grid; gap: 0 2.2rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .sb-grid { grid-template-columns: 1.15fr 1fr; } }
.sb-sec { border-top: 1px solid var(--line); padding: .8rem 0 .3rem; }
.sb-species { list-style: none; margin: .2rem 0 .5rem; padding: 0; }
.sb-species li { padding: .32rem 0; border-top: 1px solid var(--line); line-height: 1.35; }
.sb-species li:first-child { border-top: 0; }
.sb-common { font-weight: 600; }
.sb-sci { color: var(--dim); }
.sb-meta { display: block; font: 600 .7rem/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.sb-note { font-size: .92rem; color: var(--dim); }
.sb-src ol { margin: .2rem 0 0; padding-left: 1.3rem; font-size: .92rem; color: var(--dim); }
.sb-src li { margin-bottom: .2rem; }
.sb-url { word-break: break-all; font-size: .8rem; }
.sb-foot { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.sb-status { font: 600 .95rem/1.45 var(--ui); color: var(--warn); }

/* the check (teacher) */
.sb-qs { padding-left: 1.4rem; }
.sb-q { margin: 0 0 1.3rem; padding-left: .3rem; break-inside: avoid; }
.sb-qtext { font-weight: 600; margin-bottom: .35rem; }
.sb-opts { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.sb-opts li { padding: .1rem .5rem; border-radius: 6px; }
.sb-letter { font: 700 .9rem var(--ui); margin-right: .25rem; }
.sb-right { background: rgba(143, 201, 168, .16); outline: 1px solid var(--green); }
.sb-right::after { content: " \2190 correct"; font: 700 .72rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.sb-why { font-size: .95rem; margin: .45rem 0 0; color: var(--dim); }
.sb-claim { font: 500 .75rem var(--ui); letter-spacing: .04em; }

.sc-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 .82rem/1.7 var(--ui); color: var(--dim); }
.sc-foot a { margin-right: 1rem; }

/* ---- print ------------------------------------------------------------------------------------------
   html[data-print] names WHICH part goes to paper: "sheet" (the one-page region sheet), "check" (the questions
   with no answers, for pupils) or "key" (the questions with the answers). Everything else is hidden, so the
   Print button on a page that also holds a projector-sized "today" panel prints only what its label says. */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 10pt; line-height: 1.35; }
  .sc-top, .sc-btns, .sc-pick, .sc-foot, .sc-noprint, .sc-today, .sc-find { display: none !important; }
  html[data-print="sheet"] .sc-part:not(#part-sheet),
  html[data-print="check"] .sc-part:not(#part-check),
  html[data-print="key"] .sc-part:not(#part-check) { display: none !important; }
  html[data-print="sheet"] #part-sheet, html[data-print="check"] #part-check, html[data-print="key"] #part-check { display: block !important; }
  .sc-wrap { max-width: none; padding: 0; }
  .sc-card { border: 0; background: none; padding: 0; }
  h1, .sb-title { font-size: 20pt; margin: 0; color: #000; }
  h2 { color: #000; font-size: 13pt; margin: 0 0 6pt; }
  h3 { color: #333; font-size: 7.5pt; margin: 0 0 2pt; }
  .sb-kicker, .sb-meta, .sb-letter, .sb-claim { color: #333; }
  .sb-nnh, .sb-note, .sb-src ol, .sb-sci, .sb-why { color: #333; font-size: 8.5pt; }
  .sb-status { color: #000; font-size: 8.5pt; }
  .sb-sec { border-top: 1px solid #999; padding: 4pt 0 1pt; }
  .sb-grid { grid-template-columns: 1.15fr 1fr; gap: 0 14pt; }
  .sb-species li { border-color: #bbb; padding: 2pt 0; }
  .sb-foot { border-top: 1px solid #999; }
  .sb-right { background: none; outline: 1px solid #000; }
  .sb-right::after { color: #000; }
  a { color: #000; text-decoration: none; }
  .sb-q { margin-bottom: 11pt; }
  html[data-print="check"] .sb-why, html[data-print="check"] .sb-right::after { display: none; }
  html[data-print="check"] .sb-right { background: none; outline: 0; }
}

.sc-printonly { display: none; }
@media print {
  html[data-print="sheet"] .po-sheet, html[data-print="check"] .po-check, html[data-print="key"] .po-key {
    display: block; font: 600 9pt var(--ui); letter-spacing: .06em; margin-bottom: 6pt; color: #000; }
  html[data-print="check"] .sc-lines.po-check { display: flex; gap: 24pt; margin: 4pt 0 10pt; }
  .sc-lines span { flex: 1; border-bottom: 1px solid #000; height: 14pt; }
}

/* the door to Defend Your Ecoregion (school-defend-link.js), present only while the switch in evidence-flags.js is on */
.sc-defend { margin: 0 0 1.4rem; }
.sc-defend p { margin: 0 0 .5rem; }

/* THE TEACHER VIEW IS DRAWN BY SCRIPT, so for a few hundred ms its top card says "Loading" and everything under it sits where
   an empty sheet puts it. When the brief arrived the name, the one-line fact, the sheet and the check all grew at once and the
   buttons and headings below jumped 275 px (layout shift 0.25 to 0.27 at 1440, three runs, 9 Mbps and 4x CPU, 18 Nov). Nothing
   can be reserved for text of unknown length, so what moves is not shown until it has its size: visibility keeps the space and
   a hidden box is not a shift. #tSub is filled by every path in school-teacher.js (a brief, no brief, a list that failed), so
   :empty means "not yet"; with no script it would mean "never", so the rule exists only where script runs, and the animation
   lifts it after 4 s if a request hangs. #series-teacher is static text for readers without script and is never hidden for them. */
@media (scripting: enabled) {
  body:has(#tSub:empty) :is(#part-today .sc-btns, #part-today .sc-pick, #part-sheet, #part-check, #series-teacher) { visibility: hidden; animation: sc-unhide 0s linear 4s forwards; }
}
@keyframes sc-unhide { to { visibility: visible; } }
