/* learn.nalam.ca: one design system for every page (redesign 24 Nov 2026).
   Strategy: ~/Projects/business/teaching/learn-nalam-ca/redesign-strategy-2026-11-24.md §3.
   Fonts: Sentient (headings) + Switzer (text), self-hosted via src/styles/fonts.css.
   Light is the default (ThemeInit.astro); dark only when the visitor picks it with the toggle. */
:root {
  --bg: #FFFFFF; --soft: #F5F6F8; --card: #FFFFFF; --line: #E5E5E5; --line-2: #D4D4D4;
  --ink: #171717; --ink-2: #525252; --ink-3: #8A8A8A; --navy: #0B1230;
  --accent: #A84308; --accent-hover: #8C3706; --accent-soft: #FDF1EA;
  --green: #057F51; --green-soft: #E7F4EE; --bad: #B42318; --bad-soft: #FDECEA;
  --stage: #0B1230;
  --serif: "Sentient", Georgia, serif; --sans: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px; --shadow: 0 1px 2px rgba(23,23,23,.04), 0 6px 20px rgba(23,23,23,.06);
  /* Old names, still used by student pages and scripts */
  --paper: var(--soft); --muted: var(--ink-2); --ok: var(--green); --ok-bg: var(--green-soft); --bad-bg: var(--bad-soft);
  color-scheme: light;
}
/* The hidden attribute always wins over .btn and menu display rules (signed-in swap in SiteHeader). */
[hidden] { display: none !important; }
/* Signed-in visitors (html[data-signed-in], set by SiteHeader) don't see "for students" labels and join prompts. */
html[data-signed-in] [data-visitor-only], html:not([data-signed-in]) [data-member-only] { display: none !important; }
:root[data-theme="dark"] {
  --bg: #0B1020; --soft: #121A30; --card: #141C33; --line: #26304A; --line-2: #34405E;
  --ink: #EEF0F5; --ink-2: #AEB5C5; --ink-3: #7D869A; --navy: #E8EBF5;
  --accent: #F08A4B; --accent-hover: #F6A06B; --accent-soft: #2A1C14;
  --green: #4CC38A; --green-soft: #12291F; --bad: #F0857A; --bad-soft: #351A18;
  --stage: #070B16; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; line-height: 1.1; letter-spacing: -.03em; color: var(--navy); }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin: .4em 0 .3em; }
h2 { font-size: 1.5rem; }
h3 { font-weight: 400; letter-spacing: -.02em; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared top bar (SiteHeader.astro) ---------- */
.sh { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sh-in { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 64px; }
.sh-brand { font: 400 1.2rem var(--serif); letter-spacing: -.03em; color: var(--navy) !important; text-decoration: none; white-space: nowrap; }
.sh-brand span { color: var(--accent); }
.sh-menu { display: flex; gap: 2px; align-items: center; flex: 1; }
.sh-menu > a, .sh-dd > button { font: 500 .93rem var(--sans); color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sh-menu > a:hover, .sh-dd > button:hover, .sh-menu > a[aria-current], .sh-dd.is-current > button { background: var(--soft); color: var(--ink); }
.sh-dd { position: relative; }
/* Invisible bridge over the gap between the button and the panel, so the menu stays open while the mouse moves down. */
.sh-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.sh-panel { display: none; position: absolute; top: 44px; left: 0; width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 40px rgba(23,23,23,.12); padding: 8px; }
.sh-dd:hover .sh-panel, .sh-dd:focus-within .sh-panel, .sh-dd.open .sh-panel { display: block; }
.sh-panel a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.sh-panel a:hover { background: var(--soft); color: var(--ink); }
.sh-panel b { display: block; font-weight: 600; font-size: .95rem; }
.sh-panel span { font-size: .84rem; color: var(--ink-2); }
.sh-panel .sh-all { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: .88rem; color: var(--accent); border-radius: 0 0 8px 8px; }
.sh-right { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.sh-who { font-size: .85rem; color: var(--ink-2); overflow-wrap: anywhere; max-width: 220px; }
.sh .sh-burger { display: none; }
.sh-mobile { display: none; }
@media (max-width: 820px) {
  .sh-menu, .sh-right .sh-hide-sm { display: none; }
  .sh .sh-burger { display: inline-flex; }
  .sh-mobile.open { display: block; border-top: 1px solid var(--line); background: var(--bg); padding: 8px 20px 16px; }
  .sh-mobile a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
  .sh-mobile a.sub { padding-left: 16px; font-weight: 400; color: var(--ink-2); }
}

/* ---------- Buttons and pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 .95rem var(--sans); padding: 11px 20px; border-radius: 8px; text-decoration: none; border: 1px solid transparent; cursor: pointer; background: var(--accent); color: #fff; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.ghost.is-done { color: var(--green); border-color: var(--green); }
.btn.sm { padding: 7px 14px; font-size: .88rem; }
.btn:disabled { opacity: .6; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 .76rem/1 var(--sans); padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--card); white-space: nowrap; }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.pill.free { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: var(--green-soft); }
.pill.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.theme-toggle { color: var(--ink-2) !important; border-color: var(--line-2) !important; }

/* ---------- Shared footer (SiteFooter.astro) ---------- */
.sf { border-top: 1px solid var(--line); padding: 48px 0; font-size: .9rem; color: var(--ink-2); margin-top: 40px; }
.sf-in { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.sf b { display: block; color: var(--ink); margin-bottom: 10px; font-size: .9rem; font-weight: 600; }
.sf a { display: block; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.sf a:hover { color: var(--accent); }
.sf p { margin: 0 0 6px; }
.sf .sf-inline { display: inline; }
@media (max-width: 820px) { .sf-in { grid-template-columns: 1fr 1fr; } }

/* ---------- Student pages (Base.astro) ---------- */
main.wrap { padding-top: 20px; padding-bottom: 48px; }
.muted { color: var(--ink-2); }
.lede { font-size: 1.12rem; color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 600; color: var(--accent); margin: 1.6em 0 0; }
.crumbs { font-size: .88rem; margin-top: 28px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin: 20px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.course { display: block; color: inherit; text-decoration: none; margin: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.course:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.course h2 { margin: .3em 0; font-size: 1.35rem; }
/* My learning (25 Nov 2026): colour per kind of card, state colours on module tests. */
.ml { --blue: #1D5FD1; --blue-soft: #EAF1FD; --amber: #B26A00; --amber-soft: #FFF4DF; }
:root[data-theme="dark"] .ml { --blue: #7FA8F5; --blue-soft: #15223F; --amber: #F2B24C; --amber-soft: #2E2310; }
.ml-hero { margin: 8px 0 28px; padding: 30px 30px 26px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(240,138,75,.55) 0%, rgba(240,138,75,0) 55%), linear-gradient(135deg, #0B1230 0%, #1B2A5C 60%, #23408A 100%); }
.ml-hero h1 { color: #fff; margin: 4px 0 6px; }
.ml-hi { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #FFC9A6; }
.ml-sub { margin: 0 0 18px; color: rgba(255,255,255,.8); }
.ml-hero .continue { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(6px); }
.ml-hero .continue b { color: #fff; }
.ml-hero .continue [data-label] { color: #FFC9A6; }
.ml-hero .continue .btn { background: #fff; color: #A84308; }
.ml-hero .continue:hover .btn { background: #FFE3D1; }
.ml-h { font-size: 1.5rem; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.ml-h::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.ex-tests .ml-h::before { background: var(--blue); }
.ml .course { position: relative; overflow: hidden; border-top: 4px solid var(--line-2); }
.ml .k-live { border-top-color: var(--accent); }
.ml .k-live .tag { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.ml .k-self { border-top-color: var(--green); }
.ml .k-self .tag { background: var(--green-soft); color: var(--green); border-color: transparent; font-weight: 600; }
.ml .k-live .bar i { background: linear-gradient(90deg, var(--accent), #F08A4B); }
.ml .k-self .bar i { background: linear-gradient(90deg, var(--green), #4CC38A); }
.ml .course.is-done .bar i { background: var(--green); }
.ml .mt { border-top-color: var(--blue); }
.ml .mt .tag { background: var(--blue-soft); color: var(--blue); border-color: transparent; font-weight: 600; }
.ml .mt.is-pass { border-top-color: var(--green); background: linear-gradient(180deg, var(--green-soft), var(--card) 70%); }
.ml .mt.is-try { border-top-color: var(--amber); background: linear-gradient(180deg, var(--amber-soft), var(--card) 70%); }
.mt-badge { float: right; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: 2px 10px; }
.mt-badge:empty { display: none; }
.is-pass .mt-badge { background: var(--green); color: #fff; }
.is-try .mt-badge { background: var(--amber); color: #fff; }
.continue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; text-decoration: none; color: inherit; border-color: var(--accent); }
.continue b { flex: 1 1 260px; font: 400 1.25rem var(--serif); color: var(--ink); }
.continue [data-label] { flex-basis: 100%; font-size: .85rem; }
.quiet { font-size: .75rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 0 7px; }
tfoot td, tfoot th { border-top: 2px solid var(--line-2); font-size: .85rem; }
.bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.tag { font-size: .75rem; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.module { margin-top: 1.8em; font-size: 1.2rem; }
.lessons { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.lessons li + li { border-top: 1px solid var(--line); }
.lessons a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 18px; color: inherit; text-decoration: none; }
.lessons a:hover { background: var(--soft); }
.lessons a:hover .l-title { color: var(--accent); }
.l-title { font-weight: 500; }
.l-meta, .l-status { font-size: .85rem; color: var(--ink-2); }
.l-status { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.lessons li.done .l-status { color: var(--green); font-weight: 500; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r); overflow: hidden; margin: 22px 0; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 40px 16px; text-align: center; color: var(--ink-2); margin: 22px 0; background: var(--soft); }
.downloads { padding-left: 1.2em; }
.prose { max-width: 70ch; }
.prose img { max-width: 100%; }
.prose pre { overflow-x: auto; }
.prose h2 { margin-top: 1.6em; }
.quiz { margin-top: 28px; }
.quiz fieldset { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 14px; padding: 14px 16px; background: var(--card); }
.quiz legend { font-weight: 500; padding: 0 4px; }
.qn { color: var(--accent); }
.q-img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 6px; border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--soft); }
.opt input { margin-top: .35em; accent-color: var(--accent); }
.quiz fieldset.ok { border-color: var(--green); }
.quiz fieldset.bad { border-color: var(--bad); }
.quiz fieldset.bad .opt.right, .quiz fieldset.ok .opt.right { background: var(--green-soft); }
.why { margin: 8px 0 0; font-size: .95rem; }
.result.pass { color: var(--green); font-weight: 600; }
.result.fail { color: var(--bad); font-weight: 600; }
.done-row { margin: 24px 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; font-size: .95rem; }
.pager > :last-child { text-align: right; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; }
.row-form input, .row-form select { font: inherit; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 0; flex: 1 1 160px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; white-space: nowrap; }
th { font-weight: 600; }
td.na { background: var(--soft); }
small { color: var(--ink-2); }
.draft-tag { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 6px; margin-right: 8px; vertical-align: middle; }
.draft-banner { background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 12px; margin-top: 20px; font-size: .9rem; }
.ex-tests { margin-top: 40px; }
