/* Hydra theme family: magazine. Re-skin per site by changing ONLY the variables in :root, using the variation printed by
   tools/assign_theme.py (the home page's own colours win when it has them). Class names follow BEM (block__element--modifier). */
:root {
  --mz-accent:     #1e73be;   /* links, section bars, current menu item */
  --mz-accent-ink: #9e0c24;   /* hover */
  --mz-ink:        #111111;   /* headings, brand */
  --mz-text:       #3a3a3a;
  --mz-muted:      #666666;
  --mz-line:       #e5e5e5;
  --mz-paper:      #efefef;
  --mz-tint:       #f7f5f2;   /* example boxes, cover */
  --mz-foot:       #f3f1ee;   /* footer */
  --mz-head-font:  'Work Sans', sans-serif;
  --mz-body-font:  'Segoe UI', sans-serif;
  --mz-round:      2px;
  --mz-gap:        1.1;         /* spacing scale */
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mz-paper); color: var(--mz-text); font: 400 17px/1.8 var(--mz-body-font); }
a { color: var(--mz-accent); text-underline-offset: 3px; }
a:hover { color: var(--mz-accent-ink); }
img { max-width: 100%; height: auto; }

/* Masthead: brand centred above a menu row with a bottom border */
.masthead { background: var(--mz-paper); border-bottom: 1px solid var(--mz-line); padding-top: 22px; text-align: center; }
.masthead__brand { display: inline-block; padding: 0 24px; font: 800 1.6rem/1.2 var(--mz-head-font); letter-spacing: -0.02em; color: var(--mz-ink); text-decoration: none; }
.masthead__menu { margin-top: 14px; border-top: 1px solid var(--mz-line); }
.masthead__track { max-width: 1160px; margin: 0 auto; }
.masthead__list { list-style: none; margin: 0 auto; padding: 0; max-width: 1160px; display: flex; justify-content: center; gap: 30px; }
.masthead__link { display: block; padding: 12px 0 10px; font: 600 0.8rem/1 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-ink); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.masthead__link:hover, .masthead__link[aria-current="page"] { color: var(--mz-accent); border-bottom-color: var(--mz-accent); }
@media (max-width: 760px) {
  .masthead { padding-top: 14px; }
  .masthead__brand { font-size: 1.25rem; padding: 0 16px; }
  .masthead__menu { margin-top: 10px; }
  .masthead__track { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .masthead__track::-webkit-scrollbar { display: none; }
  .masthead__list { justify-content: flex-start; gap: 22px; padding: 0 16px; width: max-content; }
  .masthead__link { padding: 10px 0 8px; font-size: 0.74rem; }
}

/* Two columns on desktop: story + sticky rail */
.layout { max-width: 1160px; margin: 0 auto; padding: calc(28px * var(--mz-gap)) 24px calc(48px * var(--mz-gap)); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.layout__main { min-width: 0; }
.layout__rail { position: sticky; top: 24px; }
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 18px 16px 36px; }
  .layout__rail { position: static; border-top: 3px solid var(--mz-ink); padding-top: 18px; }
}

/* Story intro (light article header) */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 14px; font: 600 0.72rem/1.4 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.06em; color: var(--mz-muted); }
.crumbs__link { color: var(--mz-muted); text-decoration: none; }
.crumbs__link:hover { color: var(--mz-accent); }
.crumbs__sep { color: var(--mz-line); }
.crumbs__here { color: var(--mz-ink); }
.story__title { margin: 0 0 16px; font: 800 clamp(1.7rem, 4.2vw, 2.6rem)/1.15 var(--mz-head-font); letter-spacing: -0.02em; color: var(--mz-ink); }
.story__byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 18px; padding: 10px 0; border-top: 1px solid var(--mz-line); border-bottom: 1px solid var(--mz-line); font: 500 0.8rem/1.4 var(--mz-head-font); color: var(--mz-muted); }
.story__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.story__author a { color: var(--mz-ink); font-weight: 700; text-decoration: none; }
.story__date::before { content: "·"; margin-right: 14px; color: var(--mz-line); }
.story__byline .story__date:first-child::before { content: none; }
@media (max-width: 760px) {
  .story__byline { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 0; }
  .story__avatar { grid-row: span 2; }
  .story__date::before { content: none; }
}
.story__lede { margin: 0 0 20px; font-size: 1.12rem; line-height: 1.7; color: var(--mz-ink); }
.story [data-toplist-label] { margin: 0 0 28px; }

/* Story body */
.story__body h2 { position: relative; margin: calc(44px * var(--mz-gap)) 0 14px; padding-top: 16px; font: 800 clamp(1.35rem, 3vw, 1.75rem)/1.25 var(--mz-head-font); letter-spacing: -0.01em; color: var(--mz-ink); scroll-margin-top: 20px; }
.story__body h2::before { content: ""; position: absolute; top: 0; left: 0; width: 48px; height: 4px; background: var(--mz-accent); }
.story__body h3 { margin: calc(26px * var(--mz-gap)) 0 8px; font: 700 1.12rem/1.35 var(--mz-head-font); color: var(--mz-ink); }
.story__body p { margin: 0 0 calc(16px * var(--mz-gap)); }
.story__body ul, .story__body ol { margin: 0 0 18px; padding-left: 22px; }
.story__body li { margin-bottom: 6px; }
.numbered { list-style: none; counter-reset: mzstep; padding-left: 0 !important; }
.numbered li { counter-increment: mzstep; position: relative; padding-left: 44px; min-height: 30px; }
.numbered li::before { content: counter(mzstep); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--mz-ink); color: var(--mz-paper); font: 700 0.85rem/30px var(--mz-head-font); text-align: center; }
.datatable { margin: 18px 0 8px; overflow-x: auto; }
.datatable table { width: 100%; border-collapse: collapse; font: 400 0.88rem/1.5 var(--mz-head-font); }
.datatable th { padding: 10px 12px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mz-ink); border-bottom: 2px solid var(--mz-ink); }
.datatable td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid var(--mz-line); }
.story__source { font: 400 0.78rem/1.5 var(--mz-head-font) !important; color: var(--mz-muted); }
.callout { margin: 16px 0 18px; padding: 16px 20px; background: var(--mz-tint); border-top: 3px solid var(--mz-accent); border-radius: 0 0 var(--mz-round) var(--mz-round); font-size: 0.95rem; }
.callout p:last-child { margin-bottom: 0; }

/* Pillar pages: list of guides (hidden while empty) */
.story-index { margin: 36px 0 0; padding: 20px 0 0; border-top: 3px solid var(--mz-ink); }
.story-index:has(ul:empty) { display: none; }
.story-index__title { display: block; margin-bottom: 12px; font: 800 0.8rem/1 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-ink); }
.story-index__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.story-index__list a { display: block; padding: 10px 0; border-bottom: 1px solid var(--mz-line); font: 700 0.95rem/1.4 var(--mz-head-font); color: var(--mz-ink); text-decoration: none; }
.story-index__list a::after { content: " →"; color: var(--mz-accent); }

/* Bio card (person author only) */
.bio { display: grid; grid-template-columns: 72px 1fr; gap: 18px; margin: 36px 0 0; padding: 20px; background: var(--mz-tint); border-radius: var(--mz-round); }
.bio__photo { margin: 0; }
.bio__photo img { width: 72px; height: 72px; border-radius: var(--mz-round); object-fit: cover; display: block; }
.bio__name { display: block; font: 800 1rem/1.3 var(--mz-head-font); }
.bio__name a { color: var(--mz-ink); text-decoration: none; }
.bio__role { display: block; margin: 2px 0 6px; font: 600 0.75rem/1.4 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--mz-accent); }
.bio__text { margin: 0; font-size: 0.88rem; line-height: 1.6; color: var(--mz-muted); }

/* References */
.refs { margin: 32px 0 0; font: 400 0.8rem/1.6 var(--mz-head-font); color: var(--mz-muted); }
.refs__title { display: block; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-ink); }
.refs__list { margin: 0; padding-left: 20px; }

/* Rail: on this page + pillars */
.rail__block { margin-bottom: 28px; }
.rail__title { display: block; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 3px solid var(--mz-ink); font: 800 0.75rem/1 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-ink); }
.rail__list { list-style: none; margin: 0; padding: 0; font: 500 0.86rem/1.4 var(--mz-head-font); }
.rail__list a { display: block; padding: 8px 0; border-bottom: 1px solid var(--mz-line); color: var(--mz-text); text-decoration: none; }
.rail__list a:hover { color: var(--mz-accent); }
.rail__block:has(ol:empty), .rail__block:has(ul:empty) { display: none; }
@media (max-width: 980px) { .rail__block--toc { display: none; } }

/* Home page only: cover */
.cover { margin: 0 0 24px; padding: calc(36px * var(--mz-gap)) 28px; background: var(--mz-tint); border-radius: var(--mz-round); }
.cover__title { margin: 0 0 14px; font: 800 clamp(1.9rem, 4.8vw, 3rem)/1.1 var(--mz-head-font); letter-spacing: -0.025em; color: var(--mz-ink); }
.cover__lede { margin: 0; font-size: 1.15rem; line-height: 1.7; color: var(--mz-ink); }
@media (max-width: 760px) { .cover { padding: 22px 18px; } }

/* Author page */
.profile { display: flex; gap: 22px; align-items: center; margin-bottom: 20px; }
.profile__photo { width: 112px; height: 112px; border-radius: var(--mz-round); object-fit: cover; flex-shrink: 0; }
.profile__role { display: block; font: 600 0.8rem/1.4 var(--mz-head-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--mz-accent); }
.guides { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.guides a { display: block; padding: 10px 0; border-bottom: 1px solid var(--mz-line); font: 700 0.95rem/1.4 var(--mz-head-font); color: var(--mz-ink); text-decoration: none; }

/* Colophon: light multi-column footer */
.colophon { background: var(--mz-foot); border-top: 1px solid var(--mz-line); font: 400 0.84rem/1.6 var(--mz-head-font); color: var(--mz-muted); }
.colophon__grid { max-width: 1160px; margin: 0 auto; padding: 40px 24px 28px; display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 32px; }
.colophon__brand { display: inline-block; margin-bottom: 12px; font: 800 1.15rem/1.2 var(--mz-head-font); color: var(--mz-ink); text-decoration: none; }
.colophon__heading { display: block; margin-bottom: 10px; font-weight: 800; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-ink); }
.colophon__links { list-style: none; margin: 0; padding: 0; }
.colophon__links a { color: var(--mz-text); text-decoration: none; line-height: 2; }
.colophon__badges { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.colophon__badge { padding: 2px 9px; border: 1px solid var(--mz-ink); border-radius: var(--mz-round); font-size: 0.72rem; font-weight: 700; color: var(--mz-ink); }
.colophon__text { margin: 0; font-size: 0.78rem; }
@media (max-width: 760px) { .colophon__grid { grid-template-columns: 1fr; gap: 22px; padding: 28px 16px; } }
