/* ============================================================
   page-schools.css — For schools (WP-13, the her-site wave stage 2).
   Design brief § 5.2 "the menu"; plan § 7.2 "WP-13".
   Linked by src/components/pages/Schools.astro after the frame's and the parts' sheets.
   Every class here starts .schools-; the parts are placed, never restyled.
   Every colour, face and size is a token from chishan.css :root; no hex here.
   ============================================================ */

/* ---------- 1 · Hero (paper) ---------- */
/* The first screen runs into the menu (the 2026-11-20 shine pass): the words start one
   step under the header, and the photo stands with its foot in the menu's band, beside the
   menu's label — depth by the band change, no shadow (brief § 2.5). The well is 4/5 (the
   brief's crop: 18–71% of her photo's width at Focus 38% 50%, which ends just short of the
   printed box at its right and keeps the cut-off word in its first 8% out, § 5.9). Where
   the words beside it are taller than that, it grows down with them, to 2/3 at most — a
   narrower cut of the same photo, never a wider one. */
.schools-hero { --hero-overlap: var(--s-9); padding-top: var(--s-8); padding-bottom: 0; }
.schools-hero--flat { --hero-overlap: 0px; padding-bottom: var(--s-8); }   /* no menu under it: nothing to stand in */
.schools-hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: stretch;
}
/* The words: her label at the top, level with the photo's top; the heading, her line and
   the button at the foot, one step above the band — so where the words are shorter than the
   photo (the Chinese page: its h1 is one line) the space falls between the label and the
   heading, not under the button. */
.schools-hero-text {
  grid-column: 1 / span 6; min-width: 0; padding-bottom: var(--s-8);
  display: flex; flex-direction: column;
}
.schools-hero-text > .schools-hero-head { display: contents; }
.schools-hero-text .sh-label { margin-bottom: auto; padding-bottom: var(--s-4); }
.schools-hero-media {
  grid-column: 8 / span 5; min-width: 0;
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: flex-end;
  margin-bottom: calc(-1 * var(--hero-overlap));
  position: relative; z-index: 1;   /* above the band it stands in */
}
.schools-hero-media > .photo { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; }
.schools-hero-media .photo-well { flex: 1 0 auto; aspect-ratio: 4 / 5; max-height: 150cqi; }
.schools-hero-head { max-width: none; margin-bottom: 0; }
.schools-hero-head .sh-lede { max-width: 28em; }
.schools-hero-act { margin-top: var(--s-7); }

@media (max-width: 1023px) and (min-width: 761px) {
  /* two halves, so the photo is as large as the words allow (at 768 it stood small at the right) */
  .schools-hero { --hero-overlap: var(--s-8); }
  .schools-hero-text { grid-column: 1 / span 6; padding-bottom: var(--s-7); }
  .schools-hero-media { grid-column: 7 / span 6; }
}
@media (max-width: 760px) {
  .schools-hero { padding-top: 0; padding-bottom: var(--section-y); }
  .schools-hero-grid { display: flex; flex-direction: column-reverse; align-items: stretch; }
  .schools-hero-text { padding-bottom: 0; display: block; }
  .schools-hero-text .sh-label { margin-bottom: var(--s-4); padding-bottom: 0; }
  /* the hero photo first, 4/3, edge to edge (brief § 4.1, § 5.2) */
  .schools-hero-media { display: block; margin: 0 calc(-1 * var(--gutter)) var(--s-6); container-type: normal; }
  .schools-hero-media > .photo { display: block; }
  .schools-hero-media .photo-well { aspect-ratio: var(--ratio-phone, 4 / 3); max-height: none; }
  .schools-hero-act { margin-top: var(--s-6); }
  .schools-hero-act .btn { width: 100%; }
}

/* ---------- 2 · The menu (band) — the device ---------- */
/* the menu sits directly under the hero (brief § 5.2): a shorter top than a section's.
   Since the shine pass the hero's photo stands --hero-overlap into this band at the right,
   and the menu's label stands beside its foot at the left: the label ends where the photo
   does, and the ruled table starts one step under both. */
.schools-menu { padding-top: var(--s-8); padding-bottom: var(--s-9); }
.schools-hero:not(.schools-hero--flat) + .schools-menu { padding-top: calc(var(--s-9) - var(--s-5)); }
.schools-menu-label { margin-bottom: var(--s-5); }
@media (max-width: 1023px) and (min-width: 761px) {
  .schools-hero:not(.schools-hero--flat) + .schools-menu { padding-top: calc(var(--s-8) - var(--s-5)); }
}
@media (max-width: 760px) {
  .schools-menu,
  .schools-hero:not(.schools-hero--flat) + .schools-menu { padding-top: var(--s-7); padding-bottom: var(--s-8); }
}
.schools-menu-table { border-top: 1px solid var(--ink); }

.schools-menu-head,
.schools-menu-row {
  display: grid;
  /* the brief's 5fr 3fr 2fr 2fr, with the price columns widened just enough that her two
     price labels stand on one line at 1440 (they broke after "AT YOUR" and "AT OUR TEA") */
  grid-template-columns: minmax(0, 4fr) minmax(0, 2.6fr) minmax(0, 2.7fr) minmax(0, 2.7fr);
  column-gap: var(--grid-gap);
  align-items: baseline;
}
.schools-menu-table--p1 :is(.schools-menu-head, .schools-menu-row) { grid-template-columns: minmax(0, 4fr) minmax(0, 2.6fr) minmax(0, 5.4fr); }
.schools-menu-table--p0 :is(.schools-menu-head, .schools-menu-row) { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }

.schools-menu-head { padding: var(--s-4) 0 var(--s-3); border-bottom: 1px solid var(--line); }
.schools-menu-head-cell {
  font-family: var(--label);
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: var(--track-label);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--ink-soft);
  word-break: keep-all;   /* her Chinese label (茶室体验) never breaks inside a word */
}

.schools-menu-rows { list-style: none; }
.schools-menu-row {
  position: relative;
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--line);
}
.schools-menu-name {
  font-size: var(--t-h3);
  line-height: var(--lh-h3);
  font-weight: 500;
  color: var(--ink);
}
/* On a Chinese page the name is the row's only name: set a step larger than a Chinese h3
   so it holds its own beside the 58 px figures (it read small and light at 26 px) */
.schools-menu-name:lang(zh) { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.35; }
/* the Chinese name stands under the English, as on a printed menu */
.schools-menu-name .zh-tag { display: block; margin-top: var(--s-1); font-size: .7em; line-height: 1.45; }
.schools-menu-link {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-decoration-color var(--dur-hover) var(--ease);
}
/* the whole row is the link's target; its ring is drawn on the row */
.schools-menu-link::after { content: ""; position: absolute; inset: 0; }
.schools-menu-link:focus-visible { outline: none; }
.schools-menu-link:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 3px; }
.schools-menu-row:hover .schools-menu-link,
.schools-menu-link:focus-visible { text-decoration-color: var(--brass-deep); }
@media (prefers-reduced-motion: reduce) { .schools-menu-link { transition: none; } }

.schools-menu-facts { font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-soft); }
/* a fact never breaks inside itself ("60–" / "120 minutes" at 1024); the line breaks at her dot */
.schools-menu-facts > span:not(.schools-menu-dot) { white-space: nowrap; }
.schools-menu-soon {
  grid-column: 3 / -1;
  font-family: var(--label); font-size: var(--t-label); line-height: var(--lh-label);
  letter-spacing: var(--track-label); font-weight: 500; text-transform: uppercase; color: var(--ink-soft);
}
.schools-menu-row:has(.schools-menu-soon) .schools-menu-price { display: none; }

.schools-menu-price { display: flex; flex-direction: column; gap: var(--s-2); }
/* the cell's own label: read aloud at desktop (the column head shows it), shown on a phone */
.schools-menu-plabel {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.schools-menu-figure { display: flex; align-items: baseline; gap: var(--s-2); color: var(--ink); }
.schools-menu-cur {
  font-family: var(--label);
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: var(--track-label);
  font-weight: 500;
  color: var(--ink-soft);
}
.schools-menu-amt {
  font-family: var(--display);
  font-size: var(--t-price);
  line-height: var(--lh-price);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  letter-spacing: 0;
}
.schools-menu-unit {
  margin-top: var(--s-4);
  font-size: var(--t-small); line-height: var(--lh-small);
  color: var(--ink-soft);
  text-align: right;
}

@media (max-width: 760px) {
  .schools-menu-head { display: none; }
  .schools-menu-row,
  .schools-menu-table--p1 .schools-menu-row,
  .schools-menu-table--p0 .schools-menu-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0;   /* the cells' own padding makes the gap, so the rule over the two prices runs unbroken */
    row-gap: 0;
    padding: var(--s-5) 0 var(--s-6);
  }
  .schools-menu-name, .schools-menu-facts, .schools-menu-soon { grid-column: 1 / -1; }
  .schools-menu-name { font-size: 26px; line-height: 1.2; }
  /* the row is the hit area (the link's ::after); the link's own box is 44 px too, for a one-line Chinese name */
  .schools-menu-link { display: inline-block; min-height: 44px; }
  .schools-menu-facts { margin-top: var(--s-2); }
  .schools-menu-price { margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid var(--line); gap: var(--s-1); align-self: stretch; }
  .schools-menu-price { padding-right: var(--s-4); }
  .schools-menu-price + .schools-menu-price { border-left: 1px solid var(--line); padding-left: var(--s-4); padding-right: 0; }
  .schools-menu-plabel {
    position: static; width: auto; height: auto; margin: 0; overflow: visible;
    clip: auto; clip-path: none; white-space: normal;
    min-height: calc(2em * var(--lh-label));
    flex: 1 0 auto;   /* the label takes the slack, so both figures stand on one line even when one label wraps to three (320) */
    word-break: keep-all;   /* '茶室 / 体验' broke mid-word at 390 (check finding 17, here in the menu) */
    font-family: var(--label); font-size: var(--t-label); line-height: var(--lh-label);
    letter-spacing: var(--track-label); font-weight: 500; text-transform: uppercase; color: var(--ink-soft);
  }
  .schools-menu-unit { text-align: left; }
}

/* ---------- 3, 4 · A programme: a spread, then one ruled foot ---------- */
/* The spread stands on the page's own columns, 1–5 and 7–12. With makes alone, the words
   are at the left and what students make at the right. With the programme's own picture,
   the picture is at the left and the words at the right, the makes under them with their
   feet near the picture's foot. (Ours: brief § 5.2 keeps both programmes on one side; here
   they are told apart by ground and by side, so the long page turns once.) */
.schools-prog-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
}
.schools-prog-words { grid-column: 1 / span 5; min-width: 0; }
.schools-prog-makes { grid-column: 7 / span 6; min-width: 0; padding-top: var(--s-2); }
.schools-prog-grid--text .schools-prog-words,
.schools-prog-grid--text .schools-prog-makes { grid-column: 1 / span 7; }
.schools-prog-head { max-width: none; margin-bottom: 0; }

.schools-prog-grid--photo { grid-template-rows: auto 1fr; }
.schools-prog-grid--photo .schools-prog-picture { grid-column: 1 / span 5; grid-row: 1 / span 2; min-width: 0; }
.schools-prog-grid--photo .schools-prog-words { grid-column: 7 / span 6; grid-row: 1; }
.schools-prog-grid--photo .schools-prog-makes { grid-column: 7 / span 6; grid-row: 2; align-self: end; padding-top: var(--s-7); }

.schools-steps { margin-top: var(--s-7); }
.schools-steps-title { margin-bottom: var(--s-3); }
.schools-steps-list { list-style: none; max-width: var(--measure); }
.schools-steps-list li { padding: var(--s-2) 0; color: var(--ink-soft); }
.schools-steps-list li + li { border-top: 1px solid var(--line); }
.schools-steps-list strong { color: var(--ink); font-weight: 500; }

.schools-image-note {
  margin-top: var(--s-4);
  max-width: var(--measure);
  font-size: var(--t-label); line-height: var(--lh-small);
  color: var(--ink-soft);
}

/* The foot: one ink rule, as over the menu table. Under the spread's first column, the
   facts; under its right-hand columns, this programme's line of the menu again in small —
   the two prices on 7–9 and 10–12 (the make cards' own columns, PriceGrid "short") — and
   under them the one button on 7–9 and its two links on 10–12. */
.schools-prog-foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--ink);
}
.schools-prog-facts { grid-column: 1 / span 5; grid-row: 1 / span 2; min-width: 0; }
.schools-prog-prices { grid-column: 7 / span 6; grid-row: 1; min-width: 0; }
.schools-prog-act {
  grid-column: 7 / span 6; grid-row: 2; min-width: 0;
  margin-top: var(--s-6);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--grid-gap);
  align-items: start;
}
.schools-prog-act .btn { width: 100%; }
.schools-prog-priceline { font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-soft); }
.schools-prog-links { display: flex; flex-direction: column; align-items: flex-start; }
.schools-doc { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 44px; }
.schools-doc-name { display: inline-flex; align-items: center; }
.schools-doc-meta {
  font-size: var(--t-label); line-height: var(--lh-label);
  font-weight: 400; color: var(--ink-soft);
}
/* the meta line sits under the name: the underline is the name's alone */
.schools-doc { text-decoration: none; }
.schools-doc .schools-doc-name {
  text-decoration: underline; text-decoration-color: var(--brass-deep);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.schools-doc:hover .schools-doc-name { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }

.schools-extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  margin-top: var(--s-8);
  align-items: start;
}
.schools-extras--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schools-extras--n1 { grid-template-columns: minmax(0, 1fr); max-width: 628px; }
.schools-extra { min-width: 0; }
.schools-note { padding-top: var(--s-5); border-top: 1px solid var(--line); }
.schools-note-title { margin-bottom: var(--s-3); }
.schools-note-text { font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink); max-width: var(--measure); }

@media (max-width: 1079px) and (min-width: 961px) {
  .schools-prog-words { grid-column: 1 / span 6; }
  .schools-prog-grid--photo .schools-prog-words { grid-column: 7 / span 6; }
}
@media (max-width: 1079px) {
  /* The foot in two rows: the facts beside the prices, then the button and its links in a line */
  .schools-prog-facts { grid-column: 1 / span 6; grid-row: 1; }
  .schools-prog-prices { grid-column: 7 / span 6; grid-row: 1; }
  .schools-prog-act {
    grid-column: 1 / -1; grid-row: 2; margin-top: var(--s-6);
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6);
  }
  .schools-prog-act .btn { width: auto; }
  .schools-prog-links { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 var(--s-6); }
  /* the practitioner across the page and the notes side by side under her: in three
     columns her card was a 150 px column of words at 1024, and at 768 her name broke
     inside a word ("Huan / g") */
  .schools-extras, .schools-extras--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); }
  .schools-extra--person { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  /* Below 960 a spread reads in one column, in its own order: the heading and what
     students explore, the picture, what they make, then the foot. (At 768 two columns
     squeezed each make to 155 px and its name to three lines.) */
  .schools-prog-grid,
  .schools-prog-grid--photo { display: flex; flex-direction: column; align-items: stretch; }
  .schools-prog-picture { margin-top: var(--s-7); }
  .schools-prog-makes,
  .schools-prog-grid--photo .schools-prog-makes { margin-top: var(--s-7); padding-top: 0; align-self: stretch; }
  .schools-prog-picture + .schools-prog-makes,
  .schools-prog-grid--photo .schools-prog-picture + .schools-prog-makes { margin-top: var(--s-6); }
  .schools-prog-words, .schools-prog-makes { max-width: 640px; }
  .schools-prog-picture--portrait { max-width: 410px; }
  .schools-prog-picture--landscape { max-width: 640px; }
  .schools-prog-foot { margin-top: var(--s-7); }
}
@media (max-width: 760px) {
  .schools-prog-words, .schools-prog-makes, .schools-prog-picture--portrait, .schools-prog-picture--landscape { max-width: none; }
  /* the foot's ink rule is the first fact's top line (the facts are rows here) */
  .schools-prog-foot { display: block; padding-top: 0; }
  .schools-prog-facts .fact:first-child { border-top: 0; }
  .schools-prog-prices { margin-top: var(--s-5); }
  .schools-prog-act { margin-top: var(--s-6); flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .schools-prog-act .btn { width: 100%; }
  .schools-prog-links { flex-direction: column; align-items: flex-start; gap: 0; }
  .schools-extras, .schools-extras--n2, .schools-extras--n1 { display: block; margin-top: var(--s-7); max-width: none; }
  .schools-extra + .schools-extra { margin-top: var(--s-6); }
}

/* ---------- 5 · Stories ---------- */
.schools-story-list { display: grid; row-gap: var(--s-9); }
.schools-story { scroll-margin-top: var(--scroll-pad); }
/* a 4/5 lead sits on five columns (the hero's width), so her 1800 px file is never drawn
   wider than it allows (brief § 4.1, § 5.9); the text takes columns 7–11 */
.schools-story--tall .story-feature > .story-media { grid-column: 1 / span 5; }
.schools-story--tall .story-feature > .story-body { grid-column: 7 / span 5; }
.schools-story--tall.schools-story--flip .story-feature > .story-media { grid-column: 8 / span 5; }
.schools-story--tall.schools-story--flip .story-feature > .story-body { grid-column: 1 / span 5; }
.schools-story--wide.schools-story--flip .story-feature > .story-media { grid-column: 6 / span 7; }
.schools-story--wide.schools-story--flip .story-feature > .story-body { grid-column: 1 / span 4; }

@media (max-width: 760px) {
  .schools-story-list { row-gap: var(--s-8); }
}

/* ---------- 6 · Questions ---------- */
.schools-faq-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
}
.schools-faq-head { grid-column: 1 / span 4; max-width: none; margin-bottom: 0; }
.schools-faq-list { grid-column: 6 / span 7; }
@media (max-width: 760px) {
  .schools-faq-grid { display: block; }
  .schools-faq-head { margin-bottom: var(--s-6); }
}

/* Her Chinese make names break only at her spaces, never inside a word
   ("新中式茶 / 饮" at 1024); a name too long for its column may still break */
.schools-makes .make-name:lang(zh) { word-break: keep-all; overflow-wrap: anywhere; }

/* ============================================================
   PAPER & SEAL, FINISHED — the direction study (2026-11-20)
   The menu set as the original's tea list was set: a double ink rule on top as a printed
   menu has, the names in Cormorant with the Chinese under them in green, the figures in the
   display face; and her seal, cut from her own file, stamped once at its foot.
   ============================================================ */
.schools-menu-table { border-top: 3px double var(--ink); }
.schools-menu-head-cell { color: var(--pine); letter-spacing: .14em; }
.schools-menu-name { font-weight: 400; font-size: clamp(28px, 2.5vw, 36px); }
.schools-menu-name .zh-tag { color: var(--moss); font-size: .62em; letter-spacing: .12em; margin-top: var(--s-2); }
.schools-menu-facts { font-style: italic; color: var(--ink-soft); }
.schools-menu-facts:lang(zh) { font-style: normal; }
.schools-menu-amt { font-weight: 400; }
.schools-menu-cur { color: var(--pine); }
.schools-menu-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--s-4); margin-top: var(--s-4); }
.schools-menu-foot .schools-menu-unit { margin-top: 0; font-style: italic; }
.schools-menu-foot .schools-menu-unit:lang(zh) { font-style: normal; }
.schools-menu-seal { width: 44px; height: auto; flex: none; }
.schools-hero .sh-title { font-weight: 400; }
.schools-prog-head .sh-title em, .schools-stories-head .sh-title em { font-style: italic; }
@media (max-width: 760px) {
  .schools-menu-name { font-size: 28px; }
  .schools-menu-seal { width: 40px; }
}

/* ============================================================
   THE MELD (dir/meld, 2026-11-21): the menu's characters in practice squares
   ============================================================ */
/* Under the English name its characters stand in squares, as on a printed menu; on the
   Chinese page the squares are the name and the English is its gloss */
.schools-menu-zg {
  display: block; margin-top: var(--s-3);
  /* the room is the name column itself (4fr of the row's 12fr, less the run's rules), so a
     long name's squares shrink with the column and never run into the facts beside it */
  --zg-room: calc((min(100vw, var(--maxw) + 2 * var(--gutter)) - 2 * var(--gutter) - 3 * var(--grid-gap)) / 3 - (var(--n, 1) + 1) * 1px);
  --zg: max(22px, min(var(--zg-max), calc(var(--zg-room) / var(--n, 1))));
}
.schools-menu-name:lang(zh) .schools-menu-zg { margin-top: 0; --zg-max: 44px; }
.schools-menu-gloss { display: block; margin-top: var(--s-3); }
/* On a phone the menu keeps its plain setting — the Chinese name on the line, no squares
   (Wilson 2026-11-21: "yeah after except for schools schools menu phone"). */
.schools-menu-tag, .schools-menu-plain { display: none; }
@media (max-width: 760px) {
  .schools-menu-name .schools-menu-zg, .schools-menu-name .schools-menu-gloss { display: none; }
  .schools-menu-tag, .schools-menu-plain { display: inline; }
}
