/* ============================================================
   Tea on 23 — styles.css
   "The hidden garden": sage-cream ground, forest ink,
   rose-clay action, petal highlight. Dark = deep moss-green.
   ============================================================ */

/* ---------- Palette tokens (light = :root default) ---------- */
:root {
  --ground: #F4F5EC;
  --surface: #FFFFFF;
  --ink: #1E3326;
  --muted: #4F6254;
  --brand: #A8473F;        /* CTA fill */
  --brand-text: #A8473F;   /* small accent text / ticks / links on normal surfaces */
  --accent-dark: #F6D0CB;  /* accent text on always-dark bands (fixed) */
  --petal: #F6D3CF;        /* highlight fill — dark text on it, never white */
  --ink-fixed: #1E3326;    /* dark text on petal (fixed) */
  --on-brand: #FFFFFF;     /* text on brand fills (fixed) */
  --cream: #EEF1E4;        /* text on always-dark bands (fixed) */
  --band: #1E3326;         /* always-dark header/hero/footer/CTA/planner panel */

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;
  --gap: 1.5rem;
  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-body: "Mulish", system-ui, sans-serif;
  --shadow: 0 2px 10px rgba(30, 51, 38, 0.08);
  --card-border: 1px solid #DBE0D0;  /* light-mode cards rely on a visible border (bug 16) */
}

html[data-theme="dark"] {
  --ground: #121C16;
  --surface: #1E2E24;      /* dark card: 1.22:1 vs ground (measured ≥1.2) */
  --ink: #EEF1E4;
  --muted: #BFCDBF;
  --brand: #A8473F;        /* identical in dark; white ≥4.5:1 (bug 7) */
  --brand-text: #F0A89F;   /* links/ticks on normal dark surfaces ≥4.5:1 */
  --accent-dark: #F6D0CB;  /* fixed */
  --petal: #F6D3CF;        /* fixed */
  --ink-fixed: #1E3326;    /* fixed */
  --on-brand: #FFFFFF;     /* fixed */
  --cream: #EEF1E4;        /* fixed */
  --band: #0A120D;         /* even darker band in dark mode */
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --card-border: 1px solid #2E4133;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;            /* bug 3: no overflow on long text */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-text); }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1rem; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
/* bug 4: never `padding: X 0` on an element that is also `.container`.
   Section vertical rhythm lives on .section, which is NOT a .container. */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 4vw, 3rem); }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-text);
  margin: 0 0 0.6rem;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* leaf-vine divider motif */
.vine {
  border: 0;
  height: 18px;
  margin: 0 auto;
  width: 160px;
  background:
    radial-gradient(circle at 10% 50%, var(--brand-text) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 50%, var(--brand-text) 0 2px, transparent 3px);
  position: relative;
  opacity: 0.8;
}
.vine::before {
  content: "";
  position: absolute;
  top: 50%; left: 14px; right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-text), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.btn--primary:hover { background: #923c35; border-color: #923c35; color: var(--on-brand); }
.btn--ghost {
  background: transparent;
  color: var(--brand-text);
  border-color: var(--brand-text);
}
.btn--ghost:hover { background: rgba(168, 71, 63, 0.10); color: var(--brand-text); }
.btn--petal {
  background: var(--petal);
  color: var(--ink-fixed);
  border-color: var(--petal);
}
.btn--petal:hover { background: #f0bdb7; color: var(--ink-fixed); border-color: #f0bdb7; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Header (always-dark band) ---------- */
.site-header {
  background: var(--band);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.8rem;
}
.brand { display: flex; flex-direction: column; text-decoration: none; margin-right: auto; }
.brand .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--cream);
  line-height: 1.05;
  overflow-wrap: anywhere;   /* bug 3: brand name wraps */
}
/* header sub-label + any .muted in header use --accent-dark (additional rule) */
.site-header .brand-sub,
.site-header .muted {
  color: var(--accent-dark);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; align-items: center; }
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.35rem 0.2rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-dark); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent-dark); color: var(--accent-dark); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

/* theme toggle */
.theme-toggle {
  background: transparent;
  border: 2px solid rgba(246, 208, 203, 0.5);
  color: var(--cream);
  border-radius: 999px;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--accent-dark); color: var(--accent-dark); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* bug 6: link-colour rules in dark sections must not override button text.
   Header/hero/band/footer buttons keep their own colours incl. :hover. */
.site-header a.btn--primary,
.hero a.btn--primary,
.band a.btn--primary,
.site-footer a.btn--primary { color: var(--on-brand); }
.site-header a.btn--ghost,
.hero a.btn--ghost,
.band a.btn--ghost,
.planner-message a.btn--ghost,
.site-footer a.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.site-header a.btn--ghost:hover,
.hero a.btn--ghost:hover,
.band a.btn--ghost:hover,
.planner-message a.btn--ghost:hover,
.site-footer a.btn--ghost:hover { background: rgba(246,208,203,0.14); color: var(--accent-dark); }
.site-header a.btn--petal,
.hero a.btn--petal,
.band a.btn--petal,
.site-footer a.btn--petal { color: var(--ink-fixed); }

/* ---------- Always-dark bands: hero / .band / footer / planner panel ----------
   bug 1: explicit light-on-dark for every text role; bug 2: no light cards. */
.hero, .band {
  background: var(--band);
  color: var(--cream);
}
.hero h1, .hero h2, .hero h3, .hero h4,
.band h1, .band h2, .band h3, .band h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.planner-message h1, .planner-message h2, .planner-message h3, .planner-message h4 {
  color: var(--cream);
}
.hero p, .hero li, .hero .muted,
.band p, .band li, .band .muted,
.site-footer p, .site-footer li, .site-footer .muted,
.planner-message p, .planner-message li, .planner-message .muted {
  color: var(--cream);
}
/* accent text on dark bands = fixed --accent-dark, never --brand-text (bug 1) */
.hero .eyebrow, .band .eyebrow, .site-footer .eyebrow,
.hero .accent, .band .accent, .site-footer .accent,
.planner-message .eyebrow, .planner-message .accent,
.hero a:not(.btn), .band a:not(.btn),
.site-footer a:not(.btn), .planner-message a:not(.btn) {
  color: var(--accent-dark);
}
.hero a:not(.btn):hover, .band a:not(.btn):hover,
.site-footer a:not(.btn):hover, .planner-message a:not(.btn):hover { color: #ffe3df; }
/* stat/proof text, notes, img-note on dark bands */
.hero .stat, .band .stat, .site-footer .stat { color: var(--cream); }
.hero .img-note, .band .img-note { color: var(--accent-dark); }

/* ghost buttons on dark bands — both a and button (bug 1) */
.hero button.btn--ghost, .band button.btn--ghost,
.site-footer button.btn--ghost, .planner-message button.btn--ghost {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}
.hero button.btn--ghost:hover, .band button.btn--ghost:hover,
.site-footer button.btn--ghost:hover, .planner-message button.btn--ghost:hover {
  background: rgba(246,208,203,0.14);
  color: var(--accent-dark);
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero .hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.img-note {
  font-size: 0.78rem;
  margin-top: 0.5rem;
  color: var(--muted);
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: var(--card-border);        /* bug 16: visible border in light */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card .card-body { padding: 1.25rem; }
.card h3 { margin-top: 0; }

/* proof strip */
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.proof li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.proof .stat { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.proof .stat-label { font-size: 0.85rem; color: var(--muted); }

/* note chip (bug 17: ≥4.5:1 in light — dark text on tint) */
.note-chip {
  display: inline-block;
  background: var(--petal);
  color: var(--ink-fixed);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
}
/* [NEEDS CONTENT] placeholder block */
.needs-content {
  border: 2px dashed #B9573F;
  background: rgba(168, 71, 63, 0.06);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.needs-content strong { color: var(--brand-text); }

/* ---------- find-us / NAP ---------- */
.findus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}
.findus > * { min-width: 0; }         /* bug 3 */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--muted); min-width: 0; }
dl.nap dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }   /* bug 3 */
/* NAP inside a dark band gets light text (bug 1) */
.band dl.nap dt, .site-footer dl.nap dt { color: var(--accent-dark); }
.band dl.nap dd, .site-footer dl.nap dd { color: var(--cream); }
.band dl.nap dd a, .site-footer dl.nap dd a { color: var(--accent-dark); }

/* ============================================================
   Tea table planner
   ============================================================ */
.planner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--gap); align-items: start; }
.planner-form { min-width: 0; }
.planner-aside { min-width: 0; position: sticky; top: 90px; display: grid; gap: var(--gap); }

fieldset.step {
  border: var(--card-border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
fieldset.step > legend {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  padding: 0 0.4rem;
}
.step-hint { color: var(--muted); font-size: 0.9rem; margin: -0.2rem 0 0.9rem; }

/* option lists: radios / checkboxes as tiles */
.options { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 2px solid #CBD3C2;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  background: var(--ground);
  min-width: 0;
}
html[data-theme="dark"] .option { border-color: #35493A; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option .tile-label { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.option .tick {
  margin-left: auto;
  width: 22px; height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid #CBD3C2;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 0.85rem;
  line-height: 1;
}
/* bug 13: selected visible without colour alone — outline + tick.
   selected-option ticks use --brand-text (additional rule). */
.option:has(input:checked) {
  border-color: var(--brand-text);
  outline: 2px solid var(--brand-text);
  outline-offset: 1px;
  background: var(--surface);
}
.option:has(input:checked) .tick {
  border-color: var(--brand-text);
  color: var(--brand-text);
}
.option input:focus-visible ~ .tick,
.option input:focus-visible ~ .tile-label { outline: 2px dashed var(--brand-text); outline-offset: 2px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 0.5rem; }
.stepper button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--brand-text);
  background: transparent;
  color: var(--brand-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}
.stepper button:hover { background: rgba(168,71,63,0.10); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .count {
  min-width: 3ch;
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}
.stepper-caption { color: var(--muted); margin-top: 0.4rem; font-size: 0.9rem; }

/* dependent fields */
[hidden] { display: none !important; }   /* bug 14 safety */
.dependent {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #CBD3C2;
}
html[data-theme="dark"] .dependent { border-top-color: #35493A; }
.field-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--ground);
  border: 2px solid #CBD3C2;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
}
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] textarea { border-color: #35493A; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.char-count { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

/* live tea-table preview */
.tea-preview {
  background: var(--surface);
  border: var(--card-border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.tea-preview h3 { margin-top: 0; }
.table-strip {
  background: linear-gradient(0deg, #e9d8c3, #f0e4d4);
  border-radius: 10px;
  padding: 1rem 0.9rem 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 72px;
  align-items: center;
  justify-content: center;
}
html[data-theme="dark"] .table-strip { background: linear-gradient(0deg, #3a2f26, #4a3b2e); }
.cup { width: 30px; height: 34px; flex: 0 0 auto; color: var(--brand); }
.cup svg { width: 100%; height: 100%; display: block; }
.more-cups { font-weight: 700; color: var(--brand-text); align-self: center; }
.preview-caption { text-align: center; margin: 0.6rem 0 0; color: var(--muted); font-weight: 600; }

/* message panel — always dark (bug 1: planner-message band) */
.planner-message {
  background: var(--band);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.planner-message h3 { color: var(--cream); margin-top: 0; }
.planner-message .message-body {
  white-space: pre-wrap;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(246,208,203,0.25);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  color: var(--cream);
  min-height: 3rem;
  font-size: 1.02rem;
}
.planner-message .message-empty { color: var(--accent-dark); font-style: italic; }
.send-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.copy-status { font-size: 0.85rem; color: var(--accent-dark); margin-top: 0.5rem; min-height: 1.2em; }

/* ---------- Footer (always-dark band) ---------- */
.site-footer {
  background: var(--band);
  color: var(--cream);
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--gap);
  padding-block: clamp(2rem, 4vw, 3rem);
}
.footer-grid > * { min-width: 0; }     /* bug 3 */
.site-footer h3 { color: var(--cream); font-size: 1.2rem; }
.site-footer a { color: var(--accent-dark); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.footer-bottom {
  border-top: 1px solid rgba(246,208,203,0.22);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom, .footer-bottom p { color: var(--cream); }
/* bug 1: .demo-note strong on dark footer must be light */
.demo-note {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(246,208,203,0.2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  color: var(--cream);
  font-size: 0.86rem;
}
.demo-note strong { color: var(--accent-dark); }

/* skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand); color: var(--on-brand);
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Responsive — bug 3: 320px safe, nav own row ≤700, CTA hidden ≤480
   ============================================================ */
@media (max-width: 920px) {
  .hero .hero-inner { grid-template-columns: 1fr; }
  .planner { grid-template-columns: 1fr; }
  .planner-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .site-header .header-inner { flex-direction: column; align-items: stretch; }
  .brand { margin-right: 0; }
  .header-actions { justify-content: space-between; }
  .site-nav { order: 3; width: 100%; }  /* nav on its own row */
}
@media (max-width: 560px) {
  .findus { grid-template-columns: 1fr; }
  .options.cols-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }        /* bug 3: hide header CTA ≤480px */
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
