/* =========================================================================
   Wesco Domestic Gas — styles.css
   Mobile-first. Design tokens mirror DESIGN_wesco_domestic_gas.md.
   ========================================================================= */

/* ---- Self-hosted / Google Fonts (Inter) ---------------------------------
   Loaded via <link> in each page <head>. No @import here to avoid render
   blocking. */

/* ---- Design tokens ---- */
:root {
  /* Colours */
  --primary: #0B3D5C;
  --secondary: #1E6B8A;
  --accent: #C2410C;          /* Accessible CTA orange (~5.2:1 white text) */
  --accent-hover: #9A330A;
  --accent-bright: #FF6B35;   /* Decorative only — never behind white text */
  --success: #2E7D32;
  --neutral-light: #F7F9FA;
  --neutral: #E3E8EC;
  --neutral-dark: #4A5560;
  --text-primary: #1A2330;
  --text-inverse: #FFFFFF;
  --background: #FFFFFF;
  --overlay: rgba(11, 61, 92, 0.85);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Spacing */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 40px;
  --s-2xl: 64px;

  /* Shadows */
  --shadow-card: 0 2px 8px rgba(11, 61, 92, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(11, 61, 92, 0.15);
  --shadow-sticky: 0 4px 16px rgba(11, 61, 92, 0.12);

  /* Layout */
  --max-w: 1200px;
  --nav-h: 72px;
  --call-bar-h: 64px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Room for the fixed mobile call bar so content is never hidden. */
  padding-bottom: var(--call-bar-h);
}
@media (min-width: 768px) {
  body { padding-bottom: 0; }
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---- Focus visibility (a11y) ---- */
:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

/* ---- Typography scale ---- */
.h1, h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .h1, h1 { font-size: 2.5rem; }
}
.h2, h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .h2, h2 { font-size: 1.875rem; }
}
.h3, h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}
.body-lg { font-size: 1.125rem; line-height: 1.6; }
.body-sm { font-size: 0.875rem; line-height: 1.5; }
.label-caps {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s-md);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--s-lg); }
}
/* Grid children may shrink below their intrinsic content width (prevents
   long, unbreakable content from forcing horizontal overflow on mobile). */
.card-grid > *,
.coverage > *,
.contact-block > *,
.footer__grid > *,
.trust-strip__grid > * { min-width: 0; }
.section {
  padding-block: var(--s-xl);
}
@media (min-width: 768px) {
  .section { padding-block: var(--s-2xl); }
}
.section--tint { background: var(--neutral-light); }
.section__head { max-width: 640px; margin-bottom: var(--s-lg); }
.section__head p { color: var(--neutral-dark); margin-top: var(--s-sm); }
.text-center { text-align: center; }
.mt-md { margin-top: var(--s-md); }
.mt-lg { margin-top: var(--s-lg); }
.justify-center { justify-content: center; }

/* Ghost button on a dark/photo background (e.g. hero) */
.btn--ghost.btn--ghost-inverse {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn--ghost.btn--ghost-inverse:hover { background: rgba(255, 255, 255, 0.12); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  font-family: var(--font);
  font-weight: 700;
  border: 0;
  border-radius: var(--r-full);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  white-space: normal;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--call {
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 1.125rem;
  padding: 16px 32px;
  min-height: 56px;
}
.btn--call:hover { background: var(--accent-hover); }

.btn--secondary {
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 28px;
  min-height: 48px;
}
.btn--secondary:hover { background: var(--secondary); }

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--neutral);
  font-weight: 600;
  padding: 10px 22px;
  min-height: 44px;
}
.btn--ghost:hover { background: var(--neutral-light); }

.btn--full { width: 100%; }

.btn__icon { width: 20px; height: 20px; flex: 0 0 auto; }

/* ---- Trust badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success);
  color: var(--text-inverse);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-full);
  padding: 6px 14px;
}
.badge svg { width: 14px; height: 14px; }

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  height: var(--nav-h);
  border-bottom: 1px solid var(--neutral);
  transition: box-shadow 0.2s ease;
}
.nav.is-scrolled { box-shadow: var(--shadow-sticky); border-bottom-color: transparent; }
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.nav__brand:hover { text-decoration: none; }
.nav__logo { height: 44px; width: auto; flex: 0 0 auto; display: block; }
.nav__links { display: none; }
.nav__phone {
  display: none;
  font-weight: 800;
  color: var(--primary);
  font-size: 1.05rem;
}
.nav__phone:hover { text-decoration: none; color: var(--secondary); }
.nav__call-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-inverse);
}
.nav__call-icon svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .nav__links {
    display: flex;
    align-items: center;
    gap: var(--s-lg);
    margin-left: auto;
    margin-right: var(--s-lg);
  }
  .nav__links a {
    color: var(--text-primary);
    font-weight: 500;
  }
  .nav__links a:hover { color: var(--secondary); text-decoration: none; }
  .nav__phone { display: inline-block; }
  .nav__call-icon { display: none; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  color: var(--text-inverse);
  background: var(--primary);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  background: var(--primary) center / cover no-repeat;
  background-image: url("/assets/hero-boiler-engineer.webp");
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: var(--s-2xl);
  max-width: 720px;
}
.hero h1 { margin-top: var(--s-md); }
.hero__sub {
  margin-top: var(--s-md);
  color: rgba(255, 255, 255, 0.92);
  max-width: 560px;
}
.hero__phone {
  display: inline-block;
  margin-top: var(--s-lg);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-inverse);
  line-height: 1;
}
.hero__phone:hover { text-decoration: none; color: #fff; }
.hero__actions {
  margin-top: var(--s-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
}
.hero__note {
  margin-top: var(--s-md);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ---- Trust strip ---- */
.trust-strip {
  background: var(--neutral-light);
  border-bottom: 1px solid var(--neutral);
}
.trust-strip__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-md);
  padding-block: var(--s-lg);
}
@media (min-width: 768px) {
  .trust-strip__grid { grid-template-columns: repeat(4, 1fr); }
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.trust-item svg { width: 26px; height: 26px; color: var(--success); flex: 0 0 auto; }

/* ---- Service cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-md);
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-lg); }
}
.card {
  background: var(--background);
  border: 1px solid var(--neutral);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  background: var(--neutral-light);
  transform: translateY(-2px);
}
.card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 107, 138, 0.1);
  color: var(--secondary);
  margin-bottom: var(--s-md);
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: var(--s-sm); }
.card p { color: var(--neutral-dark); flex: 1 1 auto; }
.card__price {
  margin-top: var(--s-md);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}
.card__link {
  margin-top: var(--s-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---- Pricing table ---- */
.pricing {
  border: 1px solid var(--neutral);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.pricing table { width: 100%; border-collapse: collapse; }
.pricing caption { text-align: left; padding: var(--s-md); font-weight: 600; }
.pricing th, .pricing td {
  text-align: left;
  padding: 14px var(--s-md);
  border-bottom: 1px solid var(--neutral);
}
.pricing thead th {
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 0.9rem;
}
.pricing tbody tr:nth-child(even) { background: var(--neutral-light); }
.pricing tbody tr:last-child td { border-bottom: 0; }
.pricing td:last-child, .pricing th:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.pricing__note {
  margin-top: var(--s-md);
  font-size: 0.875rem;
  color: var(--neutral-dark);
}

/* ---- Coverage ---- */
.coverage {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
  align-items: center;
}
@media (min-width: 768px) {
  .coverage { grid-template-columns: 1fr 1fr; gap: var(--s-2xl); }
}
.coverage__map {
  aspect-ratio: 526 / 390;
  border-radius: var(--r-lg);
  border: 1px solid var(--neutral);
  overflow: hidden;
  background: var(--neutral-light);
}
.coverage__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.town-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-top: var(--s-md);
}
.town-list li {
  background: var(--neutral-light);
  border: 1px solid var(--neutral);
  border-radius: var(--r-full);
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ---- Why / checklist ---- */
.checklist { margin-top: var(--s-md); display: grid; gap: 12px; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}
.checklist svg { width: 22px; height: 22px; color: var(--success); flex: 0 0 auto; margin-top: 2px; }

/* ---- Contact section ---- */
.contact-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
}
@media (min-width: 768px) {
  .contact-block { grid-template-columns: 1fr 1fr; gap: var(--s-2xl); }
}
.contact-details dt { font-weight: 700; color: var(--primary); margin-top: var(--s-md); }
.contact-details dd { margin: 2px 0 0; color: var(--neutral-dark); }
.contact-phone {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.contact-phone:hover { color: var(--secondary); text-decoration: none; }

/* ---- Form ---- */
.form { display: grid; gap: var(--s-md); }
.form__row { display: grid; gap: 6px; }
.form label { font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--background);
  border: 1px solid var(--neutral);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 48px;
  width: 100%;
}
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(30, 107, 138, 0.2);
}
/* Honeypot — visually hidden from humans, present for bots. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}
.form__status { font-weight: 600; }
.form__status.is-error { color: #B3261E; }
.form__status.is-success { color: var(--success); }
[hidden] { display: none !important; }

/* ---- Footer ---- */
.footer {
  background: var(--primary);
  color: var(--text-inverse);
  padding-block: var(--s-xl);
}
.footer a { color: rgba(255, 255, 255, 0.85); }
.footer a:hover { color: #fff; }
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
}
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: repeat(3, 1fr); }
}
.footer h2 { font-size: 1rem; margin-bottom: var(--s-sm); color: #fff; }
.footer ul { display: grid; gap: 6px; }
.footer__meta {
  margin-top: var(--s-lg);
  padding-top: var(--s-md);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  justify-content: space-between;
}
.social { display: flex; gap: var(--s-sm); margin-top: var(--s-sm); }
.social a {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
}
.social a:hover { background: rgba(255, 255, 255, 0.2); }
.social svg { width: 18px; height: 18px; color: #fff; }

/* ---- Sticky mobile call bar ---- */
.call-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  height: var(--call-bar-h);
  background: var(--primary);
  box-shadow: var(--shadow-sticky);
  display: flex;
  align-items: center;
  padding: 8px var(--s-md);
}
.call-bar .btn { width: 100%; }
@media (min-width: 768px) {
  .call-bar { display: none; }
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
  background: var(--primary);
  color: var(--text-inverse);
  padding-block: var(--s-xl);
}
.page-hero p { color: rgba(255, 255, 255, 0.85); margin-top: var(--s-sm); max-width: 640px; }

/* ---- Prose (legal pages) ---- */
.prose { max-width: 760px; }
.prose h2 { margin-top: var(--s-xl); }
.prose h3 { margin-top: var(--s-lg); }
.prose p, .prose ul { margin-top: var(--s-md); color: var(--text-primary); }
.prose ul { list-style: disc; padding-left: 1.25rem; display: grid; gap: 6px; }
.prose a { text-decoration: underline; }
