/* =========================================================
   Component library
   Reusable building blocks for new pages. Load after main.css.
   See /styleguide.html for every component with copy-paste markup.

   Everything here builds on the tokens in main.css (:root):
     colour   --accent  --black  --white  --white-10  --white-20
     type     --font-sans (Eina 01)  --font-mono (IBM Plex Mono)
     space    --gutter (20px)  --section-gap (200px)
     shape    --radius (6px)   motion --ease-out
   and on the global components already in main.css:
     .mono  .btn-blur  .btn-outline  .btn-pill  .link-arrow  .section
     .project (card)  .work-grid  .ticker-box--cta  [data-reveal]

   New blocks are prefixed c- so they never clash with page CSS.
   Values match the existing pages (sector, case study, article),
   so a new page looks like it was always part of the site.
   ========================================================= */

:root {
  --c-col: 690px;        /* reading column */
  --c-gap: 200px;        /* space between blocks in a .c-stack */
  --c-gap-sm: 100px;     /* .c-stack--tight */
}

/* ---------- Animated heading lines (split by components.js) ---------- */
[data-lines] { display: flow-root; }
[data-lines] .line { display: block; overflow: hidden; padding: .16em .08em .26em; margin: -.16em -.08em -.26em; }
[data-lines] .line + .line { margin-top: -.42em; }
[data-lines] .line__inner { display: block; will-change: transform, opacity; }
html.js .c-page-head__title { visibility: hidden; }
html.js .page-c [data-fade] { opacity: 0; }

/* =========================================================
   LAYOUT
   ========================================================= */

/* Vertical rhythm: every direct child gets the section gap above it */
.c-stack { display: flex; flex-direction: column; }
.c-stack > * + * { margin-top: var(--c-gap); }
.c-stack--tight > * + * { margin-top: var(--c-gap-sm); }
.c-stack--center { align-items: center; }
.c-stack--center > * { max-width: 100%; }

/* Centred 690px reading column (Figma body width) */
.c-col { width: min(var(--c-col), 100%); margin-inline: auto; }
.c-col--center { text-align: center; }
.c-wide { width: 100%; }

/* Equal-width grids, 20px gutter */
.c-grid { display: grid; gap: var(--gutter); grid-template-columns: repeat(var(--c-cols, 2), minmax(0, 1fr)); }
.c-grid--2 { --c-cols: 2; row-gap: 100px; }   /* same as .work-grid */
.c-grid--3 { --c-cols: 3; row-gap: 60px; }
.c-grid--4 { --c-cols: 4; row-gap: 50px; }
.c-grid--4 .project__media { aspect-ratio: 335 / 188; }   /* small project cards, as on case studies */

/* Two columns: text beside media, or two text blocks */
.c-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); align-items: center; }
.c-split--top { align-items: start; }
.c-split__text { display: flex; flex-direction: column; gap: 30px; padding-right: 10%; }

/* =========================================================
   PAGE HEAD — centred title, optional intro, jump links, hero media
   ========================================================= */
.c-page-head { position: relative; padding: 236px 20px 0; }
.c-page-head .hero__bar { position: absolute; }
.c-page-head__inner { display: flex; flex-direction: column; align-items: center; gap: 50px; text-align: center; }
.c-page-head__title {
  margin: 0; max-width: 1212px;
  font-weight: 600; font-size: clamp(48px, 6.25vw, 90px); line-height: 1; letter-spacing: -0.03em;
}
.c-page-head--article .c-page-head__title { font-size: clamp(36px, 4.17vw, 60px); line-height: 1.1; }
.c-page-head__intro { max-width: var(--c-col); font-size: 17px; line-height: 1.4; }
.c-page-head__intro p { margin: 0; }
.c-page-head__intro p + p { margin-top: 18px; }
.c-page-head__jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.c-page-head__jump .icon-down { width: 8px; height: 8px; opacity: .5; color: var(--white); transition: color .3s, opacity .3s; }
.c-page-head__jump .mono { transition: color .3s, opacity .3s; }
.c-page-head__jump a:hover .mono, .c-page-head__jump a:hover .icon-down { color: var(--accent); opacity: 1; }
.c-page-head__media {
  margin: 200px 0 0; position: relative; overflow: hidden;
  aspect-ratio: 1400 / 787.5; border-radius: var(--radius); background: #111;
}
.c-page-head__media img, .c-page-head__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06); will-change: transform;
}

/* =========================================================
   TYPE
   ========================================================= */
.c-h2 { margin: 0; font-weight: 600; font-size: 30px; line-height: 1.2; }
.c-h3 { margin: 0; font-weight: 600; font-size: 22px; line-height: 1.3; }
.c-display { margin: 0; font-weight: 600; font-size: clamp(36px, 4.17vw, 60px); line-height: 1.1; letter-spacing: -0.03em; }
.c-lead { margin: 0; font-weight: 600; font-size: 22px; line-height: 1.3; }
.c-text { margin: 0; font-size: 18px; line-height: 1.3; }
.c-text--small { font-size: 16px; line-height: 1.4; }
.c-label { font-family: var(--font-mono); font-size: 12px; line-height: 1.4; letter-spacing: 1.2px; text-transform: uppercase; opacity: .5; }
.c-green { color: var(--accent); }

/* Intro block: semibold lead, then body paragraphs (sector pages) */
.c-intro > * { margin: 0; }
.c-intro > * + * { margin-top: 30px; font-size: 18px; line-height: 1.3; }
.c-intro > :first-child { font-weight: 600; font-size: 22px; line-height: 1.3; }

/* Long-form text: articles, policies, any rich copy */
.c-prose { font-size: 18px; line-height: 1.3; }
.c-prose > * { margin: 0 0 22px; }
.c-prose > :last-child { margin-bottom: 0; }
.c-prose h2 { font-weight: 600; font-size: 30px; line-height: 1.3; margin-top: 44px; }
.c-prose h3 { font-weight: 600; font-size: 22px; line-height: 1.3; margin-top: 34px; }
.c-prose ul, .c-prose ol { padding-left: 27px; }
.c-prose ul { list-style: disc; }
.c-prose ol { list-style: decimal; }
.c-prose li + li { margin-top: 10px; }
.c-prose li::marker { color: var(--accent); }
.c-prose strong { font-weight: 600; }

/* Inline text link: white, green underline */
.c-link, .c-prose a, .c-intro a {
  color: var(--white); text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1px; text-underline-offset: .18em;
  transition: color .3s ease, text-decoration-thickness .3s ease;
}
.c-link:hover, .c-prose a:hover, .c-intro a:hover { color: var(--accent); text-decoration-thickness: 2px; }

/* Bullet list with green markers */
.c-list { margin: 0; padding-left: 1.1em; list-style: disc outside; font-size: 17px; line-height: 1.4; }
.c-list li + li { margin-top: .5em; }
.c-list li::marker { color: var(--accent); }

/* =========================================================
   MEDIA
   ========================================================= */
.c-media {
  position: relative; margin: 0; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9; border-radius: var(--radius); background: #111;
}
.c-media > img, .c-media > video, .c-media > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0;
}
.c-media[data-parallax] > img, .c-media[data-parallax] > video { transform: scale(1.06); will-change: transform; }
.c-media--wide { aspect-ratio: 1400 / 787.5; }
.c-media--square { aspect-ratio: 1 / 1; }
.c-media--portrait { aspect-ratio: 4 / 5; }
.c-media--auto { aspect-ratio: auto; }
.c-media--auto > img, .c-media--auto > video { position: relative; height: auto; }

.c-caption { margin-top: 14px; }

/* Two pieces side by side (case-study gallery pair) */
.c-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); align-items: start; }

/* =========================================================
   CONTENT BLOCKS
   ========================================================= */

/* Label / value fields in a row (case-study info) */
.c-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 50px 75px; }
.c-field { display: flex; flex-direction: column; gap: 20px; }
.c-field__value { margin: 0; font-size: 17px; line-height: 1.4; }

/* Numbered tiles that fill green on hover (sector challenges, about tiles) */
.c-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--c-cols, 4), minmax(0, 1fr)); gap: 20px; }
.c-tiles--3 { --c-cols: 3; }
.c-tiles--2 { --c-cols: 2; }
.c-tile {
  position: relative; isolation: isolate; min-height: 300px; padding: 20px;
  border-radius: var(--radius); background: var(--white-10);
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  outline: none; transition: color .4s ease;
}
.c-tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--radius);
  background: var(--accent); opacity: 0; transition: opacity .4s var(--ease-out);
}
.c-tiles:not(.c-tiles--2):not(.c-tiles--3) .c-tile { aspect-ratio: 1 / 1; }   /* square, as on the sector pages */
.c-tile__num { color: var(--accent); transition: color .4s ease; }
.c-tile__title { margin: 0; font-weight: 600; font-size: clamp(22px, 2.08vw, 30px); line-height: 1.2; }
.c-tile__text { margin: 0; font-size: 16px; line-height: 1.4; }
.c-tile:hover, .c-tile:focus-visible, .c-tile:focus-within { color: var(--black); }
.c-tile:hover::before, .c-tile:focus-visible::before, .c-tile:focus-within::before { opacity: 1; }
.c-tile:hover .c-tile__num, .c-tile:focus-visible .c-tile__num { color: var(--black); }

/* Quote / testimonial */
.c-quote { position: relative; padding-top: 20px; }
.c-quote::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--white-20); }
.c-quote__body { margin: 0 auto; width: min(var(--c-col), 100%); padding-top: 70px; display: flex; flex-direction: column; gap: 40px; }
.c-quote__text { margin: 0; font-weight: 600; font-size: 25px; line-height: 1.4; }
.c-quote__by { display: flex; align-items: center; gap: 10px; }
.c-quote__avatar {
  width: 60px; height: 60px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--accent); color: var(--black);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.2px;
}
.c-quote__avatar img { width: 100%; height: 100%; object-fit: cover; }
.c-quote__who { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-mono); font-size: 12px; line-height: 1.2; letter-spacing: 1.2px; text-transform: uppercase; }
.c-quote__role { opacity: .5; }

/* Accordion (FAQs, challenge / idea / outcome) — behaviour in components.js */
.c-accordion { display: flex; flex-direction: column; gap: 10px; }
.c-acc { border-radius: var(--radius); background: var(--white-10); transition: background-color .4s ease; }
.c-acc:hover { background: rgba(255, 255, 255, 0.13); }
.c-acc__head { margin: 0; font: inherit; }
.c-acc__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 15px 20px; text-align: left; color: var(--white);
  font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.2;
}
.c-acc__btn:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; border-radius: var(--radius); }
.c-acc__icon {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--white); color: var(--black); display: grid; place-items: center;
  transition: transform .45s var(--ease-out), background-color .3s ease;
}
.c-acc__btn:hover .c-acc__icon { background: var(--accent); }
.c-acc.is-open .c-acc__icon { transform: rotate(45deg); }
.c-acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.c-acc.is-open .c-acc__panel { grid-template-rows: 1fr; }
.c-acc__inner { min-height: 0; overflow: hidden; }
.c-acc__body { display: flex; flex-direction: column; gap: 18px; padding: 3px 20px 30px; font-size: 17px; line-height: 1.4; }
.c-acc__body > * { margin: 0; opacity: 0; transition: opacity .35s ease; }
.c-acc.is-open .c-acc__body > * { opacity: 1; transition-delay: .12s; }

/* Row of large pill links (sector "explore" links) */
.c-links { display: grid; grid-template-columns: repeat(var(--c-cols, 3), minmax(0, 1fr)); gap: 20px; }
.c-links .btn-pill { width: 100%; }

/* Row of buttons / arrow links */
.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 30px; }
.c-col--center .c-actions, .c-actions--center { justify-content: center; }

/* Ruled section heading with a mono label (same look as .section, no JS needed) */
.c-rule { position: relative; padding-top: 20px; }
.c-rule::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--white-20); }

/* =========================================================
   RESPONSIVE (same breakpoints as the existing pages)
   ========================================================= */
@media (max-width: 1180px) {
  .c-grid--4 { --c-cols: 2; }
  .c-tiles { --c-cols: 2; }
}
@media (max-width: 760px) {
  :root { --c-gap: 120px; --c-gap-sm: 60px; }
  .c-page-head { padding-top: 140px; }
  .c-page-head__media { margin-top: 100px; }
  .c-grid, .c-grid--3, .c-grid--4, .c-tiles, .c-links { --c-cols: 1; }
  .c-grid--2 { row-gap: 60px; }
  .c-split, .c-pair { grid-template-columns: 1fr; }
  .c-split__text { padding-right: 0; }
  .c-tile, .c-tiles .c-tile { min-height: 220px; aspect-ratio: auto !important; }
  .c-quote__text { font-size: 20px; }
  .c-quote__body { padding-top: 40px; }
  .c-acc__btn { font-size: 18px; }
}
