/* ============================================================
   Dixon Electrical — visual refinement layer
   Loaded AFTER style.css. Overrides only; changes no content,
   no layout structure and no brand colour.

   Same navy (#0A2540) and electric yellow (#FFD60A). What changes
   is the craft: typographic scale, spacing rhythm, surface depth,
   focus states and motion discipline.
   ============================================================ */

:root {
  /* --- refined surface + depth tokens --- */
  --r-ink:          #0B1B2E;
  --r-ink-soft:     #33415A;
  --r-muted:        #55627A;   /* 4.5:1 on white — replaces gray-400 for body text */
  --r-line:         #E3E8EF;
  --r-line-strong:  #CBD5E1;
  --r-surface:      #FFFFFF;
  --r-surface-2:    #F7F9FC;
  --r-surface-3:    #EEF2F8;

  /* Layered shadows read as depth rather than a grey smudge */
  --r-sh-1: 0 1px 2px rgba(10,37,64,.05), 0 2px 6px rgba(10,37,64,.05);
  --r-sh-2: 0 2px 4px rgba(10,37,64,.05), 0 8px 20px rgba(10,37,64,.07);
  --r-sh-3: 0 4px 8px rgba(10,37,64,.06), 0 18px 42px rgba(10,37,64,.11);
  --r-sh-yellow: 0 6px 20px rgba(255,214,10,.34);

  --r-ease: cubic-bezier(.22,.61,.36,1);
  --r-fast: 170ms var(--r-ease);
  --r-med:  260ms var(--r-ease);

  --r-r-sm: 8px;
  --r-r-md: 12px;
  --r-r-lg: 18px;
}

/* ---------- 1. Typography ------------------------------------ */

body {
  color: var(--r-ink);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--r-ink);
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 1.55rem + 3.4vw, 4rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.032em;
}

h2 {
  font-size: clamp(1.75rem, 1.32rem + 1.9vw, 2.7rem);
  line-height: 1.13;
  letter-spacing: -0.026em;
}

h3 {
  font-size: clamp(1.14rem, 1.04rem + 0.42vw, 1.38rem);
  line-height: 1.28;
  letter-spacing: -0.014em;
}

p {
  font-size: 1.06rem;
  line-height: 1.72;
  color: var(--r-ink-soft);
}

/* Prose blocks stay inside a comfortable measure */
.section-header p,
.blog-article p,
.area-prose p { max-width: 68ch; }
.section-header p { margin-left: auto; margin-right: auto; }

/* Prices and figures line up in tables */
.price-table td, .mats td, .from-price, .about-stat { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent); color: var(--primary); }

/* ---------- 2. Layout rhythm --------------------------------- */

.section { padding: clamp(58px, 4.2vw + 38px, 104px) 24px; }
.section-header { margin-bottom: clamp(34px, 3vw, 56px); }
.container { padding-inline: clamp(20px, 4vw, 32px); }

/* Overline: quieter, better aligned to the heading below it */
.section-tag {
  color: var(--primary);
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat;
  border-bottom: 0;
  font-size: .70rem;
  letter-spacing: .17em;
  padding-bottom: 6px;
  margin-bottom: 14px;
  opacity: .92;
}

/* ---------- 3. Surfaces and cards ---------------------------- */

.benefit-card,
.service-card,
.area-card,
.testimonial-card {
  border-radius: var(--r-r-md);
  border: 1px solid var(--r-line);
  box-shadow: var(--r-sh-1);
  background: var(--r-surface);
  transition: box-shadow var(--r-med), border-color var(--r-med), transform var(--r-med);
  position: relative;
}

/* The yellow rule becomes a precise inset bar rather than a full border */
.benefit-card, .service-card { border-top: 1px solid var(--r-line); overflow: hidden; }
.benefit-card::before,
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 38%, transparent 38%);
  transition: background var(--r-med);
}
.benefit-card:hover::before,
.service-card:hover::before {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 100%, transparent 100%);
}

.benefit-card:hover,
.service-card:hover,
.area-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--r-sh-3);
  border-color: var(--r-line-strong);
}

.testimonial-card { border-left: 3px solid var(--accent); }

.services-grid, .benefits-grid { gap: clamp(18px, 1.6vw, 26px); }

/* Cards that are entirely a link should say so */
a.benefit-card, a.service-card, .area-card a, .card-link { cursor: pointer; }

/* ---------- 4. Buttons --------------------------------------- */

.btn {
  border-radius: 10px;
  padding: 15px 30px;
  font-size: 1.02rem;
  min-height: 48px;                 /* comfortable touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.005em;
  transition: background var(--r-fast), box-shadow var(--r-fast),
              transform var(--r-fast), color var(--r-fast), border-color var(--r-fast);
  will-change: transform;
}

.btn-primary { box-shadow: var(--r-sh-1); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--r-sh-yellow); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--r-sh-1); }

.btn-navy:hover { background: var(--primary-soft); transform: translateY(-2px); box-shadow: var(--r-sh-2); }
.btn-navy:active { transform: translateY(0); }

.btn-white {
  background: rgba(255,255,255,.09);
  border: 1.5px solid rgba(255,255,255,.36);
  backdrop-filter: blur(6px);
}
.btn-white:hover { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.60); transform: translateY(-2px); }

.nav-cta { transition: background var(--r-fast), box-shadow var(--r-fast) !important; }
.nav-cta:hover { box-shadow: var(--r-sh-yellow) !important; }

/* ---------- 5. Header + hero --------------------------------- */

.header {
  background: rgba(10,37,64,.92);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid rgba(255,214,10,.34);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 24px rgba(6,18,32,.16);
}

.nav-links a { position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--r-fast);
}
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }

.hero { padding-bottom: clamp(64px, 5vw, 96px); }

/* Deeper, more even scrim so the headline holds at every width */
.hero--home {
  background:
    linear-gradient(180deg, rgba(6,18,32,.30) 0%, rgba(6,18,32,0) 30%),
    linear-gradient(118deg, rgba(6,26,46,.94) 0%, rgba(10,37,64,.86) 46%, rgba(26,58,96,.72) 100%),
    url('../images/hero-consumer-unit-install.jpg') center center / cover no-repeat;
}

/* A soft vignette rather than a hard circle of yellow */
.hero::before {
  top: -55%; right: -28%;
  width: 780px; height: 780px;
  background: radial-gradient(circle, rgba(255,214,10,.12) 0%, rgba(255,214,10,.04) 42%, transparent 72%);
  filter: blur(6px);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(6,18,32,.28));
  pointer-events: none;
}

.hero h1 { text-shadow: 0 2px 24px rgba(3,12,22,.42); }
.hero p  { color: rgba(255,255,255,.90); font-size: clamp(1.04rem, .98rem + .32vw, 1.22rem); }
.hero-buttons { gap: 14px; margin-top: 4px; }

/* Trust strip: quieter, less "banner", more masthead */
.g-trust-strip { letter-spacing: .1px; }
.g-trust-strip a { transition: opacity var(--r-fast); }
.g-trust-strip a:hover { opacity: .82; }

/* ---------- 6. Price badge ----------------------------------- */

.from-price {
  display: inline-block;
  background: var(--r-surface-3);
  color: var(--primary);
  border: 1px solid var(--r-line-strong);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 4px 0 10px;
}

/* ---------- 7. FAQ / details --------------------------------- */

.area-faq details, .post-faq details { transition: background var(--r-fast); border-bottom-color: var(--r-line); }
.area-faq details[open], .post-faq details[open] { background: var(--r-surface-2); }
.area-faq summary, .post-faq summary { padding: 2px 0; }
.area-faq summary:hover, .post-faq summary:hover { color: var(--primary-soft); }

.faq-question { transition: color var(--r-fast); cursor: pointer; }
.faq-item { border-bottom: 1px solid var(--r-line); }

/* ---------- 8. Footer ---------------------------------------- */

.footer { border-top: 3px solid var(--accent); }
.footer a { transition: color var(--r-fast), opacity var(--r-fast); }
.footer a:hover { color: var(--accent); }

/* ---------- 9. Accessibility + motion ------------------------ */

:where(a, button, summary, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.header :where(a, button):focus-visible { outline-color: var(--accent); outline-offset: 4px; }

/* Never trap a keyboard user behind the fixed header */
:target { scroll-margin-top: 150px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .benefit-card:hover, .service-card:hover, .area-card:hover,
  .btn:hover, .btn-primary:hover, .btn-navy:hover, .btn-white:hover { transform: none; }
}

/* ---------- 10. Mobile --------------------------------------- */

.mobile-cta-bar { box-shadow: 0 -6px 24px rgba(6,18,32,.16); }
.mobile-cta-bar a { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

@media (max-width: 760px) {
  .section { padding-left: 20px; padding-right: 20px; }
  .btn { width: 100%; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; }
}

/* Tables never force the page sideways */
.price-table, .mats { display: block; overflow-x: auto; white-space: nowrap; }
@media (min-width: 620px) { .price-table, .mats { display: table; white-space: normal; } }
