/* drlewicki.com · study.css · the study guide, practice, quiz and printables on song pages (Dec 2026)
   Load on song pages after tokens.css and site.css (and grades35.css on Grades 3-5 pages).
   It builds on the lesson classes already in site.css (.lesson, .lparts/.lpart, .panel.words, .try,
   .quizset/.mcq, .lteach, .lres) and adds: the "On this page" bar, the compact hero, overview,
   worked example, "watch out" mistakes, practice list, printables band. Three skins by body class:
   .kids (read it together), .sec-35 (Field Notebook), .sec-69 (Night Lab). */

/* ---------- 1. on this page ---------- */
html:has(.onpage) { scroll-padding-top: 76px; }
.onpage { position: sticky; top: 0; z-index: 30; background: var(--paper); border-block: var(--line) solid var(--ink); }
.onpage .wrap { display: flex; gap: 8px; overflow-x: auto; padding-block: 8px; scrollbar-width: none; }
.onpage .wrap::-webkit-scrollbar { display: none; }
.onpage a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px 6px; border: 2.5px solid var(--ink); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font: 800 .95rem/1 var(--f-body); text-decoration: none; }
.onpage a:hover { background: var(--band, var(--lemon)); }
.onpage .op-print { margin-left: auto; background: var(--lemon); }
.onpage .op-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; font-size: .72rem; }

/* ---------- 2. compact hero: title and what you'll learn; the video sits right under it ---------- */
.song-hero.compact { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: end; gap: 22px 44px; }
.song-hero.compact .hero-info { gap: 12px; }
.hero-side { display: grid; gap: 14px; align-content: end; min-width: 0; }
.learn-line { margin: 0; padding: 14px 16px; background: var(--white); border: var(--line) solid var(--ink); border-radius: var(--r-xs); font-weight: 700; line-height: 1.45; }
.learn-line b { display: block; margin-bottom: 4px; font: 800 .78rem/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.hero-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta li { padding: 5px 10px 4px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--r-xs); font-weight: 800; font-size: .9rem; }
.hero-side .btn-row { margin: 0; }
.watch-media .stats { margin-top: 2px; }
.listen-line { font-weight: 700; font-size: .95rem; }

/* ---------- 3. the study guide (extends .lesson) ---------- */
.lesson-kicker { justify-self: start; margin: 0; padding: 6px 12px 4px; background: var(--white); border: 2.5px solid var(--ink); border-radius: var(--r-xs); font: 800 .8rem/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.lesson-head .lead { font-size: 1.12rem; line-height: 1.6; }
.sg-print { display: flex; flex-wrap: wrap; gap: 10px; }
.sg-print .btn { flex-direction: column; align-items: flex-start; gap: 3px; }
.sg-print .btn span, .pb span { font: 700 .8rem/1.2 var(--f-body); letter-spacing: 0; text-transform: none; }
.lpart.nofig { grid-template-columns: minmax(0, 1fr); }
.lpart.nofig .ltext { max-width: 72ch; }
.lfig.ph { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--paper-2); border: var(--line) dashed var(--ink); border-radius: var(--r-xs); color: var(--ink-2); font-weight: 700; text-align: center; padding: 16px; }

/* worked example */
.lex { margin: 0; display: grid; gap: 12px; }
.lex figcaption { font-weight: 800; font-size: 1.05rem; }
.lex img { width: 100%; border: var(--line) solid var(--ink); border-radius: var(--r-xs); }
.lex-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: ls; }
.lex-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; counter-increment: ls; }
.lex-steps li::before { content: counter(ls); display: grid; place-items: center; width: 30px; height: 30px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--p, var(--lemon)); font-weight: 800; font-size: .9rem; }
.lex-ans { margin: 0; padding: 10px 14px; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--r-xs); font-weight: 800; }

/* watch out: common mistakes */
.mlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.mlist li { display: grid; gap: 8px; padding: 14px 16px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: var(--r-xs); }
.mlist p { margin: 0; }
.mlist .no { color: var(--ink-2); }
.mlist .no b, .mlist .yes b { display: block; font: 800 .76rem/1.2 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.mlist .no s { text-decoration-thickness: 2px; text-decoration-color: var(--tomato-ink); }
.mlist .yes { font-weight: 700; }

/* practice: check yourself */
.plist { margin: 0; padding-left: 1.4em; display: grid; gap: 16px; }
.plist li { padding-left: 4px; }
.plist li::marker { font-weight: 800; }
.plist .q { font-size: 1.05rem; margin: 0 0 8px; }
.plist .hear { min-height: 44px; padding: 5px 12px; margin-top: 8px; font-size: .85rem; }

/* quiz */
.quizset .qz-meta { margin: 0; font-weight: 700; color: var(--ink-2); }
.quizset .mcqs { counter-reset: none; }
.quizset .mcq .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.quizset .mcq .opts.short { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.quizset .mcq .opt { text-align: left; }
.quizset .score:empty { display: none; }
.quizset .score { margin: 0; padding: 12px 16px; background: var(--lemon); border: var(--line) solid var(--ink); border-radius: var(--r-xs); font-size: 1.1rem; }
.qz-next { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* printables band */
.printband { display: grid; gap: 14px; padding: 22px; background: var(--white); border: var(--line) solid var(--ink); border-radius: var(--r-xs); box-shadow: var(--pop); }
.printband h2 { margin: 0; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.pb { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; align-items: center; min-height: 76px; padding: 12px 16px; border: var(--line) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--pop-sm); }
.pb:hover { background: var(--lemon); transform: translate(-2px, -2px); box-shadow: var(--pop); }
.pb::before { content: ""; grid-row: span 2; width: 44px; height: 54px; border: 2.5px solid var(--ink); border-radius: 3px; background: linear-gradient(var(--ink) 0 0) 8px 12px / 26px 3px no-repeat, linear-gradient(var(--ink) 0 0) 8px 20px / 22px 3px no-repeat, linear-gradient(var(--ink) 0 0) 8px 28px / 26px 3px no-repeat, var(--white); }
.pb b { font-size: 1.1rem; }
.printband .small { margin: 0; }

/* teachers band additions */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.key-link { display: inline-flex; }

/* small pieces used by all three bands */
.sg-sub { margin: 10px 0 -6px; font: 800 1.05rem/1.2 var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.onpage a[aria-current="true"] { background: var(--ink); color: var(--white); }
.onpage a[aria-current="true"] .op-n { border-color: var(--white); }
.lyr-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: var(--line) solid var(--ink); border-radius: var(--r-sm); background: var(--lemon); font-weight: 800; cursor: pointer; list-style: none; box-shadow: var(--pop-sm); }
.lyr-more > summary::-webkit-details-marker { display: none; }
.lyr-more > summary::after { content: "▾"; }
.lyr-more[open] > summary { display: none; }
.lyr-more[open] { display: grid; gap: 24px; }
.panel.next ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.teach-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font-weight: 800; }
.found-in { margin-top: 18px; }

/* hubs: study badge on cards, the "Has a study guide" chip, capped subject blocks */
.sg-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 2px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--r-xs); font: 800 .76rem/1.25 var(--f-body); color: var(--ink); }
.sg-badge::before { content: ""; width: 9px; height: 11px; border: 2px solid var(--ink); border-radius: 1px; background: linear-gradient(var(--ink) 0 0) 1px 2px / 5px 1.5px no-repeat, linear-gradient(var(--ink) 0 0) 1px 5px / 5px 1.5px no-repeat, var(--lemon); }
.card .sg-badge { justify-self: start; }
.kcard .krow .sg-badge { margin-right: auto; }
.chip-study { border-style: dashed; background: var(--lemon); }
.chip-study[aria-pressed="true"] { border-style: solid; }
.more-songs { margin-top: 18px; }
.more-songs > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: var(--line) solid var(--ink); border-radius: var(--r-sm); background: var(--white); font-weight: 800; cursor: pointer; list-style: none; box-shadow: var(--pop-sm); }
.more-songs > summary::-webkit-details-marker { display: none; }
.more-songs > summary::after { content: "▾"; }
.more-songs[open] > summary { margin-bottom: 18px; }
.more-songs[open] > summary::after { content: "▴"; }

/* ---------- 4. skins ---------- */
/* K-2: read it together. Big text, picture first, chunky buttons */
.kids .lesson { background-color: var(--paper-2); background-image: var(--halftone); background-size: 12px 12px; border-block: var(--line) solid var(--ink); }
.kids .lesson-head { padding: 22px 24px; background: var(--white); border: var(--line) solid var(--ink); border-radius: 18px; box-shadow: var(--pop); }
.kids .lesson-kicker { background: var(--sky); border-radius: 999px; }
.kids .lesson-head h2 { font: 400 clamp(2rem, 1.5rem + 2vw, 3rem)/1 var(--f-comic); letter-spacing: .02em; }
.kids .lesson-head .lead, .kids .ltext p { font-size: 1.22rem; line-height: 1.6; }
.kids .lpart { border-radius: 18px; box-shadow: var(--pop); }
.kids .ltext h3 { font: 400 clamp(1.4rem, 1.2rem + .9vw, 1.85rem)/1.1 var(--f-comic); letter-spacing: .02em; }
.kids .lnum { width: 2.2em; height: 2.2em; font-size: .95em; }
.kids .hear { background: var(--bubblegum); font-size: 1.05rem; min-height: 50px; padding: 10px 18px; box-shadow: var(--pop-sm); }
.kids .lesson .panel { border-radius: 18px; }
.kids .mcq .q { font-size: 1.22rem; }
.kids .quizset .mcq .opt, .kids .sort-item .pick button { min-height: 56px; font-size: 1.12rem; border-width: 3px; border-radius: 999px; text-align: center; }
.kids .quizset .mcq .opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.kids .printband, .kids .pb { border-radius: 18px; }

/* 3-5: Field Notebook. Ruled cards, tape, red-pen corrections, worksheet bubbles */
.sec-35 .lesson { padding-top: 64px; }
.sec-35 .lesson-kicker { background: var(--g35); }
.sec-35 .lesson-head h2 { background: linear-gradient(transparent 58%, var(--lemon) 58% 90%, transparent 90%); width: fit-content; padding-inline: 4px; }
.sec-35 .lpart { position: relative; background: repeating-linear-gradient(var(--white) 0 33px, rgb(19 168 158 / .22) 33px 35px); box-shadow: var(--pop); }
.sec-35 .lpart::before { content: ""; position: absolute; top: -12px; left: 22px; width: 84px; height: 24px; background: color-mix(in srgb, var(--c, var(--g35)) 78%, transparent); transform: rotate(-4deg); }
.sec-35 .panel.example { background-color: var(--white); background-image: var(--grid35); background-size: 20px 20px; }
.sec-35 .wlist { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.sec-35 .wlist div { padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: var(--r-xs); background: var(--g35-paper); }
.sec-35 .mlist .no s { text-decoration-color: var(--tomato); text-decoration-thickness: 3px; }
.sec-35 .mlist .yes b::before { content: "✓ "; color: var(--g35-ink); }  /* Design fix, Dec 3: the tick sat on its own line */
.sec-35 .quizset .mcq .opt { display: flex; gap: 10px; align-items: center; border-radius: var(--r-xs); }
.sec-35 .quizset .mcq .opt::before { content: ""; flex: none; width: 20px; height: 20px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--white); }
.sec-35 .quizset .mcq .opt.right::before { background: var(--ink); }

/* 6-9: Night Lab. Spruce bench, chalk text, lime labels */
.sec-69 .lesson-head { padding: 26px 26px 24px; background: var(--spruce); color: var(--chalk); border: var(--line) solid var(--ink); border-radius: var(--r-xs); box-shadow: var(--pop); }
/* site.css colours 6-9 headings with a very specific selector (it also matches by the nav pill), so this repeats its scope */
:is(.sec-69, body:has(.site-head .nav a[href="/songs/"][aria-current="page"])) .lesson-head :is(h2, h3) { color: var(--chalk); }
.sec-69 .lesson-kicker { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.sec-69 .lesson-head .lead { color: var(--chalk); }
.sec-69 .sg-print .btn-ghost { background: var(--chalk); }
.sec-69 .lnum { width: auto; height: auto; padding: 4px 8px 3px; border-radius: 3px; background: var(--spruce); color: var(--lime); border-color: var(--spruce); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.sec-69 .wlist div { grid-template-columns: 13ch minmax(0, 1fr); gap: 12px; align-items: baseline; }
.sec-69 .wlist dt { color: var(--g69-head); }
.sec-69 .panel.example { background: var(--spruce); color: var(--chalk); }
.sec-69 .panel.example .lex figcaption, .sec-69 .panel.example .lex-steps, .sec-69 .panel.example .small { color: var(--chalk); }
.sec-69 .panel.example .lex-steps li::before { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.sec-69 .panel.example .lex-ans { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.sec-69 .mlist li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; background: var(--white); }
.sec-69 .mlist .no { padding-right: 16px; border-right: 2px dashed var(--rule); }
.sec-69 .quizset .mcq .opt { border-radius: var(--r-xs); }

/* ---------- 5. phones ---------- */
@media (max-width: 860px) {
  .song-hero.compact { grid-template-columns: minmax(0, 1fr); }
  .sec-69 .mlist li { grid-template-columns: minmax(0, 1fr); }
  .sec-69 .mlist .no { padding: 0 0 10px; border-right: 0; border-bottom: 2px dashed var(--rule); }
}
@media (max-width: 560px) {
  .onpage .wrap { padding-inline: 12px; }
  .onpage .op-print { margin-left: 0; }
  /* phones: keep the video near the top. "You'll learn" opens the study guide, and the chips repeat in Song details */
  .hero-side .learn-line, .hero-side .hero-meta { display: none; }
  .hero-side .btn-row .btn { flex: 1 1 130px; justify-content: center; }
  .sg-print .btn { flex: 1 1 100%; }
  .sec-69 .wlist div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kids .lesson-head { padding: 18px 16px; }
}

/* ---------- 6. printing the page itself (Print this lesson fallback) ---------- */
@media print {
  .onpage, .printband, .sg-print, .hear, .qz-next { display: none !important; }
  .sec-69 .lesson-head, .sec-69 .panel.example { background: #fff !important; color: #000 !important; }
  .sec-69 .lesson-head *, .sec-69 .panel.example * { color: #000 !important; }
  .lesson { background: #fff !important; }
}

/* Design QA 1440 #1 (Dec 3): the sticky "on this page" bar (66 px, top 0) hid the top of the sticky video column */
@media (min-width: 981px) { html:has(.onpage) .watch-media { top:82px; max-height:calc(100vh - 98px); } }
