/* Heritage Hub — public (marketing/legal) pages.
 *
 * Colours are GENERATED from the app's one palette source
 * (app/lib/core/theme/brand_colors.dart) by scripts/gen_brand_css.py — see
 * the marked block below. Never hand-edit those values; change BrandColors
 * and re-run the script, so the app and the public pages cannot drift.
 *
 * The public pages are DELIBERATELY always cream — no dark-mode override.
 * (Candid review 2026-10-23: "pick one theme for all public pages"; the
 * signed-in app alone follows the device.) Fonts: Newsreader (headings) +
 * Figtree (text), loaded by each page from Google Fonts (CSP already allows
 * fonts.googleapis.com / fonts.gstatic.com).
 */

:root {
  /* BRAND-TOKENS-START — generated by scripts/gen_brand_css.py from
     app/lib/core/theme/brand_colors.dart, the ONE palette source.
     Do NOT edit these values by hand: run the script. A hand edit is
     reverted by the next run and fails preflight in the meantime. */
  --cream:        #FBF8F2; /* BrandColors.cream */
  --page:         #EFE9DD; /* BrandColors.page */
  --card:         #FFFFFF; /* BrandColors.card */
  --ink:          #2B2926; /* BrandColors.ink */
  --body:         #4A463F; /* BrandColors.body */
  --muted:        #67625A; /* BrandColors.muted */
  --green:        #4F8A66; /* BrandColors.green */
  --green-deep:   #2F5A40; /* BrandColors.greenDeep */
  --green-tint:   #EEF4EE; /* BrandColors.greenTint */
  --green-border: #CFE3D4; /* BrandColors.greenBorder */
  --border:       #ECE5D7; /* BrandColors.border */
  /* BRAND-TOKENS-END */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

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

h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; }

p { margin: 0 0 1em; }

a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

/* ---- layout ---- */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.wrap--narrow { max-width: 720px; }

/* ---- header ---- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  min-height: 48px;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--body);
  font-weight: 500;
}

.site-header nav a:hover { color: var(--green-deep); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  /* green-deep: white on the mid green was 4.07:1 at 16px — under AA
     (Codex FNF audit F9). The deep fill is ~7.6:1. */
  background: var(--green-deep);
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
}

.btn:hover { background: #254a33; color: #fff; text-decoration: none; }

/* ---- page sections ---- */

.hero {
  padding: 56px 0 32px;
}

.hero .lede {
  font-size: 1.2rem;
  max-width: 640px;
}

.section { padding: 8px 0 24px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.cards li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.cards h3 { margin-top: 0; }
.cards p { margin-bottom: 0; font-size: 0.97rem; }

.band {
  background: var(--green-tint);
  border: 1px solid var(--green-border);
  border-radius: 16px;
  padding: 28px 24px;
  margin: 32px 0;
}

.band h2 { margin-top: 0; }
.band p:last-child { margin-bottom: 0; }

.cta {
  text-align: center;
  padding: 40px 0 56px;
}

.cta p { color: var(--muted); }

/* ---- legal article (generated from assets/legal/*.md) ---- */

.legal { padding: 40px 0 24px; }

.legal h1 { font-size: 2rem; }

.legal table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.95rem;
}

.legal th, .legal td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.legal th { background: var(--green-tint); color: var(--ink); }

.legal hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.legal li { margin-bottom: 0.4em; }

/* On phones, wide legal tables scroll inside the page rather than widening it. */
.legal .table-scroll { overflow-x: auto; }

/* ---- footer (facts mirror app_footer.dart — one footer, each fact once) ---- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--page);
  padding: 28px 0 32px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 8px;
  margin-bottom: 8px;
}

.site-footer .links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 8px;
  color: var(--green-deep);
}

.site-footer p { margin: 2px 0; }

@media (max-width: 480px) {
  h1 { font-size: 1.9rem; }
  .hero { padding: 36px 0 20px; }
}
