/* The Wisdom Women Library
   Web adaptation of the Wisdom Companion design system.
   Brand colours never change. Each Human Question sets its own --world-* values
   (see content/questions/*.json → "world"), applied on the <body> element. */

@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff") format("woff"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff") format("woff"); font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* Brand foundation (every page) */
  --forest: #1F3A2E;
  --forest-hover: #2C4F3F;
  --ivory: #F8F4EC;
  --gold: #A8803F;        /* hairlines and frames only, never text */
  --gold-light: #D9B676;  /* gold text on forest */
  --gold-deep: #735623;   /* gold text on ivory */
  --ink: #1F2B24;
  --muted: #636A61;
  --rule: #D9CBB8;

  /* Neutral defaults for pages without a film world */
  --world: #B4573A;
  --world-deep: #9A4329;
  --world-soft: #E3B3A2;
  --world-tint: #F2D9CE;
  --world-line: #CF9F8C;
  --world-2: #6F8052;
  --world-2-deep: #53623A;
  --world-2-tint: #E2E7D3;
  --world-2-line: #B7C1A0;

  --display: "Instrument Serif", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --label: "Hanken Grotesk", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1180px;
  --measure: 66ch;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
@media (max-width: 640px) { body { font-size: 18px; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--world-deep); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--forest); color: var(--ivory); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 16px; top: 16px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }

/* ---------- type ---------- */
.label {
  font-family: var(--label);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.label--world { color: var(--world-deep); }
.label--world-2 { color: var(--world-2-deep); }
.label--gold { color: var(--gold-deep); }

h1, h2, h3, .display { font-family: var(--display); font-weight: 400; color: var(--forest); margin: 0; text-wrap: balance; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--world); }
.h1 { font-size: clamp(46px, 7.4vw, 88px); line-height: 0.96; letter-spacing: -0.01em; }
.h2 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1; }
.h3 { font-size: clamp(26px, 2.8vw, 32px); line-height: 1.08; }
.question { font-family: var(--display); font-size: clamp(30px, 3.8vw, 46px); line-height: 1.14; color: var(--forest); text-wrap: balance; }
.standfirst { font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.2vw, 26px); line-height: 1.24; color: var(--world); }
.lede { font-size: clamp(19px, 1.6vw, 21px); line-height: 1.55; }
.small { font-size: 15px; line-height: 1.5; color: var(--muted); }

.dropcap::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 4.1em;
  line-height: 0.8;
  padding: 0.06em 0.1em 0 0;
  color: var(--forest);
}

/* ---------- header / footer ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 20px; }
.wordmark { font-family: var(--display); font-size: 27px; line-height: 1; color: var(--forest); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; }
.wordmark .seal { flex: none; }
.wordmark em { font-style: italic; color: var(--gold-deep); }
.wordmark:hover { color: var(--forest); }
.nav { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.nav a { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--forest); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--forest); }

.site-foot { margin-top: clamp(72px, 10vw, 128px); border-top: 1px solid var(--gold); }
.site-foot .wrap { display: grid; gap: 28px; grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 48px; }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot p { font-size: 15px; color: var(--muted); max-width: 42ch; }
.site-foot ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.site-foot li a { font-size: 16px; color: var(--forest); }
.site-foot .fine { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 18px; font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 16px 28px; border: 1px solid var(--forest); border-radius: 0;
  background: var(--forest); color: var(--ivory); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--forest-hover); border-color: var(--forest-hover); color: var(--ivory); }
.btn--ghost { background: transparent; color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--ivory); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.text-link { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--forest); text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 3px; }
.text-link:hover { color: var(--world-deep); }

/* ---------- section rhythm ---------- */
.section { padding-top: clamp(56px, 8vw, 104px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 36px; }
.hairline { border: 0; border-top: 1px solid var(--gold); margin: 0; }

/* ---------- hero (home) ---------- */
.hero { padding-top: clamp(48px, 8vw, 104px); }
.hero .label { margin-bottom: 22px; }
.hero h1 { max-width: 14ch; }
.hero .lede { max-width: 54ch; margin-top: 28px; }
.hero .actions { margin-top: 36px; display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; }

/* ---------- image placeholder (warm daylight field, as in the workbooks) ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(118deg, rgba(255,250,240,0) 0 46px, rgba(255,250,240,.16) 46px 78px),
    radial-gradient(120% 90% at 18% 10%, #FBEBDD 0%, rgba(251,235,221,0) 60%),
    linear-gradient(160deg, var(--world-tint) 0%, var(--world-soft) 48%, var(--world) 100%);
}
.ph .tag { position: absolute; left: 18px; bottom: 16px; color: #FFF8F0; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }

/* ---------- feature (home) ---------- */
.feature { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .feature { grid-template-columns: 1.15fr 1fr; gap: 64px; } }
.feature .ph { aspect-ratio: 5 / 4; }
.feature .question { margin: 18px 0 22px; font-size: clamp(26px, 2.6vw, 32px); font-style: italic; }

/* ---------- question band (one colour event per page) ---------- */
.band { background: var(--world-tint); padding: clamp(40px, 6vw, 72px) 0; }
.band .label { margin-bottom: 14px; }
.band .question { max-width: 26ch; }

/* ---------- Human Question page ---------- */
.q-head { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(36px, 5vw, 56px); display: grid; gap: 28px; }
@media (min-width: 900px) { .q-head { grid-template-columns: 1fr auto; align-items: end; } }
.q-head .meta { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 22px; }

.emblem { width: 64px; height: 38px; display: block; }

.classmark { display: inline-block; border: 1px solid var(--gold); background: var(--world-tint); padding: 12px 18px 10px; text-align: center; color: var(--forest); }
.classmark .no { font-family: var(--display); font-size: 28px; line-height: 1; display: block; }
.classmark .kw { font-family: var(--label); font-weight: 600; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); display: block; margin-top: 6px; }

.two-col { display: grid; gap: 40px; }
@media (min-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr) 320px; gap: 72px; } }

.video { position: relative; aspect-ratio: 16 / 9; background: var(--forest); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video--pending { display: grid; place-items: center; text-align: center; color: var(--ivory); padding: 24px; }
.video--pending .label { color: var(--gold-light); }
.video--pending p { font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); margin: 10px 0 0; color: var(--ivory); }

.movements { list-style: none; margin: 0; padding: 0; counter-reset: mv; }
.movements li { display: grid; grid-template-columns: 56px 1fr; gap: 0 18px; padding: 26px 0; border-top: 1px solid var(--rule); }
.movements li:last-child { border-bottom: 1px solid var(--rule); }
.movements .n { font-family: var(--display); font-size: 44px; line-height: 0.9; color: var(--world); }
.movements h3 { font-size: clamp(25px, 2.4vw, 30px); line-height: 1.1; }
.movements p { margin: 10px 0 0; color: var(--ink); font-style: italic; }

.aside-card { border-top: 1px solid var(--gold); padding-top: 22px; }
.aside-card + .aside-card { margin-top: 40px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags a, .tags span { display: inline-block; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--world-2-deep); border: 1px solid var(--world-2-line); padding: 7px 10px 6px; text-decoration: none; background: var(--ivory); }
.tags a:hover { border-color: var(--world-2-deep); }

.share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.share .btn { padding: 12px 16px; }
.share-status { font-size: 14px; color: var(--muted); min-height: 1.4em; margin-top: 8px; }

/* ---------- mini publication cover (until the real cover image exists) ---------- */
.pubcover { container-type: inline-size; aspect-ratio: 8.5 / 11; background: var(--ivory); border: 1px solid var(--rule); position: relative; overflow: hidden; }
.pubcover .mast { position: absolute; inset: 0 0 auto 0; height: 9.5%; background: var(--forest); color: var(--gold-light); display: flex; align-items: center; padding: 0 7%; font-family: var(--label); font-weight: 600; font-size: 3.1cqw; letter-spacing: 0.24em; text-transform: uppercase; }
.pubcover .ph { position: absolute; top: 9.5%; left: 0; right: 0; height: 52%; }
.pubcover .ribbon { position: absolute; top: 58.9%; left: 7%; background: var(--world); color: #FFF8F0; padding: 1.6cqw 2.6cqw 1.4cqw; font-family: var(--label); font-weight: 600; font-size: 2.6cqw; letter-spacing: 0.24em; text-transform: uppercase; }
.pubcover .t { position: absolute; top: 66%; left: 6.6%; right: 7%; font-family: var(--display); font-size: 9.6cqw; line-height: 0.94; color: var(--forest); }
.pubcover .t em { font-style: italic; color: var(--world); }
.pubcover .s { position: absolute; bottom: 6%; left: 7%; right: 34%; font-family: var(--body); font-style: italic; font-size: 3.2cqw; line-height: 1.3; color: var(--world-2-deep); }
.pubcover .cm { position: absolute; right: 7%; bottom: 5.5%; border: 1px solid var(--gold); background: var(--world-tint); padding: 1.6cqw 2.4cqw; text-align: center; font-family: var(--display); font-size: 4.2cqw; line-height: 1; color: var(--forest); }

/* ---------- Companion page ---------- */
.c-head { display: grid; gap: 40px; padding-top: clamp(40px, 7vw, 88px); }
@media (min-width: 900px) { .c-head { grid-template-columns: 380px 1fr; gap: 72px; align-items: start; } }
.c-head .pubcover { max-width: 380px; }
.c-head .sub { font-family: var(--body); font-style: italic; font-size: clamp(20px, 2vw, 24px); color: var(--world-2-deep); margin: 18px 0 22px; }

.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.parts li:first-child { border-top: 0; padding-top: 4px; }
.parts li { display: grid; grid-template-columns: 64px 1fr; gap: 0 18px; padding: 22px 0; border-top: 1px solid var(--rule); }
.parts .n { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--world); }
.parts h3 { font-size: 26px; line-height: 1.1; }
.parts p { margin: 6px 0 0; color: var(--muted); }

.concepts { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.concepts > div { padding: 22px 20px 22px 0; border-bottom: 1px solid var(--rule); }
.concepts .term { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--forest); }
.concepts .sub { font-style: italic; color: var(--world-2-deep); margin-top: 6px; }

.reading { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.reading li { display: grid; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--rule); align-content: start; }
.reading .rt { font-family: var(--display); font-size: 24px; line-height: 1.12; color: var(--forest); }
.reading .ra { font-size: 16px; color: var(--muted); }

/* ---------- supported access ---------- */
.access { background: var(--world-tint); padding: clamp(28px, 4vw, 44px); }
.access h2 { margin-bottom: 10px; }
.tiers { display: grid; gap: 12px; margin: 26px 0 18px; padding: 0; border: 0; }
@media (min-width: 640px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { display: block; position: relative; background: var(--ivory); border: 1px solid var(--world-line); padding: 18px 18px 16px; cursor: pointer; }
.tier input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tier .amt { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--forest); display: block; }
.tier .name { font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--world-deep); display: block; margin-top: 10px; }
.tier .note { font-size: 14px; color: var(--muted); display: block; margin-top: 4px; }
.tier:has(input:checked) { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.tier:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 3px; }
.access .promise { font-size: 16px; line-height: 1.5; color: var(--ink); max-width: 60ch; }

/* ---------- cards (collection) ---------- */
.cards { display: grid; gap: 40px 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { display: block; text-decoration: none; color: var(--ink); border-top: 1px solid var(--gold); padding-top: 18px; }
.card .ph { aspect-ratio: 5 / 4; margin-bottom: 18px; }
.card h3 { font-size: 30px; line-height: 1.06; margin: 10px 0 10px; }
.card .q { font-style: italic; color: var(--ink); }
.card:hover h3 { color: var(--world-deep); }

.filters { display: grid; gap: 18px; margin-bottom: 40px; }
@media (min-width: 760px) { .filters { grid-template-columns: 1fr auto; align-items: end; } }
.search { display: grid; gap: 8px; }
.search input { font: inherit; font-size: 18px; padding: 12px 14px; background: var(--ivory); color: var(--ink); border: 1px solid var(--rule); border-radius: 0; width: 100%; max-width: 460px; }
.search input:focus { border-color: var(--forest); outline: 2px solid var(--forest); outline-offset: 0; }
.themes { display: flex; flex-wrap: wrap; gap: 8px; }
.themes button { font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; background: var(--ivory); color: var(--forest); border: 1px solid var(--rule); padding: 10px 14px 9px; border-radius: 0; cursor: pointer; }
.themes button[aria-pressed="true"] { background: var(--forest); color: var(--ivory); border-color: var(--forest); }
.empty { color: var(--muted); font-style: italic; }

/* ---------- prose pages ---------- */
.prose h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.05; margin: 1.6em 0 0.5em; }
.prose p, .prose li { max-width: var(--measure); }

/* ---------- draft markers (preview builds only) ---------- */
.preview .draft { outline: 1px dashed var(--world-deep); outline-offset: 10px; position: relative; }
.preview .draft::before { content: "Draft copy · for review"; position: absolute; top: -32px; right: 0; font-family: var(--label); font-weight: 600; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--world-deep); background: var(--ivory); padding: 2px 6px; }
.preview-bar { background: var(--forest); color: var(--gold-light); font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; padding: 9px 16px; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- key ideas (Companion page) ---------- */
.ideas { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.idea { background: var(--ivory); border: 1px solid var(--gold); padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.idea .term { font-size: clamp(30px, 3vw, 38px); line-height: 1.02; }
.idea .gloss { margin: 0; font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.2; color: var(--world); }
.idea .def { margin: 6px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--ink); padding-top: 14px; border-top: 1px solid var(--rule); }
.idea .carry { margin: auto 0 0; padding-top: 14px; font-style: italic; font-size: 16.5px; line-height: 1.45; color: var(--forest); display: grid; gap: 6px; }
.idea .carry .label { font-style: normal; font-size: 10.5px; }

/* ---------- video chapters ---------- */
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters li { display: grid; grid-template-columns: 64px 1fr; gap: 0 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.chapters .t { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; color: var(--world-deep); font-variant-numeric: tabular-nums; }
.chapters .ct { font-family: var(--display); font-size: 24px; line-height: 1.15; color: var(--forest); }
.chapters .ct a { text-decoration: none; }
.chapters .ct a:hover { text-decoration: underline; }

.reading .text-link { justify-self: start; margin-top: 6px; }
/* A lone last idea spans the row instead of sitting by itself */
@media (min-width: 720px) and (max-width: 1059px) {
  .ideas { grid-template-columns: repeat(2, 1fr); }
  .idea:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
}
@media (min-width: 1060px) {
  .ideas { grid-template-columns: repeat(3, 1fr); }
  .idea:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  .idea:last-child:nth-child(3n+2) { grid-column: span 2; }
}
@media (min-width: 1060px) {
  .idea:last-child:nth-child(3n+1) { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 0 32px; align-items: start; }
  .idea:last-child:nth-child(3n+1) .gloss { grid-column: 1; }
  .idea:last-child:nth-child(3n+1) .def { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding: 0 0 0 32px; border-top: 0; border-left: 1px solid var(--rule); }
  .idea:last-child:nth-child(3n+1) .carry { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding-top: 4px; }
}

.disclosure { font-size: 15px; line-height: 1.5; color: var(--ink); border-left: 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); padding: 12px 0; margin: 0 0 8px; max-width: 72ch; }

/* ---------- books ---------- */
.book { display: grid; gap: 40px; }
@media (min-width: 900px) { .book { grid-template-columns: 340px 1fr; gap: 72px; align-items: start; } }
.book-cover { aspect-ratio: 6 / 9; max-width: 340px; width: 100%; background: var(--forest); color: var(--ivory); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px 28px; box-sizing: border-box; outline: 1px solid var(--gold); outline-offset: -12px; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.bc-series { font-family: var(--label); font-weight: 600; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-light); max-width: 22ch; }
.bc-title { font-family: var(--display); font-size: 54px; line-height: 0.96; margin-top: 28px; color: var(--ivory); }
.bc-title em { color: var(--gold-light); }
.bc-rule { width: 48px; border-top: 1px solid var(--gold-light); margin: 26px 0 18px; }
.bc-parts { font-family: var(--display); font-style: italic; font-size: 20px; color: var(--gold-light); }
.book-parts { display: grid; gap: 28px; margin-top: 36px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.book-parts > div { border-top: 1px solid var(--gold); padding-top: 14px; }
.book-parts ol { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: 17px; line-height: 1.35; }
