/* ═══════════════════════════════════════════════════════════
   FAUNALY — SHARED SITE STYLES
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f5f1e8;
  --bg-deep: #ebe4d2;
  --ink: #2a2410;
  --ink-soft: #5c5440;
  --ink-muted: #8a8268;
  --accent: #7a4a2b;
  --accent-warm: #b8733f;
  --leaf: #4a5d3a;
  --line: #d4c9ae;
  --paper: #faf7ef;
  --ink-dark: #1a1408;

  /* Footer / dark-surface tokens */
  --line-on-dark: #3a3020;
  --text-on-dark: #b8ae90;
  --text-on-dark-soft: #6a6450;
  --accent-on-leaf: #d6c89c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ── BASE TYPOGRAPHY ──
   Shared heading defaults. Pages override font-size, font-weight,
   margin-bottom, and any other property as needed. ── */
h1, h2, h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: pretty;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid currentColor;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-secondary {
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--ink); }

.btn-ghost {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost:hover {
  background: var(--accent);
  color: var(--paper);
}

/* ── ACCESSIBILITY: keyboard focus rings ── */
.btn:focus-visible,
.logo:focus-visible,
.nav-links a:focus-visible,
.footer-col a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── HEADER ── */
header.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* ── PAGE HERO ── */
.page-hero {
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.page-hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(32px, 5.5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.page-hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.page-hero .lede {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* ── INTRO STRIP (reusable editorial lede band) ──
   Used directly below .page-hero on content pages (research, animals).
   Renders a left-aligned, large-serif lede paragraph that sets the
   thesis of the page. Symmetric padding so the lede hover-aligns
   vertically between the page-hero's bottom border and the strip's
   own bottom border. ── */
.intro-strip {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.intro-strip .lede-2 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 760px;
}
.intro-strip .lede-2 em { font-style: italic; color: var(--accent); }
.intro-strip .lede-2 strong { font-weight: 500; color: var(--ink); }
.intro-strip .lede-2 a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.intro-strip .lede-2 a:hover { color: var(--accent-warm); }

/* ── BUCKET TAG (reusable section eyebrow) ──
   Used on animals.html (above bucket titles), conservation.html. ── */
.bucket-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 18px;
}
.bucket-tag::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* ── CTA BAND (reusable closing call-to-action) ──
   Used on about, conservation, faq, research, animals.
   Pages can override font-size or add a background/border. ── */
.cta-band {
  padding: 96px 0;
  text-align: center;
}
.cta-band h2 {
  font-weight: 300;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.cta-band p {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

/* ── FOOTER ── */
footer.site-footer {
  background: var(--ink-dark);
  color: var(--text-on-dark);
  padding: 80px 0 32px;
  margin-top: 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-on-dark);
}

.footer-brand {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--paper);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.footer-tagline {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.footer-col a, .footer-col p {
  display: block;
  font-size: 13px;
  color: var(--text-on-dark);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent-warm); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  font-size: 11px;
  color: var(--text-on-dark-soft);
  letter-spacing: 0.04em;
}

/* ── HAMBURGER NAV (mobile menu) ──
   Hamburger button is hidden on desktop; it's the toggle for the
   mobile-nav dropdown panel that appears below the header on ≤960px.
   When open, the three bars animate to an X via aria-expanded state.
──────────────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile nav panel — closed by default, opens via .open class.
   Sits inside <header>, so the sticky header expands when open. */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-nav.open { display: block; }

.mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.mobile-nav-links li { border-bottom: 1px solid var(--line); }
.mobile-nav-links li:last-child { border-bottom: none; }

.mobile-nav-links a {
  display: block;
  padding: 18px 28px;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s, background 0.2s;
}
.mobile-nav-links a:hover,
.mobile-nav-links a:focus-visible {
  color: var(--accent);
  background: rgba(184, 115, 63, 0.06);
  outline: none;
}

/* When mobile nav is open, lock body scroll. JS sets this on <body>. */
body.nav-open { overflow: hidden; }

/* ── RESPONSIVE ──
   Canonical breakpoints across the Faunaly site:
     960px = tablet / collapse multi-column to single
     600px = mobile / single-column phone layouts
   Page-specific overrides (e.g., animals.html's 480px ultra-narrow)
   are kept inline in that page's embedded <style>.
──────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .container, .container-narrow { padding: 0 28px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .header-cta { gap: 8px; }
  .btn { padding: 16px 28px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .page-hero { padding: 60px 0 52px; }
}

@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ── ACCESSIBILITY: respect prefers-reduced-motion ──
   For users who request reduced motion at the OS level, kill
   transitions, animations, and smooth scrolling. ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
