/* WEBSITE_SCOPE.md section 5 (Brand) and section 10 (Accessibility) — tokens, type, layout, components, self-hosted fonts */

/* ---- Self-hosted fonts (Latin WOFF2 subsets; see assets/fonts/LICENSE.txt, OFL-1.1) ---- */

@font-face {
  font-family: 'Montserrat';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* ---- Tokens (section 5: Brand palette, typography, layout) ---- */

:root {
  /* colour */
  --navy:#00265C;
  --teal:#017998;
  --teal-dark:#015E76;
  --teal-tint:#E6F2F5;
  --brass:#D4A84B;
  --brass-light:#DDB560;
  --brass-ink:#8A6516;
  --ink:#1A2433;
  --slate:#5B6573;
  --paper:#F7F9FA;
  --white:#FFFFFF;
  --alert:#B42318;
  --border:#DDE3E8;

  /* shadow / radius / layout */
  --shadow: 0 2px 8px rgba(0, 38, 92, 0.08);
  --radius-btn: 6px;
  --radius-card: 10px;
  --radius-pill: 999px;
  --max-width: 1120px;
  --gutter: 24px;

  /* spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* motion */
  --motion: 150ms ease-out;

  /* font stacks */
  --font-heading: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

@media (max-width: 639px) {
  :root {
    --gutter: 16px;
  }
}

/* ---- Base / typography ---- */

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
}

@media (max-width: 639px) {
  body {
    font-size: 17px;
  }
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--navy);
  margin: 0;
}

h1 {
  font-weight: 700;
  font-size: 48px;
  line-height: 1.15;
}

h2 {
  font-weight: 700;
  font-size: 32px;
}

h3 {
  font-weight: 600;
  font-size: 22px;
}

@media (max-width: 639px) {
  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 26px;
  }

  h3 {
    font-size: 20px;
  }
}

.prose p {
  max-width: 68ch;
}

.text-small {
  font-size: 14px;
  color: var(--slate);
}

a {
  color: var(--teal);
  text-decoration: underline;
}

a:hover,
a:focus {
  color: var(--teal-dark);
}

label,
button,
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Accessibility (section 10) ---- */

*:focus-visible {
  outline: 3px solid var(--teal-dark);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.site-header :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--white);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  overflow: visible;
  padding: var(--s-3) var(--s-4);
  background: var(--navy);
  color: var(--white);
  z-index: 100;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* honeypot wrapper — hidden from sighted users and screen readers */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Layout primitives ---- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---- Header ---- */

.site-header {
  background: var(--navy);
  min-height: 72px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--navy);
  z-index: 10;
}

.site-header__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.site-logo img {
  height: 40px;
  width: auto;
}

/* Home page: the header logo appears only once the hero logo has scrolled
   under the header (assets/js/header.js); visibility keeps it out of the tab
   order and accessibility tree while hidden. */
.site-logo--reveal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease-out, visibility 0s linear 200ms;
}

.site-header--scrolled .site-logo--reveal {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease-out, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .site-logo--reveal,
  .site-header--scrolled .site-logo--reveal {
    transition: none;
  }
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

@media (max-width: 480px) {
  .site-logo img {
    height: 32px;
  }

  .site-nav .btn {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 15px;
  }
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color var(--motion), color var(--motion), border-color var(--motion);
}

.btn-primary {
  background: var(--brass);
  color: var(--navy);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--brass-light);
}

.btn-secondary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-light {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

.btn-light:hover,
.btn-light:focus-visible {
  background: var(--teal-tint);
  border-color: var(--teal-tint);
}

.btn-block {
  width: 100%;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s-16);
  background: var(--white);
  color: var(--ink);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/brand/dres-mark.svg');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: min(60%, 640px);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.hero h1,
.hero h2,
.hero h3 {
  color: var(--navy);
}

@media (max-width: 639px) {
  .hero {
    padding-block: var(--s-12);
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: center;
  }
}

.hero__brand,
.hero__content {
  min-width: 0;
}

.hero__logo {
  display: block;
  width: clamp(160px, 40vw, 360px);
  height: auto;
}

.hero__title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--navy);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  line-height: 1.15;
}

.hero__sub {
  font-size: 20px;
  color: var(--ink);
  max-width: 60ch;
}

.hero__area {
  color: var(--slate);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
}

.hero__photo:empty {
  display: none;
}

.hero__photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
}

/* ---- Sections ---- */

.section {
  padding-block: var(--s-16);
}

@media (max-width: 639px) {
  .section {
    padding-block: var(--s-12);
  }
}

.section--alt {
  background: var(--teal-tint);
}

.section--navy {
  background: var(--navy);
  color: var(--white);
}

.section--navy h1,
.section--navy h2,
.section--navy h3 {
  color: var(--white);
}

.section__title {
  position: relative;
}

.section__title::after {
  content: '';
  display: block;
  width: 64px;
  height: 2px;
  background: var(--teal);
  margin-top: var(--s-3);
}

/* ---- Cards ---- */

.cards {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s-6);
  box-shadow: var(--shadow);
}

.card__icon .icon {
  width: 32px;
  height: 32px;
  color: var(--teal);
  stroke-width: 1.75;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  color: var(--teal);
  flex-shrink: 0;
}

/* ---- Problems ---- */

.problems {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}

@media (min-width: 560px) {
  .problems {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .problems {
    grid-template-columns: repeat(3, 1fr);
  }
}

.problem {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s-6);
  box-shadow: var(--shadow);
}

.problem .icon {
  width: 32px;
  height: 32px;
  color: var(--teal);
  stroke-width: 1.75;
}

/* ---- Wizard ---- */

.wizard-progress {
  display: grid;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}

.wizard-progress__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
}

.wizard-progress__bar {
  width: 100%;
  height: 8px;
  border: none;
  border-radius: var(--radius-pill);
  appearance: none;
  overflow: hidden;
}

.wizard-progress__bar::-webkit-progress-bar {
  background: var(--border);
  border-radius: var(--radius-pill);
}

.wizard-progress__bar::-webkit-progress-value {
  background: var(--teal);
  border-radius: var(--radius-pill);
  transition: width var(--motion);
}

.wizard-progress__bar::-moz-progress-bar {
  background: var(--teal);
  border-radius: var(--radius-pill);
  transition: width var(--motion);
}

.wizard-step {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}

.wizard-step__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  color: var(--navy);
}

/* ---- Steps ---- */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-6);
  counter-reset: step;
}

@media (max-width: 899px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 559px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  position: relative;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--s-3);
}

/* ---- CTA band ---- */

.cta-band {
  background: var(--navy);
  color: var(--white);
  padding-block: var(--s-12);
  text-align: center;
}

.cta-band h1,
.cta-band h2,
.cta-band h3 {
  color: var(--white);
}

/* ---- Footer ---- */

.site-footer {
  background: var(--navy);
  color: var(--white);
  padding-block: var(--s-12);
}

.site-footer a {
  color: var(--white);
  text-decoration: underline;
}

.site-footer img {
  height: 40px;
}

.site-footer__inner {
  display: grid;
  gap: var(--s-4);
}

.site-footer__legal {
  font-size: 14px;
}

.site-footer__contact {
  font-size: 14px;
}

.site-footer__nav {
  font-size: 14px;
}

.site-footer__copy {
  font-size: 14px;
}

/* ---- Notices ---- */

.notice {
  padding: var(--s-4);
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--white);
}

.notice--error {
  border-color: var(--alert);
  color: var(--ink);
  border-left: 4px solid var(--alert);
}

/* ---- Form ---- */

.form-panel {
  background: var(--teal-tint);
  padding: var(--s-8);
  border-radius: var(--radius-card);
}

@media (max-width: 639px) {
  .form-panel {
    padding: var(--s-4);
  }
}

.form {
  display: grid;
  gap: var(--s-6);
}

.form__row {
  display: grid;
  gap: var(--s-4);
}

@media (min-width: 640px) {
  .form__row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fieldset {
  display: grid;
  gap: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s-4);
  margin: 0;
  min-width: 0;
}

.fieldset legend {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  color: var(--navy);
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--navy);
}

.field__hint {
  margin: 0;
  font-size: 14px;
  color: var(--slate);
}

.field__error {
  font-size: 14px;
  color: var(--alert);
  font-weight: 600;
  font-family: var(--font-body);
}

.field__error:empty {
  display: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-btn);
  font: inherit;
  background: var(--white);
  color: var(--ink);
}

.field--invalid input[type="text"],
.field--invalid input[type="email"],
.field--invalid input[type="tel"],
.field--invalid input[type="number"],
.field--invalid select,
.field--invalid textarea,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border: 2px solid var(--alert);
}

textarea {
  min-height: 160px;
}

.field--checkbox {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.field--checkbox input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.checkbox-grid {
  display: grid;
  gap: var(--s-2);
}

@media (min-width: 640px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkbox-grid .field--checkbox {
  min-height: 44px;
  align-items: center;
}

.checkbox-grid .field--checkbox label {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.fieldset.field--invalid {
  border: 2px solid var(--alert);
}

.form__status {
  margin: 0;
  min-height: 1.5em;
}

/* Empty live regions stay in the accessibility tree but take no layout space. */
.form__status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form__status--error {
  color: var(--alert);
  font-weight: 600;
  border-left: 4px solid var(--alert);
  padding-left: var(--s-3);
}

.form__status:focus {
  outline: 2px solid var(--alert);
  outline-offset: 2px;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}

.cf-turnstile {
  min-height: 65px;
}

.section__lead {
  max-width: 68ch;
  margin: var(--s-6) 0 var(--s-6);
  font-size: 19px;
  color: var(--ink);
}

.section__note {
  margin: var(--s-6) 0 0;
  font-size: 14px;
  color: var(--slate);
}

/* ---- Where We Work map (OpenStreetMap data, built by tools/build_area_map.py) ---- */

.coverage {
  display: grid;
  gap: var(--s-8);
}

.coverage__text p {
  max-width: 70ch;
}

.coverage__map {
  margin: 0;
}

.coverage__frame {
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  background: var(--white);
}

.area-map {
  display: block;
  width: 100%;
  height: auto;
}

.area-map__land {
  fill: var(--white);
}

.area-map__sea {
  fill: #BFDDE5;
}

.area-map__river {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-map__lake {
  fill: var(--teal);
}

.area-map__channel {
  fill: var(--teal);
}

.area-map__dyke {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-map__region {
  fill: var(--slate);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  opacity: 0.7;
}

.area-map__pin {
  fill: var(--navy);
  stroke: var(--white);
  stroke-width: 2;
}

.area-map__pin--major {
  fill: var(--brass);
  stroke: var(--navy);
}

.area-map__town {
  fill: var(--navy);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--white);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.coverage__credit {
  margin-top: var(--s-2);
  font-size: 12px;
  color: var(--slate);
}

/* Phones: show only the Broads (map x 400-1100 of 1100) with larger labels. */
@media (max-width: 639px) {
  .area-map {
    width: 157%;
    margin-left: -57%;
  }

  .area-map__town {
    font-size: 22px;
    stroke-width: 5px;
  }

  .area-map__region {
    display: none;
  }

  .area-map__pin {
    r: 7px;
  }

  .area-map__pin--major {
    r: 9px;
  }
}
