/* =============================================================
   NestNooks — base.css
   Mobile-first. Loaded on every page.
   Covers: design tokens, reset, typography, layout utilities,
           navigation (mobile drawer + desktop), site footer,
           buttons, forms, keyframe animations, scroll-reveal.
   v1.0.0
============================================================= */


/* ── DESIGN TOKENS ─────────────────────────────────────────── */

:root {
  /* ── Backgrounds ── */
  --warm-white:    #FDFBF8;
  --cream:         #F5F0E8;
  --cream-2:       #EDE5D8;
  --cream-3:       #E2D9C8;

  /* ── Dark surfaces (newsletter, footer, hero variants) ── */
  --ink:           #1E1A15;
  --ink-2:         #261F17;
  --ink-3:         #2E261C;
  --ink-4:         #382E22;

  /* ── Terracotta — primary brand accent ── */
  --terra:         #C4714A;
  --terra-mid:     #B3623D;
  --terra-dim:     #9E5434;
  --terra-light:   #D4896A;
  --terra-soft:    rgba(196, 113, 74, 0.09);
  --terra-border:  rgba(196, 113, 74, 0.20);
  --terra-glow:    rgba(196, 113, 74, 0.32);

  /* ── Sage green — secondary accent ── */
  --sage:          #5F8C78;
  --sage-light:    #7BA892;
  --sage-soft:     rgba(95, 140, 120, 0.09);
  --sage-border:   rgba(95, 140, 120, 0.22);

  /* ── Warm gold — decorative ── */
  --gold:          #C9A96E;
  --gold-light:    #DFC08C;
  --gold-soft:     rgba(201, 169, 110, 0.10);
  --gold-border:   rgba(201, 169, 110, 0.24);

  /* ── Text ── */
  --text:          #1E1A15;
  --text-2:        #3D3228;
  --muted:         #7D7268;
  --muted-2:       #A09488;
  --on-dark:       #F0EDE8;
  --on-dark-2:     #C8C2BA;
  --on-dark-muted: #8A8078;

  /* ── Borders (light theme) ── */
  --border:        rgba(30, 26, 21, 0.08);
  --border-2:      rgba(30, 26, 21, 0.14);
  --border-subtle: rgba(30, 26, 21, 0.04);

  /* ── Borders (dark theme) ── */
  --border-d:      rgba(255, 255, 255, 0.08);
  --border-d-2:    rgba(255, 255, 255, 0.14);

  /* ── Card surfaces ── */
  --card:          #FFFFFF;
  --card-2:        #FAF8F4;
  --card-3:        #F5F0E8;

  /* ── Status colours ── */
  --green:         #4A8C6B;
  --green-soft:    rgba(74, 140, 107, 0.10);
  --green-border:  rgba(74, 140, 107, 0.22);
  --red:           #C45454;
  --red-soft:      rgba(196, 84, 84, 0.10);
  --red-border:    rgba(196, 84, 84, 0.22);
  --amber:         #D4943A;
  --amber-soft:    rgba(212, 148, 58, 0.10);

  /* ── Typography ── */
  --font-display:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-accent:   'DM Serif Display', Georgia, serif;
  --font-body:     'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* ── Layout ── */
  --max:           1240px;
  --max-wide:      1480px;
  --nav-h:         68px;     /* header height, keep in sync with JS */

  /* ── Border radii ── */
  --r-xs:          6px;
  --r:             10px;
  --r-lg:          16px;
  --r-xl:          20px;
  --r-2xl:         28px;
  --r-3xl:         40px;
  --r-pill:        100px;

  /* ── Fluid spacing ── */
  --pg:            clamp(16px, 4.5vw, 56px);      /* horizontal page padding */
  --section-pad:   clamp(64px, 9vw, 120px);       /* vertical section padding */
  --section-gap:   clamp(48px, 7vw, 96px);        /* gap between elements in a section */
  --card-gap:      clamp(16px, 2.5vw, 28px);      /* gap between cards in a grid */

  /* ── Transitions ── */
  --ease-out:      cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:      180ms;
  --dur-base:      280ms;
  --dur-slow:      420ms;

  /* ── Shadows ── */
  --shadow-sm:     0 1px 4px rgba(30, 26, 21, 0.08);
  --shadow:        0 4px 16px rgba(30, 26, 21, 0.10);
  --shadow-lg:     0 8px 32px rgba(30, 26, 21, 0.12);
  --shadow-xl:     0 20px 60px rgba(30, 26, 21, 0.14);
  --shadow-terra:  0 8px 32px rgba(196, 113, 74, 0.28);
}


/* ── REDUCED MOTION ─────────────────────────────────────────── */

@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;
  }
}


/* ── RESET ─────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--warm-white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video, svg {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  color: inherit;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: var(--font-body);
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 3px;
}

:focus:not(:focus-visible) { outline: none; }


/* ── LAYOUT UTILITIES ───────────────────────────────────────── */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pg);
}

.container--wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 var(--pg);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.accent-terra  { color: var(--terra); }
.accent-sage   { color: var(--sage); }
.accent-gold   { color: var(--gold); }

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }

/* Reveal utility: used with data-reveal attribute */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-delay="100"] { transition-delay: 100ms; }
[data-reveal][data-delay="200"] { transition-delay: 200ms; }
[data-reveal][data-delay="300"] { transition-delay: 300ms; }
[data-reveal][data-delay="400"] { transition-delay: 400ms; }
[data-reveal][data-delay="500"] { transition-delay: 500ms; }


/* ── TYPOGRAPHY SCALE ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

.display-xl {
  font-size: clamp(2.4rem, 6.5vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.display-lg {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

h4 {
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 600;
}

h5, h6 {
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

em { font-style: italic; }

.section-label {
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: clamp(8px, 1.5vw, 14px);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
}

.section-title--on-dark {
  color: var(--on-dark);
}

.section-body {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--muted);
  line-height: 1.7;
  max-width: 56ch;
}

.section-body--on-dark {
  color: var(--on-dark-2);
}

.section-header {
  margin-bottom: var(--section-gap);
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-body {
  margin: clamp(12px, 2vw, 20px) auto 0;
}


/* ── BUTTONS ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: clamp(0.875rem, 1.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--r-pill);
  padding: 0 clamp(20px, 3vw, 32px);
  height: clamp(44px, 6vw, 52px);
  min-width: 120px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-in-out),
              color var(--dur-fast) var(--ease-in-out),
              border-color var(--dur-fast) var(--ease-in-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  user-select: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

/* Primary — terracotta fill */
.btn-primary {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
  box-shadow: 0 4px 16px var(--terra-glow);
}
.btn-primary:hover {
  background: var(--terra-mid);
  border-color: var(--terra-mid);
  box-shadow: 0 6px 24px var(--terra-glow);
  transform: translateY(-1px);
}

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--terra);
  border-color: var(--terra-border);
}
.btn-secondary:hover {
  background: var(--terra-soft);
  border-color: var(--terra);
}

/* Ghost light — for light backgrounds */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  background: var(--cream);
  border-color: var(--border-2);
}

/* Ghost dark — for dark backgrounds */
.btn-ghost-dark {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--border-d-2);
}
.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Sage variant */
.btn-sage {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
}
.btn-sage:hover {
  background: #4d7a67;
  border-color: #4d7a67;
}

/* Size modifiers */
.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 0.8rem;
  min-width: 80px;
}

.btn-lg {
  height: clamp(52px, 7vw, 60px);
  padding: 0 clamp(28px, 4vw, 44px);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
}

.btn-full {
  width: 100%;
}

/* Icon inside button */
.btn-icon {
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.btn:hover .btn-icon { transform: translateX(3px); }


/* ── FORM ELEMENTS ──────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}

.form-label--on-dark { color: var(--on-dark-2); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--card);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 3px var(--terra-soft);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted-2);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 16px;
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237D7268' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-error {
  font-size: 0.8rem;
  color: var(--red);
  display: none;
}
.form-group.has-error .form-error { display: block; }
.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea {
  border-color: var(--red);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted-2);
}

/* Dark-background form inputs */
.form-input--dark,
.form-select--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-d);
  color: var(--on-dark);
}
.form-input--dark:focus,
.form-select--dark:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px var(--terra-soft);
}
.form-input--dark::placeholder { color: var(--on-dark-muted); }

/* Stepper control (number input with +/- buttons) */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r);
  overflow: hidden;
}
.stepper button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  transition: background var(--dur-fast);
}
.stepper button:hover { background: var(--cream-2); }
.stepper input {
  width: 60px;
  height: 40px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}
.stepper input:focus { outline: none; }


/* ── CARDS ──────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-2);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card-img img { transform: scale(1.04); }

.card-body {
  padding: clamp(16px, 3vw, 24px);
}


/* ── BADGES + TAGS ──────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--terra-soft);
  color: var(--terra);
  border: 1px solid var(--terra-border);
}

.tag--sage {
  background: var(--sage-soft);
  color: var(--sage);
  border-color: var(--sage-border);
}

.tag--gold {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold-border);
}

.tag--neutral {
  background: var(--cream);
  color: var(--muted);
  border-color: var(--border-2);
}

.pill-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--cream);
  color: var(--text-2);
  border: 1.5px solid var(--border-2);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.pill-category:hover,
.pill-category.is-active {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}


/* ── DIVIDERS ───────────────────────────────────────────────── */

.divider {
  width: 48px;
  height: 2px;
  background: var(--terra);
  border-radius: 2px;
  margin: clamp(16px, 2.5vw, 24px) 0;
}

.divider--center { margin-left: auto; margin-right: auto; }


/* ────────────────────────────────────────────────────────────
   NAVIGATION — mobile-first
   Default: mobile (hamburger + slide-in drawer)
   1024px+: horizontal desktop nav with dropdowns
─────────────────────────────────────────────────────────────── */

/* ── Backdrop overlay (behind drawer) ── */
.nn-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 21, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-in-out),
              visibility var(--dur-base);
  z-index: 1998;
}
.nn-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ── Mobile Drawer ── */
.nn-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100vw, 380px);
  height: 100dvh;
  background: var(--warm-white);
  transform: translateX(100%);
  transition: transform 0.38s var(--ease-in-out);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 2000;
  box-shadow: -8px 0 48px rgba(30, 26, 21, 0.18);
  will-change: transform;
}
.nn-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

.nn-drawer-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0 0 32px;
}

/* Drawer header: logo + close button */
.nn-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--warm-white);
  z-index: 1;
}

.nn-drawer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nn-drawer-logo span { color: var(--terra); }

.nn-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--cream);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background var(--dur-fast);
  flex-shrink: 0;
}
.nn-drawer-close:hover { background: var(--cream-2); }
.nn-drawer-close svg { pointer-events: none; }

/* Drawer navigation links */
.nn-drawer-nav {
  padding: 20px 0;
  flex: 1;
}

.nn-drawer-item {
  display: block;
  position: relative;
}

.nn-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pg);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--dur-fast), background var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.nn-drawer-link:hover,
.nn-drawer-link[aria-expanded="true"] {
  color: var(--terra);
  background: var(--terra-soft);
}

.nn-drawer-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  transition: transform var(--dur-base) var(--ease-in-out),
              color var(--dur-fast);
  flex-shrink: 0;
}
.nn-drawer-link[aria-expanded="true"] .nn-drawer-chevron {
  transform: rotate(180deg);
  color: var(--terra);
}

/* Drawer sub-menu (accordion) */
.nn-drawer-submenu {
  background: var(--cream);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-in-out);
}
.nn-drawer-submenu.is-open {
  max-height: 400px;
}

.nn-drawer-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--pg) 12px calc(var(--pg) + 12px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--dur-fast), background var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.nn-drawer-sub-link:hover { color: var(--terra); background: var(--terra-soft); }

.nn-drawer-sub-icon {
  width: 16px;
  height: 16px;
  color: var(--terra);
  flex-shrink: 0;
}

/* Drawer footer CTA */
.nn-drawer-cta {
  padding: 20px var(--pg) 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Site Header ── */
#nn-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(253, 251, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base),
              box-shadow var(--dur-base),
              background var(--dur-base);
}
#nn-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 20px rgba(30, 26, 21, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 16px;
}

/* Logo */
.nn-logo {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.nn-logo span { color: var(--terra); }

/* Desktop primary nav — hidden on mobile */
.nn-primary-nav {
  display: none;
  align-items: center;
  gap: clamp(4px, 1.5vw, 8px);
  flex: 1;
  justify-content: center;
}

/* Desktop nav links */
.nn-nav-item {
  position: relative;
}

.nn-nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r);
  transition: color var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
}
.nn-nav-link:hover,
.nn-nav-item:hover > .nn-nav-link {
  color: var(--terra);
  background: var(--terra-soft);
}
.nn-nav-link.is-active { color: var(--terra); }

.nn-nav-caret {
  width: 12px;
  height: 12px;
  color: var(--muted);
  transition: transform var(--dur-base) var(--ease-in-out);
}
.nn-nav-item:hover .nn-nav-caret { transform: rotate(180deg); }

/* Dropdown */
.nn-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 12px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base);
}
.nn-nav-item:hover .nn-dropdown,
.nn-nav-item:focus-within .nn-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nn-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nn-dropdown-link:hover {
  background: var(--terra-soft);
  color: var(--terra);
}

.nn-dropdown-icon {
  width: 20px;
  height: 20px;
  color: var(--terra);
  flex-shrink: 0;
}

.nn-dropdown-label { font-weight: 600; }
.nn-dropdown-desc {
  font-size: 0.78rem;
  color: var(--muted-2);
  margin-top: 1px;
}

/* Header actions: CTA button + burger */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Desktop CTA — hidden on mobile */
.header-cta {
  display: none;
}

/* Burger button */
.nn-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  border-radius: var(--r);
  background: var(--cream);
  border: 1px solid var(--border);
  transition: background var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.nn-burger:hover { background: var(--cream-2); }

.nn-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-in-out),
              opacity var(--dur-base),
              width var(--dur-base);
}
.nn-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nn-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nn-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop nav: 1024px+ */
@media (min-width: 1024px) {
  .nn-primary-nav { display: flex; }
  .header-cta     { display: inline-flex; }
  .nn-burger      { display: none; }
}

/* Body scroll-lock class */
body.drawer-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}


/* ────────────────────────────────────────────────────────────
   SITE FOOTER
─────────────────────────────────────────────────────────────── */

#nn-footer {
  background: var(--ink);
  color: var(--on-dark);
  padding-top: clamp(60px, 8vw, 100px);
  padding-bottom: clamp(32px, 5vw, 52px);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 60px);
  padding-bottom: clamp(40px, 6vw, 60px);
  border-bottom: 1px solid var(--border-d);
}

@media (min-width: 640px) {
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-top {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--on-dark);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 14px;
}
.footer-logo span { color: var(--terra); }

.footer-tagline {
  font-size: 0.9rem;
  color: var(--on-dark-2);
  line-height: 1.65;
  max-width: 28ch;
  margin-bottom: 24px;
}

/* Social icons */
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-d);
  color: var(--on-dark-2);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  text-decoration: none;
}
.social-btn:hover {
  background: var(--terra-soft);
  color: var(--terra);
  border-color: var(--terra-border);
}
.social-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Footer navigation columns */
.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--on-dark-muted);
  text-decoration: none;
  transition: color var(--dur-fast);
  line-height: 1.5;
}
.footer-link:hover { color: var(--terra); }

/* Footer bottom row */
.footer-bottom {
  padding-top: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--on-dark-muted);
  line-height: 1.5;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.footer-legal-link {
  font-size: 0.8rem;
  color: var(--on-dark-muted);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-legal-link:hover { color: var(--terra); }

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}


/* ── KEYFRAME ANIMATIONS ────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--terra-glow); }
  50%       { box-shadow: 0 0 0 12px transparent; }
}

@keyframes wordCycle {
  0%  { opacity: 0; transform: translateY(12px); }
  8%  { opacity: 1; transform: translateY(0); }
  88% { opacity: 1; transform: translateY(0); }
  96% { opacity: 0; transform: translateY(-12px); }
  100%{ opacity: 0; transform: translateY(12px); }
}

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg,
    var(--cream) 25%,
    var(--cream-2) 50%,
    var(--cream) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}


/* ── MISC HELPERS ───────────────────────────────────────────── */

/* Scroll-reveal — add data-reveal to any element; JS adds is-visible */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-delay="100"] { transition-delay: 100ms; }
[data-reveal][data-delay="200"] { transition-delay: 200ms; }
[data-reveal][data-delay="300"] { transition-delay: 300ms; }
[data-reveal][data-delay="400"] { transition-delay: 400ms; }
[data-reveal][data-delay="500"] { transition-delay: 500ms; }
[data-reveal][data-delay="600"] { transition-delay: 600ms; }

/* Horizontal touch scroll container */
.scroll-x {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  gap: var(--card-gap);
  padding-bottom: 4px; /* prevent clipping of box-shadow */
}
.scroll-x::-webkit-scrollbar { display: none; }

.scroll-x > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Decorative line element */
.deco-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra);
}
.deco-line::before {
  content: '';
  width: 32px;
  height: 1.5px;
  background: var(--terra);
  border-radius: 2px;
}

/* Page hero spacer (to offset fixed header) */
.page-spacer {
  height: var(--nav-h);
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spinSlow 0.7s linear infinite;
  display: inline-block;
}

/* Aspect ratio boxes */
.aspect-4-3  { aspect-ratio: 4/3;  }
.aspect-16-9 { aspect-ratio: 16/9; }
.aspect-3-4  { aspect-ratio: 3/4;  }
.aspect-1-1  { aspect-ratio: 1/1;  }

/* Cover image */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ════════════════════════════════════════════════════════════
   SHARED COMPONENTS — loaded on every page via base.css
   (blog-card, breadcrumb, sidebar-card, newsletter-form,
    img-placeholder, meta utilities)
════════════════════════════════════════════════════════════ */


/* ── Breadcrumb (single, archive, calculator, page) ─────── */

.breadcrumb { margin-bottom: clamp(16px, 2.5vw, 28px); }

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted-2);
    min-width: 0;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast);
}
.breadcrumb a:hover { color: var(--terra); }

.breadcrumb [aria-current="page"],
.breadcrumb-current {
    color: var(--text-2);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28ch;
}

.breadcrumb svg { flex-shrink: 0; color: var(--border-2); }


/* ── Blog / Post card (home, single related, archive) ────── */

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--card-gap);
}

@media (min-width: 640px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-out);
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
    color: inherit;
}

.blog-card-img {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--cream-2);
    overflow: hidden;
    flex-shrink: 0;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--dur-slow) var(--ease-out);
}
.blog-card:hover .blog-card-img img { transform: scale(1.04); }

.blog-card-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(253, 251, 248, 0.95);
    color: var(--terra);
    padding: 4px 10px;
    border-radius: var(--r-pill);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.blog-card-body {
    padding: clamp(16px, 2.5vw, 22px);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 8px;
    font-size: 0.77rem;
    color: var(--muted-2);
    font-weight: 500;
}

.meta-dot { color: var(--border-2); }

.blog-card-title {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 1.7vw, 1.1rem);
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.01em;
    transition: color var(--dur-fast);
}
.blog-card:hover .blog-card-title { color: var(--terra); }

.blog-card-excerpt {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.65;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Image placeholder (no featured image) */
.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
    background: linear-gradient(135deg, var(--cream-2) 0%, var(--cream-3) 100%);
    aspect-ratio: 16/9;
}


/* ── Sidebar cards (single, calculator) ──────────────────── */

.sidebar-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    padding: clamp(18px, 3vw, 24px);
}

.sidebar-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.sidebar-card-title svg { color: var(--terra); flex-shrink: 0; }

.sidebar-newsletter {
    background: var(--ink);
    border-color: var(--border-d);
}
.sidebar-newsletter .section-label { color: var(--terra-light); }
.sidebar-newsletter h3 { color: var(--on-dark); }
.sidebar-newsletter p { color: var(--on-dark-2); }

.sidebar-empty {
    font-size: 0.85rem;
    color: var(--muted-2);
    font-style: italic;
    text-align: center;
    padding: 12px 0;
}

.sidebar-note {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* Sidebar related post items */
.sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-post-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: color var(--dur-fast);
}
.sidebar-post-link:hover { color: var(--terra); }

.sidebar-post-img {
    width: 52px;
    height: 42px;
    border-radius: var(--r);
    background: var(--cream-2);
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-post-img img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-post-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--dur-fast);
}
.sidebar-post-link:hover .sidebar-post-title { color: var(--terra); }


/* ── Post layout sidebar column (single.php) ─────────────── */

.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-sidebar > .sidebar-card:first-child {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    max-height: calc(100vh - var(--nav-h) - 40px);
    overflow-y: auto;
}

.post-content-area { min-width: 0; }


/* ── Newsletter form (shared: home, single sidebar) ──────── */

.nn-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.nn-newsletter-msg {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--r);
    margin-top: 8px;
    display: none;
}
.nn-newsletter-msg.success {
    display: block;
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid var(--green-border);
}
.nn-newsletter-msg.error {
    display: block;
    background: var(--red-soft);
    color: var(--red);
    border: 1px solid var(--red-border);
}

/* ── Post meta row (shared across templates) ─────────────── */

.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
    font-size: 0.82rem;
    color: var(--muted-2);
    font-weight: 500;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--text-2);
    font-weight: 600;
    transition: color var(--dur-fast);
}
.meta-author:hover { color: var(--terra); }

.meta-sep { color: var(--border-2); }

/* ── Tool icon (shared: home tools, calculator template) ─── */

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--terra-soft);
    border: 1px solid var(--terra-border);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--terra);
    flex-shrink: 0;
    transition: background var(--dur-base), transform var(--dur-base), color var(--dur-base);
}

/* ── Tips list (sidebar, calculator) ─────────────────────── */

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

.tips-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--terra);
    font-size: 0.75rem;
    top: 2px;
}

/* ── Archive / search form (archive.php, 404.php) ─────────── */

.archive-search-form {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-2);
    border-radius: var(--r-pill);
    overflow: hidden;
    background: var(--card);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.archive-search-form:focus-within {
    border-color: var(--terra);
    box-shadow: 0 0 0 3px var(--terra-soft);
}

.archive-search-input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    height: 46px;
    padding: 0 16px;
    flex: 1;
    box-shadow: none !important;
    min-width: 0;
}
.archive-search-input:focus { outline: none; box-shadow: none; }

.archive-search-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--terra);
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--dur-fast);
}
.archive-search-btn:hover { background: var(--terra-mid); }

/* ── Related posts section (single.php) ──────────────────── */

.related-posts {
    padding: var(--section-pad) 0;
    background: var(--cream);
    border-top: 1px solid var(--border);
}

/* ── WP-generated classes ─────────────────────────────────── */

.screen-reader-text { @extend .sr-only; }

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.alignleft  { float: left;  margin-right: 20px; margin-bottom: 12px; }
.alignright { float: right; margin-left: 20px;  margin-bottom: 12px; }
.alignwide  { margin-left: calc(-1 * var(--pg)); margin-right: calc(-1 * var(--pg)); }

@media (min-width: 1024px) {
    .alignfull {
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        max-width: 100vw;
        width: 100vw;
    }
}

/* ── Section header: centred variant ─────────────────────── */

.section-header--center { text-align: center; }
.section-header--center .section-body {
    margin: clamp(10px, 1.8vw, 18px) auto 0;
}

/* ── Sidebar newsletter dark variant ─────────────────────── */

.sidebar-card.sidebar-newsletter .sidebar-card-title {
    color: var(--on-dark);
    border-color: var(--border-d);
}
.sidebar-card.sidebar-newsletter .sidebar-card-title svg { color: var(--terra-light); }
