/* ============================================================
   how-it-works.html + notes/*.html — page-specific styles
   (Loaded after site.css via the head partial's extra_head slot. Uses the
   shared tokens from colors_and_type.css. Promote a block to site.css if a
   third page needs it — that is how .slider got there.)

   A few sizes here are deliberately literal rather than tokenised: the note
   body runs on its own reading scale (1.1875rem/1.68) that does not sit on the
   shared --fs-* steps, and re-pointing it at the nearest token would reflow
   every note.
   ============================================================ */

/* ---------- Capability slider ----------
   Mechanism, arrows, and rail come from .slider in site.css. Only the stat
   inside each slide is page-specific: it loses the grid cell's hairlines and
   hover wipe, because the slider frame already carries them. */
.slide .stat { height: 100%; background: transparent; border: none; padding: 34px 40px 36px; }
.slide .stat::before { content: none; display: none; }
@media (max-width: 860px) { .slide .stat { padding: 28px 24px 30px; } }

/* ---------- Technical note list ---------- */
.notes { border-top: 1px solid var(--ibbis-navy); }
.note {
  position: relative; display: grid; grid-template-columns: 190px 1fr; gap: 36px;
  padding: 34px 0 32px; border-bottom: 1px solid var(--ibbis-navy);
  text-decoration: none; color: inherit;
}
/* Same red top-rule wipe as the program-card grids, so a note row reads as the
   same kind of click target. */
.note::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--ibbis-red); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out);
}
.note:hover::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .note::before { transition: none; } }
.note__meta { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.note__tag {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-caps-l); text-transform: uppercase; color: var(--ibbis-red);
}
.note__date {
  font-family: var(--font-display); font-size: var(--fs-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-muted);
}
.note__title {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.625rem;
  line-height: var(--lh-snug); color: var(--ibbis-navy); margin: 0 0 10px;
}
.note__excerpt {
  font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.55;
  color: var(--grey-muted); margin: 0; max-width: 62ch;
}
.note__cta {
  display: inline-block; margin-top: 16px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ibbis-navy); border-bottom: 2px solid var(--ibbis-red); padding-bottom: 3px;
}
.note__foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-top: 18px; }
.note__by {
  font-family: var(--font-display); font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--grey-muted);
  padding-right: 14px; border-right: 1px solid var(--grey-line);
}
.note__foot .note__cta { margin-top: 0; }
.note:hover .note__cta { color: var(--ibbis-red); }
.notes__more { font-family: var(--font-serif); font-size: 1.0625rem; color: var(--grey-muted); margin: 24px 0 0; text-align: center; }
@media (max-width: 760px) {
  .note { grid-template-columns: 1fr; gap: 14px; }
  .note__meta { flex-direction: row; gap: 14px; align-items: baseline; }
  .note__by { border-right: none; padding-right: 0; flex: 1 1 100%; }
}

/* Two consecutive white sections stack 88px + 88px of padding — halve the seam. */
#notes .section-head { margin-bottom: 36px; }
#notes + .section:not(.section--tint):not(.section--navy) { padding-top: 0; }

/* ---------- Featured publications ---------- */
.pubs-feat { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ibbis-navy); }
.pub-feat {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 30px 28px 32px; border-left: 1px solid var(--ibbis-navy);
  text-decoration: none; color: inherit;
}
.pub-feat:first-child { border-left: none; }
.pub-feat::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--ibbis-red); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out);
}
.pub-feat:hover::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .pub-feat::before { transition: none; } }
/* Venue logos are third-party marks in clashing colours: greyscale at rest,
   colour on hover, same treatment as the partner .logo-tile in site.css. */
.pub-feat__logo { height: 76px; display: flex; align-items: center; }
.pub-feat__logo img {
  max-height: 52px; max-width: 78%; width: auto; height: auto;
  filter: grayscale(1); opacity: 0.85;
  transition: filter var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out);
}
.pub-feat:hover .pub-feat__logo img { filter: none; opacity: 1; }
.pub-feat__venue {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-caps-l); text-transform: uppercase; color: var(--ibbis-red);
}
.pub-feat__title { font-family: var(--font-serif); font-weight: 700; font-size: 1.1875rem; line-height: 1.3; color: var(--ibbis-navy); margin: 0; }
.pub-feat__authors { font-family: var(--font-serif); font-size: 0.9375rem; line-height: var(--lh-normal); color: var(--grey-muted); margin: 0; }
.pub-feat__cta {
  display: inline-block; align-self: flex-start; margin-top: auto;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ibbis-navy); border-bottom: 2px solid var(--ibbis-red); padding-bottom: 3px;
}
.pub-feat:hover .pub-feat__cta { color: var(--ibbis-red); }
@media (max-width: 900px) {
  .pubs-feat { grid-template-columns: 1fr; }
  .pub-feat { border-left: none; border-top: 1px solid var(--ibbis-navy); }
  .pub-feat:first-child { border-top: none; }
}

/* ---------- Publication list ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ibbis-navy); }
.pub-item { display: grid; grid-template-columns: 150px 1fr; padding: 18px 0 18px 28px; border-bottom: 1px solid var(--ibbis-navy); }
.pub-item__date {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ibbis-red);
  padding: 3px 24px 0 0;
}
.pub-item__body { padding-left: 24px; }
.pub-item__title { font-family: var(--font-serif); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--ibbis-navy); margin: 0; }
.pub-item__title a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(var(--navy-rgb), 0.3); }
.pub-item__title a:hover { color: var(--ibbis-red); border-bottom-color: var(--ibbis-red); }
.pub-item__meta { font-family: var(--font-serif); font-size: 0.9375rem; line-height: var(--lh-normal); color: var(--grey-muted); margin: 4px 0 0; }
@media (max-width: 760px) {
  .pub-item { grid-template-columns: 1fr; gap: 6px; padding-left: 0; }
  .pub-item__date { padding-right: 0; }
  .pub-item__body { padding-left: 0; }
}

/* ---------- Case-study tiles (navy band) ----------
   On navy there is no white plate: the logo art is knocked out to pure white
   and brightens to full opacity on hover. */
.section--navy .logo-tile { border: none; background: transparent; }
.section--navy .logo-tile object, .section--navy .logo-tile img { filter: brightness(0) invert(1); opacity: 0.75; }
.section--navy .logo-tile:hover object, .section--navy .logo-tile:focus-visible object,
.section--navy .logo-tile:hover img, .section--navy .logo-tile:focus-visible img { filter: brightness(0) invert(1); opacity: 1; }
/* Detailed multi-tone marks (the SIAT seal) lose their interior detail when
   knocked out to a flat white silhouette, so they sit on a white plate. */
.section--navy .logo-tile--plate { background: var(--ibbis-white); border-radius: var(--radius-lg); padding: 12px 18px; }
.section--navy .logo-tile--plate object, .section--navy .logo-tile--plate img,
.section--navy .logo-tile--plate:hover object, .section--navy .logo-tile--plate:hover img { filter: none; opacity: 1; }
/* site.css styles .logo-tile object only; the plate variant uses a real <img>. */
.logo-tile img {
  max-height: 56px; max-width: 80%; width: auto; height: auto; pointer-events: none;
  filter: grayscale(1); opacity: 0.85;
  transition: filter var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out);
}
.logo-tile:hover img, .logo-tile:focus-visible img { filter: none; opacity: 1; }
.case-note { font-family: var(--font-serif); font-size: 0.9375rem; line-height: var(--lh-normal); color: rgba(var(--white-rgb), 0.8); margin: 12px 0 0; text-align: center; }
/* Case-studies band: roomier columns, closer label/logo pairing. */
.logo-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 88px; margin-top: 24px; }
.section:has(.logo-cols) .section-head { margin-bottom: 48px; max-width: 880px; }
.section:has(.logo-cols) .section-head .header-xl { margin-bottom: 18px; }
.logo-col__label { margin: 0 0 18px; }
.logo-col .logo-tile { height: 88px; }
@media (max-width: 900px) { .logo-cols { grid-template-columns: 1fr; } }

/* ---------- "Feeling stuck?" cards ---------- */
.stuck-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 12px auto 0; max-width: 880px; }
.stuck-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--ibbis-white); border: 1px solid var(--grey-line);
  border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; padding: 0;
  transition: box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.stuck-card:hover { box-shadow: var(--shadow-sm); border-color: var(--ibbis-navy); }
.stuck-card__art { aspect-ratio: 16 / 11; background: var(--navy-tint); margin: 0; }
.stuck-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stuck-card__body { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 22px 22px 24px; }
.stuck-card__body > div { flex: 1 1 auto; min-width: 0; }
.stuck-card__title { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-2xl); line-height: var(--lh-tight); color: var(--ibbis-navy); margin: 0 0 10px; }
.stuck-card__desc { font-family: var(--font-serif); font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--grey-muted); margin: 0; }
.stuck-card__go {
  flex: none; width: 42px; height: 42px; border-radius: var(--radius-full);
  border: 1px solid var(--grey-line); display: grid; place-items: center;
  font-size: 16px; color: var(--ibbis-navy);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.stuck-card:hover .stuck-card__go { background: var(--ibbis-red); border-color: var(--ibbis-red); color: var(--ibbis-white); }
@media (max-width: 860px) {
  .stuck-grid { grid-template-columns: 1fr; gap: 20px; }
  .stuck-card__body { padding: 26px 22px 28px; }
}

/* ============================================================
   Technical note post template (notes/*.html)
   ============================================================ */
.post-head { background: var(--navy-tint); border-bottom: 1px solid var(--ibbis-navy); }
.post-head__inner { max-width: 820px; margin: 0 auto; padding: 44px 40px 40px; }
.crumbs {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-caps-l); text-transform: uppercase; color: var(--grey-muted);
  margin: 0 0 22px; display: flex; gap: 10px; flex-wrap: wrap;
}
.crumbs a { color: var(--ibbis-navy); text-decoration: none; }
.crumbs a:hover { color: var(--ibbis-red); }
.post__tag {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-xxs); letter-spacing: var(--tracking-caps-l);
  text-transform: uppercase; color: var(--ibbis-red); margin: 0 0 14px;
}
.post__title { font-family: var(--font-serif); font-weight: 700; font-size: clamp(2rem, 4.2vw, 2.85rem); line-height: 1.14; color: var(--ibbis-navy); margin: 0; text-wrap: pretty; }
.post__standfirst { font-family: var(--font-serif); font-size: 1.3125rem; line-height: var(--lh-normal); color: var(--grey-muted); margin: 20px 0 0; max-width: 60ch; }
.post__meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 26px 0 0;
  font-family: var(--font-display); font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--grey-muted);
}
.post__meta strong { color: var(--ibbis-navy); font-weight: 700; }

.post { max-width: 820px; margin: 0 auto; padding: 52px 40px 72px; }
/* Body ink is a touch warmer and lighter than --ibbis-navy: navy at this size
   and measure reads as heavy, and pure black breaks the palette. */
.post__body { font-family: var(--font-serif); font-size: 1.1875rem; line-height: 1.68; color: #1b1e2c; }
.post__body > p { margin: 0 0 24px; }
.post__body > p:first-child { font-size: 1.25rem; }
.post__body h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1875rem;
  letter-spacing: 0.07em; line-height: 1.35; text-transform: uppercase;
  color: var(--ibbis-navy); margin: 56px 0 18px;
}
.post__body h3 { font-family: var(--font-serif); font-weight: 700; font-size: 1.4375rem; line-height: var(--lh-snug); color: var(--ibbis-navy); margin: 38px 0 12px; }
.post__body ul, .post__body ol { margin: 0 0 24px; padding-left: 22px; }
.post__body li { margin: 0 0 10px; }
.post__body a { color: var(--ibbis-navy); text-decoration: none; border-bottom: 1px solid rgba(var(--navy-rgb), 0.35); }
.post__body a:hover { color: var(--ibbis-red); border-bottom-color: var(--ibbis-red); }
.post__body strong { color: var(--ibbis-navy); }
.post__body figure { margin: 34px 0; }
.post__body figure img { width: 100%; height: auto; display: block; }
.post__body figcaption { font-size: 0.9375rem; line-height: var(--lh-normal); color: var(--grey-muted); margin: 12px 0 0; }
.post__body blockquote { margin: 32px 0; padding: 0 0 0 24px; border-left: 1px solid var(--ibbis-navy); font-style: italic; color: var(--ibbis-navy); }
.post__body code { font-family: var(--font-mono); font-size: 0.82em; background: var(--navy-tint); padding: 1px 5px; }
/* A long unbroken identifier (children_of_controlled_taxids.csv) is wider than
   a phone column, so inline code breaks mid-token rather than pushing the page
   sideways. Block code is excluded: `pre` scrolls horizontally instead. */
.post__body :not(pre) > code { overflow-wrap: anywhere; }
.post__body hr { border: none; border-top: 1px solid var(--ibbis-navy); margin: 44px 0; }

.callout { background: var(--navy-tint); border: 1px solid var(--grey-line); padding: 26px 28px; margin: 0 0 34px; }
.callout p:first-child { margin-top: 0; }
.callout ul { margin-bottom: 0; }
.callout__label {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-caps-l); text-transform: uppercase;
  color: var(--ibbis-red); margin: 0 0 12px;
}

/* Code, terminal output, wide figures, footnotes — long-form note primitives. */
.post__body pre {
  font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.6;
  background: var(--navy-tint); border: 1px solid var(--grey-line);
  padding: 18px 20px; margin: 0 0 26px; overflow-x: auto; color: #1b1e2c;
  -webkit-text-size-adjust: 100%;
}
.post__body pre code { background: none; padding: 0; font-size: inherit; }
.post__body pre.term { background: var(--ibbis-navy); border-color: var(--ibbis-navy); color: var(--ibbis-white); }
.post__body pre.term code { color: var(--ibbis-white); }
.post__body .pre-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.625rem;
  letter-spacing: var(--tracking-caps-l); text-transform: uppercase;
  color: var(--grey-muted); margin: 0 0 8px;
}
/* Figures that need more than the 820px measure: bleed symmetrically out of the
   column, capped at the shared container width. */
.post__body figure.wide { margin-left: calc((820px - 100vw + 80px) / 2); margin-right: calc((820px - 100vw + 80px) / 2); max-width: var(--container-max); }
@media (min-width: 1300px) { .post__body figure.wide { margin-inline: -190px; } }
@media (max-width: 900px) { .post__body figure.wide { margin-inline: 0; } }

/* Inline world map (generated SVG, no JS — see tools/build-maps.py) */
.map-figure { background: var(--ibbis-white); }
.map-figure img { display: block; width: 100%; height: auto; aspect-ratio: 2754 / 1180; }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0;
  font-family: var(--font-display); font-size: var(--fs-xxs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ibbis-navy);
}

.post__footnotes { margin: 52px 0 0; padding: 22px 0 0; border-top: 1px solid var(--ibbis-navy); font-size: 0.9375rem; line-height: 1.6; color: var(--grey-muted); }
.post__footnotes p { margin: 0 0 12px; }
.post__footnotes a { color: var(--grey-muted); border-bottom-color: rgba(128, 128, 128, 0.4); }
.post__sig { font-style: italic; color: var(--grey-muted); font-size: var(--fs-sm); line-height: 1.6; }

.post-end {
  max-width: 820px; margin: 0 auto; padding: 28px 40px 80px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--ibbis-navy);
}
.post-end__note { font-family: var(--font-serif); font-size: var(--fs-sm); color: var(--grey-muted); margin: 0; flex: 1 1 100%; }
@media (max-width: 640px) {
  .post { padding: 36px 22px 56px; }
  .post-head__inner { padding: 32px 22px; }
  .post-end { padding-left: 22px; padding-right: 22px; }
}
