/* ==========================================================================
   Trent District Community First Responders
   NHS Ambulance Trust branded design system
   ========================================================================== */

:root {
  /* Core brand */
  --nhs-blue: #005eb8;
  --nhs-dark-blue: #002d6b;
  --ems-green: #00693e;      /* EMAS green, primary brand colour */
  --ems-green-dark: #00432a;
  --ems-green-tint: #e6f2ec;
  --accent-yellow: #ffb81c;  /* Sillitoe tartan amber accent */
  --donate: #d5281b;         /* warm, distinct call-to-action colour for giving */
  --donate-dark: #a81d13;

  /* Neutrals */
  --white: #ffffff;
  --grey-50: #f5f7f7;
  --grey-100: #eceff0;
  --grey-300: #d8dde0;
  --ink: #1b2226;
  --ink-soft: #45525a;

  /* Elevation & shape */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 30, 25, 0.08);
  --shadow: 0 8px 24px rgba(15, 30, 25, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 30, 25, 0.16);

  --font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --container-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: var(--grey-50);
  color: var(--ink);
  margin: 0;
  line-height: 1.65;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
}

body.nav-open header.site-header {
  z-index: 10000;
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  color: var(--ems-green-dark);
  margin-top: 0;
}

h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; }

p { color: var(--ink-soft); }
.site-footer p,
.site-footer li,
.site-footer a { color: var(--white); }

a { text-decoration: none; color: inherit; }

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--white);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 10000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.top-bar {
  background: var(--ems-green-dark);
  color: var(--white);
  font-size: 0.82rem;
  padding: 0.4rem 0;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.top-bar a { color: var(--white); }
.top-bar strong { color: var(--white); }

header.site-header {
  background: var(--ems-green);
  padding: 0.6rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

header.site-header.scrolled {
  background: var(--ems-green-dark);
  padding: 0.35rem 0;
  box-shadow: var(--shadow);
}

header.site-header.nav-compact {
  padding: 0.35rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 78px;
  gap: 1rem;
}

.logo { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; }
.logo-img {
  height: auto;
  max-height: 64px;
  max-width: 100%;
  width: auto;
  display: block;
}

.nav-toggle {
  background: none;
  border: 2px solid var(--white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: none;
  width: 48px;
  height: 48px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  padding: 0;
  color: transparent;
  font-size: 0;
  line-height: 0;
  position: relative;
  z-index: 10000;
}

.nav-toggle .hamburger {
  display: block;
  position: relative;
  background: var(--white);
  height: 3px;
  width: 24px;
  transition: background 0.2s ease;
}
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  position: absolute;
  height: 3px;
  width: 24px;
  left: 0;
  background: var(--white);
  transition: top 0.2s ease, transform 0.2s ease;
}
.nav-toggle .hamburger::before { top: -8px; }
.nav-toggle .hamburger::after { top: 8px; }

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav li {
  flex: 0 0 auto;
}

.nav a.nav-link {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}

.nav a.nav-link:hover,
.nav a.nav-link:focus,
.nav a.nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.nav a.nav-donate {
  display: inline-block;
  margin-left: 0.5rem;
  background: var(--donate);
  color: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.nav a.nav-donate:hover,
.nav a.nav-donate:focus {
  background: var(--donate-dark);
  outline: 2px solid var(--accent-yellow);
}

header.site-header.nav-compact .nav-container {
  min-height: 70px;
}

header.site-header.nav-compact .logo-img {
  max-height: 58px;
}

header.site-header.nav-compact .nav-toggle {
  display: flex;
}

header.site-header.nav-compact .nav {
  position: fixed;
  top: var(--header-height, 90px);
  right: 0;
  height: calc(100dvh - var(--header-height, 90px));
  width: min(86vw, 340px);
  background: var(--ems-green-dark);
  transform: translateX(100%);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 1.5rem;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
}

html.nav-ready header.site-header.nav-compact .nav {
  transition: transform 0.3s ease-in-out;
}

header.site-header.nav-compact .nav.active {
  transform: translateX(0);
}

header.site-header.nav-compact .nav ul {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0 1rem;
  margin: 0;
  gap: 0.25rem;
}

header.site-header.nav-compact .nav li {
  width: 100%;
}

header.site-header.nav-compact .nav a.nav-link {
  width: 100%;
  padding: 0.9rem 1rem;
}

header.site-header.nav-compact .nav a.nav-donate {
  margin: 0.75rem 1rem 0;
  text-align: center;
}

@media (max-width: 1024px) {
  .top-bar .container {
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
  }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    top: var(--header-height, 90px);
    right: 0;
    height: calc(100dvh - var(--header-height, 90px));
    width: min(86vw, 340px);
    background: var(--ems-green-dark);
    transform: translateX(100%);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 1.5rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
  }

  html.nav-ready .nav { transition: transform 0.3s ease-in-out; }

  .nav.active { transform: translateX(0); }

  .nav ul { flex-direction: column; align-items: stretch; width: 100%; padding: 0 1rem; margin: 0; gap: 0.25rem; }

  .nav li { width: 100%; }
  .nav a.nav-link { width: 100%; padding: 0.9rem 1rem; }
  .nav a.nav-donate { margin: 0.75rem 1rem 0; text-align: center; }
}

@media (max-width: 640px) {
  .top-bar {
    font-size: 0.78rem;
    line-height: 1.35;
    padding: 0.45rem 0;
  }

  .nav-container {
    min-height: 68px;
  }

  .logo-img {
    max-height: 52px;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background: linear-gradient(160deg, rgba(0,67,42,0.92) 0%, rgba(0,105,62,0.75) 55%), url('../media/hero-banner.png') center/cover no-repeat;
  color: var(--white);
  min-height: 560px;
  display: flex;
  align-items: center;
  padding: 4rem 0;
}

.hero .container { position: relative; z-index: 1; max-width: 760px; }

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero .eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-yellow);
  display: inline-block;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin-bottom: 1rem;
}

.hero p.lead {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.92);
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--nhs-blue);
  color: var(--white) !important;
  padding: 0.85rem 1.6rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-size: 1rem;
}
.btn:hover, .btn:focus {
  background: var(--nhs-dark-blue);
  color: var(--white) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-donate,
button[type='submit'] {
  background: var(--donate);
}
.btn-donate:hover, .btn-donate:focus,
button[type='submit']:hover, button[type='submit']:focus {
  background: var(--donate-dark);
}

.btn-outline {
  background: transparent;
  color: var(--white) !important;
  border-color: rgba(255,255,255,0.8);
}
.btn-outline:hover, .btn-outline:focus {
  background: rgba(255,255,255,0.14);
}

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }

/* ==========================================================================
   Sections & cards
   ========================================================================== */

.section { padding: 4rem 0; }
.section.alt { background: var(--white); }
.section-head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.section-head p { font-size: 1.05rem; }
.eyebrow-tag {
  display: inline-block;
  color: var(--ems-green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.icon-badge {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--ems-green-tint);
  color: var(--ems-green);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.icon-badge svg { width: 26px; height: 26px; }

.trustees-section {
  padding: 3rem 0;
}

.trustees-section .section-head {
  margin-bottom: 1.5rem;
}

.trustee-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.trustee-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.trustee-item .icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  flex: 0 0 auto;
}

.trustee-item .icon-badge svg {
  width: 22px;
  height: 22px;
}

.trustee-item h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.trustee-item p {
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 980px) {
  .trustee-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .trustees-section {
    padding: 2.25rem 0;
  }

  .trustees-section .section-head {
    margin-bottom: 1rem;
  }

  .trustee-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .trustee-item {
    padding: 0.85rem;
  }
}

.icon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--ink-soft);
}
.icon-list svg {
  flex-shrink: 0;
  width: 22px; height: 22px;
  color: var(--ems-green);
  margin-top: 0.15rem;
}

/* Stats band */
.stats-band {
  background: var(--ems-green-dark);
  color: var(--white);
  padding: 2.75rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat-num {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--white);
  display: block;
}
.stat-label {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Quote / testimonial */
.quote-block {
  background: var(--ems-green-tint);
  border-left: 6px solid var(--ems-green);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 2.5rem 0;
}
.quote-block p {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ems-green-dark);
  margin: 0 0 0.75rem;
}
.quote-block cite {
  font-style: normal;
  font-weight: 700;
  color: var(--ink-soft);
}

/* Donate CTA banner */
.cta-band {
  background: linear-gradient(135deg, var(--donate) 0%, var(--donate-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.cta-band h2, .cta-band p { color: var(--white); }
.cta-band .btn { background: var(--white); color: var(--donate) !important; }
.cta-band .btn:hover, .cta-band .btn:focus { background: var(--grey-100); }

/* Impact / fundraising figures used on Support Us page */
.impact-card {
  text-align: center;
  border-top: 4px solid var(--ems-green);
}
.impact-card .stat-num { color: var(--ems-green); }
.impact-card .stat-label { color: var(--ink-soft); }

/* Content Sections (legacy alias kept for simple pages) */
.section.simple {
  background: var(--white);
  margin: 2rem 0;
  padding: 2rem;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
}

/* Forms */
form {
  display: grid;
  gap: 1.1rem;
}

label { font-weight: 700; color: var(--ink); }

input, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--grey-300);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.alert-success { background: #e3f6e8; color: #1c6b34; border: 1px solid #b6e6c4; }
.alert-error { background: #fdeaea; color: #a3241b; border: 1px solid #f4c2be; }

/* Two column layout (contact page) */
.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

/* Page top images */
.page-top-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  display: block;
  box-shadow: var(--shadow-sm);
}

.page-hero {
  background: var(--ems-green-dark);
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.5rem; }
.page-hero p { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0 auto; }

/* Partnership strip */
.partner-strip {
  background: var(--white);
  padding: 1rem 0;
  border-bottom: 1px solid var(--grey-300);
  border-top: 1px solid var(--grey-300);
}
.partner-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.partner-strip p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}
.partner-strip img {
  display: block;
  width: auto;
  max-width: min(100%, 230px);
  max-height: 74px;
}

@media (max-width: 560px) {
  .partner-strip {
    padding: 0.85rem 0;
  }

  .partner-strip-inner {
    gap: 0.65rem;
  }

  .partner-strip img {
    max-width: 200px;
    max-height: 64px;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
  background: var(--ems-green-dark);
  color: var(--white);
  padding: 0.5rem 0;
}

.site-footer p { margin: 0; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--white);
}

.footer-credit {
  font-size: 0.68rem;
  opacity: 0.72;
}

.footer-dashboard-btn {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  font-size: 0.72rem;
  line-height: 1.4;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  color: var(--white);
  opacity: 0.75;
}
.footer-dashboard-btn:hover {
  opacity: 1;
  border-color: rgba(255,255,255,0.6);
  text-decoration: none;
}

@media (max-width: 768px) {
  .dashboard-body footer.site-footer { padding: 0.6rem 0; }
  .dashboard-body .footer-bottom {
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
  }
  .dashboard-body .footer-credit { display: none; }
}

/* ==========================================================================
   Cookie banner
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
}

.cookie-banner p {
  color: var(--white);
  margin: 0;
  font-size: 0.92rem;
  max-width: 640px;
}

.cookie-banner a { color: var(--accent-yellow); text-decoration: underline; }

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-sm { padding: 0.55rem 1.2rem; font-size: 0.88rem; }

@media (max-width: 560px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cookie-banner-actions { justify-content: center; }
}
