/* ============================================================
   Small ISLAND Initiative — brochure styles
   Document-formal, mirrors the typographic conventions of
   juliettemchardy.com (Heliotrope, small-caps H2, dotted rules).
   Falls back gracefully to Georgia if Heliotrope is absent.
   ============================================================ */

@font-face {
  font-family: heliotrope;
  src: url('/fonts/heliotrope_ot_3_book.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: heliotrope;
  src: url('/fonts/heliotrope_ot_3_book_italic.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: heliotrope;
  src: url('/fonts/heliotrope_ot_6_semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: heliotrope;
  src: url('/fonts/heliotrope_ot_6_semibold_italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --link-color: #003D6B;          /* WHO dark blue (page chrome) */
  --accent-color: #003D6B;        /* WHO dark blue (page chrome) */
  --accent-soft: #5b8eb5;
  --body-text-color: #333;
  --hover-color: #e6eef5;         /* light WHO-blue tint */
  --page-bg: #ffffff;             /* white */
  --rule: #000;
  --rule-soft: #888;
  /* Regional identity — same hue families as the chart REGION_COLORS pastels
     in sids_viz/style.py, darkened for legibility as marker squares and
     heading text. CAO = pink/coral family, PIO = blue family. */
  --cao-mark: #b86564;            /* deeper Caribbean coral */
  --cao-h3:   #a04848;            /* heading text */
  --cao-tint: #f7e8e8;            /* very pale background tint */
  --pio-mark: #4f7eaa;            /* deeper Pacific blue */
  --pio-h3:   #2c5f8a;            /* heading text */
  --pio-tint: #e7eff6;            /* very pale background tint */
  --paragraph-space: 1rem;
}

* {
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  text-decoration: inherit;
  color: inherit;
}

html, body { height: 100%; }

html {
  font-size: min(22px, max(16px, 2.2vw));
  background: var(--page-bg);
}

body {
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
  -webkit-font-smoothing: subpixel-antialiased;
}

main, nav.top, nav.bottom {
  position: relative;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  margin-left: 8rem;
  margin-right: 4rem;
  font-family: heliotrope, Georgia, serif;
  color: var(--body-text-color);
  line-height: 1.38;
  border-bottom: 1px solid var(--rule);
}

main {
  padding-bottom: 0.5rem;
}

p, li, h1, h2, h3, h4, h5, h6 {
  margin-bottom: var(--paragraph-space);
}

li { margin-left: 1rem; padding-left: 0.5rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: background 0.1s;
}
a:hover { background: var(--hover-color); }
a.ref { font-variant-caps: all-small-caps; }
a.external { color: var(--accent-color); }

h1, h2, h3, h4, h5, h6 { font-weight: bolder; }

h1 {
  font-size: 180%;
  font-weight: 600;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 2px;
  line-height: 1.2;
  color: var(--accent-color);
}

h2 {
  font-variant-caps: all-small-caps;
  font-size: 110%;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 0.2rem;
  letter-spacing: 0.02em;
}

h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 100%;
  font-weight: 600;
}

/* ---------- Top nav (document chrome) ---------- */
nav.top {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-variant-caps: all-small-caps;
  padding-bottom: 0.3rem;
  display: flex;
  flex-flow: row wrap;
  align-items: baseline;
  gap: 0 1rem;
  line-height: 1.4;
}
nav.top .home { font-weight: 600; }
nav.top .sep { color: var(--rule-soft); }
nav.top a { display: inline-block; padding: 0 0.15rem; }

/* ---------- Lede + subtitle ---------- */
p.subtitle {
  font-style: italic;
  font-size: 105%;
  margin-top: 0.6rem;
  margin-bottom: 1.5rem;
  color: #444;
}

p.lede {
  font-size: 105%;
  margin-bottom: 1.5rem;
}

/* ---------- Figures (EK-style: full width within column, italic caption) ---------- */
figure { margin: 1.5rem 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
}
figure figcaption {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 90%;
  color: #555;
}

/* ---------- Dual-branch region pair ---------- */
.region-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}
.region-pair .branch {
  padding-top: 0.5rem;
  border-top: 2px solid transparent; /* coloured per region below */
}
.region-pair .branch.cao { border-top-color: var(--cao-mark); }
.region-pair .branch.pio { border-top-color: var(--pio-mark); }

.region-pair .branch h3 {
  font-variant-caps: all-small-caps;
  font-size: 105%;
  margin-top: 0;
  letter-spacing: 0.02em;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 0.2rem;
}
.region-pair .branch.cao h3 { color: var(--cao-h3); }
.region-pair .branch.pio h3 { color: var(--pio-h3); }

.region-pair .branch.cao h3::before {
  content: "";
  display: inline-block;
  width: 0.6em; height: 0.6em;
  background: var(--cao-mark);
  margin-right: 0.5em; vertical-align: middle;
}
.region-pair .branch.pio h3::before {
  content: "";
  display: inline-block;
  width: 0.6em; height: 0.6em;
  background: var(--pio-mark);
  margin-right: 0.5em; vertical-align: middle;
}
.region-pair .branch ul.facts {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
}
.region-pair .branch ul.facts li {
  margin: 0; padding: 0.4rem 0;
  border-bottom: 1px dotted #ccc;
}
.region-pair .branch ul.facts li:last-child { border-bottom: 0; }
.region-pair .branch ul.facts li .lbl {
  display: block;
  font-variant-caps: all-small-caps;
  font-size: 80%;
  color: #666;
}
.region-pair .branch ul.facts li .val {
  display: block;
  font-size: 95%;
}
.region-pair .branch figure { margin: 0.75rem 0; }

/* ---------- Action areas as a clean numbered list ---------- */
ol.actions {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  counter-reset: act;
}
ol.actions > li {
  counter-increment: act;
  padding: 0.85rem 0 0.85rem 2.4rem;
  border-bottom: 1px dotted var(--rule);
  position: relative;
  margin: 0;
}
ol.actions > li:first-child { border-top: 1px dotted var(--rule); }
ol.actions > li::before {
  content: counter(act, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0.85rem;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  color: var(--accent-color);
  font-size: 95%;
}
ol.actions > li h3 {
  display: inline;
  font-weight: 600;
  margin: 0;
}
ol.actions > li p {
  margin: 0.3rem 0 0;
  font-size: 95%;
}

/* ---------- Budget table (document-style) ---------- */
table.budget {
  margin: 1rem 0 1.5rem;
  border-collapse: collapse;
  width: 100%;
}
table.budget th, table.budget td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px dotted var(--rule);
  font-size: 95%;
}
table.budget th {
  font-variant-caps: all-small-caps;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
table.budget td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.budget tr.total td {
  font-weight: 600;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ---------- PDF card (right-floated, EK style) ---------- */
div.pdf-card {
  display: flex;
  flex-flow: column nowrap;
  float: right;
  width: 32%;
  margin-left: 1.25rem;
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  hyphens: none;
  font-variant-caps: all-small-caps;
  font-style: normal;
  padding: 0.85rem 1rem;
  line-height: 1.25;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  background: rgb(246, 247, 249);
}
div.pdf-card .title {
  font-variant-caps: normal;
  font-size: 95%;
  font-weight: 600;
}
div.pdf-card .meta {
  font-size: 78%;
  color: #666;
}
div.pdf-card a {
  display: block;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(0,0,0,0);
  font-weight: 600;
}
div.pdf-card a:hover {
  border-color: #ccc;
  background: var(--hover-color);
}

/* ---------- Boxed text (key stats / callouts) ---------- */
div.boxed-text {
  border: 1px solid var(--rule);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  background: #f0f0f0;
}
div.boxed-text p:last-child { margin-bottom: 0; }
div.boxed-text .label {
  display: block;
  font-variant-caps: all-small-caps;
  font-size: 80%;
  color: #555;
  margin-bottom: 0.2rem;
}

/* ---------- Stat strip (under the title) ---------- */
.stat-strip {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat-strip li { margin: 0; padding: 0; list-style: none; }
.stat-strip .stat-num {
  display: block;
  font-size: 140%;
  font-weight: 600;
  line-height: 1.05;
  color: var(--accent-color);
}
.stat-strip .stat-lbl {
  display: block;
  font-variant-caps: all-small-caps;
  font-size: 78%;
  color: #555;
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ---------- Pull-quote (used for the Bridgetown / Political Declaration moment) ---------- */
blockquote.longform {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent-color);
  font-style: italic;
  color: #444;
}
blockquote.longform p { margin-bottom: 0.75rem; }
blockquote.longform p:last-child { margin-bottom: 0; }
blockquote.longform .attribution {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-variant-caps: all-small-caps;
  font-size: 85%;
  color: #666;
}

/* ---------- Form (document-style) ---------- */
form.eoi {
  margin: 1rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}
form.eoi .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
form.eoi label {
  display: block;
  font-size: 95%;
}
form.eoi label > .lbl {
  display: block;
  font-variant-caps: all-small-caps;
  font-size: 80%;
  color: #555;
  margin-bottom: 0.2rem;
}
form.eoi input[type="text"],
form.eoi input[type="email"],
form.eoi textarea {
  width: 100%;
  font-family: inherit;
  font-size: 100%;
  background: #fff;
  border: 1px solid #999;
  padding: 0.4rem 0.5rem;
  color: var(--body-text-color);
  line-height: 1.4;
}
form.eoi input:focus, form.eoi textarea:focus {
  outline: 1px solid var(--accent-color); outline-offset: 0;
  border-color: var(--accent-color);
}
form.eoi fieldset {
  border: 1px solid #ccc;
  padding: 0.5rem 0.75rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
}
form.eoi legend {
  font-variant-caps: all-small-caps;
  font-size: 80%;
  color: #555;
  padding: 0 0.3rem;
}
form.eoi .check {
  display: block;
  margin: 0.25rem 0;
  font-size: 95%;
}
form.eoi .check input { margin-right: 0.4rem; }
form.eoi .actions {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
form.eoi button {
  font-family: inherit;
  font-size: 100%;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border: 1px solid var(--rule);
  background: #fff;
  cursor: pointer;
  letter-spacing: 0.02em;
}
form.eoi button:hover { background: var(--hover-color); }
form.eoi .fallback { font-size: 85%; color: #666; }

/* ---------- Sign-off ---------- */
.sig {
  text-align: right;
  font-variant-caps: all-small-caps;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  margin-right: 0.5rem;
}
.sig::before { content: "— "; }

/* ---------- Footer ---------- */
footer.meta {
  margin: 1rem 8rem 2rem;
  font-size: 80%;
  color: #888;
  font-variant-caps: all-small-caps;
  line-height: 1.4;
}
footer.meta a { color: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  main, nav.top, nav.bottom {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }
  footer.meta { margin-left: 1rem; margin-right: 1rem; }
  .region-pair { grid-template-columns: 1fr; gap: 1rem; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  form.eoi .row { grid-template-columns: 1fr; }
  div.pdf-card { float: none; width: 100%; margin: 1rem auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
