/* ==========================================================================
   Hawaiʻi Island Food Resilience Initiative — shared stylesheet
   Pure CSS, no build step, no external fonts. Works from file://.
   Palette + type per site/DESIGN.md. The kīpuka motif: a living green
   stand in a dark lava field — rendered in CSS gradients, no images.
   ========================================================================== */

:root {
  --lava:  #1a1714;
  --paper: #faf7f2;
  --kalo:  #5b7553;
  --rust:  #b3402a;
  --gold:  #d98e4a;
  --ink:   #2b2620;
  --muted: #6b6357;
  --line:  #e2dccf;            /* hairline, matches the fuel chart gridlines */
  --kalo-deep: #46603f;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}

img, svg { max-width: 100%; height: auto; }

.wrap {
  max-width: 46rem;            /* the article column */
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 2.2em 0 0.6em;
}

h1 { font-size: 2.1rem; margin-top: 1.2em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p, ul, ol { margin: 0 0 1.1em; }
li { margin: 0.35em 0; }

a { color: var(--rust); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #8c3221; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

strong { color: var(--ink); }

[id] { scroll-margin-top: 1rem; }

/* small-caps sans eyebrow above section headings */
.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 3rem 0 -0.4rem;
}
.eyebrow + h2 { margin-top: 0.4rem; }

.note, .muted {
  font-size: 0.85rem;
  color: var(--muted);
}

/* breadcrumb on paper pages */
.crumb {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 1.6rem 0 0;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--rust); }

.lead { font-size: 1.12rem; }

/* ---------- header / nav (system sans) ---------- */

.site-head {
  background: var(--lava);
  font-family: var(--sans);
  border-bottom: 3px solid var(--kalo);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--gold); }

/* the kīpuka dot — a green stand in the dark */
.kipuka-dot {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #7d9a70 0%, var(--kalo) 55%, var(--kalo-deep) 100%);
  box-shadow: 0 0 0 3px #241f1a;
}

.site-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.1rem;
  font-size: 0.85rem;
}

.site-head nav a {
  color: var(--paper);
  opacity: 0.82;
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}
.site-head nav a:hover { opacity: 1; color: var(--gold); }
.site-head nav a[aria-current="page"],
.site-head nav a[aria-current="true"] {
  opacity: 1;
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- hero (index) ---------- */

.hero {
  /* the lava field, with a kīpuka standing in it */
  background:
    radial-gradient(ellipse 170px 46px at 68% 88%, rgba(125, 154, 112, 0.55) 0%, rgba(91, 117, 83, 0.85) 35%, rgba(91, 117, 83, 0) 72%),
    radial-gradient(ellipse 70px 20px at 66% 90%, #7d9a70 0%, rgba(125, 154, 112, 0) 75%),
    linear-gradient(165deg, #241f1a 0%, var(--lava) 38%, #14110e 62%, #241f1a 100%);
  color: var(--paper);
  padding: 3.2rem 0 3.6rem;
}

.hero .kicker {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.hero h1 {
  color: var(--paper);
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  margin: 0 0 0.5em;
}

.hero p { color: #e8e2d6; max-width: 38rem; }

.hero .tagline {
  font-style: italic;
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

/* ---------- kīpuka divider band ---------- */

.kipuka-band {
  height: 56px;
  margin: 3rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 120px 26px at 63% 60%, rgba(125, 154, 112, 0.6) 0%, rgba(91, 117, 83, 0.9) 40%, rgba(91, 117, 83, 0) 75%),
    radial-gradient(ellipse 46px 12px at 61% 62%, #7d9a70 0%, rgba(125, 154, 112, 0) 75%),
    linear-gradient(170deg, #241f1a 0%, var(--lava) 40%, #14110e 65%, #241f1a 100%);
}

/* ---------- stat callouts ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin: 1.6rem 0;
}

.stat {
  border-top: 3px solid var(--kalo);
  background: rgba(91, 117, 83, 0.07);
  padding: 0.85rem 0.95rem 0.9rem;
}

.stat .num {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--rust);
  line-height: 1.15;
  margin-bottom: 0.25rem;
}

.stat .label {
  display: block;
  font-size: 0.85rem;
  line-height: 1.45;
}

.stat .src {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4rem 0; }
.table-scroll > table { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.4rem 0;
}

caption {
  caption-side: top;
  text-align: left;
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 0.5rem;
}

th {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  border-bottom: 2px solid var(--lava);
  padding: 0.45rem 0.6rem;
  vertical-align: bottom;
}

td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:nth-child(even) { background: rgba(43, 38, 32, 0.035); }

/* ---------- blockquote ---------- */

blockquote {
  margin: 1.6rem 0;
  padding: 0.3rem 0 0.3rem 1.1rem;
  border-left: 3px solid var(--gold);
  font-style: italic;
  font-size: 1.06rem;
}

blockquote .attrib {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ---------- act cards ---------- */

.act-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-left: 4px solid var(--kalo);
  padding: 1rem 1.2rem 0.9rem;
  margin: 1.2rem 0;
}

.act-card h3 { margin: 0 0 0.45em; }
.act-card p:last-child, .act-card ul:last-child, .act-card ol:last-child { margin-bottom: 0.2em; }
.act-card.gold { border-left-color: var(--gold); }
.act-card.rust { border-left-color: var(--rust); }

/* ---------- buttons ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.6rem 0;
}

.btn {
  display: inline-block;
  background: var(--kalo);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border-radius: 2px;
  border: 1.5px solid var(--kalo);
}
.btn:hover { background: var(--kalo-deep); border-color: var(--kalo-deep); color: var(--paper); }

.btn.secondary {
  background: transparent;
  color: var(--kalo-deep);
}
.btn.secondary:hover { background: rgba(91, 117, 83, 0.12); color: var(--kalo-deep); }

.hero .btn.secondary { color: var(--paper); border-color: rgba(250, 247, 242, 0.55); }
.hero .btn.secondary:hover { background: rgba(250, 247, 242, 0.12); color: var(--paper); }

.btn .sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.85;
}

/* ---------- figures / chart ---------- */

figure.chart { margin: 1.6rem 0; }

figure.chart img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

figcaption {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.55rem;
  line-height: 1.5;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.6rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}
.site-foot p { margin: 0 0 0.4em; }
.site-foot a { color: var(--muted); }

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  body { font-size: 17px; }
  .wrap { padding: 0 1rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .hero { padding: 2.4rem 0 2.8rem; }
  .masthead { flex-direction: column; align-items: flex-start; }
  .brand { white-space: normal; }
  .site-head nav { gap: 0.1rem 0.9rem; font-size: 0.82rem; }
  table { font-size: 0.82rem; }
  th, td { padding: 0.4rem 0.45rem; }
  .stat .num { font-size: 1.45rem; }
  .btn { width: 100%; text-align: center; }
}

/* ---------- print: papers and pages print clean ---------- */

@media print {
  @page { margin: 2cm; }

  body {
    background: #fff;
    color: #000;
    font-size: 11.5pt;
    line-height: 1.5;
  }

  .site-head, .btn-row, .btn, .kipuka-band, .skip, .crumb { display: none !important; }

  .wrap { max-width: 100%; padding: 0; }

  .hero {
    background: none !important;
    color: #000;
    padding: 0 0 1rem;
    border-bottom: 2pt solid #000;
  }
  .hero h1, .hero p, .hero .tagline, .hero .kicker { color: #000; }

  h1, h2, h3 { page-break-after: avoid; color: #000; }
  table, figure, blockquote, .act-card, .stat { page-break-inside: avoid; }

  a { color: #000; text-decoration: none; }

  .stat { background: none; border-top: 1.5pt solid #000; }
  .stat .num, .eyebrow { color: #000; }

  th { color: #000; border-bottom-color: #000; }
  td { border-bottom-color: #999; }
  tbody tr:nth-child(even) { background: none; }

  .act-card { background: none; border-color: #000; }
  blockquote { border-left-color: #000; }

  figure.chart img { border: 1pt solid #000; }

  .site-foot { color: #000; border-top-color: #000; }
}
