/* ═══════════════════════════════════════════════════════════════════════════
   learn-home.css — the ONE course-home shell.

   All three courses (Vitalité Textbook, IB SEHS, G10 Biology) were three
   different products: a long editorial cover, a tile hub and a two-hero page.
   This file supplies the only part of a course home that has to be identical
   everywhere — the tab strip that turns one 12 000 px document into three
   top-level views:

       CH A P T E R S      the table of contents + how much of it you have read
       P R A C T I C E     quiz, flashcards, papers, the diagnostic
       R E S O U R C E S   videos, references, the study pack

   Everything above the strip (the hero) and everything inside a panel keeps
   each course's own content and its own renderer. Only the strip and the
   show/hide behaviour are shared, because those are what make the three pages
   flow the same way.

   The look is the journal system's, not a new one: hairline rules, uppercase
   micro-caps at .18em, ink underline on the open view. It sits under the
   hero's own 1px ink rule, so the strip reads as the second line of the
   masthead rather than as a control bolted on top of it.

   Loaded by: guide.html, ib-sehs-learn.html, g10-bio.html.
   ═══════════════════════════════════════════════════════════════════════════ */

.lh-tabs {
  /* the hero already closes with a 1px ink rule; the strip opens a second one
     so the two rules bracket the tabs like a masthead band */
  border-bottom: 1px solid var(--jr-rule, var(--border, rgba(0, 0, 0, .16)));
  margin: 0;
  padding: 0;
}

.lh-tabs-inner {
  display: flex;
  align-items: baseline;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  flex-wrap: wrap;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

.lh-tab {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  margin: 0 0 -1px;
  padding: .95rem 0 .85rem;
  font: 600 .72rem/1.3 var(--jr-text, inherit);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--jr-ink2, var(--text2, #5b6b7a));
  transition: color .18s ease, border-color .18s ease;
  /* 44px is the smallest tap target that does not feel broken on a phone */
  min-height: 44px;
}

.lh-tab:hover { color: var(--jr-ink, var(--text, #10202c)); }

.lh-tab[aria-selected="true"] {
  color: var(--jr-ink, var(--text, #10202c));
  border-bottom-color: var(--jr-ink, var(--text, #10202c));
}

.lh-tab:focus-visible {
  outline: 2px solid var(--jr-gold-hi, var(--accent, #b18a3c));
  outline-offset: 3px;
}

/* the right-hand note ("14 chapters · 3 of them started") */
.lh-tabs-meta {
  margin-left: auto;
  padding: .95rem 0;
  font: italic 400 .82rem/1.3 var(--jr-text, inherit);
  color: var(--jr-ink2, var(--text2, #5b6b7a));
}

/* Panels are sections in three different documents, so the only contract is
   the attribute. `hidden` is what the script toggles; this rule makes it
   authoritative even when a section's own rules set display. */
[data-lh-panel][hidden] { display: none !important; }

/* ── two views of one document ─────────────────────────────────────────────
   The textbook has done this from the start (body.vt-cover / body.vt-course):
   the cover is the course home, and the course layer only appears once a
   lesson, a section or the progress tree is asked for. G10 shipped both at
   once, which is why it had a button bar, a hub hero and a hub tab strip all
   stacked above the first lesson. Same split, same selectors, second course. */
body.lh-cover #chCourseHead,
body.lh-cover #chHub,
body.lh-cover #chPageBody { display: none !important; }

body.lh-course #lhHome { display: none !important; }

/* ── the cover's own left edge ─────────────────────────────────────────────
   The hero is left-aligned on the container's 20px padding; the table of
   contents under it was `max-width:560px; margin:0 auto`, which inset it 110px
   further right on a 1440 screen. Two left edges in one page is the reason the
   cover reads as blocks stacked rather than as one design. Every course home
   now shares the hero's edge, and only the measure is capped. */
body.lh-home #hub .toc-intro,
body.lh-home .lh-panelwrap .toc-intro,
body.lh-home .toc-intro {
  max-width: 62ch;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

/* the track filter is a row of chips under that heading, not a centred control */
body.lh-home .toc-intro .kh-tracks,
body.lh-home .kh-tracks {
  margin-left: 0;
  margin-right: 0;
  justify-content: flex-start;
}

/* ── the chapter grid, shared geometry ─────────────────────────────────────
   .ch-grid / .ch-card already exist (gold-blue-theme.css) and journal.css
   re-skins them. The only thing the three pages disagree about is how many
   columns fit, so the count is stated here once: two of them, and one on a
   phone — the same rule the textbook has always used. */
.lh-grid { max-width: 920px; }

/* Two columns, everywhere.

   `.ch-grid` is `auto-fill, minmax(280px, 1fr)` — on the textbook's 780px
   column that lands on two, but the SEHS grid was being laid out three-up
   (29 cards squeezed to 260px, titles wrapping to three lines, "Read →"
   jammed against the text). A table of contents is a fixed rhythm, not a
   responsive one: two columns, one on a phone. */
body.lh-home .ch-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  body.lh-home .ch-grid { grid-template-columns: minmax(0, 1fr); }
}

/* the code takes the number slot on SEHS (A.1.1, B.2.3), so it needs room and
   must not be mistaken for a two-digit chapter number */
body.lh-home .ch-num {
  min-width: 3.4rem;
  letter-spacing: -.01em;
}

/* The SEHS hub frame carries its own 68rem centred well and 4vw of padding,
   which is right on the reader page and wrong inside the cover: it inset the
   29 topic cards ~40px from the heading that introduces them. */
body.lh-home .ib-hub {
  max-width: none;
  margin: 0;
  padding: 0;
}
body.lh-home .ib-pane-min-height { min-height: 0 !important; }

/* The plate strip was built on the old hub's 68rem box, 136px wider than the
   820px text column every other block on the cover uses — it hung 90px out to
   the left of the labels above it. Same column, same 20px gutter. */
body.lh-home .cp-strip {
  max-width: 820px;
  padding: 2.5rem 20px 0;
}

/* ── hero actions: one row, same order, every course ──────────────────────
   Start/Continue is always first and always filled; the two study tools that
   follow are always outlined. Class names come from journal.css's button
   layer, so they inherit the ruled/uppercase treatment for free. */
.lh-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 1.2rem;
  align-items: center;
  margin-top: 2rem;
}

/* The mastery dashboard's empty state is ONE card, but it sat in a three-up
   auto-fill grid, so "Start with one short quiz" was set in a 249px column and
   broke every four words. It spans the row until there is data to fill it. */
body.lh-home .mastery-grid .mastery-empty {
  grid-column: 1 / -1;
  max-width: 62ch;
}

/* ── a panel's own top spacing ────────────────────────────────────────────
   Each host section already carries its own vertical padding; when a section
   becomes a panel the first one no longer needs to clear the hero's rule. */
[data-lh-panel] { scroll-margin-top: 90px; }

@media (max-width: 700px) {
  .lh-tabs-inner { gap: 1.1rem; }
  .lh-tab { font-size: .68rem; letter-spacing: .14em; }
  .lh-tabs-meta { margin-left: 0; width: 100%; padding-top: 0; }
}
