/* ── Design tokens ── */
:root {
  --navy:       #1a3a52;
  --navy-light: #234d6e;
  --bg:         #f0f4f8;
  --text:       #1e2a3a;
  --accent:     #2e8b7a;
  --white:      #ffffff;
  --muted:      rgba(255,255,255,0.6);
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius:     8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.08);
  --nav-text:    rgba(255,255,255,0.85);
  --hover-bg:    rgba(255,255,255,0.1);
  --border:      #e5e9ee;
  --text-muted:  #5a6778;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ── */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { max-width: 70ch; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary   { background: var(--white); color: var(--navy); }
.btn-secondary { background: rgba(255,255,255,0.12); color: var(--white); }
.btn-accent    { background: var(--accent); color: var(--white); }
.btn-outline   { background: transparent; color: var(--navy); border: 2px solid var(--navy); }

/* ── Site Header ── */
.site-header {
  background: var(--navy);
  padding: 0 1.5rem 0.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 132px;
}

.site-header .logo {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  text-decoration: none;
}

.site-header .logo img {
  height: 116px;
  width: auto;
}

.site-header .logo > div {
  margin-left: -20px;
}

.site-header .logo-text {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.site-header .logo-sub {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Nav ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link:hover,
.nav-link.active { background: var(--hover-bg); color: var(--white); }

.nav-link:focus { background: var(--hover-bg); color: var(--white); outline: 2px solid var(--accent); outline-offset: -2px; }

.nav-link .chevron {
  font-size: 0.6rem;
  opacity: 0.7;
  transition: transform 0.2s;
}

/* ── Dropdown ── */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  min-width: 240px;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 200;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.1s;
}

.dropdown a:hover { background: var(--bg); }

.dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0;
}

.dropdown .badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-free    { background: #e8f5e9; color: #2e7d32; }
.badge-paid    { background: #e3f2fd; color: #1565c0; }
.badge-soon    { background: #f5f5f5; color: #9e9e9e; }

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .nav-toggle  { display: block; }
  .site-nav    { display: none; flex-direction: column; align-items: stretch;
                 position: absolute; top: 132px; left: 0; right: 0;
                 background: var(--navy); padding: 1rem; gap: 0.25rem; }
  .site-nav.open { display: flex; }
  .dropdown    { position: static; box-shadow: none; opacity: 1; visibility: visible;
                 transform: none; background: rgba(255,255,255,0.05); margin-top: 0.25rem; }
  .dropdown a  { color: var(--nav-text); }
  .dropdown a:hover { background: var(--hover-bg); }
}

/* ── Footer ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-settings-button {
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.footer-settings-button:hover,
.footer-settings-button:focus-visible {
  color: var(--white);
}

.form-alert {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #b42318;
  background: #fef3f2;
  color: #7a271a;
  font-weight: 600;
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy-note {
  color: #5a6778;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Page layout ── */
.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 4rem 2rem;
  text-align: center;
}

.page-hero p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 1rem auto 0;
  max-width: 600px;
}

.page-content .school-intro-tagline {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
}

.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Services are intentionally arranged as two rows of three, with stewardship spanning the final row. */
.card-grid.services-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.services-card-grid > .service-card-wide {
  grid-column: 1 / -1;
  text-align: center;
}

.card-grid.services-card-grid > .service-card-wide p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.card h3 { margin-bottom: 0.75rem; }
.card p  { color: var(--text-muted); font-size: 0.925rem; }

/* Keep CTAs aligned across tool cards even when titles and copy wrap differently. */
.tool-card-grid > .card { display: flex; flex-direction: column; }
.tool-card-action { margin-top: auto; padding-top: 1.5rem; }

/* ── Section wrapper ── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── Homepage hero (full-bleed photo) ── */
.home-hero {
  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.home-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
}

.home-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,58,82,0.96) 40%, rgba(26,58,82,0.35));
}

.home-hero__body {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.5rem 3.5rem;
  width: 100%;
}

.home-hero__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

.home-hero__h1 {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  max-width: 640px;
  margin-bottom: 1.75rem;
}

/* ── Full-width section backgrounds with centred content ── */
.bg-white  { background: var(--white); }
.bg-light  { background: var(--bg); }

.content-section {
  padding: 4.5rem 0;
}

.content-section .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.content-section .section-label { margin-bottom: 0.75rem; }
.content-section h2              { margin-bottom: 1rem; padding-left: 1rem; border-left: 3px solid var(--accent); }
.content-section .lead           { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: none; }

/* The story and climate sections share the same background; tighten only the space between them. */
.home-story-section .content-section   { padding-bottom: 3rem; }
.home-climate-section .content-section { padding-top: 3rem; }

/* ── Homepage story ── */
.story-text p { font-size: 1rem; line-height: 1.85; color: #3a4a5a; max-width: none; }
.story-text p + p { margin-top: 1.25rem; }

/* ── Service cards ── */
.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.service-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
  border-top: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
}

.service-card-wide {
  grid-column: 1 / -1;
  text-align: center;
}

.service-card-wide p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.service-card.placeholder {
  border-top-color: #c8d8e8;
  background: #fafbfc;
}

.service-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.service-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
  line-height: 1.3;
  min-height: 2rem;
}

.service-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: none;
}

.service-card.placeholder h3 { color: #8a9ab0; }
.service-card.placeholder p  { color: #b0bcc8; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .service-cards { grid-template-columns: 1fr 1fr; }
  .card-grid.services-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  /* Header — shrink logo on mobile */
  .site-header         { height: 80px; padding: 0 1rem 0.4rem; }
  .site-header .logo img { height: 60px; }
  .site-header .logo > div { margin-left: -10px; }
  .site-header .logo-text { font-size: 0.95rem; }
  .site-header .logo-sub  { font-size: 0.6rem; }

  /* Hero */
  .home-hero           { min-height: 360px; }
  .home-hero__body     { padding: 0 1.25rem 2rem; }
  .home-hero__h1       { font-size: clamp(1.4rem, 5vw, 2rem); margin-bottom: 1.25rem; }

  /* Content sections */
  .content-section     { padding: 3rem 0; }
  .content-section .inner { padding: 0 1.25rem; }

  /* Page hero */
  .page-hero           { padding: 2.5rem 1.25rem; }
  .page-content        { padding: 2rem 1.25rem; }

  /* Section wrapper */
  .section             { padding: 2.5rem 1.25rem; }

  /* Footer */
  .site-footer         { padding: 2.5rem 1.25rem 1.5rem; }
}

@media (max-width: 480px) {
  .service-cards { grid-template-columns: 1fr; }
  .card-grid     { grid-template-columns: 1fr; }
  .card-grid.services-card-grid { grid-template-columns: 1fr; }
  .home-hero     { min-height: 300px; }
}

/* ── Article / page-content typography ── */
.page-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.page-content p:last-child { margin-bottom: 0; }

.page-content ul,
.page-content ol {
  padding-left: 1.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.page-content li {
  margin-bottom: 0.45rem;
  line-height: 1.7;
}

/* ── Skip to content (accessibility) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 999;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Header right column ── */
.header-right {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  margin-left: auto;
}

/* ── Language switcher ── */
.lang-switcher {
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.lang-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.lang-link:hover { background: var(--hover-bg); color: var(--white); }
.lang-link.active { color: var(--accent); background: rgba(46,139,122,0.15); }

@media (max-width: 768px) {
  .header-right {
    display: block;
  }

  .lang-switcher {
    top: 0.4rem;
    right: 3.5rem;
  }
}

/* ── SuDS management train explainer ─────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-page-content { padding-top: 1.5rem; padding-bottom: 2rem; }
.mt-page-content > .section { padding: 2rem 0; }
.mt-page-content > .mt-legend { padding: 1.25rem 1.5rem; }
.mt-page-content > .mt-cta { padding: 2rem; }

.mt-principle h2 { color: #1a3a52; }
.mt-scope-note {
  font-size: 0.85rem;
  color: #5a6778;
  border-left: 3px solid #e5e9ee;
  padding-left: 0.9rem;
  margin-top: 1rem;
}

.mt-legend { background: #f0f4f8; border-radius: 10px; padding: 1.25rem 1.5rem; }
.mt-legend-heading { font-size: 1rem; margin-bottom: 0.75rem; color: #1a3a52; }
.mt-legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }

.mt-benefit { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.mt-benefit-symbol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  font-size: 0.8rem; flex: 0 0 auto;
}
.mt-benefit--primary     .mt-benefit-symbol { background: #2e8b7a; color: #fff; }
.mt-benefit--conditional .mt-benefit-symbol { background: #fff; color: #2e8b7a; border: 1px solid #2e8b7a; }
.mt-benefit--not_typical .mt-benefit-symbol { background: #eef1f4; color: #9aa6b2; }

.mt-accordion { display: grid; gap: 0.5rem; }
.mt-stage { border: 1px solid #e5e9ee; border-radius: 10px; overflow: hidden; }
.mt-stage-heading { margin: 0; }
.mt-stage-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1rem 1.35rem; background: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: #1a3a52; text-align: left;
  scroll-margin-top: 148px;
}
.mt-stage-toggle:hover { background: #f7f9fb; }
.mt-stage-toggle:focus-visible { outline: 3px solid #2e8b7a; outline-offset: -3px; }
.mt-stage-title { font-size: 1.05rem; }
.mt-stage-chevron { transition: transform 0.2s ease; color: #2e8b7a; }
.mt-stage-toggle[aria-expanded="true"] .mt-stage-chevron { transform: rotate(180deg); }

.mt-panel { padding: 0 1.35rem 1.35rem; }
.mt-enhanced .mt-panel { animation: mt-reveal 0.2s ease; }
.mt-stage-intro { color: #5a6778; margin: 0.5rem 0 1.25rem; }

.mt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.mt-card { border: 1px solid #e5e9ee; border-radius: 10px; padding: 1.1rem; background: #fff; }
.mt-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.mt-card-icon { font-size: 1.6rem; }
.mt-card-name { margin: 0; font-size: 1rem; color: #1a3a52; }
.mt-card-desc { font-size: 0.875rem; color: #5a6778; margin: 0 0 0.75rem; }
.mt-typical { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #9aa6b2; margin: 0 0 0.6rem; }
.mt-benefits { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.35rem; }
.mt-field-note {
  font-size: 0.82rem; color: #234d6e; background: #f0f4f8;
  border-radius: 8px; padding: 0.7rem 0.85rem; margin: 0;
}
.mt-field-label { display: block; font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; color: #2e8b7a; margin-bottom: 0.25rem; }

.mt-cta { background: #1a3a52; color: #fff; border-radius: 12px; padding: 2rem; text-align: center; }
.mt-cta h2 { color: #fff; }
.mt-cta p { color: #cfdae4; }
.mt-cta-links { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }
.mt-cta-links .btn:not(.btn-accent) { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); }

.mt-guidance ul { padding-left: 1.2rem; }
.mt-disclaimer { font-size: 0.8rem; color: #5a6778; margin-top: 1.25rem; }

@keyframes mt-reveal { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .mt-stage-chevron { transition: none; }
  .mt-enhanced .mt-panel { animation: none; }
}
