/* ==========================================================================
   LionsMane.ca — Design System
   Accessible, mobile-first, zero-dependency. Palette: warm off-white base,
   deep teal-green (nature/health), warm amber accent (echoes the mushroom).
   ========================================================================== */

:root {
  /* Palette */
  --bg:          #faf8f3;   /* warm off-white page */
  --surface:     #ffffff;   /* cards */
  --surface-alt: #f2ede3;   /* subtle banded sections */
  --ink:         #1c2b26;   /* near-black text */
  --ink-soft:    #4b5a54;   /* muted text */
  --primary:     #0f5c4c;   /* deep teal-green */
  --primary-dk:  #0a4437;
  --primary-lt:  #e3efe9;   /* tint bg */
  --accent:      #c47d34;   /* warm amber/terracotta */
  --accent-dk:   #a56523;
  --border:      #e5ddcf;
  --warn-bg:     #fbf3e6;
  --warn-bd:     #e7cfa3;

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;

  /* Layout */
  --wrap: 1120px;
  --measure: 44rem;         /* readable line length for articles */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(28,43,38,.06), 0 8px 24px rgba(28,43,38,.06);
  --shadow-lg: 0 6px 18px rgba(28,43,38,.10), 0 18px 40px rgba(28,43,38,.10);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* The page itself must never pan sideways on phones — wide content scrolls
   inside its own container (.table-scroll) instead. */
html, body { overflow-x: hidden; overflow-x: clip; }
/* Grid/flex children may never force their column wider than the screen
   (e.g. a broken image rendering at its attribute size on Android). */
.grid > *, .hero__grid > * { min-width: 0; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem;        /* 18px base — accessible for older readers */
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 1.6em; }
h3 { font-size: 1.35rem; margin-top: 1.4em; }
p { margin: 0 0 1.1em; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--alt { background: var(--surface-alt); }
.section--tint { background: var(--primary-lt); }
.center { text-align: center; }
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; font-weight: 700; color: var(--accent-dk); margin-bottom: .6rem; }
.skip-link { position:absolute; left:-9999px; top:0; background:var(--primary); color:#fff; padding:.6rem 1rem; z-index:1000; }
.skip-link:focus { left:.5rem; top:.5rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,243,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; color: var(--primary-dk); text-decoration: none; letter-spacing: -.01em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark svg { width: 100%; height: 100%; display:block; }
/* Brand lockup (lion mark + wordmark) — one image, used in header and footer. */
.brand__logo { height: 56px; width: auto; display: block; }
@media (max-width: 640px) { .brand__logo { height: 42px; } }
.brand span b { color: var(--accent-dk); }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: inline-block; padding: .5rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem;
}
.nav__links a:hover { background: var(--primary-lt); color: var(--primary-dk); }
.nav__links a[aria-current="page"] { color: var(--primary-dk); background: var(--primary-lt); }
.nav__cta { background: var(--accent); color: #fff !important; }
.nav__cta:hover { background: var(--accent-dk) !important; }
.nav__toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .6rem; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--ink); }

@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: .5rem; max-height: 0; overflow: hidden;
    visibility: hidden;
  }
  .nav__links.open { max-height: 90vh; visibility: visible; padding: .5rem; }
  .nav__links a { padding: .8rem .7rem; font-size: 1.05rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-cta { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-cta:hover { background: var(--accent-dk); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-ghost { background: transparent; color: var(--primary-dk); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-lt); }
.btn-lg { font-size: 1.15rem; padding: 1rem 1.8rem; }

/* ---------- Affiliate link style (NOT underlined, per brief) ---------- */
a.aff {
  color: var(--accent-dk);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(196,125,52,.28);
  transition: border-color .15s ease, color .15s ease;
}
a.aff:hover { color: var(--accent); border-bottom-color: var(--accent); }
.aff-note { font-size: .82rem; color: var(--ink-soft); margin-top: .4rem; }
.aff-note::before { content: "↳ "; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--primary-lt); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { margin-bottom: .4em; }
.hero__img { border-radius: var(--radius); box-shadow: var(--shadow-lg); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.hero__cluster { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.trust-row { display:flex; flex-wrap:wrap; gap:1.2rem 2rem; align-items:center; margin-top:1.6rem; color:var(--ink-soft); font-size:.92rem; font-weight:600; }
.trust-row span { display:inline-flex; align-items:center; gap:.4rem; }
.trust-row .tick { color: var(--primary); font-weight:800; }
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero__media { order: -1; }
  .hero__img { aspect-ratio: 16/10; max-height: 340px; }
}

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); height: 100%;
}
.card h3 { margin-top: 0; }
.card__icon { width: 46px; height: 46px; border-radius: 10px; background: var(--primary-lt); color: var(--primary-dk); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: .9rem; }
.card--link { text-decoration: none; color: inherit; display: block; transition: transform .1s ease, box-shadow .15s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card--link .more { color: var(--primary-dk); font-weight: 700; }

/* ---------- Article layout ---------- */
.article { padding-block: clamp(2rem, 5vw, 3.5rem); }
.article__head { max-width: var(--measure); margin-inline:auto; }
.article__meta { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.4rem; display:flex; gap:1rem; flex-wrap:wrap; }
.article__body { max-width: var(--measure); margin-inline: auto; }
.article__body > figure { margin: 1.8rem 0; }
.article__body figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.article__body figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .5rem; text-align: center; }
.article__body ul, .article__body ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.article__body li { margin-bottom: .5em; }
.article__hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.8rem; }

/* Table of contents */
.toc { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; margin: 0 0 2rem; }
.toc strong { display:block; margin-bottom:.5rem; font-size:.95rem; letter-spacing:.02em; text-transform:uppercase; color:var(--ink-soft); }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Key-takeaway / answer box (featured-snippet bait) */
.answer-box { background: var(--primary-lt); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 0 0 1.8rem; border: 1px solid #cfe3db; }
.answer-box strong { color: var(--primary-dk); }

/* Study citation pull */
.study { border-left: 4px solid var(--accent); background: var(--warn-bg); padding: 1rem 1.3rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.6rem 0; font-family: var(--serif); }
.study cite { display:block; font-family: var(--sans); font-style: normal; font-size:.85rem; color: var(--ink-soft); margin-top:.5rem; }
.citations { font-size: .9rem; color: var(--ink-soft); }
.citations ol { padding-left: 1.3rem; }
.citations a { word-break: break-word; }

/* ---------- Recommendation / product callout ---------- */
.rec {
  background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow); margin: 2rem 0;
}
.rec__tag { display:inline-block; background: var(--primary); color:#fff; font-size:.78rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:.25rem .7rem; border-radius:999px; margin-bottom:.8rem; }
.rec h3 { margin: 0 0 .5rem; }
.rec .btn { margin-top: .6rem; }

/* ---------- Comparison table ---------- */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .table-scroll::before { content: "Swipe sideways to see the full comparison →"; display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .4rem; }
}
table.compare { border-collapse: collapse; width: 100%; min-width: 640px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.compare th, .compare td { padding: .9rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .98rem; vertical-align: top; }
.compare thead th { background: var(--primary); color: #fff; font-weight: 700; }
.compare tbody tr:nth-child(even) { background: #fbfaf6; }
.compare .row-top { background: var(--primary-lt) !important; }
.compare .row-top td:first-child { font-weight: 700; }
.pill { display:inline-block; font-size:.75rem; font-weight:700; padding:.15rem .55rem; border-radius:999px; }
.pill--yes { background:#e3efe9; color:var(--primary-dk); }
.pill--no { background:#f6e5e0; color:#9a3b23; }
.pill--best { background:var(--accent); color:#fff; }

/* ---------- FAQ (native accordion) ---------- */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .8rem; padding: 0 1.2rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 0; list-style: none; display:flex; justify-content:space-between; gap:1rem; align-items:center; }
.faq summary::-webkit-details-marker { display:none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--primary); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] { padding-bottom: .4rem; }
.faq details > *:not(summary) { margin-top: -.2rem; }

/* ---------- Email capture ---------- */
.optin { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%); color: #fff; border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow-lg); }
.optin h2 { color: #fff; margin-top: 0; }
.optin p { color: #e6efec; }
.optin .form { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.2rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field input[type=text], .field input[type=email] { width: 100%; padding: .8rem 1rem; font-size: 1.05rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; }
.field input:focus { outline: 3px solid rgba(15,92,76,.25); border-color: var(--primary); }
.choice { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
@media (max-width:520px){ .choice{ grid-template-columns:1fr; } }
.choice label { display:flex; gap:.6rem; align-items:flex-start; border:2px solid var(--border); border-radius:var(--radius-sm); padding:.8rem 1rem; cursor:pointer; font-weight:600; margin:0; }
.choice input { margin-top:.25rem; }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-lt); }
.unlock-steps { list-style: none; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; padding: 0; margin: 1.6rem 0; }
.unlock-steps li { display: flex; align-items: center; gap: .5rem; border: 2px solid var(--border); border-radius: 999px; padding: .45rem 1rem .45rem .5rem; font-weight: 600; font-size: .92rem; color: var(--ink-soft); background: var(--surface); }
.unlock-steps li span { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--border); color: var(--ink); font-size: .85rem; }
.unlock-steps li.done { border-color: var(--primary); color: var(--primary); }
.unlock-steps li.done span { background: var(--primary); color: #fff; }
.unlock-steps li.done span::before { content: "✓"; }
.unlock-steps li.done span { font-size: 0; }
.unlock-steps li.done span::before { font-size: .95rem; }
.unlock-steps li.now { border-color: var(--accent); color: var(--ink); }
.unlock-steps li.now span { background: var(--accent); color: #fff; }
.waiting { font-weight: 600; }
.ellipsis::after { content: ""; animation: lm-dots 1.5s steps(4, end) infinite; }
@keyframes lm-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.choice--covers label { flex-direction: column; align-items: center; text-align: center; padding: .8rem .7rem; }
.choice--covers img { width: 132px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; background: #fff; box-shadow: var(--shadow); }
.choice__row { display: flex; gap: .55rem; align-items: center; justify-content: center; margin-top: .65rem; }
.choice__row input { margin-top: 0; }
.consent { display:flex; gap:.6rem; align-items:flex-start; font-size:.9rem; color:var(--ink-soft); font-weight:400; }
.consent input { margin-top:.35rem; }

/* ---------- Disclaimer band + footer ---------- */
.disclaimer { background: var(--warn-bg); border-top: 1px solid var(--warn-bd); border-bottom: 1px solid var(--warn-bd); font-size: .88rem; color: #6a5227; }
.disclaimer .wrap { padding-block: 1rem; }
.site-footer { background: var(--primary-dk); color: #d7e5e0; padding-block: 2.5rem 1.5rem; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr; gap:1.5rem; } }
.footer-grid h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing:.05em; margin-bottom:.8rem; }
.footer-grid ul { list-style:none; margin:0; padding:0; }
.footer-grid li { margin-bottom:.5rem; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.2rem; color:#a9c3bb; font-size:.85rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem; }

/* ---------- Utilities ---------- */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.stack > * + * { margin-top: 1rem; }
.badge { display:inline-block; background:var(--accent); color:#fff; font-weight:700; font-size:.8rem; padding:.2rem .6rem; border-radius:999px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto !important; transition:none !important; } }
