/* ---------- Brand tokens ---------- */
:root {
  --green: #26522f;
  --green-dark: #1a3a21;
  --green-mid: #367543;
  --sage: #94a898;
  --amber: #cf8a3b;
  --amber-dark: #986325;
  --cream: #f6f3ec;
  --paper: #faf8f3;
  --ink: #1d1d1d;
  --muted: #5a6660;
  --rule: #e3ddcf;
  --white: #ffffff;

  --container: 1200px;
  --radius: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(26,58,33,.06);
  --shadow-md: 0 6px 24px rgba(26,58,33,.10);

  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--amber-dark); }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.15;
  color: var(--green-dark);
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

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

.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin: 0 0 .8rem;
}

.lede { font-size: 1.15rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--amber);
  color: var(--white);
}
.btn-primary:hover { background: var(--amber-dark); color: var(--white); transform: translateY(-1px); }

.btn-secondary {
  background: var(--green);
  color: var(--white);
}
.btn-secondary:hover { background: var(--green-dark); color: var(--white); }

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

.btn-ghost-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.6);
}
.btn-ghost-light:hover { background: var(--white); color: var(--green-dark); }

/* ---------- Top utility bar ---------- */
.utility {
  background: var(--green-dark);
  color: rgba(255,255,255,.85);
  font-size: .85rem;
}
.utility .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem 1.25rem;
  gap: 1rem;
}
.utility a { color: rgba(255,255,255,.85); }
.utility a:hover { color: var(--amber); }
.utility .charity-no { opacity: .8; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow .2s ease, background .2s ease, padding .2s ease;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
  transition: padding .2s ease;
}
body.is-scrolled .site-header {
  background: rgba(250, 248, 243, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 6px 20px rgba(26, 58, 33, 0.08);
}
body.is-scrolled .site-header .container {
  padding-top: .4rem;
  padding-bottom: .4rem;
}
body.is-scrolled .brand img { height: 44px; }
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand img { height: 56px; width: auto; transition: height .2s ease; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--green-dark);
  border-radius: 2px;
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -8px; }
.nav-toggle span::after { position: absolute; top: 8px; }

.primary-nav { display: flex; align-items: center; }
.primary-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.primary-nav .nav-cta { margin-left: .75rem; }
.primary-nav .nav-cta .btn { padding: .65rem 1.5rem; font-size: .95rem; }
.primary-nav > ul > li { position: relative; }
.primary-nav > ul > li > a {
  display: inline-block;
  padding: .5rem 0;
  color: var(--green-dark);
  font-weight: 700;
  font-size: .98rem;
}
.primary-nav > ul > li > a { position: relative; }
.primary-nav > ul > li > a:hover { color: var(--amber-dark); }
.primary-nav > ul > li > a.is-active { color: var(--amber-dark); }
.primary-nav > ul > li > a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 28px;
  height: 3px;
  background: var(--amber);
  border-radius: 2px;
  pointer-events: none;
}

.has-submenu > a::after {
  content: " ▾";
  font-size: .75em;
  opacity: .7;
}
.submenu {
  list-style: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -1rem;
  min-width: 220px;
  margin: 0;
  padding: .5rem 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  z-index: 60;
}
.submenu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.submenu li { display: block; margin: 0; }
.submenu a {
  display: block;
  padding: .55rem 1.1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
}
.submenu a:hover { background: var(--cream); color: var(--green-dark); }
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  color: var(--white);
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("../images/hero-eventer.jpg");
  background-size: cover;
  background-position: center 30%;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,58,33,.78) 0%, rgba(26,58,33,.45) 55%, rgba(207,138,59,.25) 100%);
  z-index: -1;
}
.hero .container { padding-top: 5rem; padding-bottom: 5rem; }
.hero h1 { color: var(--white); max-width: 18ch; }
.hero p {
  font-size: 1.25rem;
  max-width: 50ch;
  margin-bottom: 2rem;
  color: rgba(255,255,255,.92);
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-mark {
  position: absolute;
  right: 4%;
  bottom: 6%;
  width: 130px;
  opacity: .9;
  z-index: 0;
}

/* ---------- Sections ---------- */
section { padding: 5rem 0; }
section.tight { padding: 3.5rem 0; }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-head .lede { margin-top: .5rem; }

.bg-cream { background: var(--cream); }
.bg-green { background: var(--green); color: var(--white); }
.bg-green h2, .bg-green h3 { color: var(--white); }
.bg-green a { color: var(--amber); }

/* ---------- Two-column ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.two-col.reverse > :first-child { order: 2; }
.two-col img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.pillar {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pillar h3 { color: var(--green-dark); margin-bottom: .5rem; }
.pillar .icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  color: var(--green-dark);
  border-radius: 50%;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: 800;
}
.pillar p { color: var(--muted); margin-bottom: 1rem; }
.pillar a { font-weight: 700; }

/* ---------- Horse cards ---------- */
.horse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.horse-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.horse-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.horse-card .photo {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}
.horse-card .body { padding: 1.25rem 1.5rem 1.5rem; }
.horse-card h3 { margin-bottom: .25rem; }
.horse-card .meta {
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber-dark);
  font-weight: 700;
  margin-bottom: .75rem;
}
.horse-card p { color: var(--muted); margin-bottom: 0; }

/* Skeleton loading state (Supabase fetch in flight) */
.horse-card--skeleton { pointer-events: none; }
.horse-card--skeleton .photo { background: linear-gradient(110deg, #ece8df 30%, #f6f3ec 50%, #ece8df 70%); background-size: 200% 100%; animation: rr-shimmer 1.6s ease-in-out infinite; }
.skeleton-bar { height: 12px; background: linear-gradient(110deg, #ece8df 30%, #f6f3ec 50%, #ece8df 70%); background-size: 200% 100%; animation: rr-shimmer 1.6s ease-in-out infinite; border-radius: 6px; margin-bottom: .65rem; }
.skeleton-bar--title { height: 22px; width: 55%; margin-bottom: .85rem; }
.skeleton-bar--meta { width: 35%; height: 10px; }
.skeleton-bar--short { width: 75%; }
@keyframes rr-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .horse-card--skeleton .photo, .skeleton-bar { animation: none; } }

/* Empty / error fallback inside a horse-grid */
.horse-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  background: var(--cream);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  margin: 0;
  font-size: 1rem;
}
.horse-grid-empty a { color: var(--green-dark); font-weight: 700; text-decoration: underline; }

/* Card click affordances (keyboard + mouse) */
.horse-card[data-horse-id] { cursor: pointer; }
.horse-card[data-horse-id]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- Horse modal (gallery + full bio on card click) ---------- */
/* horses.js sets position:fixed on body to lock scroll (iOS-safe). The
   class is kept as a hook for any future scoped CSS that needs to react. */

.horse-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;  /* explicit + shorthand, belt-and-braces for older browsers */
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
  /* Note: deliberately NOT setting touch-action: none — that blocked
     scrolling within the modal body on mobile. The backdrop is opaque
     so touches can't reach the page underneath anyway. */
}
.horse-modal.is-open { opacity: 1; pointer-events: auto; }
.horse-modal[hidden] { display: none; }

.horse-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 33, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.horse-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  overflow: hidden;
  transform: translateY(8px) scale(.99);
  transition: transform .2s ease;
}
.horse-modal.is-open .horse-modal__panel { transform: translateY(0) scale(1); }

.horse-modal__close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
  width: 40px; height: 40px;
  border: 0;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: background .15s ease, box-shadow .15s ease;
}
.horse-modal__close:hover { background: var(--white); }
.horse-modal__close:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Gallery */
.horse-modal__gallery {
  position: relative;
  background: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: calc(100vh - 2rem);
  overflow: hidden;  /* clip any photo overflow so it can't bleed into the bio area */
}
.horse-modal__gallery--empty {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 100%);
}
.horse-modal__gallery--empty::after {
  content: 'No photos yet';
  color: rgba(255,255,255,.7);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .85rem;
}
.horse-modal__photo {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  width: auto;
  height: auto;
  object-fit: contain;
}
.horse-modal__photo[src=""] { display: none; }

.horse-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.horse-modal__nav:hover { background: rgba(0,0,0,.7); }
.horse-modal__nav:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.horse-modal__nav--prev { left: .75rem; }
.horse-modal__nav--next { right: .75rem; }
.horse-modal__nav[hidden] { display: none; }

.horse-modal__counter {
  position: absolute;
  bottom: .85rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .78rem;
  letter-spacing: .08em;
  padding: .2rem .65rem;
  border-radius: 999px;
  pointer-events: none;
}

.horse-modal__dots {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .35rem;
}
.horse-modal__dots[hidden] { display: none; }
.horse-modal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.horse-modal__dot:hover { background: rgba(255,255,255,.7); }
.horse-modal__dot.is-active { background: var(--amber); transform: scale(1.2); }
.horse-modal__dot:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Body */
.horse-modal__body {
  padding: 2rem 2rem 2rem;
  overflow-y: auto;
  max-height: calc(100vh - 2rem);
}
.horse-modal__eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin: 0 0 .5rem;
}
.horse-modal__eyebrow:empty { display: none; }
.horse-modal__body h2 {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  margin: 0 0 .25rem;
  color: var(--green-dark);
}
.horse-modal__racing-name {
  font-style: italic;
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 .35rem;
}
.horse-modal__racing-name[hidden] { display: none; }
.horse-modal__meta {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-weight: 600;
}
.horse-modal__bio p {
  margin: 0 0 .85rem;
  line-height: 1.65;
}
.horse-modal__details {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1rem;
  row-gap: .5rem;
  font-size: .92rem;
}
.horse-modal__details:empty { display: none; }
.horse-modal__details dt {
  font-weight: 700;
  color: var(--green-dark);
}
.horse-modal__details dd { margin: 0; color: var(--muted); }

.horse-modal__sponsor {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.horse-modal__sponsor[hidden] { display: none; }
.horse-modal__sponsor-blurb {
  margin: 0 0 1rem;
  color: var(--green-dark);
}
.horse-modal__sponsor-btn {
  width: 100%;
  justify-content: center;
}
.horse-modal__sponsor-fineprint {
  font-size: .8rem;
  color: var(--muted);
  margin: .75rem 0 0;
  text-align: center;
}

/* Mobile / tablet — full-screen panel.
   Panel itself doesn't scroll; the BODY section scrolls within its grid
   row. min-height: 0 is essential here — grid items default to their
   content's intrinsic min-size, which would prevent the body shrinking
   below its content and so block any overflow from kicking in. */
@media (max-width: 900px) {
  .horse-modal__panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    overflow: hidden;
  }
  .horse-modal__gallery { min-height: 240px; max-height: 45vh; flex-shrink: 0; }
  .horse-modal__photo { max-height: 45vh; max-width: 100vw; }
  .horse-modal__body {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    min-height: 0;
  }
}
@media (max-width: 560px) {
  .horse-modal__nav { width: 36px; height: 36px; font-size: 1.5rem; }
  .horse-modal__close { top: .5rem; right: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .horse-modal, .horse-modal__panel { transition: none; }
}

/* ---------- Quote / endorsement ---------- */
.quote {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem;
}
.quote blockquote {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 600;
  font-style: italic;
  margin: 0 0 1rem;
  color: var(--white);
}
.quote cite {
  font-style: normal;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .9rem;
  color: var(--amber);
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
.stat .num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  display: block;
}
.stat .label {
  margin-top: .4rem;
  font-size: .9rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

/* ---------- Page header (inner pages) ---------- */
.page-header {
  background: var(--green);
  color: var(--white);
  padding: 4rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(207,138,59,.18) 0%, rgba(207,138,59,0) 70%);
  pointer-events: none;
}
.page-header h1 { color: var(--white); margin-bottom: .25rem; }
.page-header .lede { color: rgba(255,255,255,.85); max-width: 60ch; }
.breadcrumb {
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
  font-weight: 700;
}
.breadcrumb a { color: var(--amber); }

/* ---------- Prose ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; color: var(--green-dark); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }

/* ---------- People grid ---------- */
.people {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.person {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.person h3 { margin-bottom: .25rem; }
.person .role {
  color: var(--amber-dark);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

/* ---------- Form ---------- */
form.contact-form { max-width: 640px; }
.contact-form__feedback {
  margin: .75rem 0 0;
  font-size: .9rem;
  font-weight: 600;
}
.contact-form__feedback.is-error { color: #c33; }
.contact-form__success {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
}
.contact-form__success h3 {
  color: var(--green-dark);
  margin-bottom: .5rem;
}
.contact-form__success p {
  color: var(--muted);
  margin: 0;
}
.field { display: flex; flex-direction: column; margin-bottom: 1.25rem; }
.field label {
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--green-dark);
  font-size: .95rem;
}
.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem .9rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(38,82,47,.12);
}
.field textarea { resize: vertical; min-height: 140px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.8);
  padding: 4rem 0 1.5rem;
  font-size: .95rem;
}
.site-footer h4 {
  color: var(--white);
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--amber); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1.25rem;
  text-decoration: none;
}
.footer-brand img { height: 64px; width: auto; }
.footer-wordmark {
  color: var(--white);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.site-footer .brand-block p { color: rgba(255,255,255,.7); max-width: 32ch; }
.legal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-mid) 100%);
  color: var(--white);
  padding: 3.5rem 0;
}
.cta-banner .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-banner h2 { color: var(--white); margin: 0; }
.cta-banner p { margin: .5rem 0 0; max-width: 50ch; color: rgba(255,255,255,.9); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.gallery img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform .25s ease, filter .25s ease;
}
.gallery img:hover { transform: scale(1.02); filter: brightness(1.05); }

/* ---------- Process steps ---------- */
.steps { counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.step:last-child { border-bottom: 0; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-weight: 800;
  font-size: 2rem;
  color: var(--amber);
  line-height: 1;
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--muted); margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two-col, .pillars, .horse-grid, .people, .stats, .footer-grid {
    grid-template-columns: 1fr;
  }
  .two-col { gap: 2rem; }
  .two-col.reverse > :first-child { order: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); }

  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 1.25rem 1.5rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: var(--shadow-md);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 0; width: 100%; }
  .primary-nav > ul > li > a {
    display: block;
    padding: .9rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .submenu {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 .5rem 1rem;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .submenu::before { display: none; }
  .has-submenu.is-open > .submenu { display: block; }
  .has-submenu > a::after { content: " +"; }

  .hero { min-height: 60vh; }
  .hero-mark { display: none; }

  .utility .container { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .legal { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .cta-banner .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- Newsletter section (inline, above footer) ---------- */
.newsletter {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  padding: 4rem 0;
  overflow: hidden;
  border-top: 1px solid var(--rule);
}
.newsletter::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(207,138,59,.12) 0%, rgba(207,138,59,0) 70%);
  pointer-events: none;
}
.newsletter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.newsletter h2 { color: var(--green-dark); margin-bottom: .5rem; }
.newsletter .newsletter-copy p {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 44ch;
}
.newsletter .eyebrow { color: var(--amber-dark); }

/* ---------- Newsletter signup form (custom, posts to HubSpot API) ---------- */
.newsletter-form {
  background: var(--white);
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.newsletter-form__label {
  display: block;
  font-weight: 700;
  color: var(--green-dark);
  font-size: .92rem;
  margin-bottom: .5rem;
}
.newsletter-form__row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: .75rem .9rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(38,82,47,.12);
}
.newsletter-form button[type="submit"] {
  white-space: nowrap;
  flex-shrink: 0;
}
.newsletter-form button[type="submit"]:disabled {
  opacity: .7;
  cursor: progress;
}
.newsletter-form__feedback {
  margin: .65rem 0 0;
  font-size: .9rem;
  font-weight: 600;
}
.newsletter-form__feedback.is-error { color: #c33; }
.newsletter-form__legal {
  font-size: .8rem;
  color: var(--muted);
  margin: .75rem 0 0;
  line-height: 1.5;
}
.newsletter-form__legal a {
  color: var(--green-dark);
  text-decoration: underline;
}
.newsletter-form__success {
  margin: 0;
  text-align: center;
  color: var(--green-dark);
  padding: .5rem 0;
}
.newsletter-form__success strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: .25rem;
}

/* Slide-in compact variant — stacked, transparent (lives in the white card) */
.newsletter-form--slidein {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.newsletter-form--slidein .newsletter-form__label { font-size: .85rem; }
.newsletter-form--slidein .newsletter-form__row {
  flex-direction: column;
  gap: .5rem;
}
.newsletter-form--slidein button[type="submit"] {
  width: 100%;
}
.newsletter-form--slidein .newsletter-form__legal { font-size: .75rem; }

/* Dev placeholder when HubSpot IDs aren't configured */
.newsletter-form--placeholder {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.5rem;
  border: 2px dashed var(--rule);
  background: var(--cream);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: .9rem;
  box-shadow: none;
}
.newsletter-form--placeholder strong { color: var(--green-dark); font-size: 1rem; }
.newsletter-form--placeholder code {
  background: rgba(38,82,47,.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .85em;
}

/* ---------- Slide-in newsletter card ---------- */
.newsletter-slidein {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(26,58,33,.25);
  padding: 1.5rem 1.5rem 1.25rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}
.newsletter-slidein.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear 0s;
}
.newsletter-slidein h3 {
  color: var(--green-dark);
  margin-bottom: .35rem;
  font-size: 1.2rem;
  padding-right: 2rem;
}
.newsletter-slidein > p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.slidein-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, box-shadow .15s ease;
}
.slidein-close:hover { background: var(--cream); }
.slidein-close:focus-visible {
  outline: none;
  background: var(--cream);
  box-shadow: 0 0 0 3px rgba(38,82,47,.3);
}

/* Hide HubSpot's own EU cookie banner — we manage consent via our own banner
   and push the decision to HubSpot's _hsp queue, so this one is redundant. */
#hs-eu-cookie-confirmation { display: none !important; }

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--green-dark);
  color: rgba(255,255,255,.92);
  padding: 1rem 1.25rem;
  display: none;
  z-index: 99;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
  border-top: 2px solid var(--amber);
}
.cookie-banner.is-visible {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.cookie-banner p {
  margin: 0;
  font-size: .9rem;
  flex: 1;
  min-width: 240px;
  max-width: 60ch;
}
.cookie-banner a { color: var(--amber); text-decoration: underline; }
.cookie-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.cookie-banner .btn {
  padding: .55rem 1.25rem;
  font-size: .9rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .newsletter-slidein {
    transform: none !important;
    transition: opacity .15s ease, visibility 0s linear .15s;
  }
  .newsletter-slidein.is-visible {
    transition: opacity .15s ease, visibility 0s linear 0s;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .newsletter-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 560px) {
  .newsletter-form--inline .newsletter-form__row {
    flex-direction: column;
    gap: .65rem;
  }
  .newsletter-form--inline button[type="submit"] { width: 100%; }
}
@media (max-width: 560px) {
  .newsletter-slidein {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }
  .cookie-banner.is-visible { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}
