/* =====================================================================
   Maclaren Auto — styles.css
   Independent Mercedes-Benz specialist, Tongaat.
   Palette: graphite + instrument blue + brushed platinum.
   Fonts: Sora (display), IBM Plex Sans (body/UI).
   Themes via [data-theme] on <html>. See research/design-language.md.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand + neutrals */
  --graphite: #1E2023;      /* header/footer/dark surfaces */
  --ink-deep: #131518;      /* dark-theme ground */
  --blue: #1663B4;          /* CTA fills, rules, marks, large display */
  --blue-fill: #12579C;     /* slightly darker fill for guaranteed white contrast */
  --blue-text: #155397;     /* small blue text/links on LIGHT ground (~5.3:1) */
  --platinum: #C7CCD2;      /* identity/rule/on-dark ONLY — never text on light */
  --platinum-text: #5A626B; /* metallic-looking small label on LIGHT ground */
  --bg: #F4F5F7;            /* page ground (light) */
  --surface: #FFFFFF;       /* card/panel fill (light) */
  --band: #E7E9ED;          /* quiet section bands, strips, stripes */
  --text: #191B1E;          /* body text on light (~16:1) */
  --muted: #586069;         /* secondary text (~6.6:1 on white) */
  --hairline: #D8DBDF;      /* borders, table rules (light) */
  --open: #1E7A46;          /* "open now" status only */

  /* Role tokens (two-jobs guard: --on-brand is NEVER the surface token) */
  --on-brand: #F4F5F7;      /* text/icons on graphite + on blue fill — FIXED in both themes */
  --border: var(--hairline);
  --shadow: 0 1px 2px rgba(25, 27, 30, .06), 0 8px 24px rgba(25, 27, 30, .06);

  /* Chip on always-dark surfaces (light-on-dark in BOTH themes) */
  --chip-bg: rgba(199, 204, 210, .16);
  --chip-border: rgba(199, 204, 210, .40);
  --chip-text: #E4E7EB;

  /* Type */
  --font-display: "Sora", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --gap: clamp(1rem, 2.5vw, 2rem);
}

[data-theme="dark"] {
  --bg: #101216;            /* dark ground — measured pair below */
  /* Surface vs ground measured 1.391:1 (>=1.35 required). Computed, not guessed. */
  --surface: #2A2F36;
  --band: #191D22;
  --text: #ECEDEF;
  --muted: #9BA1A8;
  --hairline: #3C424A;
  --border: #3C424A;
  --blue-text: #5FA1E0;     /* lifted blue for small links on dark surface (~6:1) */
  --platinum-text: #AEB4BB;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .5);
  /* --on-brand, --graphite, --blue, --platinum, --chip-* stay fixed */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;              /* 16px min */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue-text); }
a:hover { color: var(--blue); }
img, svg { max-width: 100%; display: block; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

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

.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--blue-fill); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  z-index: 100; transition: top .15s ease;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 8px; color: var(--on-brand); }

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue-text);
  margin: 0 0 .5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: .85rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;            /* large tap target */
  transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue-fill);
  color: var(--on-brand);
  border-color: var(--blue-fill);
}
.btn-primary:hover { background: #0F4A85; color: var(--on-brand); }

.btn-outline {
  background: transparent;
  color: var(--blue-text);
  border-color: var(--blue);
}
.btn-outline:hover { background: rgba(22, 99, 180, .08); color: var(--blue); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* Buttons that sit on the always-dark header/hero */
.on-dark .btn-outline,
.btn-outline.on-dark {
  color: var(--on-brand);
  border-color: var(--platinum);
}
.on-dark .btn-outline:hover,
.btn-outline.on-dark:hover { background: rgba(199, 204, 210, .14); color: var(--on-brand); }

/* ---------- Chips / status ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
/* [TO CONFIRM] chip on a LIGHT surface */
.chip-confirm {
  background: rgba(22, 99, 180, .10);
  color: var(--blue-text);
  border: 1px solid rgba(22, 99, 180, .30);
}
/* [TO CONFIRM] chip on an always-dark surface (light-on-dark BOTH themes) */
.on-dark .chip-confirm,
.chip-confirm.on-dark {
  background: var(--chip-bg);
  color: var(--chip-text);
  border-color: var(--chip-border);
}

.status-open {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  color: var(--open);
}
[data-theme="dark"] .status-open { color: #4FBE7E; }
.status-open .dot {
  display: inline-flex;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--graphite);
  color: var(--on-brand);
  border-bottom: 1px solid rgba(199, 204, 210, .14);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding-block: .5rem;
}

/* Brand lockup — shrinks but shows full wordmark at >=1280 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--on-brand);
  flex: 0 1 auto;
  min-width: 0;
}
.brand:hover { color: var(--on-brand); }
.brand .brand-mark { flex: 0 0 auto; display: flex; }
.brand .brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 1.15rem;
  white-space: nowrap;
  color: var(--on-brand);
}
.brand .brand-word .word-full { display: none; }
.brand .brand-word .word-short { display: inline; }
@media (min-width: 1280px) {
  .brand .brand-word .word-full { display: inline; }
  .brand .brand-word .word-short { display: none; }
}

/* Primary nav (inline on desktop) */
.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 1.5vw, 1.5rem);
  margin: 0; padding: 0;
}
.main-nav a:not([class]) {
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;         /* guard #2: no mid-phrase wrap */
  padding: .4rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:not([class]):hover { color: #fff; border-bottom-color: var(--platinum); }
.main-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--blue);
}

/* Header actions (desktop only) */
.header-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.header-call {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.header-call:hover { color: #fff; }
.header-call .icon { display: flex; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(199, 204, 210, .3);
  background: transparent;
  color: var(--on-brand);
  cursor: pointer;
  flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--platinum); }
.theme-toggle .icon { display: flex; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: flex; }
[data-theme="dark"] .theme-toggle .icon-sun { display: flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(199, 204, 210, .3);
  background: transparent;
  color: var(--on-brand);
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle .icon { display: flex; }

/* ---------- Mobile drawer ---------- */
.nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(86vw, 340px);
  background: var(--graphite);
  color: var(--on-brand);
  border-left: 1px solid rgba(199, 204, 210, .14);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 70;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.nav-drawer.open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 21, 24, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  z-index: 60;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-close {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(199, 204, 210, .3);
  border-radius: var(--radius-sm);
  color: var(--on-brand);
  cursor: pointer;
}
.drawer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.drawer-nav a:not([class]) {
  display: block;
  color: var(--on-brand);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  padding: .85rem 0;
  border-bottom: 1px solid rgba(199, 204, 210, .12);
}
.drawer-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--blue); }
.drawer-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; }
.drawer-actions .btn { width: 100%; }
.drawer-call {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--on-brand); text-decoration: none;
  font-weight: 600; font-variant-numeric: tabular-nums;
  padding: .5rem 0;
}
.drawer-call .icon { display: flex; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--graphite);
  color: var(--on-brand);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(22, 99, 180, .35), transparent 60%),
    linear-gradient(180deg, rgba(19,21,24,0) 0%, rgba(19,21,24,.4) 100%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-inner {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; }
}
.hero h1 { color: var(--on-brand); }
.hero p.lead { color: #D7DADE; font-size: 1.15rem; max-width: 56ch; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}
.hero-wa {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--on-brand); text-decoration: none; font-weight: 600;
  align-self: center;
}
.hero-wa:hover { color: #fff; }
.hero-wa .icon { display: flex; }

/* Placeholder image blocks (no real photos available) */
.img-placeholder {
  position: relative;
  border-radius: var(--radius);
  border: 1.5px dashed var(--platinum);
  background:
    repeating-linear-gradient(45deg, rgba(199,204,210,.06) 0 12px, rgba(199,204,210,.02) 12px 24px),
    var(--ink-deep);
  color: var(--platinum);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}
.img-placeholder span {
  font-family: var(--font-body);
  font-size: .85rem;
  line-height: 1.5;
  max-width: 32ch;
  color: var(--platinum);
}
.img-placeholder .ph-label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
  margin-bottom: .4rem;
  color: #fff;
}
/* placeholder on a light card surface */
.card .img-placeholder,
.surface-block .img-placeholder {
  min-height: 180px;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.band { background: var(--band); }
.hairline-rule {
  height: 2px; width: 56px;
  background: var(--blue);
  border: 0; margin: 0 0 1.25rem;
}

/* ---------- Credentials strip ---------- */
.credentials {
  background: var(--graphite);
  color: var(--on-brand);
  border-block: 1px solid rgba(199, 204, 210, .16);
}
.credentials .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding-block: 1.25rem;
  align-items: center;
  justify-content: center;
}
.cred-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  color: var(--on-brand);
}
.cred-item .icon { display: flex; color: var(--platinum); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.card h3 { margin-bottom: .25rem; }
.card .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(22, 99, 180, .10);
  color: var(--blue-text);
  margin-bottom: .5rem;
}
[data-theme="dark"] .card .card-icon { background: rgba(95, 161, 224, .14); color: var(--blue-text); }
.card .card-icon .icon { display: flex; }
.card-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--blue-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-link:hover { color: var(--blue); }

/* two-column feature block */
.feature-split {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 900px) {
  .feature-split { grid-template-columns: 1fr 1fr; }
  .feature-split.reverse .feature-media { order: 2; }
}

.check-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; }
.check-list li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
}
.check-list .icon {
  display: flex;
  flex: 0 0 auto;
  color: var(--blue-text);
  margin-top: .15rem;
}

/* ---------- Info / contact panels ---------- */
.info-grid {
  display: grid;
  gap: var(--gap);
}
@media (min-width: 900px) { .info-grid { grid-template-columns: 1fr 1fr; } }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.info-card h3 { display: flex; align-items: center; gap: .5rem; }

.nap-line { margin: 0 0 .35rem; }
.nap-line strong { font-weight: 600; }
.phone-big {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--blue-text);
  text-decoration: none;
  display: inline-block;
  margin: .25rem 0;
}
.phone-big:hover { color: var(--blue); }

/* Hours table */
.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.hours-table th, .hours-table td {
  text-align: left;
  padding: .55rem .5rem;
  border-bottom: 1px solid var(--hairline);
}
.hours-table tr:nth-child(odd) td,
.hours-table tr:nth-child(odd) th { background: var(--band); }
.hours-table th { font-weight: 500; font-family: var(--font-body); }
.hours-table td { text-align: right; font-weight: 600; }

/* Map */
.map-embed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--band);
}
.map-embed iframe {
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
  filter: saturate(.9);
}

/* ---------- Form ---------- */
.form-note {
  background: rgba(22, 99, 180, .07);
  border: 1px solid rgba(22, 99, 180, .22);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  font-size: .95rem;
  margin-bottom: 1.25rem;
}
[data-theme="dark"] .form-note { background: rgba(95,161,224,.10); border-color: rgba(95,161,224,.28); }

.book-form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 620px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label {
  font-weight: 600;
  font-size: .92rem;
}
.field .req { color: var(--blue-text); }
.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .7rem .8rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}
.field textarea { min-height: 120px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.popia-note {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--graphite);
  color: var(--on-brand);
  padding-block: 2.5rem;
  border-top: 1px solid rgba(199, 204, 210, .16);
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 {
  color: var(--on-brand);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.site-footer p, .site-footer li { color: #C9CDD2; }
/* guard #1: footer links re-set to on-brand in ALL themes */
.site-footer a:not([class]) {
  color: var(--on-brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-footer a:not([class]):hover { color: #fff; border-bottom-color: var(--platinum); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-contact .phone-big { color: #7FB4E8; font-size: 1.3rem; }
.footer-contact .phone-big:hover { color: #A9CDF0; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(199, 204, 210, .16);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: .85rem;
  color: #AEB4BB;
}
.footer-brandline {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .75rem;
}

/* ---------- Utilities ---------- */
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.flag-note {
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
}
.nap-flag {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .5rem;
}

/* ---------- Responsive: off-canvas breakpoint ----------
   Inline nav + actions must genuinely fit above 1024px.
   Below that, drawer takes over and .header-actions is hidden entirely. */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-actions { display: none; }   /* guard #2 */
  .nav-toggle { display: inline-flex; }
  .main-nav { margin-left: 0; }
}
@media (min-width: 1025px) {
  .nav-drawer, .drawer-backdrop { display: none; }
}
