/* =========================================================================
   Asmals Hardware — shared stylesheet
   Palette derived from research/design-language.md (slate-teal + warm clay
   on a warm stone ground). Light default; dark override on [data-theme="dark"].

   Contrast values verified by hand (WCAG relative-luminance ratios):
   - Ink #1C1E1D on stone #F5F2EC .......... ~14.9:1  (body, light)
   - White #F5F2EC on clay fill #A85632 ..... ~5.0:1  (CTA text)  [darkened from
       #B4603A, which computes ~4.49:1 — just under 4.5 — see NOTES.md]
   - Deep-clay #8A431F on stone #F5F2EC ..... ~5.4:1  (small clay text, light)
   - --on-brand #F5F2EC on teal #2C4A47 ..... ~8.9:1  (header/hero/footer)
   - Dark: text #ECE9E3 on ground #203936 ... ~10.8:1 (body, dark)
   - Dark: surface #404B48 vs ground #203936  ~1.38:1 (>=1.35 required) + border #5A6764
   - Dark: lifted clay #EEAE7E on surface #404B48 ~4.7:1 (small clay text, dark)
   ========================================================================= */

/* ---- Tokens: light (default) ---- */
:root {
  --teal:          #2C4A47;
  --teal-deep:     #203936;
  --clay:          #A85632;   /* CTA fill — darkened from #B4603A for >=4.5:1 white text */
  --clay-rule:     #B4603A;   /* rules / marks / large display only (not small text) */
  --clay-text:     #8A431F;   /* small clay-coloured text / links on light ground */
  --stone:         #F5F2EC;
  --surface:       #FFFFFF;   /* card / panel fill */
  --ink:           #1C1E1D;
  --muted:         #5E5A52;
  --grit:          #E5E2DB;
  --brass:         #6F571F;   /* deep-brass for brass text on light */

  /* Role tokens — kept separate so no token does two jobs */
  --on-brand:      #F5F2EC;   /* text/icons on teal header/hero/footer/buttons — NEVER remapped */
  --page-bg:       var(--stone);
  --page-text:     var(--ink);
  --page-muted:    var(--muted);
  --card-bg:       var(--surface);
  --card-border:   var(--grit);
  --hairline:      var(--grit);
  --chip-bg:       #EEE9DF;
  --chip-text:     #6B5A3A;
  --chip-border:   #D8CFBB;
  --shadow:        0 1px 2px rgba(28,30,29,.06), 0 4px 14px rgba(28,30,29,.06);

  --font-head: "Zilla Slab", "Rockwell", Georgia, serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1120px;
  --radius: 10px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
}

/* ---- Tokens: dark override ---- */
[data-theme="dark"] {
  --page-bg:     var(--teal-deep);   /* #203936 */
  --page-text:   #ECE9E3;
  --page-muted:  #9A958B;
  --card-bg:     #404B48;            /* surface — LIGHTER than ground; computed 1.38:1 vs #203936 (guard #3) */
  --card-border: #5A6764;            /* visible border, lighter than surface */
  --hairline:    #4C5754;
  --clay-text:   #EEAE7E;            /* lifted clay for small text/links in dark; ~4.7:1 on surface, ~6.5:1 on ground */
  --chip-bg:     #33403D;
  --chip-text:   #D8D1C3;
  --chip-border: #5A6764;
  --shadow:      0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.35);
  /* --clay stays usable as a fill (white text ~5:1); --on-brand unchanged */
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--page-text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--page-text); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--clay-text); }
:focus-visible { outline: 3px solid var(--clay-rule); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--clay-text); margin: 0 0 .5rem; }
.tabnum { font-variant-numeric: tabular-nums; font-weight: 600; }
.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: -48px; background: var(--clay); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: 8px; z-index: 200; transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1;
  padding: .8rem 1.15rem; border-radius: 8px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap; min-height: 44px;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-primary { background: var(--clay); color: var(--on-brand); border-color: var(--clay); }
.btn-primary:hover { background: #96492a; border-color: #96492a; }
.btn-outline { background: transparent; color: var(--page-text); border-color: var(--card-border); }
.btn-outline:hover { border-color: var(--clay); color: var(--clay-text); }
/* On teal grounds, an outline button uses on-brand text */
.on-teal .btn-outline { color: var(--on-brand); border-color: rgba(245,242,236,.5); }
.on-teal .btn-outline:hover { border-color: var(--on-brand); color: var(--on-brand); background: rgba(245,242,236,.08); }

/* ---- Header ---- */
.site-header { background: var(--teal); color: var(--on-brand); position: sticky; top: 0; z-index: 100; }
.header-row {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px; 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: 40px; height: 40px; display: block; }
.brand .wordmark { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; line-height: 1.05; color: var(--on-brand); white-space: nowrap; }
.brand .wordmark small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; display: flex; align-items: center; gap: clamp(.5rem, 1.4vw, 1.1rem); margin: 0; padding: 0; }
.primary-nav a { color: var(--on-brand); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; padding: .4rem .1rem; border-bottom: 2px solid transparent; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { border-bottom-color: var(--clay-rule); }

.header-actions { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.header-actions .btn { padding: .55rem .8rem; font-size: .9rem; min-height: 40px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 auto; padding: 0;
  background: transparent; border: 2px solid rgba(245,242,236,.4); border-radius: 8px;
  color: var(--on-brand); cursor: pointer;
}
.icon-btn:hover { border-color: var(--on-brand); }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: block; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }

.nav-toggle { display: none; }

/* Call link in header (text) */
.header-call { color: var(--on-brand); text-decoration: none; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
.header-call svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---- Mobile nav (off-canvas) ----
   Breakpoint raised 900 -> 1000: with the short nav labels (Home / Tiles /
   Materials / Plumbing / Hardware / Contact ~430px) the inline row
   (brand + nav + actions ~=924px) fits the 1120 container above this, and
   the container only narrows with the viewport below it. Verified in a
   browser at 375/768/1024/1280 — no horizontal scroll. */
@media (max-width: 1000px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 auto; padding: 0;
    background: transparent; border: 2px solid rgba(245,242,236,.4); border-radius: 8px;
    color: var(--on-brand); cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; display: block; }
  .primary-nav {
    position: fixed; inset: 64px 0 auto 0; margin: 0;
    background: var(--teal-deep); border-top: 1px solid rgba(245,242,236,.15);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .primary-nav.open { max-height: 70vh; overflow: auto; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 0; }
  .primary-nav li { border-bottom: 1px solid rgba(245,242,236,.08); }
  .primary-nav a { display: block; padding: .9rem clamp(1rem, 4vw, 2rem); border-bottom: none; }
  .header-call span { display: none; }  /* keep header row compact on mobile */
}
/* Below ~560px the brand subtitle (longer than the name itself) is what
   sets the wordmark width — hiding it keeps the header row inside 375px. */
@media (max-width: 560px) {
  .brand .wordmark small { display: none; }
}
@media (max-width: 480px) {
  .brand .wordmark { font-size: .98rem; }
  .header-actions .btn .btn-label { display: none; }  /* WhatsApp icon-only on very small screens */
  .header-actions .btn { padding: .55rem .7rem; }
  .header-row { gap: .5rem; }
  .header-actions { gap: .35rem; }
}

/* ---- Sections ---- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-tint { background: var(--card-bg); }
.section-teal { background: var(--teal); color: var(--on-brand); }
.section-teal h1, .section-teal h2, .section-teal h3 { color: var(--on-brand); }
.section-teal .eyebrow { color: #E6B79A; }
.section-lede { font-size: 1.1rem; color: var(--page-muted); max-width: 60ch; }
/* any teal-ground context (sections, hero, areas band) gets on-brand body text */
.section-teal .section-lede,
.hero .section-lede,
.areas-band .section-lede { color: rgba(245,242,236,.88); }
.section-teal .eyebrow,
.hero .eyebrow,
.areas-band .eyebrow { color: #E6B79A; }
.center { text-align: center; }
.center .section-lede { margin-inline: auto; }

/* ---- Hero ---- */
.hero { background: var(--teal); color: var(--on-brand); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 85% 0%, rgba(180,96,58,.20), transparent 60%);
}
.hero .container { position: relative; z-index: 1; padding-block: clamp(2.75rem, 7vw, 5rem); }
.hero h1 { color: var(--on-brand); max-width: 18ch; }
.hero .hero-lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: rgba(245,242,236,.9); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.status-line { margin-top: 1.25rem; display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #9A958B; flex: 0 0 auto; }
.status-line.is-open .status-dot { background: #6FBF73; }
.status-line.is-closed .status-dot { background: #E08A6B; }

/* ---- Trust strip ---- */
.trust-strip { background: var(--card-bg); border-block: 1px solid var(--hairline); }
.trust-strip ul { list-style: none; margin: 0; padding-block: 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: center; }
.trust-strip li { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; }
.trust-strip .ico { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; color: var(--clay-text); }
.trust-strip .ico svg { width: 20px; height: 20px; display: block; }

/* ---- Chips ([TO CONFIRM]) ---- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem; vertical-align: middle;
  font-family: var(--font-body); font-size: .68rem; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; padding: .18em .5em; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-text); border: 1px solid var(--chip-border);
  white-space: nowrap;
}

/* ---- Grid / cards ---- */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem; display: flex; flex-direction: column; gap: .5rem;
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--page-muted); }
.card-link { text-decoration: none; color: inherit; transition: transform .12s ease, border-color .12s ease; }
.card-link:hover { transform: translateY(-2px); border-color: var(--clay); }
.card .card-cta { margin-top: auto; padding-top: .4rem; color: var(--clay-text); font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.card .card-cta svg { width: 16px; height: 16px; flex: 0 0 auto; }
.card-media {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  flex: 0 0 auto; border-radius: 8px; background: rgba(180,96,58,.12); color: var(--clay-text);
  margin-bottom: .4rem;
}
.card-media svg { width: 26px; height: 26px; display: block; }

/* ---- Image placeholder blocks (no real photos yet — see sources.md) ---- */
.img-placeholder {
  border: 2px dashed var(--card-border); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(94,90,82,.05) 12px, rgba(94,90,82,.05) 24px);
  color: var(--page-muted); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem; min-height: 200px; gap: .4rem;
}
.img-placeholder .ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; color: var(--clay-text); }
.img-placeholder .ico svg { width: 40px; height: 40px; display: block; }
.img-placeholder strong { font-family: var(--font-head); color: var(--page-text); }
.img-placeholder small { font-size: .78rem; max-width: 40ch; }

/* ---- Steps (how to order) ---- */
.steps { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.step .step-num {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 50%; background: var(--clay); color: var(--on-brand); font-family: var(--font-head); font-weight: 600; margin-bottom: .6rem;
}
.step h3 { margin: 0 0 .3rem; }
.step p { margin: 0; color: var(--page-muted); }

/* ---- Lists of stock lines ---- */
.line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.line-list li { display: flex; align-items: flex-start; gap: .55rem; }
.line-list .ico { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; color: var(--clay-text); margin-top: 1px; }
.line-list .ico svg { width: 18px; height: 18px; display: block; }

/* ---- Areas band ---- */
.areas-band { background: var(--teal); color: var(--on-brand); }
.areas-list { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; padding: 0; list-style: none; }
.areas-list li { border: 1px solid rgba(245,242,236,.3); border-radius: 999px; padding: .35rem .9rem; font-weight: 600; font-size: .92rem; }

/* ---- Hours + map layout ---- */
.info-split { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 780px) { .info-split { grid-template-columns: 1fr 1fr; align-items: start; } }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: .55rem 0; border-bottom: 1px solid var(--hairline); }
.hours-table th { font-weight: 600; }
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; color: var(--page-muted); }
.hours-table tr.today th, .hours-table tr.today td { color: var(--clay-text); font-weight: 700; }

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

/* ---- Facebook nod ---- */
.fb-nod { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.fb-nod .ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; color: var(--clay-text); }
.fb-nod .ico svg { width: 40px; height: 40px; display: block; }

/* ---- Contact details ---- */
.contact-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 820px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.nap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.nap-list li { display: flex; align-items: flex-start; gap: .75rem; }
.nap-list .ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; background: rgba(180,96,58,.12); color: var(--clay-text); }
.nap-list .ico svg { width: 22px; height: 22px; display: block; }
.nap-list .nap-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--page-muted); margin: 0 0 .1rem; }
.nap-list a { color: var(--page-text); text-decoration: none; font-weight: 600; }
.nap-list a:hover { color: var(--clay-text); text-decoration: underline; }

/* ---- Form ---- */
.form { display: grid; gap: 1.1rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; }
.field .req { color: var(--clay-text); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--page-text);
  background: var(--page-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: .7rem .8rem; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--clay-rule); outline-offset: 1px; border-color: var(--clay); }
.radio-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400; }
.form-note { font-size: .88rem; color: var(--page-muted); margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.form-actions .btn { flex: 1 1 auto; }

/* ---- Footer ---- */
.site-footer { background: var(--teal-deep); color: var(--on-brand); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.site-footer h2, .site-footer h3 { color: var(--on-brand); }
.footer-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.site-footer a { color: var(--on-brand); }
.site-footer .footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer .footer-links a { text-decoration: none; opacity: .9; }
.site-footer .footer-links a:hover { opacity: 1; text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.7; opacity: .92; }
.site-footer .footer-meta { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(245,242,236,.15); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .85rem; opacity: .85; }
.site-footer .popia { max-width: 60ch; }

/* Guard #1: dark-mode classless links must not turn gold/clay in footer or CTAs.
   Classless links get lifted-clay in body, but footer classless links stay on-brand. */
[data-theme="dark"] a:not([class]) { color: var(--clay-text); }
[data-theme="dark"] .site-footer a:not([class]) { color: var(--on-brand); }

/* ---- Utility spacing ---- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.stack > * + * { margin-top: 1rem; }
.lede-block { max-width: 65ch; }
