/* ==========================================================================
   Foundry Trades Template — main stylesheet
   One file, plain CSS, no dependencies. Styled to the wireframe brief supplied
   alongside the scope brief — NOT to the Equity Release sites' look, which is
   only the funnel/business-model reference.
   Sections: 1. Tokens  2. Base  3. Layout  4. Buttons  5. Header & nav
   6. Hero  7. Trust strip  8. Services  9. About  10. Areas + map
   11. Reviews  12. CTA banner  13. Forms  14. Footer  15. Sticky mobile bar
   ========================================================================== */

/* 1. Tokens (trade-neutral placeholders, not a final brand palette — a real
      client's brand colours are a later "theme" config block, not built yet) */
:root {
  --brand-700: #154273;
  --brand-800: #113459;
  --brand-900: #0d2c4d;
  --cta-blue: #0f4a86;      /* "Need an electrician?" band */
  --charcoal: #1b222b;      /* footer */
  --ink: #1c2226;
  --ink-soft: #4a545c;
  --paper: #ffffff;
  --cream: #f6f8fa;
  --line: #dde3e8;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
  --radius-lg: 14px;
  --max: 1180px;
  --shadow: 0 1px 2px rgba(13,44,77,.06), 0 8px 24px rgba(13,44,77,.08);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--brand-900); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
a { color: var(--brand-700); }
a:hover { color: var(--brand-900); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand-900); color: #fff; padding: .75em 1em; z-index: 100; }
.skip-link:focus { left: 0; }

/* 3. Layout ------------------------------------------------------------------ */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand-700); margin-bottom: .5em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading-link { font-weight: 700; white-space: nowrap; text-decoration: none; }

/* Long-form text pages (privacy notice): a comfortable reading width */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.prose ul { margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }

/* 4. Buttons ------------------------------------------------------------------ */
.btn { display: inline-block; padding: .85em 1.5em; border-radius: var(--radius); font-weight: 700; text-decoration: none; border: 2px solid transparent; }
.btn--primary { background: var(--brand-700); color: #fff; }
.btn--primary:hover { background: var(--brand-900); color: #fff; }
.btn--ghost { border-color: var(--brand-700); color: var(--brand-700); }
.btn--ghost:hover { background: var(--cream); }
.btn--on-dark.btn--ghost { border-color: #fff; color: #fff; }
.btn--on-dark.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--white { background: #fff; color: var(--cta-blue); }
.btn--white:hover { background: var(--cream); color: var(--brand-900); }
.btn-icon { width: 1.1em; height: 1.1em; vertical-align: -.15em; margin-right: .5em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* 5. Header & nav ------------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding-top: .85rem; padding-bottom: .85rem; } /* horizontal padding comes from .wrap (this element carries both classes) — a full shorthand here would silently override it, as it did on .trust-strip-grid */
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-logo { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.1rem; color: var(--brand-900); }
.brand-tagline { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.header-call { margin-left: auto; text-decoration: none; text-align: right; }
.header-call-label { display: block; font-size: .72rem; color: var(--ink-soft); }
.header-call-number { display: block; font-weight: 800; color: var(--brand-700); font-size: 1.05rem; }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 22px; height: 2px; background: var(--brand-900); position: relative; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.site-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 600; color: var(--ink); white-space: nowrap; }
.site-nav a[aria-current="page"] { color: var(--brand-700); }

/* 6. Hero / page banner ------------------------------------------------------------------ */
.hero, .page-banner { background: var(--cream); padding: 3rem 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.hero-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }

/* 7. Trust strip ------------------------------------------------------------------ */
/* Icons are inline <svg> (currentColor), not emoji — matches the wireframe's plain blue line-icon look.
   The 4th ("Quality Workmanship") is a filled circle badge in the wireframe, the other three are plain. */
.trust-strip { border-bottom: 1px solid var(--line); background: var(--paper); }
.trust-strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-top: 1.75rem; padding-bottom: 1.75rem; } /* NOT a full "padding:" shorthand — this element also carries .wrap, whose own horizontal padding a shorthand here would silently override (the exact bug Neil spotted on mobile) */
.trust-item { display: flex; flex-direction: column; gap: .15rem; }
.trust-item-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--brand-700); margin-bottom: .4rem; }
.trust-item-icon svg { width: 100%; height: 100%; }
.trust-item-icon--badge { background: var(--brand-700); border-radius: 50%; }
.trust-item-icon--badge svg { width: 55%; height: 55%; }
.trust-item strong { color: var(--brand-900); }
.trust-item span:last-child { color: var(--ink-soft); font-size: .9rem; }

/* 8. Services ------------------------------------------------------------------ */
/* Single row on desktop (up to 6 tiles: up to 5 core services + the conditional emergency-callout tile),
   matching the wireframe's compact icon-strip look rather than a bordered card grid. */
.services-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
/* Each service is a bordered box. Grid items stretch, so every box is the same height; the card is a flex
   column with the link pinned to the bottom, and the title has a fixed two-line slot (centred in it) so the
   descriptions all start at the same height whether a title wraps or not. */
.service-card { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem 1rem 1.25rem; box-shadow: var(--shadow); }
.service-card h3 { display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: .5em; }
.service-card p { color: var(--ink-soft); font-size: .9rem; margin-bottom: .75em; }
.service-card p.service-card-price { font-weight: 700; color: var(--brand-700); }
.service-card-link { margin-top: auto; padding-top: .5rem; white-space: nowrap; font-weight: 700; text-decoration: none; font-size: .9rem; }
.service-card-link:hover { text-decoration: underline; }
.icon-badge { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: var(--brand-700); margin-bottom: .9rem; }
.icon-badge svg { width: 26px; height: 26px; }

/* 9. About ------------------------------------------------------------------ */
/* Photo | copy | shaded features box, as in the wireframe */
.about-grid { display: grid; grid-template-columns: 240px 1fr 300px; gap: 2.5rem; align-items: center; }
.about-media img { border-radius: var(--radius-lg); aspect-ratio: 1 / 1; width: 100%; object-fit: cover; }
.about-copy p:last-child { margin-bottom: 0; }
.about-features { background: #eaf1f8; border: 1px solid #d3e0ee; border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; }
.about-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.about-list li { padding-left: 2em; position: relative; font-weight: 600; color: var(--brand-900); }
.about-list li::before { content: "\2713"; position: absolute; left: 0; top: .1em; width: 1.35em; height: 1.35em; line-height: 1.35em; text-align: center; font-size: .85em; border-radius: 50%; background: var(--brand-700); color: #fff; font-weight: 700; }

/* 10. Areas + map ------------------------------------------------------------------ */
.areas-section { background: var(--cream); scroll-margin-top: 4rem; } /* so #areas links (contact page) don't land under the sticky header */
.areas-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.areas-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.areas-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .3em .9em; font-size: .9rem; }
.map-placeholder { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: repeating-linear-gradient(45deg, var(--line), var(--line) 10px, #eef2f5 10px, #eef2f5 20px); display: flex; align-items: center; justify-content: center; border: 1px dashed #aab6c0; }
.map-placeholder span { background: var(--brand-700); color: #fff; padding: .4em 1em; border-radius: 999px; font-weight: 700; }
.map-image img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* 11. Reviews ------------------------------------------------------------------ */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.review-card { background: var(--cream); border-radius: var(--radius-lg); padding: 1.5rem; }
.review-card-quote { font-style: italic; }
.review-card-author { font-weight: 700; color: var(--brand-900); margin: 0; }

/* 12. CTA banner ------------------------------------------------------------------ */
.cta-banner { background: var(--cta-blue); color: #fff; padding: 2.75rem 0; }
.cta-banner h2 { color: #fff; margin-bottom: .25em; font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
.cta-banner p { color: #d8e6f4; margin-bottom: 0; }
.cta-banner .hero-actions { margin-top: 0; }
.cta-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }

/* 13. Forms ------------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }
.form-card, .panel { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel + .panel { margin-top: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35em; }
.field .hint { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.field .req { color: #b3261e; }
input, textarea { width: 100%; padding: .7em .8em; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
textarea { min-height: 7rem; }
.hp { position: absolute; left: -9999px; }
.form-status { color: #b3261e; font-weight: 600; min-height: 1.4em; }
.form-note { font-size: .85rem; color: var(--ink-soft); margin-top: .75rem; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin-bottom: .9rem; }
.contact-list small { display: block; color: var(--ink-soft); font-size: .8rem; }
.thanks { text-align: center; max-width: 34rem; }
.thanks-tick { width: 3.5rem; height: 3.5rem; line-height: 3.5rem; border-radius: 50%; background: var(--brand-700); color: #fff; font-size: 1.5rem; margin: 0 auto 1rem; }

/* 14. Footer ------------------------------------------------------------------ */
.site-footer { background: var(--charcoal); color: #d3d9df; padding: 3rem 0 2rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1.5fr .7fr; gap: 2rem; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #aab4be; font-size: .95rem; margin-top: .75rem; }
.footer-grid h2 { color: #fff; font-size: 1rem; margin-bottom: .75em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .95rem; }
.footer-contact li { display: flex; align-items: flex-start; gap: .6rem; }
.footer-contact li svg { flex-shrink: 0; width: 1.05rem; height: 1.05rem; margin-top: .3em; color: #8fb4dc; }
.footer-line { display: block; }
.social-icons { display: flex; gap: .6rem; }
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.social-icon svg { width: 16px; height: 16px; }
.legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; color: #aab4be; }
.legal p { margin: 0; }

/* 15. Sticky mobile call/WhatsApp bar (mobile only) ------------------------------- */
.sticky-bar { display: none; }

/* 16. Responsive ------------------------------------------------------------------ */
/* Six boxes across need roughly 1100px+; below that they drop to three per row */
@media (min-width: 1101px) {
  .service-card h3 { min-height: 2.5em; } /* two-line title slot so descriptions line up across the row */
}
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-strip-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 220px 1fr; }
  .about-features { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .header-call { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem; }
  .site-nav a { display: block; padding: .6rem 0; }

  .hero-grid, .about-grid, .areas-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 220px; }
  .services-grid, .reviews-grid { grid-template-columns: 1fr; }
  .contact-grid, .service-detail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  /* Mobile view, following the wireframe's phone layout: everything centred, big full-width buttons,
     boxed services, and a slimmed-down footer (no Quick Links / Our Services columns). */
  .hero, .page-banner { text-align: center; }
  .hero { padding-bottom: 0; }
  .hero-actions { flex-direction: column; gap: .85rem; }
  .hero-actions .btn { display: block; width: 100%; text-align: center; padding: 1.05em 1.25em; font-size: 1.15rem; }
  .hero-media { margin: 0 -1.25rem; }   /* photo runs edge to edge, as in the wireframe */
  .hero-media img { border-radius: 0; box-shadow: none; }

  .trust-item { align-items: center; text-align: center; }
  .section-heading { flex-direction: column; align-items: center; text-align: center; }

  /* Service boxes: icon on the left, text left-aligned beside it (wireframe mobile view) */
  .service-card { display: grid; grid-template-columns: 56px 1fr; column-gap: 1rem; align-items: start; justify-items: start; text-align: left; padding: 1.1rem 1.25rem; }
  .service-card .icon-badge { grid-row: 1 / span 4; width: 56px; height: 56px; margin-bottom: 0; }
  .service-card .icon-badge svg { width: 28px; height: 28px; }
  .service-card h3 { justify-content: flex-start; margin-bottom: .25em; }
  .service-card p { margin-bottom: .5em; }
  .service-card-link { margin-top: 0; padding-top: 0; }

  .about-grid { justify-items: center; text-align: center; }
  .about-features { width: 100%; }
  .about-list { justify-content: center; text-align: left; }
  .areas-grid { text-align: center; }
  .areas-list { justify-content: center; }
  .reviews-section .wrap { text-align: center; }

  .cta-banner-inner { flex-direction: column; text-align: center; justify-content: center; }
  .cta-banner .hero-actions { width: 100%; }

  .footer-col--desktop { display: none; }
  .footer-grid { text-align: center; justify-items: center; gap: 2rem; }
  .footer-brand .brand { justify-content: center; }
  .footer-contact li { justify-content: center; align-items: center; text-align: left; }
  .footer-contact li svg { margin-top: 0; }
  .footer-contact li span { text-align: center; }
  .footer-contact li svg { width: 1.25rem; height: 1.25rem; }
  .footer-contact ul { gap: .85rem; font-size: 1.05rem; }
  .footer-phone { font-size: 1.75rem; font-weight: 800; }
  .social-icons { justify-content: center; gap: 1rem; }
  .social-icon { width: 52px; height: 52px; }
  .social-icon svg { width: 24px; height: 24px; }
  .legal { flex-direction: column; align-items: center; text-align: center; }

  /* Sticky mobile Call/WhatsApp bar (brief §4: phone-first, sticky call button on mobile) */
  .sticky-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; box-shadow: 0 -2px 12px rgba(13,44,77,.15); }
  .sticky-bar-btn { flex: 1; text-align: center; padding: 1rem .75rem; font-size: 1rem; white-space: nowrap; font-weight: 700; text-decoration: none; color: #fff; }
  .sticky-bar-call { background: var(--brand-700); flex: 1.5; }
  .sticky-bar-whatsapp { background: #25d366; }
  /* room for the sticky bar so it never covers the footer's own content */
  .site-footer { padding-bottom: calc(2rem + 64px); }
}
