/* The site's dark look, taken from the lessons ("Instrument"): graphite page,
   hairline panels, one blue-to-teal button for the way forward, amber for
   "new" and "planned", green only for done.

   It applies only to pages whose front matter says   look: dark
   (home, topics, topic pages, coverage, About, For teachers). Older lessons
   keep the light look until they are rebuilt. Loaded after site.css, so it
   only has to change the values and the few rules that name a colour.

   Parts of this file that are not under .look-dark (the course label in the
   header, the status chips) work in both looks. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------- things used in both looks */
.site-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; }
.course-pill {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.chip { display: inline-block; padding: 0.08rem 0.65rem; font-size: 0.8rem; font-weight: 700; line-height: 1.5; white-space: nowrap; border-radius: 999px; }
.chip--ready { background: #12343a; color: #5fd3c6; }
.chip--soon { background: #212837; color: #a3adc2; }

/* -------------------------------------------------------------- the dark look */
.look-dark {
  --paper: #0e1118;
  --surface: #171c26;
  --raise: #1c2230;
  --ink: #e9ebf1;
  --ink-soft: #b4bbcb;
  --muted: #8d96aa;
  --rule: #262d3b;
  --rule-strong: #3a4254;

  --prussian: #5fd3c6;        /* links and labels: teal */
  --prussian-deep: #0a0d14;   /* the feedback panel and footer */
  --copper: #8fe3d8;          /* focus rings, hovers */
  --malachite: #5fd39a;       /* done, correct */
  --chromate: #e8a33d;        /* amber: planned, new */
  --cinnabar: #ff8a80;
  --dichromate: #ff8f4d;
  --go: linear-gradient(135deg, #3343c4, #2c6fbe 55%, #1aa3a0);

  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* read by the live demo on the home page (assets/js/site.js) */
  --demo-face: #0b1030;
  --demo-needle: #5fd3c6;
  --demo-hot: #ff8a80;

  color-scheme: dark;
}
.look-dark h1 { font-size: clamp(2.2rem, 5vw, 3.1rem); font-weight: 600; letter-spacing: -0.02em; }
.look-dark h2 { font-size: 1.85rem; font-weight: 600; letter-spacing: -0.01em; }
.look-dark h3 { font-size: 1.35rem; font-weight: 600; }
.look-dark .skip-link { color: #0e1118; }

/* buttons */
.look-dark .btn { background: var(--go); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.look-dark .btn:hover { background: var(--go); border-color: transparent; color: #fff; filter: brightness(1.12); }
.look-dark .btn--quiet { background: transparent; color: var(--ink); border: 2px solid var(--rule-strong); box-shadow: none; }
.look-dark .btn--quiet:hover { background: var(--raise); border-color: var(--prussian); color: var(--ink); filter: none; }
.look-dark .btn--light { background: var(--chromate); border-color: var(--chromate); color: #1a1200; box-shadow: none; }
.look-dark .btn--light:hover { background: #f2b45a; border-color: #f2b45a; color: #1a1200; filter: none; }

/* header and footer */
.look-dark .site-header { background: #12161e; border-bottom-color: var(--rule); }
.look-dark .site-nav a:hover { border-bottom-color: var(--rule-strong); }
.look-dark .site-footer { background: #0a0d14; color: var(--ink-soft); border-top: 1px solid var(--rule); }
.look-dark .site-footer a { color: var(--ink); }
.look-dark .site-footer .footer-name { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.look-dark .site-footer .footer-small { font-size: 0.88rem; color: var(--muted); }

/* hero and its featured lesson */
.look-dark .hero h1 { color: var(--ink); font-size: clamp(2.6rem, 6.4vw, 4.4rem); line-height: 1.02; font-weight: 600; letter-spacing: -0.025em; }
.look-dark .hero-sub { color: var(--ink-soft); }
.hero-note { margin: 1rem 0 0; font-size: 0.95rem; color: var(--muted); }
.look-dark .hero-feature { border: 1px solid var(--rule-strong); }
.look-dark .hero-feature-go { border-top: 1px solid var(--rule); }

/* cards, chips and tags */
.look-dark .topic-count { color: var(--prussian); }
.look-dark .tag--test { color: #0e1118; }
.look-dark .status--live { background: #12343a; color: var(--prussian); border-color: #1e5c63; }
.look-dark .status--planned { background: var(--chromate); color: #1a1200; }
.look-dark .card-grid--steps > li::before { background: var(--go); border-color: var(--paper); color: #fff; }
.look-dark .model-card-link a:hover, .look-dark .topic-grid a:hover { border-color: var(--prussian); }
.look-dark .carry-on p { border-color: var(--rule-strong); }

/* feedback panel inputs (site.css gives them a white background) */
.look-dark .fb { border-top: 1px solid var(--rule); }
.look-dark .fb textarea, .look-dark .fb select { color: var(--ink); background: var(--surface); border-color: var(--rule-strong); }

/* ------------------------------------------------------------------ home page */
.home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1.5rem; }
.home-head h2 { margin: 0; }
.home-key { margin: 0; font-size: 0.9rem; color: var(--muted); }
.parts-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.part-col { padding: 1.1rem 1.1rem 0.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.part-col h3 { margin: 0 0 0.5rem; }
.tindex { list-style: none; margin: 0; padding: 0; }
.tindex a { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.6rem 0.4rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; border-top: 1px solid var(--rule); }
.tindex a:hover { background: var(--raise); }
.tindex .dot { flex: 0 0 1rem; font-size: 0.8rem; color: var(--prussian); }
.tindex .ref { flex: 0 0 3.3rem; font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--prussian); }
.tindex .name { flex: 1 1 auto; }
.tindex .is-soon a, .tindex .is-soon .ref, .tindex .is-soon .dot { color: var(--muted); }
.more-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.more-part { display: block; padding: 1.1rem 1.25rem; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.more-part:hover { border-color: var(--prussian); }
.more-part strong { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.more-part span { color: var(--ink-soft); font-size: 0.97rem; }
.teachers-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2.5rem; padding: 1.75rem 2rem; background: #161c2b; border: 1px solid var(--rule); border-radius: 16px; }
.teachers-band h2 { margin: 0 0 0.4rem; }
.teachers-band p { margin: 0; max-width: 40rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- topics page */
.topics-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.topics-head h1 { margin: 0 0 0.3rem; }
.topics-head .section-lead { margin: 0; }
.mode-toggle { display: inline-flex; border: 2px solid var(--rule-strong); border-radius: 999px; overflow: hidden; }
.mode-toggle button { min-height: 2.75rem; padding: 0.5rem 1.1rem; font: inherit; font-weight: 700; color: var(--ink); background: transparent; border: 0; cursor: pointer; }
.mode-toggle button[aria-pressed="true"] { color: #fff; background: var(--go); }
html:not(.js) .mode-toggle { display: none; }
.part-block { margin-top: 2.2rem; scroll-margin-top: 1rem; }
.part-block h2 { margin-bottom: 0.7rem; }
[data-topic-list][data-show="ready"] .is-soon { display: none; }
.topic-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.topic-rows > li + li { border-top: 1px solid var(--rule); }
.topic-row, .topic-rows summary { display: flex; align-items: center; gap: 0.9rem; min-height: 3.25rem; padding: 0.7rem 1.1rem; color: var(--ink); text-decoration: none; cursor: pointer; list-style: none; }
.topic-rows summary::-webkit-details-marker { display: none; }
.topic-rows summary::after { content: ""; flex: 0 0 0.6rem; height: 0.6rem; margin-left: 0.2rem; border-right: 2.5px solid var(--ink-soft); border-bottom: 2.5px solid var(--ink-soft); transform: translateY(-0.12rem) rotate(45deg); transition: transform 0.15s; }
.topic-rows details[open] > summary::after { transform: translateY(0.1rem) rotate(-135deg); }
.topic-row:hover, .topic-rows summary:hover { background: var(--raise); }
.topic-row .ref, .topic-rows summary .ref { flex: 0 0 3.4rem; font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--prussian); }
.topic-row .name, .topic-rows summary .name { flex: 1 1 auto; font-family: var(--display); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.topic-row.is-soon, .is-soon > .topic-row { color: var(--muted); }
.is-soon > .topic-row .ref, .is-soon > .topic-row .name { color: var(--muted); }
.topic-panel { padding: 0.4rem 1.1rem 1.4rem 5.3rem; background: #121722; border-top: 1px solid var(--rule); }
.topic-panel .blurb { max-width: 40rem; color: var(--ink-soft); }
.topic-panel h3 { margin: 1.2rem 0 0.6rem; font-size: 1.15rem; }
.topic-panel .open-topic { display: inline-block; margin-top: 1rem; font-weight: 700; }
.soon-list { list-style: none; margin: 0.8rem 0 0; padding: 0; color: var(--muted); }
.soon-list li { padding: 0.3rem 0; }
.soon-list .chip { margin-left: 0.4rem; }
.topic-ref { margin: 0 0 0.3rem; font-size: 0.95rem; font-weight: 700; color: var(--prussian); }

@media (max-width: 800px) {
  .topic-panel { padding-left: 1.1rem; }
  .topic-row .ref, .topic-rows summary .ref { flex-basis: 3rem; }
  .teachers-band { padding: 1.4rem 1.25rem; }
}

/* Long summaries on cards: show three lines. */
.look-dark .model-card-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Exam board picker in the header (works in both looks). */
.board-pick { position: relative; }
.board-pick summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem; }
.board-pick summary::-webkit-details-marker { display: none; }
.board-pick summary::after { content: ""; width: 0.45rem; height: 0.45rem; margin: -0.2rem 0 0 0.1rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.board-pick[open] summary::after { transform: rotate(-135deg); margin-top: 0.15rem; }
.board-now { font-weight: 800; color: #5fd3c6; }
body:not(.look-dark) .board-now { color: var(--accent, var(--ink)); }
.board-pick summary:focus-visible, .board-row:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #1b2a8a; }
.board-panel {
  position: absolute; z-index: 60; top: calc(100% + 0.5rem); left: 0;
  width: min(21rem, calc(100vw - 2rem));
  padding: 0.9rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.board-head { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.board-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; min-height: 44px; padding: 0.35rem 0.7rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
a.board-row:hover { background: var(--raise, var(--surface)); }
.board-row.is-current { border: 1px solid #2c6fbe; }
.board-row.is-soon { color: var(--muted); font-weight: 600; }
.board-tag { font-size: 0.8rem; font-weight: 700; white-space: nowrap; color: var(--muted); }
.board-row.is-current .board-tag { color: #5fd3c6; }
body:not(.look-dark) .board-row.is-current .board-tag { color: var(--ink); }
.board-tag--dev { padding: 0.05rem 0.55rem; border: 1px dashed currentColor; border-radius: 999px; }
.board-note { margin: 0.7rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--rule); font-size: 0.88rem; line-height: 1.5; color: var(--ink-soft, var(--muted)); }

/* On a phone, lessons keep their header to one line: the course label is for the site pages. */
@media (max-width: 640px) {
  body:not(.look-dark) .site-header .course-pill, body:not(.look-dark) .site-header .board-pick { display: none; }
}

/* ---------------------------------------------------- AS or A-level (AQA 7404 / 7405)
   The choice is in the header's course menu (site.js). AS greys out the
   A-level-only topics (Paul, 23 November 2026: "just grey out"); .for-as /
   .for-alevel swap a few words. */
html[data-course="as"] [data-alevel-only] { opacity: 0.45; }
html[data-course="as"] [data-alevel-only] .lvl-tag { color: #f5c46b; border-color: #b7791f; }
.for-as { display: none; }
html[data-course="as"] .for-as { display: inline; }
html[data-course="as"] .for-alevel { display: none; }
html[data-course="as"] p.for-as { display: block; }
.lvl-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.5rem; font-size: 0.72rem; font-weight: 700; line-height: 1.5; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; }
.lvl-tag--both { color: #5fd3c6; border-color: #2c6f6a; }
.as-warning { margin-top: 0.8rem; padding: 0.6rem 0.8rem; border: 1px solid #b7791f; border-radius: 10px; color: #f5c46b; font-weight: 600; }
.course-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-bottom: 0.4rem; }
.course-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; min-height: 48px; padding: 0.4rem 0.7rem; font: inherit; font-weight: 800; color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; text-align: left; }
.course-btn[aria-pressed="true"] { border-color: #2c6fbe; box-shadow: inset 0 0 0 1px #2c6fbe; }
.course-btn[aria-pressed="true"]::after { content: "Chosen"; font-size: 0.75rem; font-weight: 700; color: #5fd3c6; }
.course-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.course-code { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.course-note { margin: 0 0 0.9rem; font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft, var(--muted)); }

/* The lesson's AQA number, under its title in the lesson bar (src/_data/specMap.json). */
.ms-titles { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.ms-titles .ms-title { flex: none; }
.ms-spec { font-size: 0.72rem; font-weight: 600; line-height: 1.2; letter-spacing: 0.02em; color: #8d96aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
