/* ==========================================================================
   Allied Equine — site stylesheet
   Design system extracted from the original Squarespace 7.1 build.
   Palette: cream #EEE4CE · black #000 · royal blue #091790 ·
            gold #9D7925 · green #225912
   Type:    Instrument Serif (headings) · Cabin (body/nav) · Newsreader (buttons)
   ========================================================================== */

:root {
  --cream: #EEE4CE;
  --black: #000000;
  --blue: #091790;
  --gold: #9D7925;
  --green: #225912;

  --font-heading: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Cabin', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --font-button: 'Newsreader', Georgia, serif;

  --max-w: 1200px;
  --gutter: 4vw;
  --gutter-m: 6vw;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--black);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---------- Headings (fluid ramp from the original) ---------- */
h1, h2, h3, h4, .accordion__toggle, .marquee__group span {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
}
h1, h2, h3, h4 { margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: min(calc(3 * 1.2vw + 1rem), 4rem);   line-height: 1.056; }
h2 { font-size: min(calc(1.8 * 1.2vw + 1rem), 2.8rem); line-height: 1.1136; }
h3 { font-size: min(calc(1.2 * 1.2vw + 1rem), 2.2rem); line-height: 1.1424; }
h4 { font-size: min(calc(0.6 * 1.2vw + 1rem), 1.6rem); line-height: 1.1712; }
@media (max-width: 767px) and (orientation: portrait) {
  h1 { font-size: calc(3 * 0.012 * min(100vh, 900px) + 1rem); }
  h2 { font-size: calc(1.8 * 0.012 * min(100vh, 900px) + 1rem); }
  h3 { font-size: calc(1.2 * 0.012 * min(100vh, 900px) + 1rem); }
  h4 { font-size: calc(0.6 * 0.012 * min(100vh, 900px) + 1rem); }
}
.fe-b h1, .fe-b h2, .fe-b h3, .fe-b h4 { margin: 0; }
.fe-b h1 + p, .fe-b h2 + p, .fe-b h3 + p, .fe-b h4 + p { margin-top: 0.75em; }

.text-small { font-size: 0.9rem; }

/* ---------- Section themes ---------- */
/* default = the photo heroes: only the scrim reads a token */
.theme-default { --bg: var(--cream); }
.theme-black {
  --bg: var(--black);
  --c-h1: var(--cream); --c-h2: var(--cream); --c-h3: var(--cream); --c-h4: var(--cream);
  --c-p: var(--cream);
  --c-rule: var(--cream);
  --c-link: var(--cream);
  --btn-bg: var(--cream); --btn-tx: var(--black);
  --arrow-bg: var(--cream); --arrow-ic: var(--black);
}
.theme-light-bold {
  --bg: var(--blue);
  --c-h1: var(--cream); --c-h2: var(--cream); --c-h3: var(--cream); --c-h4: var(--cream);
  --c-rule: var(--green);
  --c-link: var(--cream);
  --arrow-bg: var(--green); --arrow-ic: var(--cream);
}

.sec h1 { color: var(--c-h1); }
.sec h2 { color: var(--c-h2); }
.sec h3 { color: var(--c-h3); }
.sec h4 { color: var(--c-h4); }
.sec p, .sec li { color: var(--c-p); }
.sec a:not(.btn) { color: var(--c-link); }

/* Forced color spans (from the original rich text) */
.tc-white { color: var(--cream) !important; }
.tc-black { color: var(--black) !important; }
.tc-gold { color: var(--gold) !important; }
.tc-pure-white { color: #FFFFFF !important; }

/* Text alignment helpers */
.ta-c { text-align: center; }
.ta-r { text-align: right; }

/* ---------- Sections ---------- */
.sec {
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sec--small  { min-height: 33vh; }
.sec--medium { min-height: 66vh; }
.sec--small > .fe  { padding-top: 3.3vmax; padding-bottom: 3.3vmax; }
.sec--medium > .fe { padding-top: 6.6vmax; padding-bottom: 6.6vmax; }

/* Full-bleed background image + scrim (scrim color = theme bg, like the original) */
.sec__bg {
  position: absolute; inset: 0; overflow: hidden;
}
.sec__bg img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.sec__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--bg);
  opacity: var(--scrim);
}

/* ---------- Fluid-engine grid (faithful port of the original formulas) ----------
   Desktop: 26 tracks = gutter + 24 content cols + gutter, rows = 2.15% of container width.
   Mobile:  10 tracks = gutter + 8 content cols + gutter, rows min 24px.
   Per block: --gm (mobile grid-area), --gd (desktop grid-area). */
.fe {
  display: grid;
  position: relative;
  width: 100%;
  --gap: 11px;
  --gg: calc(var(--gutter-m) - var(--gap));
  --cmw: calc((var(--max-w) - var(--gap) * 7) / 8);
  grid-template-rows: repeat(var(--rows-m, 1), minmax(24px, auto));
  grid-template-columns:
    minmax(var(--gg), 1fr)
    repeat(8, minmax(0, var(--cmw)))
    minmax(var(--gg), 1fr);
  gap: var(--gap);
  overflow-x: clip;
}
.fe--nogap { --gap: 0px; }
.fe-b { position: relative; grid-area: var(--gm, auto); min-width: 0; display: flex; flex-direction: column; justify-content: var(--jc, flex-start); }
@media (min-width: 768px) {
  .fe {
    --gg: calc(var(--gutter) - var(--gap));
    --cmw: calc((var(--max-w) - var(--gap) * 23) / 24);
    --cw: min(var(--max-w), calc(100vw - var(--gutter) * 2));
    grid-template-rows: repeat(var(--rows, var(--rows-m, 1)), minmax(calc(var(--cw) * 0.0215), auto));
    grid-template-columns:
      minmax(var(--gg), 1fr)
      repeat(24, minmax(0, var(--cmw)))
      minmax(var(--gg), 1fr);
  }
  .fe-b { grid-area: var(--gd, auto); justify-content: var(--jc-d, var(--jc, flex-start)); }
}
.fe-b--center { --jc: center; }

/* Images inside blocks */
.img-cover, .img-contain { width: 100%; height: 100%; }
.img-cover img { width: 100%; height: 100%; object-fit: cover; }
.img-contain img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Thin rule (design motif) ---------- */
.rule {
  border: none;
  height: 1px;
  width: 100%;
  margin: 0;
  align-self: center;
  background-color: var(--c-rule);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  transition: transform 0.3s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner {
  max-width: calc(var(--max-w) + 48px);
  margin: 0 auto;
  padding: 2vw 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-logo img { width: auto; max-height: 137px; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  margin-left: 1.4vw;
  padding: 0.1em 0;
}
.site-nav a:hover { opacity: 0.75; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
.nav-toggle { display: none; }

@media (max-width: 899px) {
  /* logoCenterNavRight: centered logo, burger right (as in the original) */
  .header-inner { position: relative; justify-content: flex-end; min-height: 96px; padding: 12px var(--gutter-m); }
  .header-logo { position: absolute; left: 50%; transform: translateX(-50%); }
  .header-logo img { max-height: 72px; }
  .site-nav { display: none; }
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 26px;
    height: 1px;
    background: var(--cream);
    margin: 7px 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* Mobile menu overlay — bright-inverse theme (cream bg, green links) */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18vh var(--gutter-m) 8vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
body.nav-open .mobile-nav { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }
.mobile-nav a {
  font-size: 1.7rem;
  color: var(--green);
  text-decoration: none;
  padding: 0.45em 0;
}
.mobile-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.25em; }
@media (min-width: 900px) { .mobile-nav { display: none; } }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  background: var(--cream);
  color: var(--black);
  padding: 8px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-button);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  padding: 1rem 1.3rem;
  border: none;
  border-radius: 0;
  background: var(--btn-bg);
  color: var(--btn-tx);
  cursor: pointer;
  transition: opacity 0.1s linear;
}
.btn:hover { opacity: 0.8; }

/* ---------- Accordion ---------- */
.accordion__item { border-bottom: 1px solid var(--c-rule); }
.accordion__item:first-child { border-top: 1px solid var(--c-rule); }
.accordion__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 15px 0;
  cursor: pointer;
  text-align: left;
  font-size: min(calc(0.9 * 1.2vw + 1rem), 1.9rem);
  color: var(--c-h3);
}
.accordion__icon {
  position: relative;
  flex: 0 0 14px;
  height: 14px;
}
.accordion__icon::before, .accordion__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.25s ease;
}
.accordion__icon::before { left: 0; right: 0; top: 50%; height: 1px; }
.accordion__icon::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.accordion__item.is-open .accordion__icon::after { transform: scaleY(0); }
.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion__panel-inner { padding: 0 0 30px; }
.accordion__panel p { font-size: 0.9rem; color: var(--c-p); }

/* ---------- Carousel ---------- */
.carousel { position: relative; width: 100%; --per-view: 1; }
.carousel__viewport { overflow: hidden; }
.carousel__track {
  display: flex;
  column-gap: 20px;
  transition: transform 0.45s ease;
}
.carousel__slide {
  flex: 0 0 calc((100% - 20px * (var(--per-view) - 1)) / var(--per-view));
  min-width: 0;
}
@media (min-width: 768px) { .carousel--cols3 { --per-view: 3; } }
/* adjacent-slide peek (like the original's isShowAdjacentSlides) */
.carousel--peek .carousel__slide {
  flex-basis: calc((100% - 20px * var(--per-view)) / (var(--per-view) + 0.3));
}
.carousel__nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}
.carousel__arrow {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--arrow-bg);
  color: var(--arrow-ic);
  opacity: 0.7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  flex: 0 0 auto;
}
.carousel__arrow:hover { opacity: 1; }
.carousel__arrow:disabled { opacity: 0.3; cursor: default; }
.carousel__arrow svg { width: 36px; height: 36px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
/* Carousel arrows floated mid-height at the sides (testimonial style) */
.carousel--side-arrows .carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.carousel--side-arrows .carousel__arrow--prev { left: 5vw; }
.carousel--side-arrows .carousel__arrow--next { right: 5vw; }
@media (max-width: 767px) {
  .carousel__arrow { width: 48px; height: 48px; }
  .carousel__arrow svg { width: 20px; height: 20px; }
  /* on phones the arrows sit centered below the quote, like the original */
  .carousel--side-arrows { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
  .carousel--side-arrows .carousel__viewport { flex: 0 0 100%; max-width: 100% !important; }
  .carousel--side-arrows .carousel__arrow {
    position: static;
    transform: none;
    margin-top: 24px;
  }
}

/* List-section wrapper (carousel sections) */
.list-sec { padding: 6.6vmax 0; position: relative; }
.list-sec__title {
  text-align: center;
  margin: 0 auto 40px;
  font-size: min(calc(1.8 * 1.2vw + 1rem), 2.8rem);
}
.list-sec__inner { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 3% 0;
  white-space: nowrap;
}
.marquee__inner {
  display: inline-flex;
  animation: marquee-scroll 40s linear infinite;
}
.marquee__group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.marquee__group span {
  font-size: min(calc(3 * 1.2vw + 1rem), 4rem);
  line-height: 1.056;
  color: var(--c-h1);
  padding: 0 0.35em;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__inner { animation: none; }
}

/* ---------- Forms (black theme: gold fill, cream text) ---------- */
.form-block label {
  display: block;
  font-size: 0.9rem;
  color: var(--c-p);
  margin-bottom: 6px;
}
.form-block .field { margin-bottom: 20px; }
.form-block .field-row { display: flex; gap: 10px; }
.form-block .field-row > div { flex: 1; }
.form-block input,
.form-block textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--cream);
  background: var(--gold);
  border: none;
  border-radius: 10px;
  padding: 5px 10px;
  transition: opacity 0.15s ease;
}
.form-block input:hover, .form-block textarea:hover { opacity: 0.9; }
.form-block input:focus, .form-block textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  opacity: 1;
}
.form-block textarea { min-height: 8em; resize: vertical; }
.form-block .form-submit { width: 100%; line-height: normal; }
.form-block .form-note { font-size: 0.9rem; color: var(--c-p); margin-top: 12px; }

/* ---------- Social icons (circle knockout, 28px) ---------- */
.social-icons { display: flex; gap: 8px; align-items: center; }
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.social-icons a:hover { opacity: 0.7; }
.social-icons svg { width: 14px; height: 14px; fill: currentColor; }

/* ---------- Footer ---------- */
.site-footer p { margin: 0 0 0.4em; }

/* ---------- Map embed ---------- */
.map-embed { width: 100%; height: 100%; min-height: 320px; }
.map-embed iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
  filter: grayscale(0.2);
}

/* ---------- Misc ---------- */
.role-label {
  font-family: var(--font-button);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
::selection { background: var(--gold); color: var(--black); }
