/* ════════════════════════════════════════════════════════════════════════════
   Old-Time Banjo Society — "Modern Heritage" theme
   Modern-minimal structure (space, scale, restraint) + warm heritage palette.
   Self-contained: system sans body, self-hosted Fraunces variable serif display.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Self-hosted variable font (SIL OFL) ─────────────────────────────────── */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  /* palette (accent/ink/paper are overridden live by Site Settings) */
  --paper: #FAF7F1;
  --ink: #23201B;
  --muted: #6F6659;
  --accent: #A64B2A;
  --accent-2: #C2913F;
  --line: #EAE3D7;

  /* type */
  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* spacing scale */
  --s-1: .5rem;  --s-2: 1rem;  --s-3: 1.5rem;  --s-4: 2.5rem;
  --s-5: 4rem;   --s-6: 6rem;

  /* widths */
  --measure: 42rem;    /* prose */
  --wide: 66rem;       /* header / hero / footer */
  --radius: 6px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* ~17px, comfortable */
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, .brand, .lede {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; transition: color .15s ease; }
a:hover { color: var(--ink); }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, #fff); position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(180%) blur(6px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1.1rem 0; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.3rem; font-weight: 600; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.brand-mark { display: inline-flex; color: var(--accent); }
.brand span:last-child { line-height: 1; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-nav a { text-decoration: none; font-size: .875rem; letter-spacing: .01em; color: var(--muted); padding-bottom: 2px; border-bottom: 1.5px solid transparent; transition: color .15s ease, border-color .15s ease; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); border-color: var(--accent); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { padding: var(--s-6) 0 var(--s-4); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 0 0 var(--s-2); font-weight: 600; }
.lede { font-size: 1.35rem; font-weight: 400; line-height: 1.35; color: var(--muted); max-width: 34rem; }
.hero .lede { margin: 0 0 var(--s-3); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; margin: .35rem .5rem 0 0; padding: .8rem 1.5rem;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600; letter-spacing: .01em;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: var(--radius); border: 1.5px solid var(--accent);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ── Content / prose ─────────────────────────────────────────────────────── */
.prose { max-width: var(--measure); padding: var(--s-2) 0 var(--s-5); }
.prose h2 { font-size: 1.9rem; margin: var(--s-4) 0 var(--s-1); }
.prose h3 { font-size: 1.3rem; margin: var(--s-3) 0 var(--s-1); }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 var(--s-2); }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose a { text-decoration: underline; }
.page-list { padding-left: 1.1rem; }

/* tables — hairline, minimal */
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-body); font-weight: 600; color: var(--muted); border-bottom-width: 2px; }

/* ── Home cards — borderless, hairline accent detail ─────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-4); padding: var(--s-2) 0 var(--s-6); }
.card { background: transparent; border: none; padding: 0; }
.card::before { content: ""; display: block; width: 2.25rem; height: 2.5px; background: var(--accent); margin-bottom: var(--s-2); }
.card h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 .35rem; font-weight: 600; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: transparent; padding: var(--s-4) 0; margin-top: var(--s-4); }
.site-footer p { margin: .2rem 0; }
.site-footer strong { font-family: var(--font-display); font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }

/* ── Mock donate widget ──────────────────────────────────────────────────── */
.donate-fab {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50;
  height: 3rem; padding: 0 1.25rem; border-radius: 999px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font: 600 .9rem/1 var(--font-body); box-shadow: 0 6px 20px rgba(40,20,10,.22);
  display: inline-flex; align-items: center; gap: .4rem;
  transition: transform .15s ease, background .15s ease;
}
.donate-fab:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 85%, #000); }
.donate-pop {
  position: fixed; right: 1.5rem; bottom: 5rem; z-index: 50;
  width: min(21rem, calc(100vw - 3rem));
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(40,20,10,.20); padding: 1.4rem 1.5rem;
}
.donate-pop[hidden] { display: none; }
.donate-pop h4 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin: 0 0 .4rem; }
.donate-pop p { margin: 0 0 1rem; font-size: .95rem; color: var(--muted); }
.donate-pop .btn { width: 100%; text-align: center; margin: 0; }
.donate-pop .mock-note { font-size: .72rem; color: var(--muted); margin-top: .7rem; font-style: italic; }
.donate-pop .close { position: absolute; top: .5rem; right: .7rem; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; }

/* ── Figures / embedded media ────────────────────────────────────────────── */
figure { margin: var(--s-4) 0; }
figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
figure.bw img { filter: grayscale(1) contrast(1.03); }
figure.portrait { max-width: 22rem; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; line-height: 1.5; }
figcaption cite { font-style: normal; font-weight: 600; color: var(--ink); }
figcaption p { margin: 0; }

.embed { margin: var(--s-4) 0; }
.embed-frame { aspect-ratio: 16 / 9; width: 100%; border-radius: 8px; overflow: hidden; background: #000; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-placeholder {
  aspect-ratio: 16 / 9; width: 100%; border: 1.5px dashed var(--line); border-radius: 8px;
  display: grid; place-content: center; text-align: center; color: var(--muted);
  background: color-mix(in srgb, var(--paper) 60%, #fff); padding: 1.5rem;
}
.embed-placeholder strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); display: block; margin-bottom: .4rem; }
.embed-cap { font-size: .82rem; color: var(--muted); margin-top: .55rem; }

/* ── Motion / a11y ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
