/* The Chromozone: course pages in the new look (R9, 11 Nov 2026; Robbe picked the design). A sidebar of units and
   collapsible topic boxes. Poppins for titles, Nunito for text, the course's own colour set (same sets as
   css/lesson-tabs.css). Markup: tools/course_page.py. Everything is scoped to .cpg, so css/course.css (specification
   checklists, hub) is not affected. Fonts are the self-hosted files in /fonts/ (SIL Open Font Licence). */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.cpg, .cp-unit--bio  { --s1: #CBDED3; --s2: #8BA49A; --s3: #3B6255; --s1t: #f4f8f5; --s2t: #eef3f0; --s3t: #e6eee9; }
.cpg--chem, .cp-unit--chem { --s1: #CFDCE3; --s2: #8DA3B3; --s3: #3B5A70; --s1t: #f4f7f9; --s2t: #eef2f5; --s3t: #e6ecf1; }
.cp-unit--phys { --s1: #DCD3E3; --s2: #A296B0; --s3: #5A4A6E; --s1t: #f7f4f9; --s2t: #f2eff5; --s3t: #ebe7f0; }
.cpg--bus { --s1: #DCE4F5; --s2: #8FA3CF; --s3: #2E4A8C; --s1t: #f5f7fc; --s2t: #eef2fa; --s3t: #e7ecf7; }
.cpg--psych { --s1: #F0D9C6; --s2: #D19A73; --s3: #9A5A33; --s1t: #fcf6f1; --s2t: #f9efe7; --s3t: #f4e8df; }
.cpg { --hl: #e3c567; --hl-soft: #f6ecc8; --cp-ink: #12302b; --cp-ink2: #2f4f49; --cp-line: #e3ddcc;
  font-family: 'Nunito', system-ui, sans-serif; color: var(--cp-ink); padding: 28px 0 64px; line-height: 1.5; }
.cpg .wrap { max-width: 1160px; }
.cpg [hidden] { display: none !important; }
.cpg h1, .cpg h2, .cpg h3, .cp-btn, .cp-chip, .cp-cpchip, .cp-pill-h { font-family: 'Poppins', system-ui, sans-serif; }
.cpg a { color: var(--s3); }
.cpg a:hover { color: var(--cp-ink); }
.cpg :focus-visible { outline: 3px solid var(--cp-ink); outline-offset: 2px; border-radius: 4px; }
.sp-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cpg .lock-ico { display: inline-block; flex: none; width: 13px; height: 13px; }

/* Head */
.cp-crumb { font-size: 0.9rem; color: var(--cp-ink2); }
.cp-crumb a { color: var(--cp-ink2); }
.cp-head { display: grid; gap: 10px; justify-items: start; margin: 14px 0 22px; }
.cpg h1 { font-weight: 700; font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.15; letter-spacing: 0; margin: 0; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; }
.cp-pill-h { font-size: 0.8rem; font-weight: 700; background: var(--s3); color: #fff; padding: 4px 12px; border-radius: 999px; letter-spacing: 0; }
.cp-lead { font-size: 1.1rem; color: var(--cp-ink2); max-width: 66ch; margin: 0; }
.cp-facts { font-size: 0.92rem; color: var(--cp-ink2); max-width: 66ch; margin: 0; }
.cpg .spec-chip { color: var(--cp-ink2); }

/* Buttons */
.cp-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 8px; background: var(--s3); color: #fff !important; border: 2px solid var(--s3); font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.cp-btn:hover { background: var(--cp-ink); border-color: var(--cp-ink); }
.cp-btn--ghost { background: transparent; color: var(--s3) !important; }
.cp-btn--ghost:hover { background: var(--s3t); color: var(--cp-ink) !important; border-color: var(--s3); }
.cp-btn--yellow { background: var(--hl); border-color: var(--hl); color: var(--cp-ink) !important; }
.cp-btn--yellow:hover { background: #fff; border-color: #fff; }

/* This course includes */
.cp-includes { display: grid; gap: 10px; background: #fff; border: 1px solid var(--cp-line); border-radius: 12px; padding: 16px 18px; margin-bottom: 26px; }
.cp-includes-h { font-family: 'Poppins', system-ui, sans-serif; font-weight: 600; margin: 0; }
.cp-includes .ticks { gap: 4px 24px; }
.cp-includes .ticks .tick { color: var(--s3); font-family: 'Poppins', system-ui, sans-serif; font-size: 1rem; font-weight: 700; }
.cp-includes .ticks li { color: var(--cp-ink); font-size: 0.97rem; }
.cp-includes-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.cp-includes.course-access--open { background: var(--s3t); border-color: var(--s1); }

/* Layout: sidebar + topics */
.cp-layout { display: flex; gap: 40px; align-items: flex-start; }
.cp-main { flex: 1; min-width: 0; }
.cp-side { flex: 0 0 240px; width: 240px; position: sticky; top: 16px; box-sizing: border-box; background: #fff; border: 1px solid var(--cp-line); border-radius: 12px; padding: 16px; }
.cp-side-h { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cp-ink2); }
.cp-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cp-nav { display: block; padding: 8px 10px; border-radius: 8px; color: var(--cp-ink) !important; text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.cp-nav span { display: block; font-size: 0.82rem; color: var(--cp-ink2); }
.cp-nav:hover { background: var(--s3t); }
.cp-nav[aria-current="true"] { background: var(--s1); }
.cp-nav[aria-current="true"] span { color: var(--cp-ink); }

/* Units and topic boxes */
.cp-unit { margin-bottom: 28px; scroll-margin-top: 16px; }
.cp-unit-head { margin-bottom: 12px; }
.cp-unit-code { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cp-ink2); }
.cp-unit h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: 0; margin: 2px 0 0; line-height: 1.25; }
.cp-topic { background: #fff; border: 1px solid var(--s1); border-radius: 14px; margin-bottom: 10px; overflow: hidden; scroll-margin-top: 16px; }
.cp-topic[open] { border: 2px solid var(--s3); }
.cp-topic > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 20px; cursor: pointer; list-style: none; }
.cp-topic > summary::-webkit-details-marker { display: none; }
.cp-topic[open] > summary { background: var(--s3); color: #fff; padding: 15px 20px; }
.cp-t-title { flex: 1 1 260px; min-width: 0; margin: 0; font-weight: 600; font-size: 1rem; letter-spacing: 0; line-height: 1.4; }
.cp-topic[open] .cp-t-title { font-size: 1.1rem; }
.cp-chip { display: inline-block; background: var(--s1); color: var(--cp-ink); border-radius: 6px; padding: 1px 9px; margin-right: 6px; }
.cp-chip--2 { background: var(--s2); }
.cp-chip--hl, .cp-topic[open] .cp-chip { background: var(--hl); color: var(--cp-ink); }
.cp-t-count { font-size: 0.85rem; color: var(--cp-ink2); }
.cp-topic[open] .cp-t-count { color: #fff; }
.cp-fold { flex: none; width: 22px; text-align: center; font-weight: 700; font-size: 1.3rem; line-height: 1; color: var(--cp-ink2); }
.cp-fold::before { content: "+"; }
.cp-topic[open] .cp-fold { color: #fff; }
.cp-topic[open] .cp-fold::before { content: "\2212"; }
.cp-topic > summary:focus-visible { outline-offset: -4px; }
.cp-topic[open] > summary:focus-visible { outline-color: var(--hl); }

/* Access badges (js/site.js swaps them for "Open to you"); each has its own light fill so it reads on white and on the dark header */
.cpg .tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0; text-transform: none; padding: 2px 10px; border-radius: 999px; color: var(--cp-ink); }
.cpg .tag--free { background: var(--hl-soft); box-shadow: inset 0 0 0 1px #d9bc4f; }
.cpg .tag--part { background: #fff; box-shadow: inset 0 0 0 1.5px #d9bc4f; }
.cpg .tag--plan { background: #f7f4ec; box-shadow: inset 0 0 0 1px var(--s2); }
.cpg .tag--open { background: var(--s1); }

/* Lesson rows */
.cp-rows { list-style: none; margin: 0; padding: 0; font-size: 0.97rem; }
.cp-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 9px 20px; border-top: 1px solid #dfeae3; }
.cp-row:hover { background: var(--s3t); }
.cp-num { font-weight: 700; color: var(--s3); overflow-wrap: anywhere; }
.cp-name a { color: var(--cp-ink); text-decoration: none; }
.cp-name a:hover { text-decoration: underline; color: var(--cp-ink); }
.cp-row.lr--locked .cp-name a { color: var(--cp-ink2); }
.lr-lock { display: inline-flex; vertical-align: -1px; margin-left: 7px; color: var(--cp-ink2); }
.cp-cpchip { background: var(--hl); color: var(--cp-ink); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-left: 8px; white-space: nowrap; }
.cp-pill { justify-self: start; display: inline-flex; align-items: center; min-height: 32px; padding: 3px 12px; border: 1.5px solid var(--s3); border-radius: 8px; font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--s3) !important; background: #fff; white-space: nowrap; }
.cp-pill:hover { background: var(--s3); color: #fff !important; }
.cp-extras { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 12px 20px; border-top: 1px solid #dfeae3; background: var(--s1); font-size: 0.92rem; }
.cp-extras a { color: var(--cp-ink) !important; font-weight: 700; }
.cp-extras .lr-lock { margin-left: 6px; }
.cp-note { margin: 0; padding: 10px 20px 12px; border-top: 1px solid #dfeae3; font-size: 0.9rem; color: var(--cp-ink2); }
.cp-topic > p:first-of-type:not(.cp-extras) { border-top: 0; }
.cp-legal { margin-top: 28px; font-size: 0.84rem; color: var(--cp-ink2); max-width: 80ch; }

/* Ready to teach */
.cp-end { margin-top: 40px; background: var(--cp-ink); color: #f7f4ec; border-radius: 14px; padding: 36px 24px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.cp-end h2 { color: #f7f4ec; font-weight: 700; font-size: 1.7rem; margin: 0; }
.cp-end p { margin: 0; }
.cp-end-ticks { text-align: left; display: grid; gap: 8px; }
.cp-end .ticks .tick { color: var(--hl); font-family: 'Poppins', system-ui, sans-serif; font-size: 1rem; font-weight: 700; }
.cp-end .ticks li { color: #f7f4ec; }

@media (min-width: 720px) {
  .cpg { padding: 40px 0 96px; }
  .cp-includes { padding: 18px 22px; }
  .cp-includes .ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-row { grid-template-columns: 6.5rem minmax(0, 1fr) auto; }
  .cp-pill { justify-self: end; }
  .cp-t-title { font-size: 1.05rem; }
}
@media (max-width: 860px) {
  .cp-layout { flex-direction: column; gap: 22px; }
  .cp-side { position: static; width: 100%; flex: none; }
  .cp-side ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .cp-side ul { grid-template-columns: minmax(0, 1fr); }
  .cp-topic > summary, .cp-topic[open] > summary, .cp-row, .cp-extras, .cp-note { padding-left: 14px; padding-right: 14px; }
  .cp-end { padding: 28px 16px; }
}
@media print {
  .cp-side, .cp-includes-links, .cp-end { display: none; }
  .cp-topic > :not(summary) { display: block; }
}

/* /courses/ hub: one outlined card per course, in that course's colour (tools/build_courses_hub.py) */
.hub-card--bio { --s3: #3B6255; --s1: #CBDED3; }
.hub-card--psych { --s3: #9A5A33; --s1: #F0D9C6; }
.hub-card--chem { --s3: #3B5A70; --s1: #CFDCE3; }
.hub-card--prim { --s3: #7A5C0A; --s1: #f6ecc8; }
.hub-card--pshe { --s3: #1F6B67; --s1: #CDE6E3; }
.hub-card--bus { --s3: #2E4A8C; --s1: #DCE4F5; }
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.hub-card { display: grid; gap: 12px; align-content: start; background: transparent; border: 2px solid var(--s3); border-radius: 14px; padding: 20px; }
.hub-card h2 { font-size: 1.45rem; margin: 0; line-height: 1.25; }
.hub-card h2 a { color: var(--cp-ink); text-decoration: none; }
.hub-card h2 a:hover { text-decoration: underline; }
.hub-card .spec-chip { justify-self: start; }
.hub-card .spec-chip b { background: var(--s3); color: #fff; }
.hub-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.cpg .tag--count { background: var(--s1); }
.hub-meta { margin: 0; font-size: 0.95rem; color: var(--cp-ink2); }
.hub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.hub-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 4px; }
.hub-foot .hub-actions { margin-top: 0; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
.hub-foot .cp-btn { white-space: nowrap; }
.hub-crew { display: flex; gap: 4px; flex-shrink: 0; margin-left: auto; }
.hub-crew-one { margin: 0; text-align: center; }
.hub-crew-one img { display: block; width: 72px; height: auto; margin: 0 auto; }
.hub-crew-one figcaption { font-size: 0.75rem; font-weight: 700; color: var(--cp-ink2); margin-top: 3px; }
.hub-crew:has(.hub-crew-one + .hub-crew-one) .hub-crew-one img { width: 44px; }
.hub-quip { margin: -2px 0 0; text-align: right; font-style: italic; font-size: 0.85rem; color: var(--cp-ink2); }
.hub-soon-title { margin: 36px 0 12px; font-size: 1.3rem; }
.hub-card--soon { border: 2px dashed var(--s2); }
.hub-card--soon h2 { font-size: 1.3rem; }
.hub-card--soon .hub-foot > div { flex: 1 1 180px; min-width: 0; }
@media (min-width: 720px) { .hub-card { padding: 24px 28px; } }
@media (min-width: 1000px) { .hub-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* The four levels on /courses/ (18 Nov 2026): two by two */
@media (min-width: 720px) { .hub-list--levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
