/* =========================================================================
   Verulam Security Services (Pty) Ltd — stylesheet
   Palette + type per research/design-language.md.
   Theming: separate tokens for on-brand text (stays light in BOTH themes)
   vs. surface fills (flip dark). Red = emergency CTA ONLY.
   ========================================================================= */

:root {
  /* Brand */
  --brand: #16324F;        /* midnight/watch blue */
  --brand-deep: #0E2135;   /* night */
  --steel: #3E6E9C;        /* steel accent / links */
  --emergency: #C1272D;    /* signal red — 24/7 call button ONLY */
  --brass: #A9832E;        /* restrained credential seal */

  /* Ground / surfaces (LIGHT theme defaults) */
  --bg: #F4F3EF;           /* warm off-white page ground */
  --surface: #FFFFFF;      /* card / panel fill */
  --surface-alt: #E4E6E4;  /* quiet section band / fog */
  --border: #D7DAD7;       /* hairline borders */

  /* Text */
  --ink: #1B1F24;          /* body text on light */
  --muted: #5A6473;        /* secondary text */
  --link: #2f5a83;         /* steel darkened for small-text contrast on bone */

  /* On-brand: text/icons sitting ON the blue header/hero/footer/buttons.
     Stays light in BOTH themes — never remapped to a surface colour. */
  --on-brand: #F4F3EF;
  --on-brand-muted: #C4D0DC;

  /* Emergency button text */
  --on-emergency: #FFFFFF;

  /* Header/footer surfaces — stay blue in both themes */
  --header-bg: #16324F;
  --footer-bg: #0E2135;

  --shadow: 0 2px 6px rgba(14, 33, 53, 0.10), 0 8px 24px rgba(14, 33, 53, 0.06);
  --radius: 10px;
  --maxw: 1120px;

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

[data-theme="dark"] {
  --bg: #0E2135;
  --surface: #22384D;      /* lifted well clear of the ground so cards read as panels, not floating text */
  --surface-alt: #1A2E42;  /* section bands stay distinct from both bg and surface */
  --border: #3A536E;       /* lighter hairline so card / input / area-tile edges are visible on the dark ground */

  --ink: #E7E9EC;
  --muted: #9AA6B2;
  --link: #7FB0DE;         /* steel nudged brighter for dark contrast */
  --steel: #5A90C0;
  --brass: #C8A24A;

  /* on-brand + emergency intentionally unchanged */
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* ---------- base ---------- */
*, *::before, *::after { 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(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 3.25rem 0; }
.section--band { background: var(--surface-alt); }

.section-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--steel);
  margin: 0 0 0.4rem;
}

.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: var(--on-brand);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: #1d4368; color: var(--on-brand); }

.btn--outline {
  background: transparent; color: var(--ink); border-color: var(--steel);
}
.btn--outline:hover { background: var(--steel); color: var(--on-brand); }

/* Emergency — the ONLY use of signal red */
.btn--emergency { background: var(--emergency); color: var(--on-emergency); }
.btn--emergency:hover { background: #a51f24; color: var(--on-emergency); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
}

.brand-lockup { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-lockup:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 38px; flex: none;
}
.brand-mark path, .brand-mark rect { fill: none; stroke: var(--on-brand); stroke-width: 6; }
.brand-mark text { fill: var(--on-brand); }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display); font-weight: 700;
  color: var(--on-brand); font-size: 1.1rem; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-desc {
  font-size: 0.68rem; color: var(--on-brand-muted);
  letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

/* nav */
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid rgba(255,255,255,0.25);
  color: var(--on-brand); border-radius: 8px;
  width: 44px; height: 44px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--on-brand); }

.main-nav ul {
  list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0;
}
.main-nav a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 6px;
  color: var(--on-brand); font-weight: 600; font-size: 0.98rem;
  white-space: nowrap;   /* keep "Areas We Cover" / "Free Assessment" on one line */
}
.main-nav a:hover { background: rgba(255,255,255,0.10); text-decoration: none; }
.main-nav a[aria-current="page"] {
  color: #fff; box-shadow: inset 0 -3px 0 var(--steel);
}

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

/* persistent emergency call button in header */
.header-call {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--emergency); color: var(--on-emergency);
  font-family: var(--font-display); font-weight: 700;
  padding: 0.55rem 0.95rem; border-radius: 8px;
  font-size: 0.98rem; min-height: 44px; white-space: nowrap;
}
.header-call:hover { background: #a51f24; color: var(--on-emergency); text-decoration: none; }
.header-call svg { width: 18px; height: 18px; fill: currentColor; }
.header-call .call-label { display: flex; flex-direction: column; line-height: 1; }
.header-call .call-label small { font-size: 0.62rem; font-weight: 600; opacity: 0.9; letter-spacing: 0.04em; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  background: var(--brand-deep);
  color: var(--on-brand);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.32; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,33,53,0.55), rgba(14,33,53,0.85));
}
.hero-inner { position: relative; z-index: 1; padding: 4rem 0 3.5rem; }
.hero h1 { color: var(--on-brand); max-width: 18ch; }
.hero p { color: var(--on-brand-muted); font-size: 1.2rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero .btn--outline { color: var(--on-brand); border-color: var(--on-brand); }
.hero .btn--outline:hover { background: var(--on-brand); color: var(--brand); }

.page-hero {
  background: var(--brand); color: var(--on-brand);
  padding: 2.75rem 0;
}
.page-hero h1 { color: var(--on-brand); }
.page-hero p { color: var(--on-brand-muted); max-width: 60ch; margin-bottom: 0; }
.breadcrumb { font-size: 0.85rem; color: var(--on-brand-muted); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--on-brand-muted); text-decoration: underline; }

/* =========================================================================
   Service grid / cards
   ========================================================================= */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

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

.svc-card { display: flex; flex-direction: column; }
.svc-card .svc-icon {
  width: 46px; height: 46px; border-radius: 10px;
  background: rgba(62,110,156,0.14);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.85rem;
}
.svc-card .svc-icon svg { width: 26px; height: 26px; stroke: var(--steel); fill: none; }
.svc-card .who { font-size: 0.8rem; color: var(--steel); font-weight: 600; margin-top: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
a.card { text-decoration: none; color: inherit; transition: transform 0.08s ease, box-shadow 0.15s ease; }
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 6px 16px rgba(14,33,53,0.16); }

/* =========================================================================
   Trust bar
   ========================================================================= */
.trust-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.trust-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; text-align: center;
}
.trust-item .trust-value { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.trust-item .trust-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chip-needs {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  color: var(--brass); border: 1px dashed var(--brass);
  border-radius: 999px; padding: 0.15rem 0.6rem; margin-top: 0.35rem;
  letter-spacing: 0.03em; background: rgba(169,131,46,0.08);
}

/* =========================================================================
   Areas
   ========================================================================= */
.area-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.area-list li {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem; font-weight: 600;
}
.area-list li svg { width: 18px; height: 18px; stroke: var(--steel); fill: none; flex: none; }

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

/* =========================================================================
   Rating
   ========================================================================= */
.rating-line {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
}
.stars { color: var(--brass); letter-spacing: 0.1em; }
.review-quote {
  border-left: 4px solid var(--steel); padding: 0.5rem 0 0.5rem 1.1rem;
  font-style: italic; color: var(--ink); margin: 1rem 0 0.4rem; font-size: 1.15rem;
}
.review-attr { color: var(--muted); font-size: 0.9rem; }

/* =========================================================================
   Forms
   ========================================================================= */
.form-note {
  background: rgba(62,110,156,0.10); border: 1px solid var(--border);
  border-left: 4px solid var(--steel);
  border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 1.5rem;
  color: var(--ink); font-size: 0.97rem;
}
.form-note strong { color: var(--ink); }

.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; margin-bottom: 0.35rem; font-size: 0.95rem; }
.field .req { color: var(--emergency); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem;
  padding: 0.7rem 0.8rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--ink);
  width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(62,110,156,0.25);
}
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1rem; margin: 0; }
fieldset legend { font-weight: 600; padding: 0 0.4rem; }
.checks { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 0.5rem; }
.checks label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.checks input { width: auto; }
.form-actions { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* =========================================================================
   Misc content blocks
   ========================================================================= */
.split { display: grid; gap: 2rem; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.media-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.media-frame img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.media-caption { font-size: 0.8rem; color: var(--muted); padding: 0.5rem 0.7rem; background: var(--surface); }

.callout {
  background: var(--brand); color: var(--on-brand);
  border-radius: var(--radius); padding: 2rem; text-align: center;
}
.callout h2 { color: var(--on-brand); }
.callout p { color: var(--on-brand-muted); }
.callout .btn--outline { color: var(--on-brand); border-color: var(--on-brand); }
.callout .btn--outline:hover { background: var(--on-brand); color: var(--brand); }

.service-detail { border-top: 1px solid var(--border); padding-top: 2rem; margin-top: 2rem; }
.service-detail:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.service-detail ul { color: var(--muted); }

.definition { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nap-block { font-size: 1.05rem; line-height: 1.7; }
.nap-block strong { font-family: var(--font-display); }
.big-number { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--ink); letter-spacing: 0.01em; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--footer-bg); color: var(--on-brand);
  padding: 3rem 0 1.5rem; margin-top: 2rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { color: var(--on-brand); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em; }
.site-footer a { color: var(--on-brand-muted); }
.site-footer a:hover { color: var(--on-brand); }
.site-footer p, .site-footer li { color: var(--on-brand-muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.footer-nap strong { color: var(--on-brand); }
.footer-note { font-size: 0.82rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 2rem; padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: 0.82rem; color: var(--on-brand-muted);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

/* The six nowrap nav labels + brand lockup + red call button + toggles need
   the full container width to sit inline; hand over to the hamburger below
   ~1080px so nothing overflows or wraps. */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--header-bg); border-top: 1px solid rgba(255,255,255,0.1);
    display: none; padding: 0.5rem 1.25rem 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0.15rem; }
  .main-nav a { padding: 0.8rem 0.6rem; }
  /* header stays sticky (sticky establishes the containing block for the
     absolutely-positioned dropdown) so the 24/7 call button follows scroll */
}

@media (max-width: 560px) {
  .brand-desc { display: none; }
  .header-call .call-label small { display: none; }
  .header-call .call-num { display: none; }
  .header-inner { gap: 0.5rem; }
}

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