/* =========================================================================
   Alpha Hardware (Canelands, Verulam) — styles.css
   Palette & type from research/design-language.md.
   Black + Alpha yellow (#F5B301) on warm white. Saira Condensed + Source Sans 3.

   Recurring-bug guards (see design-language.md §Dark-theme + brief.md §9):
   1. Dark-mode <a> recolour scoped a:not([class]) so it can't kill .btn/.card text.
   2. Nav links white-space:nowrap; off-canvas breakpoint high enough that the
      inline nav + persistent WhatsApp button fit; NO overflow-x:hidden crutch.
   3. Dark --surface #2E2E2E vs dark ground #0D0D0D = ~1.40:1 (computed, >=1.35),
      with visible border + shadow.
   4. Yellow never used as text on light: deep-amber #8A6100 for small yellow text;
      #F5B301 only for fills/rules/marks/large display. Text on yellow is ink #161616.
   5. --on-brand (text on black header/hero/footer/buttons) stays near-white in BOTH themes.
   7. Every fixed-size icon wrapper uses display:flex so the SVG can't expand.
   ========================================================================= */

/* ---- Tokens: light (default) ---- */
:root {
  /* Brand */
  --ink-black: #161616;      /* header/footer/headings/primary buttons ground */
  --true-black: #0D0D0D;     /* dark ground / hero overlay depth */
  --yellow: #F5B301;         /* brand accent — fills, rules, marks, large display */
  --yellow-text: #8A6100;    /* deep amber — small yellow-coloured text on light (AA) */

  /* Grounds & surfaces */
  --ground: #F6F4F0;         /* page ground */
  --surface: #FFFFFF;        /* card/panel fill */
  --surface-2: #FBFAF8;      /* subtle alt surface */

  /* Text */
  --text: #191919;           /* body text on light (~15:1) */
  --muted: #5F5B54;          /* secondary text / meta */

  /* Structure */
  --grit: #E6E4E0;           /* quiet bands, hairline borders, table rules */
  --border: #D9D6D0;
  --shadow: 0 1px 2px rgba(22,22,22,.06), 0 6px 20px rgba(22,22,22,.06);

  /* Info / steel (sparing) */
  --steel: #41708C;
  --steel-text: #2E5068;     /* steel text on light */

  /* On-brand: text/icons on the black header/hero/footer/primary buttons.
     Near-white in BOTH themes — never remapped. */
  --on-brand: #F6F4F0;
  --on-brand-muted: #C9C6C0;

  --maxw: 1120px;
  --radius: 10px;
  --gap: clamp(1rem, 3vw, 2rem);

  --font-head: "Saira Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Tokens: dark override ---- */
[data-theme="dark"] {
  --ground: #0D0D0D;
  --surface: #2E2E2E;        /* computed ~1.40:1 vs #0D0D0D ground (>=1.35) */
  --surface-2: #262626;
  --text: #ECEAE6;
  --muted: #9A958C;
  --grit: #1E1E1E;
  --border: #3A3A3A;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
  /* Small yellow text/links use the yellow itself on dark (deep-amber is light-only) */
  --yellow-text: #F5B301;
  --steel: #6FA4C4;
  --steel-text: #6FA4C4;
  /* --on-brand intentionally NOT changed — stays near-white. */
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  /* NOTE: deliberately NO overflow-x:hidden — layout must not h-scroll on its own. */
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.section--band { background: var(--grit); }
.section--ink { background: var(--ink-black); color: var(--on-brand); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--on-brand); }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  font-size: .85rem;
  color: var(--yellow-text);
  margin: 0 0 .5rem;
}
.section--ink .eyebrow { color: var(--yellow); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.section--ink .lead { color: var(--on-brand-muted); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--yellow); color: var(--ink-black);
  padding: .6rem 1rem; font-weight: 700; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header {
  background: var(--ink-black);
  color: var(--on-brand);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 3px solid var(--yellow);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
  padding-block: .5rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--on-brand); flex: 0 0 auto; }
.brand .logo-mark { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; }
.brand .logo-mark svg { width: 100%; height: 100%; display: block; }
.brand .wordmark { font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; line-height: 1; }
.brand .wordmark small { display: block; font-family: var(--font-body); font-size: .62rem; letter-spacing: .18em; color: var(--on-brand-muted); text-transform: uppercase; }

.nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; align-items: center; gap: .9rem; margin: 0; padding: 0; }
.nav-list a { color: var(--on-brand); text-decoration: none; font-weight: 600; white-space: nowrap; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list a[aria-current="page"] { border-bottom-color: var(--yellow); }

.header-actions { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 auto;
  background: transparent; color: var(--on-brand);
  border: 1.5px solid rgba(246,244,240,.35); border-radius: 8px;
  cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: var(--yellow); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Menu button (mobile) */
.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 42px; height: 40px; flex: 0 0 auto;
  background: transparent; color: var(--on-brand);
  border: 1.5px solid rgba(246,244,240,.35); border-radius: 8px;
  cursor: pointer; padding: 0;
}
.menu-toggle svg { width: 22px; height: 22px; display: block; }

/* =========================================================================
   Buttons (every CTA has a class — guard #1)
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  line-height: 1; text-decoration: none; cursor: pointer;
  padding: .85rem 1.25rem; border-radius: 10px; border: 2px solid transparent;
  min-height: 48px; /* large tap target */
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.btn-wa { background: var(--yellow); color: var(--ink-black); }      /* WhatsApp — ink text on yellow, both themes */
.btn-wa:hover { background: #ffc21f; }
.btn-call { background: transparent; color: var(--on-brand); border-color: var(--on-brand); }
.btn-call:hover { background: rgba(246,244,240,.12); }
.btn-primary { background: var(--yellow); color: var(--ink-black); }
.btn-primary:hover { background: #ffc21f; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink-black); }
.section--ink .btn-ghost { color: var(--on-brand); border-color: rgba(246,244,240,.4); }
.btn-sm { padding: .55rem .85rem; min-height: 40px; font-size: .92rem; }
.btn-block { width: 100%; }

/* Header persistent actions */
.header-actions .btn-wa { padding: .55rem .9rem; min-height: 40px; font-size: .95rem; }
.header-actions .btn-call.icon-only { width: 40px; padding: 0; }
.header-actions .btn-call.icon-only svg { margin: 0; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  background: var(--ink-black);
  color: var(--on-brand);
  position: relative;
  padding-block: clamp(2.75rem, 7vw, 5rem);
  border-bottom: 4px solid var(--yellow);
}
.hero h1 { color: var(--on-brand); max-width: 16ch; }
.hero h1 .accent { color: var(--yellow); }
.hero .lead { color: var(--on-brand-muted); font-size: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-status { margin-top: 1.25rem; }

/* Open/closed status pill */
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .95rem;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(246,244,240,.1); color: var(--on-brand);
  border: 1px solid rgba(246,244,240,.25);
}
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.status[data-open="true"] .dot { background: #4ADE80; }
.status[data-open="false"] .dot { background: #F87171; }

/* =========================================================================
   Trust strip
   ========================================================================= */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: .6rem .9rem;
  list-style: none; margin: 1.5rem 0 0; padding: 0;
}
.trust-strip li {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 600; font-size: .95rem;
  padding: .35rem .7rem; border-radius: 8px;
  background: rgba(246,244,240,.08); border: 1px solid rgba(246,244,240,.2);
  color: var(--on-brand);
}
.trust-strip li svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--yellow); }

/* [TO CONFIRM] chip */
.chip-tc {
  display: inline-block; font-family: var(--font-body); font-weight: 700;
  font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  vertical-align: middle; margin-left: .35rem;
  padding: .12rem .4rem; border-radius: 5px;
  background: var(--yellow); color: var(--ink-black);
  border: 1px solid rgba(22,22,22,.25);
}
.section--ink .chip-tc, .hero .chip-tc, .trust-strip .chip-tc { background: var(--yellow); color: var(--ink-black); }

/* =========================================================================
   Cards / grids
   ========================================================================= */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dept-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  color: var(--text);
}
.card h3 { color: var(--text); }
.card p { color: var(--muted); margin-bottom: 0; }

/* Department card (link) */
a.dept-card { text-decoration: none; display: flex; flex-direction: column; gap: .35rem; transition: transform .15s ease, border-color .15s ease; }
a.dept-card:hover { transform: translateY(-3px); border-color: var(--yellow); }
.dept-card .dept-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex: 0 0 auto; margin-bottom: .5rem;
  background: var(--yellow); color: var(--ink-black); border-radius: 10px;
}
.dept-card .dept-icon svg { width: 26px; height: 26px; display: block; }
.dept-card h3 { color: var(--text); margin: 0; }
.dept-card .dept-list { color: var(--muted); font-size: .92rem; margin: 0; }
.dept-card .go { color: var(--yellow-text); font-weight: 700; margin-top: auto; padding-top: .6rem; }

/* Placeholder image block (no real photos exist — clearly labelled) */
.img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: .5rem;
  background:
    repeating-linear-gradient(45deg, var(--grit), var(--grit) 12px, transparent 12px, transparent 24px),
    var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 1.5rem; min-height: 200px;
}
.img-placeholder .ph-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; color: var(--yellow-text); }
.img-placeholder .ph-icon svg { width: 32px; height: 32px; display: block; }
.img-placeholder .ph-label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .8rem; color: var(--text); }
.img-placeholder .ph-note { font-size: .8rem; max-width: 32ch; }
.img-placeholder.ph-tall { min-height: 320px; }

/* =========================================================================
   Range lists (department pages)
   ========================================================================= */
.range-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.range-list li { display: flex; align-items: flex-start; gap: .6rem; }
.range-list li::before {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-top: .55rem;
  background: var(--yellow); border-radius: 2px;
}
.note-inline {
  background: var(--grit); border-left: 4px solid var(--yellow);
  padding: .85rem 1rem; border-radius: 6px; color: var(--text); font-size: .95rem;
}

/* Steel info block (delivery / payments) */
.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--steel);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.info-block h3 { color: var(--steel-text); }

/* Steps (how to order) */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li { display: flex; gap: .9rem; align-items: flex-start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  background: var(--yellow); color: var(--ink-black);
  font-family: var(--font-head); font-weight: 700; border-radius: 8px;
}
.steps li strong { display: block; }

/* =========================================================================
   Contact / NAP / form
   ========================================================================= */
.nap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.nap-list li { display: flex; gap: .8rem; align-items: flex-start; }
.nap-list .nap-ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; background: var(--yellow); color: var(--ink-black); border-radius: 8px; }
.nap-list .nap-ico svg { width: 22px; height: 22px; display: block; }
.nap-list a { color: var(--text); text-decoration: none; font-weight: 700; }
.nap-list a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }

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

/* Form */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; font-size: .95rem; }
.field .req { color: var(--yellow-text); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 1rem;
  padding: .7rem .8rem; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--yellow); outline: none; box-shadow: 0 0 0 3px rgba(245,179,1,.25); }
.radio-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.form-note { font-size: .9rem; color: var(--muted); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--ink-black); color: var(--on-brand); padding-block: clamp(2.5rem, 5vw, 3.5rem); border-top: 3px solid var(--yellow); }
.site-footer h4 { color: var(--on-brand); font-size: 1.1rem; margin-bottom: .75rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
.site-footer a { color: var(--on-brand); }           /* explicit — guard #3 */
.site-footer a:hover { color: var(--yellow); }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-list a { text-decoration: none; }
.footer-meta { color: var(--on-brand-muted); font-size: .85rem; }
.footer-bottom { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(246,244,240,.18); color: var(--on-brand-muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* =========================================================================
   Dark-mode link recolour — SCOPED so it can't touch .btn/.card/.nav (guard #1)
   ========================================================================= */
[data-theme="dark"] a:not([class]) { color: #FFD24D; }
[data-theme="dark"] a:not([class]):hover { color: var(--yellow); }
/* footer links are classless <a> inside .footer-list/.footer-meta — keep them
   near-white in dark too (guard #3), not the gold from the rule above. */
[data-theme="dark"] .site-footer a:not([class]) { color: var(--on-brand); }
[data-theme="dark"] .site-footer a:not([class]):hover { color: var(--yellow); }

/* =========================================================================
   Utilities
   ========================================================================= */
.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.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; }

/* =========================================================================
   Responsive — off-canvas nav breakpoint set high (1040px) so the inline nav +
   theme toggle + WhatsApp button genuinely fit above it without h-scroll
   (verified: brand+nav+actions ≈ 940px in the 1056px inner container at 1120px
   viewport, and the container only shrinks below that as the viewport does).
   Guard #2.
   ========================================================================= */
@media (max-width: 1040px) {
  .menu-toggle { display: flex; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    background: var(--ink-black);
    border-bottom: 3px solid var(--yellow);
    margin: 0; padding: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
    z-index: 90;
  }
  .nav.open { max-height: 70vh; overflow-y: auto; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1rem 1rem; }
  .nav-list li { width: 100%; }
  .nav-list a { display: block; padding: .85rem 0; border-bottom: 1px solid rgba(246,244,240,.12); }
  .nav-list a:hover, .nav-list a[aria-current="page"] { border-bottom-color: var(--yellow); }
  /* Keep the wordmark subtitle from crowding at small widths */
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand .wordmark small { display: none; }
  .header-actions .btn-wa .btn-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .header-actions .btn-wa { padding: .55rem .7rem; }
  /* Let the brand give way so the action row + brand fit small phones (no h-scroll) */
  .header-inner { gap: .5rem; }
  .brand { flex: 0 1 auto; min-width: 0; }
  .brand .wordmark { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { gap: .35rem; }
}

@media (max-width: 400px) {
  .brand .logo-mark { width: 34px; height: 34px; }
  .brand .wordmark { font-size: 1rem; letter-spacing: .02em; }
  .theme-toggle, .btn-call.icon-only { width: 38px; }
  .menu-toggle { width: 38px; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

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