/* ═══════════════════════════════════════════════════════════════════════════
   design/app.css — interior surfaces: dashboard, course hub, lesson reader

   The landing is allowed a display-scale headline. A dashboard is not: at
   1440px the shared `--t-display` ramp put "Good evening, Alex." at ~70px and
   wrapped it across two lines, which is a hero, not a greeting. This file
   restores a working hierarchy for the 41 interior pages without touching the
   landing.

   Also fixes a real defect in the lesson reader: the sticky top bar is 58px
   tall and the reader scrolls its block flush to y=0, so the first line of
   every slide — usually the section eyebrow — lands underneath the bar.

   Load after design/tokens.css and design/primitives.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ interior headline scale ═══════════════════════════════════════════════ */
/* NO SIZE OVERRIDES HERE. An earlier pass re-ramped interior h1/h2 down to
   2.35rem/1.65rem "to restore a working hierarchy", which shrank every h2 on
   the site from 48px to 26px and every h1 from 86px to 70px. The legacy sheets
   already set those sizes per page; the re-skin only owns face, weight,
   tracking and colour. */

/* the landing's italic serif dek was charming in EB Garamond; in a sans it reads
   as a default browser <em>. Interior pages keep their copy, lose the slant. */
body.jr:not(.jr-landing) .jr-dek,
body.jr:not(.jr-landing) .jr-lead,
body.jr:not(.jr-landing) .ib-dek,
body.jr:not(.jr-landing) .ib-hero p,
body.jr:not(.jr-landing) .lead{
  font-style:normal;
}

/* ═══ lesson reader: clear the sticky bar ═══════════════════════════════════ */
/* 58px bar + 18px breathing room. Applies to anchor scrolls and to the reader's
   own scroll-to-block on every Next/Prev, which is what was clipping the
   eyebrow under the bar. */
html{scroll-padding-top:76px}
.ib-block,.ib-now,[class*="ib-sec"]{scroll-margin-top:76px}

/* the reader's own scroll target: give the block a little air under the bar
   instead of butting against it */
body.ib-lesson .ib-lesson-shell{padding-top:0}
body.ib-lesson .ib-block.ib-now{margin-top:calc(var(--s5) + 4px)}

/* ═══ interior page blocks ══════════════════════════════════════════════════ */
/* cards on interior pages: same surface, less padding than the landing's */
body.jr:not(.jr-landing) .card,
body.jr:not(.jr-landing) [class*="-card"]{
  border-radius:var(--r-md);
}

/* tables inside content pages: ruled, not boxed */
body.jr:not(.jr-landing) table{
  font-variant-numeric:tabular-nums;
  border-top:1px solid var(--line-2);
}
body.jr:not(.jr-landing) th{
  font-size:var(--t-label);font-weight:var(--w-bold);
  letter-spacing:var(--tr-label);text-transform:uppercase;
  color:var(--ink-3);
}
body.jr:not(.jr-landing) th,
body.jr:not(.jr-landing) td{
  padding:.6em .7em;
  border-bottom:1px solid var(--line);
}

/* ═══ course hub / curriculum lists ═════════════════════════════════════════ */
/* .jr-head h2 keeps whatever size journal.css gave it — see the note above. */

/* ═══ dark-mode legibility for legacy surfaces ══════════════════════════════ */
/* several legacy sheets paint a hardcoded #fff panel; in the new dark canvas
   that produces a white card with light text. These catch the most common
   offenders without touching the 42 pages individually. */
body.dark .ib-cats button,
body.dark .ib-so__cat,
body.dark .ib-xc{
  color:var(--ink);
  border-color:var(--line);
}

/* ═══ dashboard: the editorial italic habit does not survive the sans ══════ */
/* journal.css sets several home widgets in italic serif to imitate a printed
   caption. In Manrope the same slant reads as a browser default <em>, and the
   "weakest area" figure renders at weight 400 which makes the page's focal
   number look like body copy. Both corrected here. */
body.jr-home #hmSub,
body.jr-home #hmStreakLab,
body.jr-home .jr-dek,
body.jr-home .hm-sec .jr-k{font-style:normal}
body.jr-home b{font-weight:600;font-style:normal}
body.jr-home .hm-sec b{line-height:1.08;letter-spacing:-.021em}

/* ═══ dashboard: the ruled data band ═══════════════════════════════════════
   Three cells share one row. The first and third carry NUMBERS at the display
   size; the middle one carries a course NAME, and inheriting the same 42px
   wrapped "Vitalité Textbook" onto two lines — which made a course the student
   may not even have opened the loudest thing under the greeting. A name is not
   a statistic, so it gets a headline size and the numbers keep theirs. */
body.jr-home .hm-strip .sp-weak > b{
  font-size:clamp(1.15rem,1.5vw,1.45rem)!important;
  line-height:1.22!important;
  letter-spacing:-.012em!important;
}

/* the accents inside the same band: "/188" and "day in a row" were italic
   serif captions next to sans numerals. In one typeface the slant is noise. */
body.jr-home .hm-strip .sp-card > b i,
body.jr-home .hm-strip .sp-tiles span{font-style:normal}
body.jr-home .hm-strip .sp-card > b i{font-size:.6em;letter-spacing:.01em}

/* ═══ course hub: the plate strip ══════════════════════════════════════════
   Four figures, one per topic area, are the only imagery on the hub — that
   part was right. What was wrong is that the section carried an inline
   max-width:1180px, so its left edge sat 68px outside the hero's and its right
   edge ran past the content column, under no heading, hard against the header.
   It read as a broken carousel rather than a decision.

   Now it is a labelled band on the hero's own grid: same 68rem box, same
   horizontal padding (`clamp(1.4rem,4vw,2.6rem)`, copied from .ib-hub so the
   two stay locked together), square corners to match the rest of the system,
   and a line of text that says what the reader is looking at. */
.cp-strip{
  max-width:68rem;
  margin:0 auto;
  /* #pageTop sits immediately above this section carrying margin-top:-52px to
     offset a legacy anchor. That negative margin drags the strip up under the
     sticky header, so the strip adds it back — otherwise the label renders at
     the header's bottom edge, half-covered. */
  padding:calc(52px + 1.75rem) clamp(1.4rem,4vw,2.6rem) 0;
}
/* the label that gives the band a reason to exist; shared by both strips */
.cp-k{
  margin:0 0 .9rem;
  font-family:var(--font-sans);
  font-size:.6875rem;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--accent);
}
.cp-strip .cp-plates{margin:0}

/* ── the plates themselves: shared by the course hub and the Condition hub ──
   These are DIAGRAMS, not photographs, and the source files run 1.0 to 2.0 in
   aspect. `object-fit:cover` in a 4:3 box therefore amputated them: the MyPlate
   table lost half its columns, the free-body diagram lost the vector its labels
   name, and the ankle-ligament drawing lost its top row. A figure you cannot
   read is not a figure, so the well becomes `contain` — the uneven letterboxing
   is what a real plate sheet looks like.

   White in BOTH themes, on purpose. Several of these files are transparent PNGs
   drawn in black strokes; mount one on the dark surface and the diagram simply
   disappears, leaving a red triangle with no labels. These are printed figures,
   so the well is the paper. */
.cp-strip .cp-fig img,
#condition-plates .cp-fig img{
  object-fit:contain;
  background:#fff;
  padding:.4rem;
  /* the site deleted its rounded corners in this redesign; these four
     thumbnails were the last 6px radius left above the fold */
  border-radius:0;
}
/* One plate is a portrait photograph (825×1100) and `contain` left it as a
   narrow strip between two white bars. Cropping a PHOTOGRAPH is fine — it was
   cropping a DIAGRAM that lost content — so the fit is declared per figure
   rather than guessed for all of them. */
.cp-strip .cp-fig img[data-fit="cover"],
#condition-plates .cp-fig img[data-fit="cover"]{object-fit:cover;padding:0}
.cp-strip .cp-cap,
#condition-plates .cp-cap{margin-top:.55rem;font-size:.78rem;line-height:1.42}.cp-strip .cp-cap b,
#condition-plates .cp-cap b{font-size:.82rem;font-weight:700;letter-spacing:0}
.cp-strip .cp-fig .topic-img-src,
#condition-plates .cp-fig .topic-img-src{font-size:.625rem;opacity:.75}

/* On a phone the 2×2 grid pushed "IB SEHS" below the fold — four figures and
   then, if you scrolled, the name of the course. A single snap-scrolling row
   keeps the imagery, shows a sliver of the next plate so the row reads as
   scrollable, and leaves the title in the first screen where it belongs. */
@media (max-width:640px){
  .cp-strip .cp-plates,
  #condition-plates .cp-plates{
    display:grid;
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:66%;
    gap:.9rem;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    padding-bottom:.4rem;
  }
  .cp-strip .cp-fig,
  #condition-plates .cp-fig{scroll-snap-align:start}
}

/* Chinese sets labels at .06em, not .14em — 字距 that loose breaks word gestalt */
body.lang-zh .cp-k{letter-spacing:.06em}

/* ── the header wordmark box was 20px wide while its label was 53px ────────
   Pages that ship `.sb-mark` (icon + "Vitalité") put it in `.lin-topleft` as a
   flex row. The mark's box was pinned to the icon's 20px, so the label spilled
   out of it and the language toggle, laid out next in the same row, printed on
   top of the word. Size the mark to its content. */
body.jr .lin-topleft .sb-mark{
  width:auto;flex:0 0 auto;
  background:none;border:0;border-radius:0;box-shadow:none;padding:0;
}
body.jr .lin-topleft .sb-word{white-space:nowrap}
