/* =========================================================================
   Verulam Fencing Service — shared styles
   Palette & type per research/design-language.md. Mobile-first.
   Theme tokens: --on-brand (text on navy surfaces) is kept separate from
   --surface (card fill) so remapping surface in dark mode never darkens
   text that must stay light on navy. See steering doc.
   ========================================================================= */

:root {
  /* Brand */
  --navy:        #1B3B5F;
  --navy-deep:   #122A45;
  --steel:       #8A939B;
  --zinc:        #E4E7EA;
  --amber:       #F2A413;
  --amber-hover: #d8930d;
  --accent-deep: #8A5A0C;   /* amber-bronze: accent TEXT on light only — ~5.2:1 on white/ground for AA */

  /* Surfaces & text (light theme = default) */
  --ground:      #F5F5F2;   /* page background */
  --surface:     #FFFFFF;   /* card / panel fill */
  --band:        #EDEEEA;   /* quiet section band */
  --ink:         #1D2126;   /* body text */
  --muted:       #5C6670;   /* secondary text */
  --border:      #D7DAD5;   /* hairlines */

  /* Text that sits on saturated brand backgrounds — light in BOTH themes */
  --on-brand:        #F5F5F2;
  --on-brand-muted:  #C4CBD4;

  /* Text that must sit on the amber CTA fill */
  --on-amber:    #122A45;

  --shadow:      0 1px 3px rgba(18,42,69,.10), 0 4px 16px rgba(18,42,69,.06);
  --shadow-lg:   0 6px 28px rgba(18,42,69,.16);
  --radius:      8px;
  --maxw:        1120px;

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

[data-theme="dark"] {
  --navy:        #1B3B5F;   /* header/footer stay navy */
  --navy-deep:   #0E2236;

  --ground:      #0E2236;
  --surface:     #22405E;   /* lifted clear of ground (~1.5:1) + border + shadow */
  --band:        #1B3A5C;
  --ink:         #E6EAEE;
  --muted:       #9AA5AF;
  --border:      #31506E;

  /* on-brand stays light — do NOT let it inherit the dark surface */
  --on-brand:        #F5F5F2;
  --on-brand-muted:  #AFBAC6;

  --shadow:      0 1px 3px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.35);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.45);
}

/* ---------- Reset / 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;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
[data-theme="dark"] a:not([class]) { color: #8FB6DE; }  /* scoped: prose links only */

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section--band { background: var(--band); }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin: 0 0 .4rem;
}
[data-theme="dark"] .eyebrow { color: var(--amber); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--amber); color: var(--on-amber); }
.btn--primary:hover { background: var(--amber-hover); }
.btn--ghost {
  background: transparent;
  color: var(--on-brand);
  border-color: rgba(245,245,242,.55);
}
.btn--ghost:hover { border-color: var(--on-brand); }
.btn--navy { background: var(--navy); color: var(--on-brand); }
.btn--navy:hover { background: var(--navy-deep); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
[data-theme="dark"] .btn--outline { color: var(--ink); border-color: var(--border); }
.btn--outline:hover { background: var(--navy); color: var(--on-brand); }
.btn--lg { padding: 16px 30px; font-size: 1.1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: var(--on-brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--on-brand);
  margin-right: auto;
}
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1.05rem;
}
.brand-tag {
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--on-brand-muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--on-brand);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: .9rem;
  padding: 8px 9px;
  border-radius: 6px;
  white-space: nowrap;   /* keep "Palisade & Gates" / "Security & Industrial" on one line */
}
.nav .btn { white-space: nowrap; padding: 9px 14px; font-size: .85rem; }
/* the in-nav amber CTA: keep dark navy text on amber in BOTH themes
   (.nav a's color:var(--on-brand) would otherwise win over .btn--primary) */
.nav a.nav-btn-quote { color: var(--on-amber); }
.nav a.nav-btn-quote:hover { background: var(--amber-hover); }
.nav a:not(.nav-btn-quote):hover { background: rgba(255,255,255,.10); }
.nav a[aria-current="page"] {
  color: var(--amber);
  box-shadow: inset 0 -2px 0 var(--amber);
}
.header-actions { display: flex; align-items: center; gap: 8px; }

/* theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(245,245,242,.4);
  color: var(--on-brand);
  width: 40px; height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(255,255,255,.10); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.call-link {
  color: var(--on-brand);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  white-space: nowrap;
}
.call-link:hover { color: var(--amber); }
.call-link .label { display: none; }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(245,245,242,.4);
  color: var(--on-brand);
  width: 40px; height: 40px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 1040px) {
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 320px);
    flex-direction: column;
    align-items: stretch;
    background: var(--navy-deep);
    padding: 76px 16px 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform .22s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,.4);
  }
  .nav.open { transform: translateX(0); }
  .nav a { font-size: 1.05rem; padding: 12px 14px; }
  .nav-toggle { display: inline-flex; }
  /* keep the quote CTA visible inside the open drawer, full-width */
  .nav-btn-quote { margin-top: 12px; justify-content: center; }
  .nav a.nav-btn-quote { color: var(--on-amber); }
  .call-link .label { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--on-brand);
  background: var(--navy-deep);
}
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(18,42,69,.92) 0%, rgba(18,42,69,.78) 45%, rgba(27,59,95,.55) 100%);
}
.hero-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 84px 20px;
}
.hero-content { max-width: 640px; }
.hero .slogan {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--amber);
  font-weight: 600;
  font-size: .95rem;
  margin: 0 0 .6rem;
}
.hero h1 { color: var(--on-brand); margin-bottom: .4em; }
.hero p { color: var(--on-brand-muted); font-size: 1.2rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-since {
  margin-top: 30px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .85rem;
  color: var(--on-brand-muted);
}
.hero-since strong { color: var(--amber); font-size: 1.05em; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card--product h3 {
  display: flex; align-items: center; gap: 10px;
}
.card--product .ico {
  color: var(--amber);
  flex: none;
}
[data-theme="dark"] .card--product .ico { color: var(--amber); }

/* ---------- Heritage strip ---------- */
.heritage { background: var(--navy); color: var(--on-brand); }
.heritage .container { padding-block: 44px; }
.heritage h2 { color: var(--on-brand); }
.heritage-list {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 14px 26px;
}
@media (max-width: 700px){ .heritage-list { grid-template-columns: 1fr; } }
.heritage-list li {
  display: flex; gap: 10px; align-items: flex-start;
  color: var(--on-brand);
}
.heritage-list .ico { color: var(--amber); flex: none; margin-top: 2px; }
.heritage-list strong { color: var(--on-brand); }

/* ---------- Client list ---------- */
.clients {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px;
}
@media (max-width: 760px){ .clients { grid-template-columns: repeat(2,1fr); } }
.clients li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: .02em;
  box-shadow: var(--shadow);
}
.clients-note { color: var(--muted); font-size: .95rem; margin-top: 14px; }

/* ---------- Gallery ---------- */
.gallery-filters {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 26px;
}
.filter-btn {
  font-family: var(--font-head);
  text-transform: uppercase; letter-spacing: .04em;
  font-size: .88rem; font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px;
  cursor: pointer;
}
.filter-btn:hover { border-color: var(--amber); }
.filter-btn[aria-pressed="true"] {
  background: var(--amber); color: var(--on-amber); border-color: var(--amber);
}
.gallery-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px){ .gallery-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .gallery-grid { grid-template-columns: 1fr; } }
.gallery-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--band);
}
.gallery-item figcaption {
  padding: 10px 12px; font-size: .9rem; color: var(--muted);
}
.gallery-item.is-hidden { display: none; }

/* teaser strip */
.teaser-grid { display:grid; gap:14px; grid-template-columns: repeat(4,1fr); }
@media (max-width:760px){ .teaser-grid{ grid-template-columns: repeat(2,1fr);} }
.teaser-grid img {
  width:100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: var(--radius); border:1px solid var(--border);
}

/* ---------- Placeholder (needs-content) ---------- */
.placeholder {
  border: 2px dashed var(--steel);
  border-radius: var(--radius);
  background: var(--band);
  color: var(--muted);
  padding: 28px;
  text-align: center;
  font-family: var(--font-head);
  letter-spacing: .03em;
}

/* ---------- Product detail sections ---------- */
.prod {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center;
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.prod:last-child { border-bottom: 0; }
.prod:nth-child(even) .prod-media { order: -1; }
@media (max-width: 780px){ .prod { grid-template-columns: 1fr; }
  .prod:nth-child(even) .prod-media { order: 0; } }
.prod-media img { border-radius: var(--radius); border:1px solid var(--border); box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; width:100%; }
.tags { display:flex; flex-wrap:wrap; gap:8px; margin:.5rem 0 1rem; padding:0; list-style:none; }
.tags li {
  font-size:.8rem; font-family:var(--font-head); letter-spacing:.03em;
  text-transform:uppercase; color:var(--navy);
  background:var(--zinc); border-radius:20px; padding:4px 12px;
}
[data-theme="dark"] .tags li { color: var(--ink); background: var(--band); border:1px solid var(--border); }

/* in-page product nav (anchors) */
.chip-nav { display:flex; flex-wrap:wrap; gap:8px; margin: 18px 0 4px; }
.chip-nav a {
  text-decoration:none; font-family:var(--font-head); font-size:.85rem;
  text-transform:uppercase; letter-spacing:.03em;
  background: var(--surface); color: var(--navy);
  border:1px solid var(--border); border-radius:20px; padding:6px 14px;
}
[data-theme="dark"] .chip-nav a { color: var(--ink); }
.chip-nav a:hover { border-color: var(--amber); }

/* ---------- Quote form ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 26px;
}
.form-note {
  background: var(--band);
  border-left: 3px solid var(--amber);
  padding: 12px 14px; border-radius: 6px;
  font-size: .95rem; color: var(--muted);
  margin-bottom: 20px;
}
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px){ .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label {
  display:block; font-family:var(--font-head); font-weight:500;
  letter-spacing:.02em; margin-bottom:6px; color: var(--ink);
}
.field .req { color: var(--accent-deep); }
[data-theme="dark"] .field .req { color: var(--amber); }
.field input, .field select, .field textarea {
  width:100%; font-family: var(--font-body); font-size:1rem;
  color: var(--ink);
  background: var(--ground);
  border:1px solid var(--border); border-radius:6px;
  padding:11px 12px;
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea { background: #0B1B2C; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber);
}
.field textarea { min-height: 120px; resize: vertical; }
.checkgrid { display:grid; grid-template-columns: repeat(2,1fr); gap:8px; }
@media (max-width:620px){ .checkgrid{ grid-template-columns:1fr; } }
.checkgrid label {
  display:flex; align-items:center; gap:8px; font-family:var(--font-body);
  font-weight:400; background:var(--ground); border:1px solid var(--border);
  border-radius:6px; padding:9px 12px; cursor:pointer; margin:0;
}
[data-theme="dark"] .checkgrid label { background:#0B1B2C; }
.checkgrid input { width:auto; }
.radio-inline { display:flex; gap:18px; flex-wrap:wrap; }
.radio-inline label { display:flex; gap:8px; align-items:center; font-family:var(--font-body); font-weight:400; margin:0; }
.radio-inline input { width:auto; }

/* ---------- Contact info blocks ---------- */
.info-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 820px){ .info-grid { grid-template-columns: 1fr; } }
.nap {
  list-style:none; margin:0; padding:0;
}
.nap li { display:flex; gap:12px; margin-bottom:16px; align-items:flex-start; }
.nap .ico { color: var(--amber); flex:none; margin-top:3px; }
.nap strong { display:block; font-family:var(--font-head); font-weight:500; letter-spacing:.02em; }
.nap a { color: var(--navy); font-weight:600; text-decoration:none; }
[data-theme="dark"] .nap a { color: #8FB6DE; }
.map-embed {
  border:1px solid var(--border); border-radius: var(--radius); overflow:hidden;
  box-shadow: var(--shadow); background: var(--band);
}
.map-embed iframe { width:100%; height:340px; border:0; display:block; }

/* rating line */
.rating-line {
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--font-head); font-weight:500; letter-spacing:.02em;
}
.rating-line .stars { color: var(--amber); letter-spacing:2px; }
.rating-line a { color: var(--navy); }
[data-theme="dark"] .rating-line a { color:#8FB6DE; }

/* ---------- Quote CTA block ---------- */
.cta-band {
  background: var(--navy);
  color: var(--on-brand);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.cta-band h2 { color: var(--on-brand); }
.cta-band p { color: var(--on-brand-muted); max-width: 54ch; margin-inline:auto; }
.cta-band .hero-actions { justify-content:center; }

/* areas covered */
.areas { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:18px; padding:0; list-style:none; }
.areas li {
  font-family:var(--font-head); letter-spacing:.03em; text-transform:uppercase; font-size:.9rem;
  border:1px solid var(--border); border-radius:20px; padding:6px 16px;
  background: var(--surface);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: var(--on-brand);
  padding: 44px 0 26px;
  margin-top: 20px;
}
.footer-grid {
  display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px;
}
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr; gap:24px; } }
.site-footer h4 {
  font-family:var(--font-head); text-transform:uppercase; letter-spacing:.06em;
  font-size:.9rem; color: var(--on-brand); margin:0 0 12px;
}
.site-footer p, .site-footer li { color: var(--on-brand-muted); }
.footer-links { list-style:none; margin:0; padding:0; }
.footer-links li { margin-bottom:8px; }
.footer-links a { color: var(--on-brand-muted); text-decoration:none; }
.footer-links a:hover { color: var(--amber); }
.footer-slogan {
  font-family:var(--font-head); text-transform:uppercase; letter-spacing:.12em;
  color: var(--amber); font-weight:600; margin-top:8px;
}
.footer-bottom {
  border-top:1px solid rgba(255,255,255,.12);
  margin-top:30px; padding-top:18px;
  display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between;
  font-size:.85rem; color: var(--on-brand-muted);
}
.footer-bottom a { color: var(--on-brand-muted); }

.flag {
  font-size:.85rem; color: var(--muted);
  background: var(--band); border:1px dashed var(--steel);
  border-radius:6px; padding:2px 8px; display:inline-block;
}

.skip-link {
  position:absolute; left:-999px; top:0; z-index:200;
  background: var(--amber); color: var(--on-amber);
  padding:10px 16px; border-radius:0 0 6px 0; font-family:var(--font-head);
}
.skip-link:focus { left:0; }

.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;
}
