/* ==========================================================================
   Ashcroft & Bailey Plumbing & Heating — central stylesheet
   --------------------------------------------------------------------------
   Colour roles, type scale and spacing scale are defined once in :root.
   Nothing below this block hard-codes a hex value or a font size.

   Palette notes:
     - #ff00ff is intentionally unused (fails contrast on all surfaces).
     - #8a98db and #878112 are restricted to surfaces, rules and large text.
     - White is the only value not from the supplied palette; it is the base
       surface. Every other tint is one of your seven.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- Colour: roles, not decoration --- */
  --ink:        #1d403f;  /* 11.3:1 on white  — body copy, dark bands      */
  --paper:      #ffffff;  /* base surface                                   */
  --rose:       #d2b4bc;  /*  5.9:1 w/ ink    — light tinted band           */
  --periwinkle: #8a98db;  /*  4.1:1 w/ ink    — band; LARGE text only       */
  --green:      #298712;  /*  4.6:1 w/ white  — buttons, links              */
  --olive:      #878112;  /*  4.1:1 on white  — rules, markers, large text  */
  --alert:      #ff69b4;  /*  4.3:1 w/ ink    — emergency marker, large bold*/

  /* --- Type --- */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Source Sans 3", "Segoe UI", Roboto, sans-serif;

  --text-2xs: 0.694rem;
  --text-xs:  0.833rem;
  --text-s:   0.938rem;
  --text-m:   1rem;
  --text-l:   1.2rem;
  --text-xl:  1.44rem;
  --text-2xl: clamp(1.5rem, 1.35rem + 0.65vw, 1.728rem);
  --text-3xl: clamp(1.75rem, 1.50rem + 1.10vw, 2.074rem);
  --text-4xl: clamp(2.10rem, 1.60rem + 2.20vw, 2.488rem);

  --leading-tight: 1.15;
  --leading-snug:  1.35;
  --leading-body:  1.6;

  /* --- Spacing (4px root) --- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  /* --- Structure --- */
  --wrap:     72rem;
  --measure:  62ch;      /* max line length for prose */
  --radius:   2px;       /* near-sharp. We are not a fintech. */
  --hairline: 1px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

body,
h1, h2, h3, h4,
p, figure, blockquote,
dl, dd, ul, ol { margin: 0; }

ul[class], ol[class] { padding: 0; list-style: none; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: var(--leading-body);
  /* Room for the fixed mobile call bar so it never covers the footer */
  padding-bottom: 0;
}

@media (max-width: 44.99rem) {
  body { padding-bottom: 3.75rem; }
}

img, svg { display: block; max-width: 100%; }

input, button, textarea, select { font: inherit; color: inherit; }

/* Visible, consistent focus. Non-negotiable. */
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.band--ink :focus-visible,
.band--periwinkle :focus-visible { outline-color: var(--paper); }

/* Skip link — first tab stop, hidden until focused */
.skip {
  position: absolute;
  left: var(--space-s);
  top: -100%;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: var(--space-s); }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-l); letter-spacing: -0.005em; }

p { max-width: var(--measure); text-wrap: pretty; }

.lede {
  font-size: var(--text-l);
  line-height: var(--leading-snug);
  max-width: 46ch;
}

/* Small-caps label. Used for section eyebrows and table headers. */
.label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--olive);          /* large-ish & bold enough to clear AA */
}

.band--ink .label { color: var(--rose); }

a { color: var(--green); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

.band--ink a { color: var(--paper); }

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-m);
}

@media (min-width: 48rem) {
  .wrap { padding-inline: var(--space-l); }
}

/* Full-bleed horizontal band. This is our main structural device —
   we separate content with colour and rules, not with floating cards. */
.band { padding-block: var(--space-3xl); }
.band--tight { padding-block: var(--space-2xl); }

.band--rose       { background: var(--rose); }
.band--periwinkle { background: var(--periwinkle); }
.band--ink        { background: var(--ink); color: var(--paper); }
.band--ink h2,
.band--ink h3     { color: var(--paper); }
.band--ink p      { color: var(--rose); }

/* A hairline that separates stacked blocks instead of a card border */
.rule {
  border: 0;
  border-top: var(--hairline) solid var(--olive);
  margin: 0;
}
.band--ink .rule { border-top-color: var(--olive); }

.stack > * + * { margin-top: var(--space-m); }
.stack--tight > * + * { margin-top: var(--space-s); }
.stack--loose > * + * { margin-top: var(--space-l); }

/* --------------------------------------------------------------------------
   5. HEADER
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: var(--hairline) solid var(--olive);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s) var(--space-m);
  padding-block: var(--space-s);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-l);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.wordmark span {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--olive);
}

/* Nav scrolls horizontally on narrow screens rather than hiding behind a
   hamburger. Six short labels fit; no JS, no focus-trap, nothing to break. */
.nav {
  order: 3;
  width: 100%;
  display: flex;
  gap: var(--space-m);
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: var(--space-3xs);
}
.nav a {
  white-space: nowrap;
  font-size: var(--text-s);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding-block: var(--space-3xs);
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--olive); }
.nav a[aria-current="page"] { border-bottom-color: var(--green); }

@media (min-width: 56rem) {
  .nav {
    order: 0;
    width: auto;
    overflow: visible;
    padding-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   6. BUTTONS & ACTIONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-m);
  border: var(--hairline) solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-s);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.btn--call {
  background: var(--green);
  color: var(--paper);
  font-size: var(--text-m);
}
.btn--call:hover { background: var(--ink); color: var(--paper); }

.btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.band--ink .btn--ghost { border-color: var(--paper); color: var(--paper); }
.band--ink .btn--ghost:hover { background: var(--paper); color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); }

/* --------------------------------------------------------------------------
   7. LISTS, TABLES, TAGS
   -------------------------------------------------------------------------- */
/* Problem router / service index — a ruled list, not a card grid */
.ruled { border-top: var(--hairline) solid var(--olive); }
.ruled li { border-bottom: var(--hairline) solid var(--olive); }
.ruled a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-s);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-l);
}
.ruled a:hover { color: var(--green); }
.ruled a::after {
  content: "→";
  font-weight: 400;
  color: var(--olive);
  flex: none;
}
.ruled .note {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-s);
  color: var(--ink);
  opacity: 0.75;
  margin-top: var(--space-3xs);
  max-width: 40ch;
}

.tag {
  display: inline-block;
  padding: 0.15em 0.55em;
  border: var(--hairline) solid var(--olive);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--olive);
}
.tag--alert {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink);          /* 4.3:1 — large/bold only. See notes. */
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-s);
}
caption {
  text-align: left;
  font-size: var(--text-s);
  color: var(--ink);
  opacity: 0.75;
  padding-bottom: var(--space-s);
}
th, td {
  text-align: left;
  padding: var(--space-xs) var(--space-s) var(--space-xs) 0;
  border-bottom: var(--hairline) solid var(--rose);
  vertical-align: top;
}
th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--olive);
}

/* Spec-sheet definition list — used for service detail */
.spec { display: grid; gap: var(--space-s); }
.spec div {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xs);
  padding-bottom: var(--space-s);
  border-bottom: var(--hairline) solid var(--rose);
}
@media (min-width: 34rem) {
  .spec div { grid-template-columns: 11rem 1fr; gap: var(--space-m); }
}
.spec dt {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--olive);
}
.spec dd { margin: 0; }

/* --------------------------------------------------------------------------
   8. GRIDS (asymmetric by default)
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-l); }

/* 7/5 split — deliberately not 50/50, and not three equal columns */
@media (min-width: 56rem) {
  .grid--split { grid-template-columns: 7fr 5fr; gap: var(--space-2xl); }
  .grid--split-rev { grid-template-columns: 5fr 7fr; gap: var(--space-2xl); }
  .grid--half { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
}

/* --------------------------------------------------------------------------
   9. FORMS
   -------------------------------------------------------------------------- */
.field { display: grid; gap: var(--space-3xs); }

.field label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--olive);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: var(--space-xs);
  background: var(--paper);
  border: var(--hairline) solid var(--ink);
  border-radius: var(--radius);
  font-size: var(--text-m);
}
.field textarea { min-height: 8rem; resize: vertical; }

.field .hint {
  font-size: var(--text-xs);
  color: var(--ink);
  opacity: 0.75;
}

.radio-set { display: grid; gap: var(--space-2xs); border: 0; padding: 0; }
.radio-set legend {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--olive);
  padding: 0;
  margin-bottom: var(--space-2xs);
}
.radio-set label {
  display: flex;
  gap: var(--space-2xs);
  align-items: flex-start;
  font-size: var(--text-s);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
}

/* Honeypot. Bots fill it; humans never see it. Server must reject if filled. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-grid { display: grid; gap: var(--space-m); }
@media (min-width: 40rem) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field--wide { grid-column: 1 / -1; }
}

.error-msg {
  color: #b00020;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.field input.is-invalid,
.field textarea.is-invalid {
  border-color: #b00020;
  outline-color: #b00020;
}

.field input.is-valid,
.field textarea.is-valid {
  border-color: #2e7d32;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.is-invalid {
  animation: shake 0.2s ease-in-out;
}

.success-banner {
  background: #e8f5e9;
  border: 1px solid #2e7d32;
  color: #1b5e20;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-weight: 600;
}

.photo-preview {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.photo-preview__item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.photo-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.photo-preview__source {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  padding: 3px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.photo-btn.has-file {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #1b5e20;
}

/* --------------------------------------------------------------------------
   10. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: var(--rose);
  padding-block: var(--space-2xl);
  font-size: var(--text-s);
}
.footer h2 { font-size: var(--text-s); color: var(--paper); }
.footer a { color: var(--paper); }
.footer__grid {
  display: grid;
  gap: var(--space-l);
}
@media (min-width: 48rem) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--space-2xl); }
}
.footer .rule { border-top-color: var(--olive); margin-block: var(--space-l); }
.footer__legal { font-size: var(--text-xs); color: var(--rose); }

/* --------------------------------------------------------------------------
   11. MOBILE CALL BAR
   -------------------------------------------------------------------------- */
/* The single most important interaction on the site. It gets its own
   fixed element on small screens rather than being scrolled past. */
.callbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--green);
  border-top: var(--hairline) solid var(--ink);
}
.callbar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding-block: var(--space-s);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-m);
  text-decoration: none;
}
.callbar a + a {
  border-left: var(--hairline) solid var(--ink);
  background: var(--ink);
}
@media (min-width: 45rem) { .callbar { display: none; } }

/* --------------------------------------------------------------------------
   12. PAGE-SPECIFIC
   -------------------------------------------------------------------------- */
/* Home — the opening block is a router, not a hero. */
.opener { padding-block: var(--space-2xl) var(--space-3xl); }
.opener__intro { max-width: 34ch; }

/* Coverage strip — flat, inline, no map embed */
.coverage {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  font-size: var(--text-s);
}
.coverage a { text-decoration: none; }
.coverage a:hover { text-decoration: underline; }

/* Review entry — flat block, rule-separated */
.review {
  padding-top: var(--space-m);
  border-top: var(--hairline) solid var(--olive);
}
.review__meta {
  font-size: var(--text-xs);
  color: var(--olive);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.review blockquote {
  font-size: var(--text-l);
  line-height: var(--leading-snug);
  max-width: 52ch;
}
.placeholder {
  background: var(--rose);
  border-left: 3px solid var(--olive);
  padding: var(--space-xs) var(--space-s);
  font-size: var(--text-s);
}

/* Service group anchor nav */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  padding-block: var(--space-s);
  border-block: var(--hairline) solid var(--olive);
  font-size: var(--text-s);
}
.jump a { font-weight: 600; text-decoration: none; }
.jump a:hover { text-decoration: underline; }

/* Anchor offset so sticky header doesn't cover jumped-to headings */
:target { scroll-margin-top: 7rem; }

/* Hours table */
.hours td:last-child { text-align: right; }
.hours .today { font-weight: 600; }