/* ============================================================
   CHI SHAN — Our story (WP-18, the her-site wave stage 2; recomposed as one
   spread by the 2026-11-20 shine pass, seat `work`)
   The hung picture: design brief § 5.6. Loaded after the frame and the parts
   sheets by SiteLayout. Every colour, face and size is a token from chishan.css
   :root; no hex here. Classes are prefixed .story- (plan § 5).
   ============================================================ */

/* ---- The spread (band): the frame is the left page, on columns 1–6; the right page, on
   columns 7–12, holds her words from the top and Emily Huang at its foot, level with the
   frame's foot (at 1280 and wider); her triad runs under both on pipes, across the twelve
   columns ---- */
.story-hero { padding-block: var(--s-8) var(--section-y); }
.story-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
}
.story-frame { grid-column: 1 / span 6; grid-row: 1 / span 2; margin: 0; min-width: 0; }
.story-text { grid-column: 7 / span 6; grid-row: 1; min-width: 0; padding-left: var(--s-7); padding-top: var(--s-6); }
.story-second { grid-column: 7 / span 6; grid-row: 2; align-self: end; min-width: 0; padding-left: var(--s-7); margin-top: var(--s-6); }
.story-hero--no-frame .story-text,
.story-hero--no-frame .story-second { grid-column: 1 / span 8; padding-left: 0; }
.story-triad { grid-column: 1 / -1; grid-row: 3; }
/* A word and the em dash after it stay on one line (Story.astro keepDash) */
.story-keep { white-space: nowrap; }

/* The frame: a paper mat, 16 px, with a 1 px brass line on its inner edge and nothing
   on its outer edge; no shadow. The line is the 16th pixel of the mat, so the picture
   sits 16 px in. The picture keeps its own 2/3 ratio, so it is never cropped; at six
   columns it is drawn 596 px wide at 1440, under her file's 730 max. */
.story-mat { background: var(--paper); padding: 15px; }
.story-mat-line { border: 1px solid var(--brass); }
.story-picture { display: block; }

/* Under the frame: her caption at the left, the credit at the right. When the frame is
   too narrow for both on one line, the credit moves whole to a line of its own at the
   left (flex items wrap at their full width before any breaks inside them) */
.story-frame-cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  column-gap: var(--s-4); row-gap: var(--s-1);
  margin-top: var(--s-3);
  font-family: var(--label);
  font-size: var(--t-label);
  line-height: var(--lh-label);
  color: var(--ink-soft);
}
.story-frame-caption {
  min-width: 0;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.story-frame-credit { min-width: 0; text-wrap: pretty; }

/* The heading: her label and h1 take the column's full width (the section head's
   seven-column cap is for a head on the whole grid) */
.story-head { max-width: none; margin-bottom: var(--s-6); }

/* "Sissi" in Cormorant italic 40 px, her role in the label voice beside it */
.story-who {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: var(--s-5); row-gap: var(--s-1);
  margin-bottom: var(--s-5);
}
.story-name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  color: var(--ink);
}
.story-role {
  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);
}
.story-bio { max-width: var(--measure); }
.story-bio + .story-bio { margin-top: var(--s-4); }

/* ---- Emily Huang at the right page's foot: the feature card (its hairline above it), and
   under her words the programme she leads — its label and its name as the link ---- */
.story-progs { list-style: none; margin-top: var(--s-5); padding-left: calc(200px + var(--s-6)); }
.story-prog + .story-prog { margin-top: var(--s-4); }
.story-prog-name { margin-top: var(--s-1); font-size: var(--t-h4); line-height: var(--lh-h4); font-weight: var(--w-h4); }
.story-prog-link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--brass-deep);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-hover) var(--ease);
}
.story-prog-link:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: reduce) { .story-prog-link { transition: none; } }
/* Her Chinese line breaks at its punctuation or a space, never inside a word (栖山 split
   across two lines at 1440); a clause too long for its line still breaks, so nothing overflows */
.story-second .person-bio:lang(zh), .story-bio:lang(zh) { word-break: keep-all; overflow-wrap: anywhere; }

/* ---- Her triad on pipes, as on her printed card: one word to each third of the grid
   (four columns each), every word after the first preceded by a 1 px --line-strong rule ---- */
.story-triad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  margin-top: var(--s-9);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.story-triad-word {
  font-family: var(--display);
  font-size: var(--t-h3);
  line-height: var(--lh-h3);
  font-weight: var(--w-h3);
  letter-spacing: var(--track-label);
  color: var(--ink);
  white-space: nowrap;
}
.story-triad-word + .story-triad-word { border-left: 1px solid var(--line-strong); padding-left: var(--s-5); }
.story-triad:lang(zh) .story-triad-word { font-family: var(--cjk); }

/* ---- Below 1280: the frame and her words share the spread; Emily runs under it at full
   width (at 1080–1279 the right page left her card a 200 px column for her words) ---- */
@media (max-width: 1279px) {
  .story-frame { grid-row: 1; }
  .story-text { padding-left: var(--s-4); padding-top: 0; align-self: center; }
  .story-second {
    grid-column: 1 / -1; grid-row: 2; padding-left: 0; margin-top: var(--s-9);
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); align-items: start;
  }
  /* Emily on columns 1–8 and her programme on 9–12, each standing on its own hairline, so
     the programme does not drop under her portrait and leave a hole beside it */
  .story-emily { grid-column: 1 / span 8; }
  .story-emily.person-card--feature { grid-template-columns: 160px minmax(0, 1fr); }
  .story-progs { grid-column: 9 / span 4; margin-top: 0; padding-left: 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
  .story-name { font-size: 34px; }
  .story-triad { margin-top: var(--s-8); }
  .story-triad-word { font-size: var(--t-h4); }
}

/* ---- Phone: the framed picture first, then her words, Emily, and the triad as three rows ---- */
@media (max-width: 760px) {
  .story-hero { padding-top: var(--section-y); }
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-frame, .story-text, .story-second, .story-triad,
  .story-hero--no-frame .story-text, .story-hero--no-frame .story-second { grid-column: 1; grid-row: auto; }
  .story-text { padding-left: 0; padding-block: 0; margin-top: var(--s-7); }
  .story-second { display: block; margin-top: var(--s-8); }
  .story-emily.person-card--feature { grid-template-columns: minmax(0, 1fr); }
  .story-progs { margin-top: var(--s-5); padding-top: 0; border-top: 0; }
  .story-mat { padding: 9px; }
  .story-name { font-size: 34px; }
  /* The framed picture at 78% of the column, held to the left edge with everything else, so
     the label and the h1 start inside the first screen: at full width the frame filled it and
     the h1 began at y 778 of 844 (stage 3, s3-review-design). Its caption takes its width. */
  .story-frame { width: 78%; }
  .story-triad { grid-template-columns: minmax(0, 1fr); padding-top: 0; margin-top: var(--s-8); }
  .story-triad-word { display: flex; align-items: center; min-height: 52px; }
  .story-triad-word + .story-triad-word { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
}
