/* ============================================================
   RICKESTON MILL NURSING HOME — Premium Design System
   Navy / Gold / Cream / Sage palette
   Source Serif 4 (headings) + Mulish (body)
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --navy: #1B2A4A;
  --navy-light: #2A3D66;
  --gold: #C9A96E;
  --gold-light: #E0CBA0;
  --gold-dark: #8A6D2F; /* AA-accessible gold for text/glyphs on light backgrounds (>=4.5:1) */
  --cream: #FAF8F5;
  --cream-dark: #F0EDE8;
  --sage: #7A9E7E;
  --sage-light: #A3C2A6;
  --warm-grey: #6B6B6B;
  --light-grey: #E8E6E3;
  --text-primary: #2C2C2C;
  --text-secondary: #5A5A5A;
  --text-light: #8A8A8A;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.08);
  --shadow-md: 0 4px 12px rgba(27, 42, 74, 0.1);
  --shadow-lg: 0 8px 30px rgba(27, 42, 74, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Source Serif 4', 'Georgia', serif;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.8rem; }
h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin-bottom: 0.6rem; }
h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }
.lead { font-size: 1.15rem; line-height: 1.8; color: var(--text-secondary); }

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Section Spacing --- */
.section { padding: 5rem 0; }
.section-flush-top { padding-top: 0; }
.carousel-top { padding-top: 80px; padding-bottom: 0; }
.section-cream { background: var(--cream); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy p { color: rgba(255,255,255,0.85); }

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}
.section-header p { color: var(--text-light); }

/* Gold accent line under section headers */
.section-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1.2rem auto 0;
  border-radius: 2px;
}
.section-navy .section-header::after { background: var(--gold-light); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: 'Mulish', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-align: center;
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline-light:hover {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn-sm { padding: 0.6rem 1.4rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }

/* Loading state for submit buttons (set by main.js on a valid submit) */
.btn.is-loading { cursor: default; opacity: 0.85; }
.btn-spinner {
  display: inline-block;
  width: 1em; height: 1em;
  margin-right: 0.55em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation: none; }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.3rem 0.3;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--navy);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  background: var(--gold);
  color: var(--white) !important;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
}
.nav-cta:hover {
  background: var(--gold-dark);
  color: var(--white) !important;
}
.nav-cta::after { display: none !important; }

/* --- Dropdown menus --- */
.nav-item.nav-has-dropdown { position: relative; }
.nav-dropdown-toggle {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 0;
  padding: 0.3rem 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active,
.nav-has-dropdown:hover .nav-dropdown-toggle { color: var(--navy); }
.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: var(--transition);
}
.nav-has-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown-toggle.active::after { width: 100%; }
.nav-caret {
  width: 0.42rem;
  height: 0.42rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0; /* right + bottom borders = outline chevron */
  transform: rotate(45deg); /* points down */
  margin-top: -0.18rem; /* optical vertical centring of the down chevron */
  transition: transform var(--transition), margin-top var(--transition);
}
.nav-has-dropdown:hover .nav-caret,
.nav-dropdown-toggle[aria-expanded="true"] .nav-caret {
  transform: rotate(-135deg); /* points up when open */
  margin-top: 0.12rem;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  min-width: 190px;
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 1001;
}
.nav-has-dropdown:hover .nav-dropdown-menu,
.nav-has-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu li { padding: 0; }
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav-dropdown-menu a::after { display: none; }
.nav-dropdown-menu a:hover {
  color: var(--navy);
  background: var(--cream);
}
.nav-dropdown-menu a.active {
  color: var(--navy);
  background: var(--cream);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold); /* gold "current page" bar, no layout shift */
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: var(--navy);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  /* JPEG fallback first, then WebP for browsers that support image-set */
  background-image: url('/images/hero-exterior.jpg');
  background-image: image-set(
    url('/images/hero-exterior.webp') type('image/webp'),
    url('/images/hero-exterior.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27,42,74,0.92) 0%, rgba(27,42,74,0.7) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  padding: 3rem 0;
}
.hero h1 { color: var(--white); font-size: clamp(2.4rem, 5vw, 3.5rem); }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.15rem; line-height: 1.8; }
.hero .btn { margin-right: 1rem; margin-top: 0.5rem; }

.hero-badge {
  display: inline-block;
  background: rgba(201, 169, 110, 0.15);
  border: 1px solid rgba(201, 169, 110, 0.4);
  color: var(--gold-light);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* --- Trust Bar --- */
.trust-bar {
  background: var(--white);
  border-bottom: 1px solid var(--light-grey);
  padding: 1.5rem 0;
}
.trust-items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.trust-icon {
  width: 44px;
  height: 44px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  flex-shrink: 0;
}
.trust-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--navy);
}
.trust-item small {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card-body { padding: 1.8rem; }
.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* Image placeholder for dev */
.img-placeholder {
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--light-grey) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  font-style: italic;
  min-height: 220px;
}

/* Real content photos */
.content-img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.content-img.card-img { height: 220px; border-radius: 0; }

/* Branded "photo coming soon" placeholder (for the home's own photography) */
.photo-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 220px;
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
  background-size: contain;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
}
.photo-pending::before {
  content: "";
  width: 52px;
  height: 52px;
  background: url('/images/favicon-logo.png') center/contain no-repeat;
  opacity: 0.45;
}
.photo-pending span {
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text-light);
  max-width: 22ch;
}

/* Team initials avatars (until real headshots are supplied) */
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--gold-light);
  border-radius: var(--radius-md);
}
.avatar-initials span {
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  font-size: 4rem;
  line-height: 1;
}

/* --- Service Cards --- */
.service-card .card-body { text-align: center; }
.service-icon {
  width: 64px;
  height: 64px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  color: var(--gold-dark);
}

/* --- carehome.co.uk wordmark --- */
.carehome-logo { display: flex; align-items: center; gap: 0.5rem; font-family: 'Mulish', sans-serif; line-height: 1; }
.carehome-logo__text { font-weight: 700; font-size: 1.6rem; letter-spacing: -0.5px; }
.carehome-logo .ch-care { color: #14509b; }
.carehome-logo .ch-home { color: #229bbd; }
.carehome-logo .ch-couk { color: var(--warm-grey); font-weight: 600; }

/* --- Blog category filter chips: even wrap spacing (all widths) --- */
.filter-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }

/* --- Blog "Key Takeaway" callout --- */
.key-takeaway {
  background: var(--navy);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--radius-md);
  margin: 2.5rem 0;
}
.key-takeaway h3 { color: var(--white); margin-bottom: 1rem; }
.key-takeaway p { color: rgba(255,255,255,0.85); margin: 0; line-height: 1.8; }

/* --- Food Hygiene Rating (FHRS) badge --- */
.fhrs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  box-shadow: var(--shadow-sm);
}
.fhrs-badge__score {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #5b8f22;
  color: var(--white);
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Mulish', sans-serif;
}
.fhrs-badge__text {
  text-align: left;
  line-height: 1.25;
  color: var(--navy);
}
.fhrs-badge__text strong { display: block; font-size: 0.95rem; }
.fhrs-badge__text small { color: var(--warm-grey); font-size: 0.78rem; }

/* --- Document download row --- */
.doc-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.doc-download svg { flex-shrink: 0; }

/* --- Testimonials --- */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-family: 'Source Serif 4', serif;
  font-size: 4rem;
  color: var(--gold-light);
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
}
.testimonial-text {
  padding-top: 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.8;
}
.testimonial-author {
  margin-top: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
}
.testimonial-source {
  font-size: 0.8rem;
  color: var(--text-light);
}
.stars { color: var(--gold-dark); letter-spacing: 2px; margin-bottom: 0.5rem; }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* --- Stats / Feature Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat-item h3 {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.stat-item p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--navy);
  padding: 4rem 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); margin-bottom: 1rem; }
.cta-banner p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto 2rem; }

/* --- Footer --- */
.footer {
  background: #151F33;
  color: rgba(255,255,255,0.7);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer h4 {
  color: var(--white);
  font-family: 'Mulish', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}
.footer-logo {
  display: inline-block;
  background: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.footer-logo img {
  height: 40px;
  width: auto;
  display: block;
}
.footer p { font-size: 0.9rem; line-height: 1.7; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: var(--gold-light); }
.footer-contact a { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--gold-light); }

/* --- Page Hero (Interior pages) --- */
.page-hero {
  position: relative;
  padding: 10rem 0 4rem;
  background: var(--navy);
  text-align: center;
}
.page-hero h1 { color: var(--white); }
.page-hero p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto; }
.page-hero::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1.5rem auto 0;
}

/* Breadcrumb */
.breadcrumb {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.breadcrumb a { color: var(--gold-light); }
.breadcrumb span { color: rgba(255,255,255,0.5); }

/* --- Blog Cards --- */
.blog-card .card-body { padding: 1.5rem; }
.blog-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.blog-meta .category {
  background: var(--cream);
  color: var(--gold-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.blog-card h3 a { color: var(--navy); }
.blog-card h3 a:hover { color: var(--gold-dark); }

/* --- Contact Form --- */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-sm);
  font-family: 'Mulish', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  background: var(--white);
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}
textarea.form-control { min-height: 140px; resize: vertical; }

/* Standalone field label (used where the control isn't a native <label> target, e.g. the CV dropzone) */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

/* --- File upload dropzone (CV upload) --- */
.file-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.8rem 1.2rem;
  border: 2px dashed var(--gold);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  /* Override the generic .form-group label rules so the dropzone isn't squashed. */
  margin-bottom: 0;
  font-weight: 400;
}
.file-dropzone:hover,
.file-dropzone:focus-within { border-color: var(--gold-dark); background: var(--cream-dark); }
.file-dropzone.dragover { border-color: var(--gold-dark); background: var(--cream-dark); box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15); }
/* Visually hide the native input but keep it accessible/focusable. */
.file-dropzone-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-dropzone-icon { color: var(--gold-dark); }
.file-dropzone-text { font-size: 0.95rem; color: var(--navy); }
.file-dropzone-hint { font-size: 0.8rem; color: var(--text-light); }
.file-name {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-dark);
  word-break: break-all;
}
.file-name.has-file { display: block; }

/* Fallback styling for any native file input that isn't a dropzone. */
input[type="file"].form-control { padding: 0.5rem; }
input[type="file"].form-control::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
input[type="file"].form-control::file-selector-button:hover { background: var(--gold-dark); }

/* --- Team Cards --- */
.team-card { text-align: center; }
.team-card .card-img { height: 280px; }
.team-card h3 { font-size: 1.2rem; margin-bottom: 0.2rem; }
.team-card .role { color: var(--gold-dark); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.8rem; }

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--light-grey);
  padding: 1.5rem 0;
}
.faq-item h3 { margin: 0; }
.faq-toggle {
  font-family: 'Mulish', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.faq-toggle::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--gold-dark);
  font-weight: 300;
  flex-shrink: 0;
}
.faq-toggle[aria-expanded="true"]::after { content: '\2212'; } /* minus sign when open */
.faq-answer { padding-top: 0.8rem; }

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.gallery-item {
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}
.gallery-item:hover img { transform: scale(1.05); }

/* --- Feature Row (icon + text) --- */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.feature-item { display: flex; gap: 1rem; }
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold-dark);
}
.feature-item h4 { margin-bottom: 0.3rem; font-family: 'Mulish', sans-serif; font-weight: 600; }
.feature-item p { font-size: 0.9rem; margin: 0; }

/* --- Map --- */
.map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.map-container iframe { display: block; }

/* --- Accessibility: skip link --- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 2000;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: var(--white);
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Visually hidden but available to screen readers */
.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;
}

/* --- Recognition / Trust bar (logos + ratings) --- */
.recognition-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}
.recognition-badge img { width: 44px; height: 44px; object-fit: contain; }

/* --- Validation messages --- */
.field-validation-error, .validation-summary-errors { color: #B23B3B; font-size: 0.85rem; }
.input-validation-error { border-color: #B23B3B !important; }
.alert-success {
  background: #E8F0E9;
  border: 1px solid var(--sage);
  color: #2E4A33;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

/* --- Article body (blog / job descriptions) --- */
.article-body h2 { margin-top: 2.2rem; }
.article-body h3 { margin-top: 1.6rem; }
.article-body ul { margin: 0.5rem 0 1.2rem 1.5rem; }
.article-body li { margin-bottom: 0.4rem; color: var(--text-secondary); }

/* --- Utility --- */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: 1rem; }

/* --- Facebook feed section (60% content / 40% feed) --- */
.fb-feed-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 3rem;
  align-items: start;
}
.fb-feed-embed { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; width: 100%; }
.fb-feed-embed iframe { max-width: 500px; width: 100%; }
.fb-feed-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1877F2; /* Facebook brand blue */
}
.fb-feed-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1.8rem;
}
.fb-feed-thumbs img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

/* --- Image carousel (Moments) --- */
.carousel { position: relative; max-width: 920px; margin: 0 auto; }
.carousel-viewport { overflow: hidden; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.carousel-track { display: flex; transition: transform 0.5s ease; }
.carousel-slide { min-width: 100%; position: relative; }
.carousel-slide picture { display: block; width: 100%; }
.carousel-slide img { width: 100%; height: 460px; object-fit: cover; display: block; }

/* Full-bleed variant — carousel spans the full viewport width (edge to edge). */
.carousel-full { max-width: 100%; width: 100%; margin: 0; }
.carousel-full .carousel-viewport { border-radius: 0; box-shadow: none; }
.carousel-full .carousel-slide img { height: clamp(480px, 66vh, 720px); object-position: center; }

/* Natural variant — contained; shows each photo at its real proportions (no crop/stretch). */
.carousel-natural { max-width: 960px; }
.carousel-natural .carousel-slide img {
  height: clamp(360px, 52vh, 560px);
  object-fit: contain;
  background: var(--cream-dark);
}
.carousel-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.6rem 1.8rem 1.5rem;
  color: var(--white);
  background: linear-gradient(transparent, rgba(27, 42, 74, 0.85));
  text-align: center;
}
.carousel-caption-title {
  margin: 0;
  font-family: 'Source Serif 4', serif;
  font-size: 1.5rem;
  color: var(--white);
  line-height: 1.2;
}
.carousel-caption-text {
  margin: 0.3rem auto 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 1.7rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.carousel-btn:hover { background: var(--white); }
.carousel-prev { left: 0.8rem; }
.carousel-next { right: 0.8rem; }
.carousel-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.carousel-dots button {
  width: 10px; height: 10px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--light-grey); cursor: pointer;
  transition: var(--transition);
}
.carousel-dots button.active { background: var(--gold); }

/* --- Responsive --- */
@media (max-width: 968px) {
  /* Facebook feed stacks below the content on mobile */
  .fb-feed-section { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4, .stats-row, .feature-row, .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3, .stats-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); } /* tablet/medium: 2 per row */
  .fb-feed-thumbs img { height: 250px; } /* tablet/medium: FB thumbs */
  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--light-grey);
  }
  .nav-links.nav-open { display: flex; }
  .nav-links li { padding: 0.6rem 0; }
  .nav-links a { font-size: 1rem; }
  .nav-toggle { display: block; }
  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  /* Dropdowns are centered inline accordions in the mobile menu (match the plain links) */
  .nav-item.nav-has-dropdown { width: auto; text-align: center; }
  .nav-dropdown-toggle {
    width: auto;
    margin: 0 auto;
    justify-content: center;
    gap: 0.4rem;
    font-size: 1rem;
    padding: 0.6rem 0;
  }
  .nav-dropdown-toggle::after { display: none; }
  .nav-dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding: 0.2rem 0 0.4rem;
    text-align: center;
  }
  .nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { text-align: center; font-size: 0.9rem; }
  .hero { min-height: 70vh; }
  .hero-content { max-width: 100%; }
  .trust-items { gap: 1.5rem; }
}

@media (max-width: 600px) {
  .grid-3, .stats-row, .footer-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; } /* phones: 1 image per row */
  .fb-feed-thumbs img { height: 200px; } /* phones: keep FB thumbs from getting too tall */
  .section { padding: 3rem 0; }
  .section-flush-top { padding-top: 0; } /* keep flush utility winning over the mobile .section rule above */
  .hero { min-height: 60vh; }
  /* Left-align trust items to a common edge (icons line up) while centring the group */
  .trust-items { flex-direction: column; align-items: flex-start; gap: 1.1rem; width: fit-content; margin: 0 auto; }

  /* Stack CTA / hero / btn-stack buttons as equal-width, centred blocks (overrides inline side-by-side margins) */
  .cta-banner .btn, .hero-content .btn, .btn-stack .btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .cta-banner .btn + .btn, .hero-content .btn + .btn, .btn-stack .btn + .btn { margin-top: 0.8rem; }

  /* Carousel: shorter slides + smaller caption on mobile */
  .carousel-slide img { height: 280px; }
  .carousel-full .carousel-slide img { height: 380px; }
  .carousel-caption { padding: 1.8rem 1.1rem 1rem; }
  .carousel-caption-title { font-size: 1.2rem; }
  .carousel-caption-text { font-size: 0.9rem; }
  .carousel-btn { width: 38px; height: 38px; font-size: 1.4rem; }
}

/* --- Cookie consent banner --- */
.cookie-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  background: var(--navy);
  color: var(--white);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(27, 42, 74, 0.35);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.cookie-consent-text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}
.cookie-consent-text a { color: var(--gold-light); text-decoration: underline; }
.cookie-consent-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .cookie-consent-inner { padding: 1rem; }
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-actions .btn { flex: 1; }
}
