/* ==========================================================================
   Krishen Khanna — /biography/
   Builds on main.css tokens only; no new colours.
   ========================================================================== */

/* ------------------------------------------------------------ hero: portrait + quote */
.bio-hero {
  background: var(--white);
  color: var(--ink);
  padding-block: 60px;
}
.bio-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-y) var(--gap-x);
  align-items: center;
}
.bio-hero__media picture { width: 100%; }
.bio-hero__media img { width: 100%; height: auto; }
.bio-hero__body .eyebrow { color: var(--grey-1); }
.bio-hero__quote { margin: 0; width: 100%; max-width: 30ch; }
.bio-hero .figcaption__credit { color: var(--grey-2); }
@media (min-width: 1024px) {
  .bio-hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .bio-hero__body { padding-left: 50px; }
  .bio-hero__media { max-width: 640px; }
}

/* ------------------------------------------------------------ lede */
.bio-lede__body { max-width: 78ch; }
.bio-lede__body .lede { max-width: 72ch; }
.bio-lede__body .lede:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ timeline */
.bio-timeline-wrap { position: relative; }
/* no rule of its own on top: the section head's hairline is the top rule, and its 50 leads straight into 1942 */
.bio-timeline__row:first-child { padding-top: 0; }
.bio-timeline__row {
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}
/* a row: its year and lines (.bio-timeline__entry), after the pictures of that year (.bio-band, below) */
.bio-timeline__entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0 var(--gap-x);
}
.bio-timeline__year {
  font-size: var(--fs-meta);
  line-height: 2.32rem;   /* the entry text's line box (1.6 × 1.45rem): the year sits on its first line */
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--grey-1);
  white-space: nowrap;
}
.bio-timeline__text { max-width: 70ch; }
/* a wrapped line (1.6) is visibly tighter than the step between two entries (+ .75em) */
.bio-timeline__text p { margin: 0 0 .75em; max-width: 70ch; line-height: 1.6; }
.bio-timeline__text p:last-child { margin-bottom: 0; }
.bio-timeline__pubs { margin-top: .5em; font-size: var(--fs-meta); line-height: 2.1rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
/* B1: 14px text was a 14px target at 21px pitch; pad the anchors to ~32px tall and
   keep >= 8px clear between the two links (flex gap, not whitespace). */
.bio-timeline__pubs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-top: 0; }
.bio-timeline__pubs a { display: inline-block; padding: 6px 0; text-decoration: none; }
/* "· PDF" wraps as one piece, so the dot never ends a line and the two links never read as one label */
.bio-timeline__pdf { display: inline-flex; align-items: baseline; gap: 0 8px; white-space: nowrap; }
.bio-timeline__pubs a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) {   /* a tapped link would keep its hover underline */
  .bio-timeline__pubs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
}
.bio-timeline__sep { color: var(--grey-2); }
@media (max-width: 640px) {
  .bio-timeline__entry { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .bio-timeline__year { line-height: 2.1rem; }
}
/* phones and every touch screen (an iPad too): 44px tap targets (text size unchanged), and 16px or more between a book's
   link and its PDF link */
@media (max-width: 768px), (pointer: coarse) {
  .bio-timeline__pubs li { gap: 0 16px; }
  .bio-timeline__pubs a { padding-block: 12px; }   /* inline-block: 20.5px line + 24px */
}

/* ------------------------------------------------------------ LLP feature */
.bio-llp .feature__body p { max-width: 62ch; }
.bio-llp .figure__media { background: var(--bg-soft); }
/* the shared .feature__media crops to a square; the studio photograph shows whole */
.bio-llp .feature__media { max-width: 480px; }
.bio-llp .feature__media .figure__media { aspect-ratio: auto; overflow: visible; }
.bio-llp .feature__media .figure__media picture,
.bio-llp .feature__media .figure__media img { width: 100%; height: auto; object-fit: contain; }
@media (min-width: 1025px) { .bio-llp { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); } }

/* ------------------------------------------------------------ KK additions: essay credit, chronology sections and pictures */
/* the essay's book sits under its heading (.quote__by: meta, linked <cite>), then the essay */
.bio-lede__body h2 { margin-bottom: .4em; }
.bio-lede__body .bio-lede__credit { margin: 0 0 calc(var(--para) * 1.2); }
/* a held passage of the book is marked as a cut: a centred ellipsis between the two paragraphs */
.bio-lede__body .bio-lede__cut { text-align: center; }
/* chronology: the five section titles as plain anchor jumps, in the eyebrow/meta style */
.bio-chron-nav { margin: calc(-1 * var(--gap-y) + 18px) 0 var(--gap-y); font-size: var(--fs-meta); line-height: 2.1rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
.bio-chron-nav ul { display: flex; flex-wrap: wrap; gap: 0 28px; }   /* spaced, no dots: a wrapped line never starts with a separator */
.bio-chron-nav li { display: flex; align-items: baseline; gap: 0 10px; }
.bio-chron-nav a { display: inline-block; padding: 6px 0; text-decoration: none; }
.bio-chron-nav a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) {   /* a tapped link would keep its hover underline */
  .bio-chron-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
}
.bio-chron-nav__sep { display: none; }
/* phones: each title is a line of its own anyway, so a plain list without the dots */
@media (max-width: 640px) {
  .bio-chron-nav ul { flex-direction: column; }
  .bio-chron-nav__sep { display: none; }
}
@media (max-width: 768px), (pointer: coarse) { .bio-chron-nav a { padding-block: 12px; } }   /* 44px tap targets, as the book links above */
/* section titles: the site's h3 (ink, uppercase, tracked) with a hairline above; the year labels stay as they are */
.bio-timeline__section { margin: var(--gap-y) 0 0; padding: 18px 0 22px; border-top: 1px solid var(--hairline); }

/* ------------------------------------------------------------ chronology: an era = its title, its lines, its pictures */
.bio-era + .bio-era { margin-top: var(--gap-y); }
.bio-era .bio-timeline__section { margin-top: 0; }
/* the next title's hairline closes the era above: its last row needs no rule of its own */
.bio-era:has(+ .bio-era) .bio-timeline > .bio-timeline__row:last-child { border-bottom: 0; }
/* a band: the pictures of one row's year, one or two side by side, centred; two share one band, each picture centred
   on the other's middle (no top- or bottom-hung pair) and their captions on one line below. Column widths: never wider
   than the picture's own pixels / 1.5 nor taller than 330px desktop / 240px phones (--cols, --pcols) */
.bio-band { display: grid; grid-template-columns: var(--pcols); grid-template-rows: auto auto; justify-content: center;
            column-gap: 30px; }
.bio-fig { display: grid; grid-row: span 2; grid-template-rows: subgrid; min-width: 0; }
.bio-fig__media { display: block; align-self: center; background: var(--bg-raised); }
.bio-fig picture, .bio-fig img { display: block; width: 100%; height: auto; }
/* a book's caption, stacked: its words, the medium, the book (linked as a quote's book is) */
.bio-fig__cap { align-self: start; flex-direction: column; gap: 0; padding-top: 14px; }
.bio-fig__medium, .bio-fig__src { color: var(--grey-2); }
.bio-fig__cap a { color: inherit; text-decoration: underline; text-decoration-color: var(--grey-3); text-underline-offset: .2em; text-decoration-thickness: 1px; }
.bio-fig__cap a:hover, .bio-fig__cap a:focus-visible { color: var(--ink); text-decoration-color: currentColor; }
.bio-fig__cap cite { font-style: normal; }
a.bio-fig__media img { transition: opacity var(--t-hover); }
a.bio-fig__media:hover img { opacity: .85; }
/* desktop: the lines keep their column and their rhythm; each band floats in the column to their right at the top of
   its own row (as a sidenote: float right, clear right, a negative margin into the room the list leaves), and a band
   that runs past the next one's row pushes that one down rather than opening a gap between the lines. The list holds
   its floats, so a section whose last pictures outrun its lines ends below them. */
@media (min-width: 1100px) {
  .bio-era { --figcol: clamp(330px, 29vw, 440px); --figgap: clamp(50px, 5vw, 90px); }
  .bio-timeline { display: flow-root; padding-right: calc(var(--figcol) + var(--figgap)); }
  .bio-band { float: right; clear: right; width: var(--figcol); grid-template-columns: var(--cols);
              margin: 0 calc(-1 * (var(--figcol) + var(--figgap))) 40px 0; padding-top: 4px; }
  .bio-band--last { margin-bottom: 0; }
}
/* phones and tablets: a row's pictures follow its lines, before its hairline */
@media (max-width: 1099px) {
  .bio-timeline__row--band { display: flex; flex-direction: column; }
  .bio-band { order: 1; margin-top: 30px; }
}
