/* ============================================================
   Home for Christmas — a Fisher & Farmer Foundation programme
   Shared stylesheet.

   Design register: an Advent charitable programme in the west of
   Ireland. A small-press / regional-newspaper sensibility — serif-led,
   warm, printed. The identity motif is the candle in the window — the
   Irish tradition of a light left burning for the stranger who has no
   room. No snowflakes, no red-and-green, no countdown.

   Type: Fraunces (old-style display) / Spectral (literary text serif) /
   IBM Plex Mono (datelines & small labels — the letterpress note).
   Deliberately off the Playfair/Lora default to avoid the generic
   "elegant template" look. Family resemblance to Fisher & Farmer is kept
   through the red accent family rather than the exact house salmon —
   see planning/design-notes.md (flagged for the Professor).
   ============================================================ */

:root {
  /* Type */
  --serif-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --serif-body: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans-label: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Paper & ink — aged manila stock, warm bible-black */
  --paper: #e9e2d0;        /* oat / manila ground */
  --paper-deep: #ded3bd;   /* card / recessed */
  --paper-warm: #f2ecdd;   /* lifted panels */
  --ink: #221f19;          /* body text — warm near-black */
  --ink-soft: #574e42;     /* secondary text */
  --ink-faint: #8a8070;    /* captions, labels */
  --rule: #d2c8b2;         /* hairlines */

  /* Winter dark — bog slate at dusk, the turning of the year */
  --dusk: #17211d;         /* deep green-black */
  --dusk-deep: #0f1512;
  --dusk-soft: #29342e;

  /* Warmth — a madder/brick red and beeswax candlelight.
     The red is a "winterised" cousin of the F&F house salmon (#DA7756),
     shifted deeper and less coral to read as printed ink, not template. */
  --salmon: #b34a2e;       /* madder / brick — primary accent */
  --salmon-deep: #8f3a24;  /* darker, for links & hovers */
  --candle: #d29a45;       /* beeswax amber — the flame, used sparingly */
  --candle-soft: #e7c184;

  --maxw: 1160px;
  --measure: 66ch;         /* reading measure */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif-body);
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  position: relative;
}

/* Fine paper grain — tactile, not flat */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: .03; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--salmon-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif-display); font-weight: 540; line-height: 1.1;
  letter-spacing: -0.005em; font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 0, 'WONK' 1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.55rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-variation-settings: 'SOFT' 0, 'WONK' 0; }
h1 em, h2 em, h3 em { font-style: italic; font-variation-settings: 'SOFT' 40, 'WONK' 1; }

.eyebrow {
  font-family: var(--sans-label);
  font-weight: 600; font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--salmon-deep);
  display: inline-block; margin-bottom: 1.1rem;
}
.eyebrow.on-dark { color: var(--candle-soft); }

.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.6; color: var(--ink); }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.15rem; }
.muted { color: var(--ink-soft); }

/* ── Layout scaffolding ─────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.4rem, 5vw, 3.5rem); }
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-rule { border: 0; border-top: 1px solid var(--rule); max-width: var(--maxw); margin: 0 auto; }

/* ── Draft banner (copy is draft-for-review) ────────────── */
.draftbar {
  background: var(--dusk); color: var(--candle-soft);
  font-family: var(--sans-label); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; text-align: center;
  padding: .5rem 1rem; position: relative; z-index: 60;
}
.draftbar strong { color: #fff; font-weight: 600; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,239,230,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: .9rem clamp(1.4rem, 5vw, 3.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 26px; height: 30px; flex: none; }
.brand-name { font-family: var(--serif-display); font-size: 1.18rem; font-weight: 500; line-height: 1; letter-spacing: .005em; }
.brand-sub { display: block; font-family: var(--sans-label); font-size: .54rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); margin-top: .32rem; }

.nav-links { display: flex; align-items: center; gap: 1.7rem; list-style: none; }
.nav-links a {
  font-family: var(--sans-label); font-size: .78rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none; transition: color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--salmon-deep); }
.nav-cta {
  font-family: var(--sans-label); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none;
  background: var(--salmon); color: #fff !important;
  padding: .5rem 1.1rem; border-radius: 2px; transition: background .2s;
}
.nav-cta:hover { background: var(--salmon-deep); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 22px; height: 1.6px; background: var(--ink); margin: 5px 0; transition: .3s; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { background: var(--dusk); color: #f3ede2; position: relative; overflow: hidden; }
.hero::after { /* candlelight glow, low and warm */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(58% 52% at 16% 94%, rgba(210,154,69,.24), rgba(23,33,29,0) 60%);
}
/* Photography slot: replace the gradient with a real winter photograph of
   Killary / the Leenane valley. Keep the dark scrim for legibility. */
.hero-media {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(15,21,18,.32) 0%, rgba(15,21,18,.55) 60%, rgba(15,21,18,.92) 100%),
    linear-gradient(158deg, #1f2b25 0%, #17211d 46%, #0f1512 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(5rem, 13vw, 9rem) clamp(1.4rem, 5vw, 3.5rem) clamp(4rem, 9vw, 6.5rem); }
.hero h1 { color: #fbf6ec; max-width: 16ch; }
.hero h1 em { color: var(--candle); }
.hero-lede { color: #d9d0c2; max-width: 44ch; margin-top: 1.4rem; font-size: clamp(1.1rem, 2vw, 1.35rem); }
.hero-meta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem;
  font-family: var(--sans-label); font-size: .8rem; letter-spacing: .04em; color: #c9c0b2; }
.hero-meta b { display: block; color: #f3ede2; font-weight: 600; letter-spacing: .01em; margin-bottom: .15rem; }
.hero-actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: .9rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans-label); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; padding: .8rem 1.5rem; border-radius: 2px; border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--salmon); color: #fff; }
.btn-primary:hover { background: var(--salmon-deep); color: #fff; }
.btn-ghost { background: transparent; color: #f3ede2; border-color: rgba(243,237,226,.4); }
.btn-ghost:hover { border-color: #f3ede2; color: #fff; }
.btn-dark { background: var(--dusk); color: #f3ede2; }
.btn-dark:hover { background: var(--dusk-deep); color: #fff; }

/* ── Generic editorial blocks ───────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.two-col.narrow { grid-template-columns: 1fr 1fr; }
.stack > * + * { margin-top: 1.15rem; }

.pull {
  font-family: var(--serif-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.28; color: var(--ink);
  border-left: 2px solid var(--salmon); padding-left: 1.4rem; max-width: 30ch;
}

/* Numbered editorial list (used for "how it works" — not a card grid) */
.steps { list-style: none; counter-reset: step; display: grid; gap: 1.8rem; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--serif-display); font-size: 1.4rem; color: var(--salmon-deep);
  line-height: 1; padding-top: .1rem; min-width: 2.2ch;
}
.steps h3 { margin-bottom: .3rem; }

/* Definition rows (for facts: where / when / who) */
.facts { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.facts > div { display: grid; grid-template-columns: 10rem 1fr; gap: 1.5rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--sans-label); font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); padding-top: .2rem; }
.facts dd { font-size: 1.08rem; }

/* Panels */
.panel { background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 3px;
  padding: clamp(1.6rem, 4vw, 2.6rem); }
.panel-dark { background: var(--dusk); color: #eee6d9; border: 0; }
.panel-dark h2, .panel-dark h3 { color: #fbf6ec; }
.panel-dark .eyebrow { color: var(--candle-soft); }

/* Tier scaffolding for the donate page — deliberately plain, amounts TBD */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.tier { background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 3px; padding: 1.6rem; }
.tier .amount { font-family: var(--serif-display); font-size: 1.9rem; color: var(--ink); }
.tier .amount .tbd { color: var(--salmon-deep); font-style: italic; font-size: 1.2rem; }
.tier h3 { margin-bottom: .4rem; }
.tier p { font-size: .98rem; color: var(--ink-soft); }

/* Review flag — for copy needing the Professor's / a reviewer's sign-off */
.flag {
  border-left: 3px solid var(--candle); background: rgba(233,182,101,.1);
  padding: 1rem 1.2rem; border-radius: 0 3px 3px 0; margin: 1.6rem 0;
  font-size: .94rem; color: var(--ink-soft);
}
.flag b { font-family: var(--sans-label); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--salmon-deep); display: block; margin-bottom: .3rem; }

/* Simple form styling (no backend wired — see planning) */
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-family: var(--sans-label); font-size: .76rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  font-family: var(--serif-body); font-size: 1rem; color: var(--ink);
  background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 2px;
  padding: .7rem .8rem; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--salmon); outline-offset: 1px; }

/* ── Footer ─────────────────────────────────────────────── */
.foot { background: var(--dusk-deep); color: #cdc4b6; padding: clamp(3rem, 7vw, 5rem) 0 2.5rem; }
.foot a { color: var(--candle-soft); }
.foot a:hover { color: #fff; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.foot h4 { font-family: var(--sans-label); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: #8f8677; margin-bottom: 1rem; font-weight: 600; }
.foot ul { list-style: none; display: grid; gap: .55rem; }
.foot-links a { text-decoration: none; }
.foot-brand .brand-name { color: #f3ede2; }
.foot-note { max-width: 40ch; font-size: .92rem; color: #9c9385; margin-top: 1rem; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: 2.5rem; padding-top: 1.6rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: .82rem; color: #8f8677; }
.foot-bottom a { color: #b8af9f; text-decoration: none; }
.foot-attrib { font-style: italic; }

/* ── Scroll reveal (progressive enhancement) ────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-links { position: fixed; inset: 0 0 auto 0; top: 0; flex-direction: column;
    background: var(--paper); padding: 5rem 2rem 2.5rem; gap: 1.4rem; align-items: flex-start;
    transform: translateY(-100%); transition: transform .35s ease; height: auto; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
  .nav-links.open { transform: none; }
  .nav-toggle { display: block; z-index: 60; }
  .two-col, .two-col.narrow { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr; gap: 2rem; }
  .facts > div { grid-template-columns: 1fr; gap: .3rem; }
  .facts dt { padding-top: 0; }
}
