/* ============================================================
   The Living Well Guide — design tokens & base
   Field Guide / Handbook system
   ============================================================ */
:root {
  --moss: #4F5D40;
  --moss-dark: #3C4830;
  --moss-tint: #E7EADF;
  --rust: #9C4A3C;
  --rust-dark: #7E3B30;
  --parchment: #F2ECDD;
  --parchment-alt: #EAE1C8;
  --ink: #332B24;
  --ink-light: #5C5346;
  --white: #FFFFFF;
  --border: #D9CDAF;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Karla', 'Segoe UI', system-ui, sans-serif;
  --radius: 8px;
  --shadow: 0 6px 20px rgba(51, 43, 36, 0.10);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
}
h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 28px; font-weight: 700; margin-top: 1.4em; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--rust); }
a:hover { color: var(--rust-dark); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--rust);
  color: var(--white);
}
.btn-primary:hover { background: var(--rust-dark); color: var(--white); }
.btn-outline {
  background: transparent;
  border-color: var(--moss);
  color: var(--moss);
}
.btn-outline:hover { background: var(--moss); color: var(--white); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-topbar {
  background: var(--moss-dark);
  color: var(--parchment-alt);
  font-size: 12px;
  text-align: center;
  padding: 7px 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-header {
  background: var(--moss);
  color: var(--white);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 16px;
}
.brand {
  display: flex;
  flex-direction: column;
  color: var(--white);
  text-decoration: none;
  line-height: 1.15;
}
.brand:hover { color: var(--white); }
.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 23px;
}
.brand-tagline {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--parchment-alt);
  margin-top: 2px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.15s;
}
.site-nav a:hover {
  background: rgba(255,255,255,0.14);
  color: var(--white);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--moss-dark);
    padding: 8px 16px 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .site-header { position: relative; }
}

/* ============================================================
   Guide tab / chapter badge — sequential-guide index language
   Use ONLY for genuinely sequential content (guide chapters, steps)
   ============================================================ */
.guide-tab {
  display: inline-block;
  background: var(--moss);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 6px 12px 5px;
  border-radius: 4px 4px 0 2px;
  position: relative;
  margin-bottom: 10px;
}
.guide-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  border-width: 6px 8px 0 0;
  border-style: solid;
  border-color: var(--moss-dark) transparent transparent transparent;
}
.guide-tab.rust { background: var(--rust); }
.guide-tab.rust::after { border-color: var(--rust-dark) transparent transparent transparent; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: linear-gradient(180deg, var(--parchment-alt) 0%, var(--parchment) 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 56px;
}
.hero .wrap { max-width: 860px; }
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}
.hero h1 { font-size: 44px; margin-bottom: 18px; }
.hero-lede {
  font-size: 18px;
  color: var(--ink-light);
  max-width: 640px;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .hero h1 { font-size: 32px; }
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding: 56px 0; }
.section-alt { background: var(--white); }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head .guide-tab { margin-bottom: 14px; }
.section-head p { color: var(--ink-light); }

/* ============================================================
   Chapters / table-of-contents grid (homepage topic areas)
   ============================================================ */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.chapter-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.chapter-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--moss);
  color: var(--ink);
}
.chapter-card h3 { margin: 4px 0 8px; }
.chapter-card p { font-size: 14px; color: var(--ink-light); margin: 0; }

/* ============================================================
   Step list — numbered how-to steps within real guide content
   ============================================================ */
.step-list {
  list-style: none;
  counter-reset: step;
  margin: 24px 0;
  padding: 0;
}
.step-list li {
  counter-increment: step;
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 68px;
  margin-bottom: 14px;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rust);
  color: var(--white);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list li h4 { margin: 0 0 4px; font-size: 16px; }
.step-list li p:last-child { margin-bottom: 0; }

/* ============================================================
   Product grid / cards
   ============================================================ */
.product-grid, .article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}
.product-card, .article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover, .article-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--ink);
}
.product-card-media, .article-card-media {
  aspect-ratio: 4 / 3;
  background: var(--parchment-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-size: 13px;
  font-family: var(--font-sans);
}
.product-card-body, .article-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-card-body h3, .article-card-body h3 { font-size: 18px; margin: 0; }
.product-card-body p, .article-card-body p { font-size: 14px; color: var(--ink-light); margin: 0; flex: 1; }
.product-card-price {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--moss);
}
.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-light);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ============================================================
   Newsletter
   ============================================================ */
.newsletter {
  background: var(--moss-tint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
}
.newsletter h2 { margin-top: 0; }
.newsletter p { color: var(--ink-light); max-width: 520px; margin-left: auto; margin-right: auto; }
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 22px auto 0;
  flex-wrap: wrap;
  justify-content: center;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--white);
  color: var(--ink);
}
.newsletter-form input[type="email"]:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.newsletter-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.newsletter-msg { margin-top: 12px; font-size: 14px; min-height: 20px; }
.newsletter-msg.success { color: var(--moss-dark); font-weight: 600; }
.newsletter-msg.error { color: var(--rust-dark); font-weight: 600; }

/* ============================================================
   Legal / long-form article pages ("brief" body)
   ============================================================ */
.brief {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.crumbs {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 16px 24px 0;
  max-width: 760px;
  margin: 0 auto;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--ink-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin: 18px 0 28px;
}
.doc-meta b { color: var(--ink); }
.callout {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--moss);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px;
  margin: 20px 0;
}
.callout .callout-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 8px;
}
.fineprint { font-size: 13px; color: var(--ink-light); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--parchment-alt);
  padding: 48px 0 0;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-brand { font-family: var(--font-serif); color: var(--white); font-size: 20px; margin-bottom: 8px; }
.footer-about { font-size: 13px; color: #B9AF9C; max-width: 320px; }
.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: var(--parchment-alt);
  text-decoration: none;
  padding: 5px 0;
  font-size: 14px;
}
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 20px 24px;
  font-size: 12px;
  color: #9C927E;
  text-align: center;
  line-height: 1.7;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Cookie consent banner
   ============================================================ */
#cookieBanner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink);
  color: var(--white);
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.2);
}
#cookieBanner.show { display: block; }
#cookieBanner .in {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
#cookieBanner p { margin: 0; font-size: 13px; color: var(--parchment-alt); flex: 1; min-width: 220px; }
#cookieBanner a { color: var(--white); text-decoration: underline; }
#cookieBanner button {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: var(--white);
}
#cookieBanner #cbAccept { background: var(--rust); border-color: var(--rust); }
