/* Lesson page sections and slide viewer (public/js/lesson-parts.js), ⋮ menu on lesson cards is styled by public/js/row-menu.js. */
/* Lesson sections (public/js/lesson-parts.js): one section at a time, chosen in the section menu of the lesson head. */
.sect-menu > summary { background: var(--navy); border-color: var(--navy); color: #fff; }
.sect-menu > summary::before { content: "Section"; margin-right: .5em; font-size: .78em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
:lang(fr) .sect-menu > summary::before { content: "Partie"; }
.sect-menu > summary:hover { background: var(--navy-deep); }
.sect-menu .act-panel a[aria-current="true"] { color: var(--accent); }
@media screen { .lesson-body.is-parted .part-off { display: none !important; } }
.reading-layout.sect-other { grid-template-columns: minmax(0, 1fr); }
.reading-layout.sect-other > .contents { display: none; }
.reading-layout.sect-other > .lesson-body { max-width: 980px; margin-inline: auto; width: 100%; }
.part-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; }
.part-nav a { display: grid; gap: 4px; text-decoration: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.part-nav a:hover { border-color: var(--navy); }
.part-nav span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.part-nav strong { font: 600 18px/1.3 var(--serif); color: var(--navy); }
.part-nav .part-next { grid-column: 2; text-align: right; background: var(--navy); border-color: var(--navy); }
.part-nav .part-next span { color: rgba(255, 255, 255, .75); }
.part-nav .part-next strong { color: #fff; }
@media (max-width: 600px) { .part-nav { grid-template-columns: 1fr; } .part-nav .part-next { grid-column: 1; text-align: left; } }
/* Slides section: the lesson deck as pictures. */
.slides-view h2 { margin-bottom: 6px; }
.sv-stage { position: relative; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); aspect-ratio: 16 / 9; }
.sv-stage:fullscreen { border: 0; border-radius: 0; background: #000; display: grid; place-items: center; }
.sv-main { display: block; width: 100%; height: 100%; object-fit: contain; }
.sv-hit { position: absolute; top: 0; bottom: 0; width: 30%; border: 0; background: transparent; cursor: pointer; }
.sv-hit-prev { left: 0; cursor: w-resize; } .sv-hit-next { right: 0; cursor: e-resize; }
.sv-bar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.sv-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--navy); cursor: pointer; }
.sv-btn:hover { border-color: var(--navy); }
.sv-full { margin-left: 8px; }
.sv-count { min-width: 5.5em; text-align: center; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.sv-count b { color: var(--navy); }
.sv-thumbs { display: flex; gap: 10px; overflow-x: auto; list-style: none; margin: 16px 0 0; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.sv-thumbs li { flex: none; scroll-snap-align: center; }
.sv-thumbs button { display: block; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; opacity: .75; }
.sv-thumbs button:hover { opacity: 1; }
.sv-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.sv-thumbs img { display: block; width: 128px; height: 72px; object-fit: cover; }
@media print { .part-nav, .slides-view { display: none !important; } }
.sv-locked .sv-bar, .sv-locked .sv-thumbs, .sv-locked .sv-hit { display: none; }
.sv-locked .sv-stage { cursor: default; }
.sv-locked-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.sv-locked-cta[hidden] { display: none; }
.sv-locked-cta p { margin: 0; font-weight: 600; color: var(--navy); }
.sv-locked-cta .fc-lock, .sv-dl .fc-lock { display: inline-block; width: 1.1em; height: 1.1em; margin-right: .4em; vertical-align: -.18em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0562f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2' fill='%23fff3ec'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") no-repeat center/contain; }
.sv-locked > .hint { display: none; }
/* Lesson bar (public/js/lesson-parts.js): once the lesson head has scrolled away, a slim bar under the site header
   holds the section menu, the "In this lesson" menu (heading being read) and the share of the section read.
   It spans the page above the text, so it never covers a line of the lesson. */
.sect-spot { display: block; width: 0; height: 0; }
.lesson-strip { position: fixed; z-index: 45; top: var(--header-h); left: 0; right: 0; background: rgba(255, 254, 250, .94); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); box-shadow: 0 8px 22px -18px rgba(16, 42, 60, .45); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
.lesson-strip.is-on { transform: none; opacity: 1; visibility: visible; transition: opacity .18s ease, transform .18s ease; }
.ls-in { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.ls-slot { flex: none; }
.lesson-strip .sect-menu > summary { box-shadow: none; }
.lesson-strip .act-panel { max-height: 70vh; overflow: auto; }
.ls-toc { flex: 0 1 auto; min-width: 0; }
.ls-toc > summary { display: flex; align-items: center; max-width: 100%; gap: .5em; background: var(--surface); }
.ls-toc .ls-cap { flex: none; font-size: .78em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ls-toc .ls-now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--navy); }
.ls-toc .ls-now:empty { display: none; }
.ls-toc .act-panel { width: min(420px, calc(100vw - 32px)); }
.ls-toc .act-panel a { font-weight: 500; line-height: 1.35; }
.ls-toc .act-panel a[aria-current="true"] { color: var(--accent); font-weight: 700; background: var(--paper); }
/* Hover / open: stays light (the dark outline-button hover hid the heading). */
html .ls-toc > summary.btn-outline:hover, html .ls-toc[open] > summary.btn-outline { background: var(--paper); border-color: var(--navy); color: var(--navy); }
.lesson-strip.ls-other .ls-toc { display: none; }
.ls-pct { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1 var(--sans); color: var(--navy); font-variant-numeric: tabular-nums; }
.ls-ring { --p: 0; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px); mask: radial-gradient(circle, transparent 6px, #000 6.5px); }
.ls-pct.is-done { color: #2e7d4f; }
.ls-pct.is-done .ls-ring { background: #2e7d4f; }
.ls-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: rgba(16, 42, 60, .06); }
.ls-line span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
/* While the bar shows, it carries the reading line, and the headings land below it. */
html.ls-on .read-progress { opacity: 0; }
html:has(.lesson-strip) { scroll-padding-top: calc(var(--header-h) + 72px) !important; }
@media (min-width: 901px) {
  /* Side "In this lesson" menu (when shown): starts below the bar. */
  html.ls-on .reading-layout:not(.toc-folded) .contents { top: calc(var(--header-h) + 76px); max-height: calc(100vh - var(--header-h) - 96px); }
  /* Folded menu: the bar has its own "In this lesson", so the folded pill stays in its place instead of following. */
  html:has(.lesson-strip) .toc-folded .contents { position: static; }
}
@media (max-width: 900px) {
  /* Phones: the bar replaces the folded "In this lesson" bar that followed under the header. */
  html.ls-on .contents { visibility: hidden; }
  .ls-in { min-height: 52px; gap: 8px; }
  .lesson-strip .sect-menu > summary::before { display: none; }
  .ls-toc .ls-cap { display: none; }
  .ls-toc .ls-now:empty { display: inline; }
  .ls-toc .ls-now:empty::before { content: "In this lesson"; }
  :lang(fr) .ls-toc .ls-now:empty::before { content: "Dans cette leçon"; }
  .ls-pct b { font-size: 13px; }
  .lesson-strip .act-panel { left: 0; right: auto; }
  .ls-toc .act-panel { position: fixed; top: calc(var(--header-h) + 56px); left: 16px; right: 16px; width: auto; }
}
/* Header hidden while scrolling down a lesson (html.hdr-hide, set by lesson-parts.js); back on scrolling up. */
html .site-header { transition: transform .25s ease, box-shadow .2s ease, border-color .2s ease; }
html.hdr-hide .site-header { transform: translateY(-100%); box-shadow: none; }
.lesson-strip { transition: opacity .18s ease, transform .18s ease, top .25s ease, visibility 0s linear .18s; }
.lesson-strip.is-on { transition: opacity .18s ease, transform .18s ease, top .25s ease; }
html.hdr-hide .lesson-strip { top: 0; }
html.hdr-hide .ls-toc .act-panel { top: calc(100% + 6px); }
@media (min-width: 901px) { html.hdr-hide.ls-on .reading-layout:not(.toc-folded) .contents { top: 76px; max-height: calc(100vh - 96px); } }
@media (prefers-reduced-motion: reduce) { .site-header, .lesson-strip { transition: none; } }
/* Time left, ticks on sections read, "Next" button at the end of a section. */
.ls-left { font: 500 13px/1 var(--sans); color: var(--muted); white-space: nowrap; }
.ls-left:empty { display: none; }
.ls-next { flex: none; white-space: nowrap; }
.ls-next[hidden] { display: none; }
.ls-next .ls-s { display: none; }
.ls-next.ls-mark { background: #2e7d4f; border-color: #2e7d4f; color: #fff; }
.sect-menu .act-panel a .ls-tick { margin-left: .5em; color: #2e7d4f; font-weight: 700; }
@media (max-width: 900px) {
  .ls-left { display: none; }
  .ls-next .ls-l { display: none; }
  .ls-next .ls-s { display: inline; }
  .ls-next { padding-inline: 14px; }
  .ls-in:has(.ls-next:not([hidden])) .ls-toc { display: none; }
}
/* Text size ("Aa" in the lesson bar). */
html[data-fs="s"] .lesson-body { font-size: 16px; }
html[data-fs="l"] .lesson-body { font-size: 21px; line-height: 1.8; }
html[data-fs="l"] .lesson-body table { font-size: 18px; }
.ls-fs { flex: none; }
.ls-fs > summary { padding-inline: 12px; font-family: var(--serif); font-weight: 700; }
html .ls-fs > summary::after { display: none; }
.ls-fs > summary small { font-size: .72em; margin-left: 1px; }
html .ls-fs > summary.btn-outline:hover, html .ls-fs[open] > summary.btn-outline { background: var(--paper); border-color: var(--navy); color: var(--navy); }
.ls-fs .act-panel { left: auto; right: 0; min-width: 170px; }
.ls-fs .act-panel button { padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: 600 .95rem/1.2 var(--sans); text-align: left; cursor: pointer; }
.ls-fs .act-panel button:hover, .ls-fs .act-panel button:focus-visible { background: var(--paper); }
.ls-fs .act-panel button[aria-pressed="true"] { color: var(--accent); }
.ls-fs .act-panel button[aria-pressed="true"]::before { content: "✓ "; }
/* Keyboard: a clear focus ring on everything in the bar. */
.lesson-strip summary:focus-visible, .lesson-strip a:focus-visible, .lesson-strip button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .ls-pct .ls-ring { display: none; }
  .ls-fs > summary { padding-inline: 10px; }
}
@media print { .lesson-strip { display: none !important; } }
/* Slides section head: title + "Download / Print" menu (PowerPoint, PDF, print). */
.sv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.sv-head h2 { margin: 0; }
.sv-dl .act-panel { left: auto; right: 0; }
.sv-dl .sv-dl-lock[hidden] { display: none; }
.sv-dl .sv-dl-lock { margin-right: .4em; }
.sv-dl-status { margin: 8px 0 0; font-weight: 600; color: var(--navy); }
.sv-dl-status[hidden] { display: none; }
/* Flash cards: room around the card buttons, before the exam tip and before the section cards. */
.flashcards .fc-nav { margin-top: 20px; margin-bottom: 32px; }
.flashcards .fc-tip { margin-top: 28px; }
.lesson-body.is-parted .part-nav { margin-top: 56px; }

/* Activities (.practice): more air, one line per sub-question (public/js/row-menu.js splits "(a) … (b) …"). */
.lesson-body .practice { padding: 18px 22px 16px; margin: 22px 0; }
.lesson-body .practice > p:first-child { margin: 0 0 12px; }
.lesson-body .practice > p:not(:first-child) { margin: 0 0 10px; }
.lesson-body .practice ol, .lesson-body .practice ul { margin: 6px 0 10px; }
.lesson-body .practice li + li { margin-top: 6px; }
.q-parts { display: grid; gap: 8px; margin: 10px 0 12px; }
.q-parts .qp-item { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); align-items: baseline; padding: 8px 12px; border-radius: 8px; background: var(--paper, #f8f7f2); }
.q-parts .qp-label { font-weight: 700; color: var(--navy); }
.q-parts .qp-text > p { margin: 0; }
.q-parts.q-roman { margin: 8px 0 0; gap: 4px; }
.q-parts.q-roman .qp-item { padding: 2px 0; background: none; }
.lesson-body .practice details { margin-top: 14px; }
.lesson-body .practice details[open] { padding: 12px 16px 6px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--paper, #f8f7f2); }
.lesson-body .practice details[open] > summary { margin-bottom: 10px; }
.lesson-body .practice details[open] .q-parts .qp-item { background: var(--surface, #fffefa); }
@media (max-width: 600px) { .lesson-body .practice { padding: 16px 14px 14px; } .q-parts .qp-item { padding: 8px 10px; } }
@media print { .q-parts .qp-item { background: none; padding: 2px 0; } }
/* Home and subject pages: the "Continue where you left off" notice lines up with the page (public/js/progress.js). */
.pg-notice.container { margin-inline: auto; }
/* Phone menu: "Tutoring" starts closed and opens/closes on tap (global.css forced it open). Prefixed html so it beats the Base CSS loaded after. */
@media (max-width: 900px) {
  html .site-header .nav-sub, html .site-header .nav-sub.nav-sub-narrow { display: none; width: auto; box-shadow: none; border-radius: 0; }
  html .site-header .nav-group.open .nav-sub { display: block; }
}
/* Lesson bar: no % read / time left in Slides, Quiz and What to remember (lesson-parts.js sets data-sect). */
.lesson-strip[data-sect="slides"] .ls-pct, .lesson-strip[data-sect="quiz"] .ls-pct, .lesson-strip[data-sect="flashcards"] .ls-pct,
.lesson-strip[data-sect="slides"] .ls-line, .lesson-strip[data-sect="quiz"] .ls-line, .lesson-strip[data-sect="flashcards"] .ls-line { display: none; }
.lesson-strip[data-sect="slides"] .ls-fs, .lesson-strip[data-sect="quiz"] .ls-fs, .lesson-strip[data-sect="flashcards"] .ls-fs { margin-left: auto; }
