/* rite energy – shared styles */
:root {
  /* rite energy brand colours: "A-rated green", from the A band of an EPC rating */
  --ink: #1d2b22;
  --ink-soft: #4d5a52;
  --paper: #ffffff;
  --panel: #e5f2ec;        /* pale green tint for alternating sections */
  --line: #d0e2d8;
  --lime: #2fa36b;         /* lighter brand green – decoration only (bullets, rules) */
  --grey: #9b9ea6;         /* logo squares */
  --accent: #00804f;       /* brand green: logo, buttons (white text passes WCAG AA) */
  --accent-dark: #00663f;
  --accent-text: #00704a;  /* brand green for text, readable on white and the pale tint */
  --focus: #f2c200;
  --radius: 6px;
  --wrap: 1120px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .75rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-stretch: 112%; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; max-width: 65ch; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 251, 248, .96);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.logo img { height: 44px; width: auto; }
.footer-logo { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--accent-text); }
.nav-phone { font-weight: 700 !important; color: var(--accent-text) !important; white-space: nowrap; }
@media (max-width: 760px) { .nav a:not(.btn):not(.nav-phone) { display: none; } .nav { gap: 1rem; } }
@media (max-width: 420px) { .nav .btn { display: none; } }

/* Buttons */
.btn {
  display: inline-block; padding: .8rem 1.4rem;
  background: var(--accent); color: #fff !important;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink) !important; border: 2px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff !important; }

/* Hero */
.hero {
  background: var(--panel) url("../images/hero-skyline.webp") center bottom / cover no-repeat;
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(7rem, 14vw, 12rem);
}
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); }
.hero img { width: min(100%, 380px); margin-inline: auto; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero img { width: 200px; margin: 0; }
}
@media (max-width: 560px) {
  .hero img { display: none; }
  .hero { padding-bottom: 6rem; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }

/* Trust strip */
.trust { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.trust .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr; gap: 2rem 3rem; align-items: center; }
.trust img { max-width: 560px; width: 100%; }
.trust-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.trust-points li { padding-left: 1rem; border-left: 4px solid var(--lime); color: var(--ink-soft); }
.trust-points strong { display: block; color: var(--ink); font-size: 1.1rem; }
@media (max-width: 860px) { .trust .wrap { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section.tint { background: var(--panel); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.split.media-first > :first-child { order: -1; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 2rem; } }

.service-tag { display: inline-block; font-weight: 600; color: var(--accent-text); margin-bottom: .5rem; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.checks li { position: relative; padding-left: 1.75rem; font-weight: 500; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: .8rem; height: .8rem; border-radius: 2px; background: var(--lime);
}
.callout { border-left: 4px solid var(--accent); padding: .25rem 0 .25rem 1.25rem; margin: 1.5rem 0; }
.callout strong { display: block; font-size: 1.2rem; }

/* Contact */
.contact-details { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .5rem; }
form.enquiry { display: grid; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .7rem .8rem; border: 1px solid #b9c6bf; border-radius: var(--radius); background: #fff;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.form-status { margin: 0; padding: .8rem 1rem; border-radius: var(--radius); font-weight: 500; }
.form-status[hidden] { display: none; }
.form-status.ok { background: #e3f4ea; color: #0b5e37; }
.form-status.err { background: #fde8eb; color: #9b0f26; }

fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 1rem; }
fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 1.25rem; }
legend { font-weight: 700; font-size: 1.1rem; padding: 0; margin-bottom: .75rem; }
.opt { font-weight: 400; color: var(--ink-soft); }
.hint { margin: -.5rem 0 0; font-size: .95rem; color: var(--ink-soft); }
/* Service options: tiles size to their text and share each row, so no label breaks onto two lines */
.checks-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
fieldset { container-type: inline-size; }
/* When the form is narrow, stack all four as full-width tiles instead of uneven rows */
@container (max-width: 440px) { .checks-grid { flex-direction: column; } }
label.check { flex: 1 1 auto; white-space: nowrap; display: flex; align-items: center; gap: .6rem; font-weight: 500; margin: 0; padding: .55rem .7rem; border: 1px solid #b9c6bf; border-radius: var(--radius); cursor: pointer; }
label.check:has(input:checked) { border-color: var(--accent); background: var(--panel); }
label.check input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
/* Field errors */
.field-error { margin: .4rem 0 0; color: #b00d26; font-weight: 600; font-size: .95rem; display: flex; gap: .4rem; align-items: baseline; }
.field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #b00d26; color: #fff; font-size: .75rem; font-weight: 800; transform: translateY(.1rem); }
.field-error[hidden] { display: none; }
.has-error > label { color: #b00d26; }
input[aria-invalid="true"] { border: 2px solid #b00d26; background: #fff7f8; }
.checks-grid[aria-invalid="true"] label.check { border-color: #b00d26; }
input.upper { text-transform: uppercase; }

/* Footer */
.site-footer { background: var(--ink); color: #dce6e1; padding: 2.5rem 0; }
.site-footer a { color: #fff; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; font-size: .95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; cursor: pointer; }

/* Privacy policy page */
.legal { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.legal .wrap { max-width: 780px; }
.legal h2 { font-size: 1.45rem; margin-top: 2.5rem; }
.legal ul { padding-left: 1.25rem; max-width: 65ch; }
.legal li { margin-bottom: .4rem; }
.updated { color: var(--ink-soft); }
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; }
.legal table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.legal th { background: var(--panel); }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 200;
  max-width: 720px; margin-inline: auto;
  background: #fff; color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 30px rgba(20, 48, 43, .25);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.cookie-banner p { font-size: .95rem; margin-bottom: 1rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.cookie-actions .btn { padding: .65rem 1.2rem; }

.service-illustration { width: min(100%, 340px); margin-inline: auto; }
@media (max-width: 860px) { .service-illustration { width: 200px; margin: 0; } }

/* Service detail: key facts and survey options */
.facts-title { margin-top: clamp(2.5rem, 5vw, 3.5rem); font-size: 1.35rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 1rem 0 1.5rem; }
.facts > div { border-top: 4px solid var(--lime); padding-top: .9rem; }
.facts dt { font-weight: 700; margin-bottom: .35rem; }
.facts dd { margin: 0; color: var(--ink-soft); }
.facts-2 { grid-template-columns: repeat(2, 1fr); max-width: 820px; }
@media (max-width: 860px) { .facts, .facts-2 { grid-template-columns: 1fr; } }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
.options article { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.options h4 { margin: 0; font-size: 1.15rem; }
.options .when { margin: .15rem 0 .75rem; font-weight: 600; color: var(--accent-text); }
.options p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.after-options { margin-top: 1.25rem; }
@media (max-width: 760px) { .options { grid-template-columns: 1fr; } }
.checks-grid.has-error > label { color: inherit; }

/* ---------- Phone fixes (26/11/2026) ---------- */
/* Grid columns may shrink below their content's width (stops the contact form pushing the page sideways) */
.split > *, .hero .wrap > *, .trust .wrap > * { min-width: 0; }
/* Narrow form: let long service names wrap instead of forcing the form wider */
@container (max-width: 440px) { label.check { white-space: normal; } }

/* Tablets: single-column sections, so keep the illustrations a sensible size */
@media (max-width: 860px) { .split > img { width: min(100%, 320px); } }

@media (max-width: 560px) {
  /* Hero: skyline sits below the buttons instead of behind them; buttons full width */
  .hero { background-size: 760px auto; padding-bottom: 9.5rem; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .hero .btn-ghost { background: #fff; }
  .hero .btn-ghost:hover { background: var(--ink); }

  /* Illustrations: smaller so they don't fill the whole screen */
  .split > img { width: min(100%, 230px); }
  .service-illustration { width: 160px; }

  /* Form: a little more room inside the box */
  form.enquiry { padding: 1rem; }

  /* Bigger tap targets for small links */
  .contact-details a, .footer-links a, .footer-links .linklike { display: inline-block; padding: .55rem 0; }
  .nav-phone { padding: .6rem 0; }

  /* Cookie banner: compact, buttons side by side */
  .cookie-banner { left: .5rem; right: .5rem; bottom: .5rem; padding: .9rem 1rem; }
  .cookie-banner h2 { font-size: 1rem; margin-bottom: .25rem; }
  .cookie-banner p { font-size: .85rem; line-height: 1.45; margin-bottom: .75rem; }
  .cookie-actions { flex-wrap: nowrap; gap: .5rem; }
  .cookie-actions .btn { flex: 1 1 0; padding: .6rem .5rem; font-size: .875rem; line-height: 1.3; text-align: center; }
}
@media (max-width: 380px) {
  .logo img { height: 38px; }
  .nav-phone { font-size: .95rem; }
}
