/*
 * v0.3 "Chapters" — layout layer for the home page, loaded after editorial.css.
 * One idea: the page reads as a sequence of chapters. Each chapter has its own surface
 * (paper, stone, ink), opens with a numbered mark, a stacked heading and one Bruegel figure,
 * and keeps its content in a single vertical column wherever reading order matters.
 */

.page-editorial { --ch-pad: clamp(96px, 11vw, 168px); }

/* ─── Surfaces ────────────────────────────────────────────── */
.chapter { position: relative; padding-block: var(--ch-pad); scroll-margin-top: var(--header-h, 64px); }
.chapter--paper { background: var(--background); }
.chapter--stone { background: var(--surface); }
.chapter--ink { background: var(--band); color: var(--on-band); }
.chapter--follow { padding-top: 0; }
.chapter .band, .chapter.band { padding-block: 0; }

/* ─── Chapter opener ──────────────────────────────────────── */
.chapter-mark { display: flex; align-items: center; gap: 14px; margin: 0 0 26px !important; color: var(--ed-coral); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: var(--type-label-weight); letter-spacing: var(--type-label-tracking); text-transform: uppercase; }
.chapter-mark::before { content: ""; width: 36px; height: 2px; background: currentColor; }
.chapter-num { font: 500 clamp(54px, 6vw, 92px)/0.85 var(--ed-heading); letter-spacing: -0.05em; color: var(--ed-coral); }
.chapter--ink .chapter-num { color: var(--ch-on-ink-accent); }
.chapter--ink .chapter-mark { color: var(--ch-on-ink-accent); }

.chapter-head {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(120px, 1fr);
  align-items: end;
  gap: 40px;
  margin-bottom: clamp(64px, 8vw, 112px);
  padding-bottom: clamp(36px, 4vw, 56px);
  border-bottom: 1px solid var(--foreground);
}
.chapter-head .ed-eyebrow { margin-bottom: 18px; color: var(--muted); }
.chapter-head h2 { font-size: clamp(46px, 5.4vw, 84px); line-height: 1.04; letter-spacing: -0.045em; }
.chapter-intro { max-width: 640px; margin-top: 30px !important; color: var(--muted); font-size: 18px; line-height: 1.75; }
.chapter-emblem { justify-self: end; width: clamp(150px, 17vw, 250px); margin: 0; }
.chapter-emblem img { display: block; width: 100%; height: auto; }

/* ─── 01 Platform: the diagram gets air, the role journey keeps its sticky stage ─── */
#platform .shared-foundation { margin-bottom: clamp(80px, 9vw, 130px); }
#platform .role-journey { margin-top: 0; }

/* ─── 02 Method: one column, principles as a numbered vertical list ─── */
.method-preview .method-grid { position: relative; display: block; }
.method-preview .method-grid > div { max-width: 820px; }
.method-preview .chapter-emblem { position: absolute; top: 0; right: 0; width: clamp(170px, 20vw, 290px); }
.method-preview h2 { margin: 18px 0 30px; }
.method-preview .method-description { max-width: 640px; color: var(--ed-on-ink-muted); font-size: 18px; line-height: 1.75; }
.method-preview .button { margin-top: 36px; }
.method-principles { margin: clamp(72px, 8vw, 110px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--on-band-line); }
.method-principles li { display: block; padding: 38px 0; border-bottom: 1px solid var(--on-band-line); }
.method-principles li > div { max-width: 640px; }
.method-principles h3 { margin-bottom: 12px; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.15; }
.method-principles p { max-width: 560px; font-size: 16px; line-height: 1.75; }

/* ─── 03 In practice: case files, the institution's question leads ─── */
.case-files { display: grid; gap: clamp(36px, 4vw, 56px); }
.case-file {
  display: grid;
  gap: 28px;
  padding: clamp(28px, 4.4vw, 64px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}
.case-file__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.case-file__label span { color: var(--ed-coral); }
.case-file h3 { max-width: 820px; font-size: clamp(30px, 3vw, 44px); line-height: 1.12; letter-spacing: -0.035em; }
.case-file__question { margin: 0; padding: clamp(24px, 3vw, 40px); border-left: 3px solid var(--ed-coral); background: var(--brand-tint-hex); }
.case-file__question .ed-eyebrow { display: block; margin-bottom: 14px; color: var(--ed-coral); }
.case-file__question p { max-width: 820px; font: 500 clamp(22px, 2.3vw, 31px)/1.38 var(--ed-heading); letter-spacing: -0.02em; color: var(--foreground); }
.case-file__body { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--ed-line); }
.case-file__body > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding: 22px 0; border-bottom: 1px solid var(--ed-line); }
.case-file__body dt { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 4px; }
.case-file__body dd { max-width: 680px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

/* Services: a quiet closing note of chapter 03, stacked. */
.services-band .services { display: grid; grid-template-columns: minmax(0, 760px); gap: 18px; padding-top: clamp(56px, 6vw, 80px); border-top: 1px solid var(--ed-line); }
.services-band .services h3 { grid-row: auto; font-size: clamp(30px, 3vw, 42px); line-height: 1.15; }
.services-band .services > p:not(.ed-eyebrow) { grid-column: auto; max-width: 620px; font-size: 16px; line-height: 1.75; }
.services-band .services .text-link { grid-column: auto; margin-top: 6px; }

/* ─── 05 Contact: the closing question on ink ───────────── */
.chapter--contact .contact { padding-block: 0; }
.chapter--contact h2 { color: var(--on-band); }
.chapter--contact h2 em { color: var(--ch-on-ink-accent); }
.chapter--contact .ed-eyebrow { color: var(--ed-on-ink-muted); }
.chapter--contact .contact-bottom { border-color: var(--on-band-line); }
.chapter--contact .contact-bottom p { color: var(--ed-on-ink-muted); font-size: 16px; }
.chapter--ink .button { background: var(--on-band); border-color: var(--on-band); color: var(--band); }
.chapter--ink .button:hover { background: color-mix(in srgb, var(--on-band) 88%, var(--band)); border-color: color-mix(in srgb, var(--on-band) 88%, var(--band)); }
.chapter--ink :focus-visible { outline-color: var(--ch-on-ink-accent); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .chapter-head { grid-template-columns: 1fr; gap: 28px; }
  .chapter-emblem { justify-self: start; width: 132px; grid-row: 1; }
  .method-preview .chapter-emblem { position: static; width: 150px; margin-bottom: 28px; }
  .case-file__body > div { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .chapter-intro, .method-preview .method-description { font-size: 16px; }
}
.chapter--contact .contact { border-top: 0; }
.services-band .services { border-bottom: 0; padding-bottom: 0; }

/* ─── Commons on the home page ───────────────────────────── */
.commons-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--foreground); }
.commons-item { position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 32px; row-gap: 8px; padding: 30px 0; border-bottom: 1px solid var(--ed-line); }
.commons-item > * { grid-column: 2; }
.commons-item .commons-tag { grid-column: 1; grid-row: 1 / span 3; align-self: start; width: fit-content; margin-top: 8px; padding: 3px 9px; border: 1px solid var(--ink); border-radius: var(--radius-sm); color: var(--ink); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.commons-tag--soon { border-style: dashed !important; border-color: var(--muted) !important; color: var(--muted) !important; }
.commons-item h3 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.1; letter-spacing: -0.03em; }
.commons-item p { max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.commons-item:not(.commons-item--live) h3 { color: var(--muted); }
.commons-item--live h3 a::after { content: ""; position: absolute; inset: 0; }
.commons-item--live:hover h3 { color: var(--ed-coral); }
.commons-item--live:has(a:focus-visible) { outline: 2px solid var(--ed-coral); outline-offset: 4px; }
.commons-item .text-link { width: fit-content; margin-top: 6px; }
.commons-all { margin-top: 34px !important; }
@media (max-width: 700px) {
  .commons-item { grid-template-columns: 1fr; }
  .commons-item > *, .commons-item .commons-tag { grid-column: 1; grid-row: auto; }
}

/* ─── Document pages (methodology, white paper) in the chapter layout ─── */
.doc-opening { padding-bottom: clamp(56px, 6vw, 88px); }
.doc-opening .chapter-head { margin-bottom: 0; }
.doc-opening h1 { font-size: clamp(54px, 6.4vw, 100px); line-height: 1.02; letter-spacing: -0.05em; }
.doc-opening h1 em { color: var(--ed-coral); }
.doc-opening .lead { max-width: 720px; margin-top: 28px; font: 500 clamp(20px, 2vw, 25px)/1.5 var(--ed-heading); }
.doc-opening .reading-tag { margin-top: 20px; }
.doc-contents { margin-top: clamp(40px, 5vw, 64px); }
.doc-contents .ed-eyebrow { margin-bottom: 14px; color: var(--muted); }
.doc-contents ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; max-width: 900px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ed-line); }
.doc-contents li { border-bottom: 1px solid var(--ed-line); }
.doc-contents a { display: block; padding: 12px 0; font-size: 15px; }
.doc-contents a:hover { color: var(--ed-coral); }
.doc-section { max-width: 820px; }
.page-editorial .doc-section h2 { margin-bottom: 26px; font-size: clamp(36px, 3.8vw, 56px); line-height: 1.1; letter-spacing: -0.04em; }
.doc-section h3 { margin: 36px 0 14px; font-size: 28px; line-height: 1.2; }
.doc-section p { margin-bottom: 20px !important; color: var(--muted); font-size: 17px; line-height: 1.85; }
.doc-section p strong { color: var(--foreground); font-weight: 600; }
.doc-section p em { font-style: italic; }
.doc-section a:not(.button):not(.text-link) { text-decoration: underline; text-underline-offset: 4px; }
.doc-section .principle-heading { margin-top: 40px; color: var(--ed-coral); font-size: 24px; }
.doc-section .pullquote { margin: 40px 0; }
.doc-section .button { margin-top: 12px; }
.chapter--stone .causal-diagram { background: var(--card-bg); }
@media (max-width: 700px) { .doc-contents ul { grid-template-columns: 1fr; } }
.chapter--commons .chapter-head { margin-bottom: clamp(40px, 5vw, 64px); }
.chapter--commons .commons-list { border-top: 0; }
.doc-section { max-width: none; }
.doc-section > * { max-width: 820px; }

/* ─── v0.5 ─────────────────────────────────────────────────── */
/* Headings use the full width available; they wrap only where the line ends. */
.chapter-head { grid-template-columns: minmax(0, 1fr) auto; }
.chapter-head h2 { max-width: 1000px; }
.case-file h3 { max-width: none; }
.services-band .services { grid-template-columns: minmax(0, 860px); }

/* Hero: the category is the headline, no buttons. */
.opening h1 { font-size: var(--type-hero-size); line-height: var(--type-hero-line); }
.opening__description { max-width: 440px; }

/* ─── v0.6 ─────────────────────────────────────────────────── */
/* Training and co-design: text and a group of figures side by side. */
.services-band .services { display: grid; grid-template-columns: minmax(0, 760px) minmax(160px, 1fr); align-items: center; gap: 48px; }
.services__text { display: grid; gap: 18px; }
.services__text .text-link { width: fit-content; margin-top: 6px; }
.services__art { justify-self: end; width: clamp(220px, 26vw, 380px); margin: 0; }
.services__art img { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .services-band .services { grid-template-columns: 1fr; }
  .services__art { justify-self: start; width: 240px; grid-row: 1; }
}
@media (max-width: 900px) {
  .chapter-head { grid-template-columns: 1fr; }
}
/* v0.7: wider group for training. */
.services__art { width: clamp(240px, 28vw, 400px); }
.services-band .services { grid-template-columns: minmax(0, 1fr) auto; }
.services__text { max-width: 760px; }
@media (max-width: 900px) { .services-band .services { grid-template-columns: 1fr; } }

/* Methodology: the section index sits under the opening, in a row, instead of a side column */
.doc-opening .document-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 10px 22px; margin-top: 36px; }
