/* Chelmsford Liquor Store Tongaat — shared styles
   Palette & type per research/design-language.md.
   Two-role token discipline (per steering):
   --on-brand  = text/icons on the wine-coloured header/hero/footer/buttons.
                 Stays near-white in BOTH themes (it sits on the brand fill,
                 not on the page's own swappable background).
   --on-gold   = dark label on a gold fill. Never remapped.
   --surface   = card/panel fill. Legitimately flips dark in dark mode.
   These are deliberately separate tokens so remapping the surface never
   drags the on-brand text colour dark with it. */

:root {
  /* Brand */
  --wine:        #5C1A2E;
  --wine-deep:   #3A0F1D;
  --gold:        #C99A3D;
  --gold-text:   #936422; /* deep gold for small text on a light ground — raw --gold fails WCAG AA at this size (2.3-2.6:1) */

  /* Ground / surfaces (theme-swappable) */
  --ground:      #F7F3EC;
  --surface:     #FFFFFF;
  --hairline:    #E4DACE;

  /* Text (theme-swappable) */
  --ink:         #241417;
  --muted:       #6E5F62;

  /* Fixed-role tokens — DO NOT remap per theme */
  --on-brand:    #F7F3EC; /* text on wine/hero/footer/buttons */
  --on-gold:     #241417; /* text on gold fill */

  /* Applied brand-band colours (swappable so dark mode can deepen them) */
  --band:        var(--wine);
  --band-deep:   var(--wine-deep);

  --shadow:      0 2px 8px rgba(36, 20, 23, .08), 0 8px 24px rgba(36, 20, 23, .06);
  --radius:      12px;
  --maxw:        1080px;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  /* Ground deepened and surface lifted so cards separate from the page:
     computed surface-vs-ground contrast = 1.47:1 (design-language requires
     >=1.35:1; the doc's suggested #2A1017 only gave ~1.02:1 against the ground
     and was verified/rejected in a real contrast check). */
  --ground:      #1B0C0F;
  --surface:     #4A2734;
  --hairline:    #603543;

  --ink:         #F2E9E3;
  --muted:       #B9A6AA;

  /* Brand bands sit a touch deeper against the dark ground */
  --band:        #4A1424;
  --band-deep:   #3A0F1D;

  /* --on-brand and --on-gold intentionally NOT overridden here. */

  --shadow:      0 2px 8px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .30);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

a { color: var(--wine); }
[data-theme="dark"] a:not([class]) { color: var(--gold); }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tint { background: var(--surface); }

.muted { color: var(--muted); }
.center { text-align: center; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold-text);
  margin: 0 0 .6rem;
}
/* Inside the wine-coloured hero band the eyebrow sits on a dark fill in
   both themes, so the bright brand gold (not the light-ground-safe
   --gold-text) is the correct, sufficiently-contrasting choice here.
   Same reasoning applies to every eyebrow in dark mode generally, since
   the dark ground/surface are both dark fills too. */
.hero .eyebrow,
[data-theme="dark"] .eyebrow { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background-color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--gold); color: var(--on-gold); }
.btn--primary:hover { background: #d9ab4f; }

.btn--ghost {
  background: transparent;
  color: var(--on-brand);
  border-color: rgba(247, 243, 236, .5);
}
.btn--ghost:hover { border-color: var(--on-brand); }

.btn--outline {
  background: transparent;
  color: var(--wine);
  border-color: var(--wine);
}
[data-theme="dark"] .btn--outline { color: var(--gold); border-color: var(--gold); }
.btn--outline:hover { background: rgba(92, 26, 46, .06); }
[data-theme="dark"] .btn--outline:hover { background: rgba(201, 154, 61, .12); }

/* ---------- Header ---------- */
.site-header {
  background: var(--band);
  color: var(--on-brand);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--on-brand);
  text-decoration: none;
  line-height: 1.1;
}
.brand span { color: var(--gold); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.nav a.navlink {
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.nav a.navlink:hover,
.nav a.navlink[aria-current="page"] { border-bottom-color: var(--gold); }

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

.icon-btn {
  background: transparent;
  border: 2px solid rgba(247, 243, 236, .4);
  color: var(--on-brand);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.icon-btn:hover { border-color: var(--on-brand); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--gold);
  color: var(--on-gold);
  text-decoration: none;
  font-weight: 700;
  padding: .5rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
}
.call-btn:hover { background: #d9ab4f; }
.call-btn svg { width: 16px; height: 16px; }

/* Mobile nav toggle */
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    background: transparent;
    border: 2px solid rgba(247,243,236,.4);
    color: var(--on-brand);
    width: 42px; height: 42px;
    border-radius: 10px;
    align-items: center; justify-content: center;
    cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--band-deep);
    padding: .5rem 20px 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a.navlink {
    padding: .8rem 0;
    border-bottom: 1px solid rgba(247,243,236,.12);
  }
  .nav a.navlink:hover,
  .nav a.navlink[aria-current="page"] { border-bottom-color: rgba(247,243,236,.12); color: var(--gold); }
  .call-btn .call-label { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--band);
  color: var(--on-brand);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .22;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(58,15,29,.55), rgba(58,15,29,.85));
}
.hero__inner {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0;
  max-width: 720px;
}
.hero h1 { color: var(--on-brand); }
.hero p.lede { font-size: 1.2rem; color: var(--on-brand); opacity: .95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero__nap {
  margin-top: 1.6rem;
  font-size: .98rem;
  color: var(--on-brand);
  opacity: .9;
}
.hero__nap a { color: var(--gold); font-weight: 700; text-decoration: none; }

/* ---------- Trust strip ---------- */
.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.trust .card { text-align: center; }
.trust h3 { color: var(--wine); }
[data-theme="dark"] .trust h3 { color: var(--gold); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.cat {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.cat h3 { margin-bottom: .3rem; }
.cat p { margin: 0; font-size: .95rem; color: var(--muted); }

/* ---------- Split feature ---------- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.split img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 420px;
}
figure.media { margin: 0; }
figure.media figcaption {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .5rem;
  font-style: italic;
}

/* ---------- Map ---------- */
.map-embed {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-embed iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ---------- Contact layout ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
  display: flex;
  gap: .8rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--hairline);
}
.info-list li:last-child { border-bottom: 0; }
.info-list .ico {
  color: var(--gold);
  flex: 0 0 auto;
  margin-top: 2px;
}
.info-list .ico svg { width: 22px; height: 22px; }
.info-list a { color: var(--wine); font-weight: 700; text-decoration: none; }
[data-theme="dark"] .info-list a { color: var(--gold); }

/* ---------- Form ---------- */
.form-note {
  background: rgba(201,154,61,.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  font-size: .92rem;
  margin-bottom: 1.4rem;
}
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-weight: 700;
  font-size: .92rem;
  margin-bottom: .35rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.field textarea { min-height: 130px; resize: vertical; }

/* ---------- 18+ notice ---------- */
.age-notice {
  background: var(--band-deep);
  color: var(--on-brand);
  text-align: center;
  font-size: .92rem;
  padding: .8rem 20px;
}
.age-notice strong { color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--band-deep);
  color: var(--on-brand);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}
.site-footer h4 {
  font-family: var(--font-head);
  color: var(--on-brand);
  margin: 0 0 .8rem;
  font-size: 1.05rem;
}
.site-footer a { color: var(--on-brand); text-decoration: none; opacity: .9; }
.site-footer a:hover { color: var(--gold); opacity: 1; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-brandline {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.footer-brandline span { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(247,243,236,.15);
  padding: 1.2rem 0;
  font-size: .85rem;
  color: var(--on-brand);
  opacity: .8;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  justify-content: space-between;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .trust { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
  .call-btn .call-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
