/* CIJ — Children's International Journal · Emergent-matched design system
   White/blue palette, all sans-serif, hairline borders, airy spacing. */
:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-deep: #1E40AF;
  --ink: #0F172A;
  --body: #475569;
  --muted: #64748B;
  --line: #E2E8F0;
  --band: #F8FAFC;
  --tint: #EFF6FF;
  --tint-line: #BFDBFE;
  --navy: #020617;
  --footer-muted: #94A3B8;
  --footer-link: #E2E8F0;
  --amber-bg: #FFFBEB;
  --amber-text: #92400E;
  --amber-line: #FDE68A;
  --warn: #C2410C;
  --error-bg: #FEF2F2;
  --error-line: #FECACA;
  --error-text: #991B1B;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: #ffffff;
  font-size: 16.5px;
  line-height: 1.65;
  overflow-x: hidden;
}
body.page-pale { background: var(--band); }

h1, h2, h3, h4 { color: var(--ink); font-weight: 750; line-height: 1.2; letter-spacing: -0.015em; margin: 0.5em 0 0.45em; }
h1 { font-size: 2.35rem; font-weight: 800; }
h2 { font-size: 1.7rem; font-weight: 800; margin-top: 0.2em; }
h3 { font-size: 1.08rem; }
p { margin: 0.55em 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
strong { color: var(--ink); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-bottom: 56px; }

/* full-bleed bands inside the centred container */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.bleed-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 700; color: var(--blue); margin: 0 0 10px;
}
.section { padding: 44px 0 8px; }
.section-lede { max-width: 52em; }
.band { background: var(--band); padding-top: 48px; padding-bottom: 52px; margin-top: 44px; }

/* pills */
.pill {
  display: inline-flex; align-items: center; padding: 4px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; border: 1px solid; white-space: nowrap;
}
.pill-blue { background: var(--tint); color: var(--blue); border-color: var(--tint-line); }
.pill-amber { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-line); }
.stage-badge { /* legacy alias — amber founding pill */
  display: inline-flex; padding: 4px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-line);
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 60; background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { flex: 0 0 auto; display: block; width: 42px; height: 42px; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.06rem; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.brand-tag { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: 8px; }
.main-nav a { color: var(--body); text-decoration: none; font-size: 0.95rem; font-weight: 550; }
.main-nav a:hover { color: var(--blue); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 8px; text-decoration: none;
  font-weight: 600; border: 1px solid transparent; cursor: pointer; font-size: 1rem;
  font-family: inherit; line-height: 1.3; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 0.92rem; }
.btn-primary { background: var(--blue); color: #ffffff; }
.btn-primary:hover { background: var(--blue-dark); color: #ffffff; }
.btn-secondary { background: #ffffff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--band); color: var(--ink); border-color: #CBD5E1; }
.btn-light { background: #ffffff; color: var(--blue-deep); }
.btn-light:hover { background: var(--tint); color: var(--blue-deep); }

/* hero */
.hero {
  background: linear-gradient(180deg, var(--tint) 0%, #ffffff 88%);
  padding: 56px 0 30px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.hero h1 { font-size: 3.4rem; line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 18px; }
.hero h1 .accent { color: var(--blue); }
.lede { font-size: 1.16rem; color: var(--body); max-width: 34em; margin: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 4px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.ticks li { display: flex; align-items: center; gap: 8px; font-size: 0.94rem; font-weight: 550; color: var(--ink); }
.ticks svg { flex: 0 0 auto; }

.hero-media {
  position: relative; border-radius: 20px; overflow: hidden; min-height: 460px;
  background: linear-gradient(155deg, #7DD3FC 0%, var(--blue) 52%, #0F766E 130%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.quote-card {
  position: absolute; left: 20px; right: 20px; bottom: 20px;
  background: #ffffff; border-radius: 14px; padding: 16px 20px 14px;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.22);
}
.quote-card .eyebrow { margin-bottom: 5px; }
.quote-card .quote { margin: 0; color: var(--ink); font-size: 1.02rem; line-height: 1.5; font-weight: 550; }

/* built-for strip */
.audience-strip {
  list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 12px 34px;
}
.audience-strip li {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}

/* mission */
.mission { text-align: center; }
.mission .eyebrow { text-align: center; }
.mission-statement {
  font-size: 1.32rem; line-height: 1.6; color: var(--ink); font-weight: 500;
  max-width: 46em; margin: 6px auto 0;
}

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin: 18px 0; }
.card {
  background: #ffffff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px;
}
.card h3 { margin-top: 0; }
.card p { margin: 0.3em 0; }
.card .big { font-size: 1.7rem; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }

.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px;
  background: var(--tint); color: var(--blue);
}
.tint-blue { background: #DBEAFE; color: #2563EB; }
.tint-green { background: #DCFCE7; color: #16A34A; }
.tint-rose { background: #FFE4E6; color: #E11D48; }
.tint-indigo { background: #E0E7FF; color: #4F46E5; }
.tint-amber { background: #FEF3C7; color: #D97706; }
.tint-teal { background: #CCFBF1; color: #0D9488; }
.tint-violet { background: #EDE9FE; color: #7C3AED; }
.tint-pink { background: #FCE7F3; color: #DB2777; }

.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 20px; }
.areas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 20px; }
.why-card p, .area-card p { color: var(--body); font-size: 0.97rem; }

/* founding programme stepper */
.step-cards { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; }
.step-card {
  position: relative; flex: 1 1 150px; background: #ffffff; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px;
}
.step-card::after {
  content: "›"; position: absolute; right: -19px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 700; color: #94A3B8;
}
.step-card:last-child::after { content: none; }
.step-card h3 { font-size: 0.99rem; margin: 10px 0 4px; }
.step-card p { font-size: 0.9rem; margin: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #ffffff;
  font-weight: 700; font-size: 0.95rem;
}

/* journal steps (numbered list) */
.steps { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 12px; }
.steps li {
  display: flex; gap: 16px; align-items: flex-start; background: #ffffff;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px;
}
.steps h3 { margin: 0 0 2px; }
.steps p { margin: 0; }

.cta-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.cta-card p { color: var(--body); }

/* index teaser */
.teaser {
  background: var(--tint); border: 1px solid var(--tint-line); border-radius: 16px;
  padding: 30px 34px; margin-top: 48px;
}
.teaser h2 { margin-top: 10px; }
.teaser p { max-width: 52em; }

/* founding council roles */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-top: 20px; }
.role-card p { color: var(--body); font-size: 0.96rem; }
.role-status {
  display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
}

/* research alerts panel */
.alerts-panel {
  background: linear-gradient(120deg, var(--blue) 0%, var(--blue-deep) 100%);
  padding: 48px 0 52px; margin-top: 56px; color: #DBEAFE;
}
.alerts-panel h2 { color: #ffffff; margin-top: 0; }
.alerts-panel p { color: #DBEAFE; max-width: 46em; }
.alerts-form { margin-top: 20px; }
.alerts-panel .alerts-form label { color: #ffffff; }

/* forms */
.stack-form { display: flex; flex-direction: column; gap: 15px; max-width: 660px; margin-top: 18px; }
.stack-form.narrow { max-width: 380px; }
.stack-form label, .inline-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.stack-form .hint { font-weight: normal; color: var(--muted); font-size: 0.85rem; }
.stack-form label.checkbox-row { flex-direction: row; align-items: flex-start; gap: 10px; }
.stack-form label.checkbox-row input[type="checkbox"] { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--blue); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.scorecard-list { list-style: none; margin: 6px 0 0; padding: 0; }
.scorecard-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.scorecard-list li:last-child { border-bottom: 0; }
input, select, textarea {
  font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid #CBD5E1;
  border-radius: 8px; background: #ffffff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #DBEAFE;
}
.inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.inline-form label { min-width: 210px; flex: 1; }
.inline-form .btn { flex: 0 0 auto; }
.form-errors {
  background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-text);
  border-radius: 12px; padding: 12px 20px; max-width: 660px;
}
.form-errors p { color: var(--error-text); font-weight: 600; }

/* callouts */
.note {
  background: var(--tint); border: 1px solid var(--tint-line); color: #1E3A8A;
  border-radius: 12px; padding: 13px 18px;
}
.note strong { color: #1E3A8A; }
.note-warn { background: #FFF7ED; border-color: #FDBA74; color: var(--warn); }
.note-warn strong { color: var(--warn); }
.prov-status { color: var(--warn); font-weight: 600; }

/* tables */
table { border-collapse: collapse; width: 100%; margin: 16px 0 26px; background: #ffffff; font-size: 0.96rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--band); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }

/* chat */
.chat { border: 1px solid var(--line); border-radius: 16px; background: #ffffff; overflow: hidden; margin-top: 18px; }
.chat-log { padding: 20px; min-height: 230px; max-height: 480px; overflow-y: auto; }
.chat-msg { margin-bottom: 16px; }
.chat-msg p { margin: 2px 0; white-space: pre-wrap; color: var(--body); }
.chat-msg strong { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.chat-msg.user strong { color: var(--blue); }
.chat-msg.assistant strong { color: var(--blue-deep); }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--band); }
.chat-form input { flex: 1; }

/* footer */
.site-footer { background: var(--navy); color: var(--footer-muted); padding: 52px 0 0; margin-top: 0; font-size: 0.94rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand { color: #ffffff; font-weight: 800; font-size: 1.05rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.footer-about p { margin: 0; max-width: 26em; }
.footer-col h4 {
  color: var(--footer-muted); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; margin: 4px 0 14px;
}
.footer-col a { display: block; color: var(--footer-link); text-decoration: none; padding: 4px 0; font-size: 0.94rem; }
.footer-col a:hover { color: #ffffff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(148, 163, 184, 0.25); margin-top: 40px; padding-top: 18px; padding-bottom: 22px; }
.disclaimer { font-size: 0.85rem; color: var(--footer-muted); margin: 0; }

code { background: var(--tint); border-radius: 5px; padding: 1px 6px; font-size: 0.9em; color: var(--blue-deep); }

/* responsive */
@media (max-width: 1020px) {
  .why-grid, .areas-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-media { min-height: 380px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hero { padding: 38px 0 10px; }
  .hero h1 { font-size: 2.4rem; }
  h1 { font-size: 1.9rem; }
  .step-card::after { content: none; }
  .cta-cards { grid-template-columns: 1fr; }
  .header-actions { margin-left: 0; }
  .main-nav { margin-left: 0; }
  .chat-form { flex-direction: column; }
  table { font-size: 0.86rem; }
  th, td { padding: 7px 8px; }
  .teaser { padding: 24px 22px; }
}
@media (max-width: 520px) {
  .why-grid, .areas-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero-media { min-height: 320px; }
}

/* header polish: keep the full header on one row down to ~1100px (laptops)
   instead of wrapping to a second row around 1280px */
@media (max-width: 1280px) {
  .brand-tag { display: none; }
  .header-inner { gap: 8px 18px; padding-top: 10px; padding-bottom: 10px; }
  .main-nav { gap: 4px 12px; margin-left: 4px; }
  .main-nav a { font-size: 0.9rem; }
}

/* ==== UX polish: mobile-first pass ====
   Scrollable table wrapper: on wide screens it is invisible (the table
   simply fills it); on phones the table scrolls inside it instead of
   pushing the whole page sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 26px; }
.table-scroll table { margin: 0; }

/* visible keyboard focus for links, buttons and selects (inputs keep
   their existing focus ring) */
a:focus-visible, .btn:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid #93C5FD; outline-offset: 2px;
}

/* integrity hub cards: the whole card is the tap target, not just its title */
.cards .card { position: relative; }
.cards .card h3 a::after { content: ""; position: absolute; inset: 0; }
.cards .card:hover { border-color: var(--tint-line); }

@media (max-width: 860px) {
  /* header becomes three compact rows — brand, a full-width pair of
     CTAs, then one scrollable nav row — and stops being sticky, so it
     no longer eats a third of a phone screen while reading */
  .site-header { position: static; }
  .header-inner { gap: 10px 14px; padding-top: 10px; padding-bottom: 12px; }
  .brand { padding: 3px 0; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-name { font-size: 1.02rem; }
  .header-actions { order: 2; flex: 1 1 100%; margin-left: 0; gap: 10px; }
  .header-actions .btn {
    flex: 1 1 0; min-height: 46px; display: inline-flex;
    align-items: center; justify-content: center; text-align: center;
  }
  .main-nav {
    order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin-left: 0;
    gap: 2px; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 11px 10px; white-space: nowrap; border-radius: 8px; font-size: 0.95rem; }
  .main-nav a:active { background: var(--tint); }

  /* tap targets and form comfort */
  input, select, textarea { padding: 12px; }
  .btn { min-height: 46px; }
  .footer-col a { padding: 10px 0; }
}

@media (max-width: 720px) {
  .wrap, .bleed-inner { padding-left: 18px; padding-right: 18px; }
  .section { padding: 36px 0 6px; }
  .band { padding-top: 40px; padding-bottom: 44px; margin-top: 36px; }
  .card { padding: 18px; }
  .steps li { padding: 14px 16px; }

  /* stacked, full-width inline forms (research alerts) */
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form label { min-width: 0; }

  /* data tables keep their natural width and scroll inside the wrapper;
     the first column stays pinned (on ranking tables the country column
     is pinned too, with a fixed-width rank column so the offset is exact) */
  .data-table { min-width: max-content; font-size: 0.92rem; border-collapse: separate; border-spacing: 0; }
  .data-table th, .data-table td { padding: 11px 12px; }
  .data-table th:first-child, .data-table td:first-child {
    position: sticky; left: 0; z-index: 2; background: #ffffff;
  }
  .data-table thead th:first-child { background: var(--band); z-index: 3; }
  .rank-table th:first-child, .rank-table td:first-child { width: 54px; min-width: 54px; }
  .rank-table th:nth-child(2), .rank-table td:nth-child(2) {
    position: sticky; left: 54px; z-index: 2; background: #ffffff;
    box-shadow: 10px 0 10px -10px rgba(15, 23, 42, 0.35);
  }
  .rank-table thead th:nth-child(2) { background: var(--band); z-index: 3; }
  /* country links fill their whole cell, so the row is one big tap target */
  .rank-table td:nth-child(2) a { display: block; margin: -11px -12px; padding: 11px 12px; }
}

/* Country search on the Index rankings */
.country-search { margin: 12px 0 4px; }
.country-search input[type="search"] { width: 100%; max-width: 420px; min-height: 44px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
