/* AIM United · Insights (blog). Shared styles for /insights/index.html and every article.
   Colours come only from the variables that ../nav/aim-theme.js sets on <html> (light = White + Yellow,
   dark = Navy + Yellow). This file is a linked stylesheet, so the theme's colour re-mapping of inline
   <style> blocks never touches it; the fallbacks below are the light-mode values. */
@font-face { font-family: "Clash Display"; src: url("../fonts/ClashDisplay-Variable.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }

:root {
  --bg: var(--aim-bg, #ffffff); --s1: var(--aim-s1, #ffffff); --s2: var(--aim-s2, #f2f4f8);
  --fg: var(--aim-fg, #1a2449); --mute: var(--aim-mute, #76809b); --mute2: var(--aim-mute2, #48527a);
  --line: var(--aim-line, rgba(26, 36, 73, .14)); --line-s: var(--aim-line-s, rgba(26, 36, 73, .28));
  --acc: var(--aim-acc, #f9b928); --acc-ink: var(--aim-acc-ink, #1a2449); --acc-tx: var(--aim-acc-tx, #1c4076);
  --navy: #1a2449; --yellow: #f9b928; --cream: #fef1d4; --sapphire: #145dac; --teal: #0b8fa8; --gold: #bb8b1e;
  --panel: #fef1d4;              /* key takeaways box: cream on light */
  --panel-line: rgba(187, 139, 30, .35);
  --cta-bg: #1a2449; --cta-fg: #f7f6f2; --cta-mute: #b9bdcd;
  --body: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --head: "Clash Display", "Raleway", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --hdrH: 72px;
  color-scheme: light;
}
html[data-aim-mode=dark] {
  --panel: #222d57; --panel-line: rgba(249, 185, 40, .35);
  --cta-bg: #0d1225; --cta-fg: #f7f6f2; --cta-mute: #b9bdcd;
  color-scheme: dark;
}
html { background: var(--bg); scroll-padding-top: calc(var(--hdrH) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; font-variant-numeric: lining-nums; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
.label { font: 600 11px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.hrow { height: var(--hdrH); max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter); box-sizing: border-box; }
.brand { display: flex; align-items: center; min-height: 44px; text-decoration: none; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.brand .lk-w { display: none; }
html[data-aim-mode=dark] .brand .lk-w { display: block; }
html[data-aim-mode=dark] .brand .lk-n { display: none; }
.hnav { display: flex; align-items: center; gap: 6px; }
.hnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; font: 600 14px/1 var(--body); text-decoration: none; color: var(--fg); white-space: nowrap; }
.hnav a:hover { background: var(--s2); }
.hnav a[aria-current=page], .hnav a.cur { box-shadow: inset 0 -2px 0 var(--acc); border-radius: 0; }
.hnav a.talk { border: 1px solid var(--fg); background: var(--fg); color: var(--bg); margin-left: 4px; }
.hnav a.talk:hover { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.hnav .aim-thm-btn { margin: 0 2px 0 6px !important; }

/* Clash Display sets tight: keep words apart in every heading */
h1, h2, h3 { word-spacing: .07em; }
/* ---------- shared bits ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); box-sizing: border-box; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; font-size: 13px; color: var(--mute); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-s); }
.crumbs a { text-decoration: none; color: var(--mute2); }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--mute2); }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c, var(--acc)); transform: rotate(45deg); }
.c-regulation { --c: #f9b928; } .c-gigaprojects { --c: #145dac; } .c-standards { --c: #0b8fa8; }
.c-delivery { --c: #bb8b1e; } .c-operations { --c: #0b8fa8; } .c-gcc { --c: #145dac; } .c-case { --c: #f9b928; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--mute); }
.meta b { color: var(--mute2); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; box-sizing: border-box; padding: 0 22px; border-radius: 999px; font: 600 15px/1 var(--body); text-decoration: none; border: 1px solid currentColor; white-space: nowrap; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.btn.solid { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.btn.solid:hover { background: #fbd57e; border-color: #fbd57e; }
.btn svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* ---------- article ---------- */
.a-head { padding: clamp(28px, 5vw, 64px) 0 clamp(20px, 3vw, 36px); }
.a-head .crumbs { margin-bottom: 26px; }
.a-head h1 { font: 600 clamp(34px, 4.6vw, 62px)/1.05 var(--head); letter-spacing: -.01em; word-spacing: .08em; margin: 14px 0 20px; max-width: 22ch; text-wrap: balance; }
.a-head .dek { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--mute2); max-width: 62ch; margin: 0 0 22px; }
.a-hero { margin: 0 0 clamp(28px, 4vw, 48px); }
.a-hero img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 18px; background: var(--s2); }
.a-hero figcaption, .a-fig figcaption { font-size: 13px; color: var(--mute); margin-top: 10px; }
.a-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-bottom: clamp(48px, 7vw, 96px); }
@media (min-width: 1100px) { .a-grid { grid-template-columns: 240px minmax(0, 720px); justify-content: start; column-gap: clamp(64px, 8vw, 128px); } }
.toc { display: none; }
@media (min-width: 1100px) {
  .toc { display: block; position: sticky; top: calc(var(--hdrH) + 28px); align-self: start; max-height: calc(100vh - var(--hdrH) - 56px); overflow: auto; }
  .toc ol { list-style: none; margin: 14px 0 0; padding: 0; border-left: 1px solid var(--line); }
  .toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.35; color: var(--mute2); text-decoration: none; }
  .toc a:hover { color: var(--fg); }
  .toc a.on { color: var(--fg); border-left-color: var(--acc); font-weight: 600; }
}
.prose { font-size: 18px; line-height: 1.72; max-width: 70ch; }
.prose > * + * { margin-top: 1.05em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font: 600 clamp(26px, 2.6vw, 34px)/1.12 var(--head); letter-spacing: -.012em; margin: 2.1em 0 .1em; text-wrap: balance; }
.prose h3 { font: 700 19px/1.35 var(--body); margin: 1.7em 0 0; }
.prose a { color: var(--acc-tx); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--mute); }
.prose .lead { font-size: 20px; line-height: 1.6; }
.prose .def { border: 1px solid var(--line-s); border-radius: 14px; padding: 18px 20px; background: var(--s2); font-size: 17px; }
.prose .def b:first-child { display: block; font: 600 11px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.prose .note { border-left: 3px solid var(--acc); padding: 4px 0 4px 18px; color: var(--mute2); font-size: 16.5px; }
.take { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 16px; padding: 22px 24px 20px; margin: 0 0 2em; }
.take h2 { font: 700 12px/1.2 var(--body) !important; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px !important; color: var(--fg); }
.take ul { margin: 0; padding-left: 1.2em; font-size: 16.5px; line-height: 1.6; }
.take li + li { margin-top: .5em; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 560px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl th { font-weight: 700; background: var(--s2); }
.tbl tr:last-child td { border-bottom: 0; }
.a-fig img { width: 100%; border-radius: 14px; background: var(--s2); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 48px; font-weight: 700; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 24px/1 var(--body); color: var(--mute); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 16px; font-size: 16.5px; }
.cta { background: var(--cta-bg); color: var(--cta-fg); border-radius: 20px; padding: clamp(24px, 4vw, 40px); margin-top: 2.6em !important; }
.cta .label { color: var(--yellow); }
.cta h2 { margin: 10px 0 12px !important; color: var(--cta-fg); }
.cta p { color: var(--cta-mute); font-size: 17px; margin: 0 0 22px; }
.cta .row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn.ghost { color: var(--cta-fg); border-color: rgba(247, 246, 242, .4); }
.cta .btn.ghost:hover { border-color: var(--cta-fg); }
.sources { font-size: 15px; line-height: 1.55; color: var(--mute2); }
.sources ol { padding-left: 1.4em; }
.sources li + li { margin-top: .6em; }
.sources a { color: var(--acc-tx); word-break: break-word; }
.sources .src-note { font-size: 14px; color: var(--mute); }
.byline { display: flex; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 22px; font-size: 15px; color: var(--mute2); }
.byline img { width: 44px; height: 44px; border-radius: 50%; background: var(--s2); padding: 9px; box-sizing: border-box; }

/* related + cards */
.rel { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 72px) 0; }
.rel h2 { font: 600 clamp(26px, 2.6vw, 34px)/1.1 var(--head); margin: 0 0 26px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 28px 24px; list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.card .ph { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 14px; background: var(--s2); }
.card .ph, .feat .ph { position: relative; }
.card .ph img, .feat .ph img { position: absolute; inset: 0; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .ph img { transform: scale(1.04); }
.card h3 { font: 600 21px/1.2 var(--head); letter-spacing: -.005em; margin: 4px 0 0; text-wrap: balance; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card p { margin: 0; color: var(--mute2); font-size: 15.5px; line-height: 1.55; }
.card .meta { font-size: 13px; }
.card[hidden] { display: none; }

/* ---------- index ---------- */
.i-head { padding: clamp(32px, 6vw, 80px) 0 clamp(24px, 4vw, 44px); }
.i-head h1 { font: 600 clamp(40px, 6vw, 86px)/1 var(--head); letter-spacing: -.015em; word-spacing: .1em; margin: 14px 0 20px; max-width: 16ch; text-wrap: balance; }
.i-head h1 span { color: var(--mute); }
.i-head .dek { font-size: clamp(18px, 1.6vw, 21px); color: var(--mute2); max-width: 60ch; margin: 0; }
.feat { position: relative; display: grid; gap: 22px 48px; align-items: center; padding: 28px 0 clamp(40px, 6vw, 64px); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .feat { grid-template-columns: 1.25fr 1fr; } }
.feat .ph { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 18px; background: var(--s2); }
.feat .ph img { width: 100%; height: 100%; object-fit: cover; }
.feat h2 { font: 600 clamp(28px, 3.4vw, 48px)/1.04 var(--head); letter-spacing: -.015em; margin: 12px 0 14px; text-wrap: balance; }
.feat h2 a { text-decoration: none; }
.feat h2 a::after { content: ""; position: absolute; inset: 0; }
.feat h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.feat p { color: var(--mute2); font-size: 17px; margin: 0 0 16px; }
.flt { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.flt button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-s); background: transparent; color: var(--fg); font: 600 14px/1 var(--body); cursor: pointer; }
.flt button:hover { border-color: var(--fg); }
.flt button[aria-pressed=true] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.flt .n { font-weight: 500; opacity: .6; margin-left: 4px; }
.i-list { padding-bottom: clamp(48px, 7vw, 96px); }
.i-count { margin: 0 0 18px; }
.band { background: var(--cta-bg); color: var(--cta-fg); }
.band .wrap { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); display: grid; gap: 22px 48px; align-items: end; }
@media (min-width: 900px) { .band .wrap { grid-template-columns: 1.4fr 1fr; } }
.band h2 { font: 600 clamp(28px, 3.4vw, 46px)/1.05 var(--head); margin: 10px 0 12px; }
.band .label { color: var(--yellow); }
.band p { color: var(--cta-mute); margin: 0; font-size: 17px; }
.band .row { display: flex; flex-wrap: wrap; gap: 10px; }
.band .btn.ghost { color: var(--cta-fg); border-color: rgba(247, 246, 242, .4); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); }
.foot .wrap { padding-top: 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 14px 48px; color: var(--mute); font-size: 14px; }
.foot address { font-style: normal; max-width: 46ch; }
.foot .links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot .links a { text-decoration: none; color: var(--mute2); min-height: 36px; display: inline-flex; align-items: center; }
.foot .links a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --hdrH: 60px; }
  body { font-size: 16px; }
  .brand img { height: 25px; }
  .hnav { gap: 0; }
  .hnav a { padding: 0 7px; font-size: 13.5px; }
  .hnav a.talk { padding: 0 13px; margin-left: 2px; }
  .hnav .aim-thm-btn { width: 38px !important; height: 38px !important; margin: 0 2px 0 2px !important; }
  .prose { font-size: 17px; line-height: 1.68; }
  .a-hero img { aspect-ratio: 4 / 3; border-radius: 14px; }
  .take { padding: 18px 18px 16px; }
  /* Tables: no sideways scroll box on phones. Each row becomes a card; cells carry their column header (data-label, added by build.py). */
  .tbl { overflow: visible; border: 0; border-radius: 0; }
  .tbl table { min-width: 0; font-size: 15px; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbl tr { display: block; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; overflow: hidden; }
  .tbl td { display: grid; grid-template-columns: minmax(88px, 36%) minmax(0, 1fr); gap: 12px; padding: 10px 14px; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-label); font-weight: 700; font-size: 13.5px; color: var(--mute2); }
  .tbl td:first-child { display: block; font-weight: 700; background: var(--s2); }
  .tbl td:first-child::before { display: block; font-size: 12.5px; margin-bottom: 2px; }
  .tbl td[data-label=""]::before, .tbl td:not([data-label])::before { content: none; }
  .tbl td[data-label=""], .tbl td:not([data-label]) { display: block; }
  .tbl tr:last-child td { border-bottom: 1px solid var(--line); }
  .tbl tr td:last-child { border-bottom: 0; }
}
@media (max-width: 359px) {
  .hnav a.svc { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
