/* =========================================================================
   HYLLSTOFTA STUTERI — Travuppfödning i världsklass
   Design system: heritage equestrian · Scandinavian luxury.
   Deep stable-night greens & warm parchment, restrained champagne brass,
   a heritage oxblood. Display: Fraunces · Body: Inter.

   Colours are tokenised — when the real logo arrives, retune the four
   --brand-* tokens below and the whole site follows.
   ========================================================================= */

:root {
  /* ---- Brand anchors (retune to the logo) ---- */
  --brand-dark:    #15170f;   /* primary near-black (warm green-black) */
  --brand-paper:   #f3eee2;   /* primary light background */
  --brand-gold:    #bf9d5e;   /* champagne brass — prestige accent / CTA */
  --brand-oxblood: #5a2330;   /* heritage racing-silk red (secondary) */

  /* ---- Extended palette ---- */
  --noir:        #15170f;
  --noir-2:      #1c1e15;     /* lifted dark surface */
  --noir-3:      #24271c;     /* cards on dark */
  --forest:      #2c3a2c;     /* deep paddock green */
  --forest-deep: #20291f;
  --bark:        #2a2218;     /* dark brown */
  --paper:       #f3eee2;
  --paper-2:     #e9e0cd;     /* deeper section bg */
  --cream:       #faf6ec;
  --gold:        #bf9d5e;
  --gold-deep:   #9d7c3c;
  --gold-soft:   #d8c193;
  --oxblood:     #5a2330;
  --sage:        #8b9079;
  --stone:       #8d8573;

  /* ---- Text ---- */
  --text:            #211e16;
  --text-muted:      #5d5746;
  --text-faint:      #8a8472;
  --on-dark:         #ece6d6;
  --on-dark-muted:   #a9a48f;
  --on-dark-faint:   #7f7a68;

  /* ---- Lines ---- */
  --rule:         rgba(33, 30, 22, 0.14);
  --rule-strong:  rgba(33, 30, 22, 0.26);
  --rule-on-dark: rgba(236, 230, 214, 0.15);

  /* ---- Status colours ---- */
  --status-available: #4f6b46;
  --status-reserved:  #9d7c3c;
  --status-sold:      #7a3b44;

  /* ---- Type ---- */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Fluid type scale ---- */
  --step--2: clamp(0.72rem, 0.69rem + 0.12vw, 0.78rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
  --step-0:  clamp(1rem, 0.95rem + 0.24vw, 1.14rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(1.95rem, 1.6rem + 1.7vw, 2.95rem);
  --step-4:  clamp(2.5rem, 1.8rem + 3.1vw, 4.8rem);
  --step-5:  clamp(3rem, 1.95rem + 5.4vw, 6.8rem);

  /* ---- Layout & shape ---- */
  --container: 1220px;
  --container-narrow: 760px;
  --gutter: clamp(1.2rem, 4vw, 3.25rem);
  --section-y: clamp(4.75rem, 8.5vw, 10.5rem);
  --radius: 3px;
  --radius-lg: 6px;
  --shadow-sm: 0 6px 18px -12px rgba(21, 23, 15, 0.5);
  --shadow: 0 22px 60px -34px rgba(21, 23, 15, 0.6);
  --shadow-lg: 0 40px 90px -45px rgba(21, 23, 15, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--brand-dark);
}
h1 { font-size: var(--step-5); line-height: 1.0; letter-spacing: -0.012em; }
h2 { font-size: var(--step-4); line-height: 1.04; letter-spacing: -0.01em; }
h3 { font-size: var(--step-2); font-weight: 600; }
h4 { font-size: var(--step-1); font-weight: 600; letter-spacing: 0; }
p { max-width: 66ch; }

.display-italic { font-style: italic; font-weight: 400; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
}
.eyebrow::before {
  content: "";
  width: 2em; height: 1px;
  background: currentColor;
  opacity: 0.65;
}
.on-dark .eyebrow, .eyebrow.on-dark { color: var(--gold-soft); }

.lead { font-size: var(--step-1); line-height: 1.58; color: var(--text-muted); font-weight: 400; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.measure { max-width: 60ch; }
.measure-mx { max-width: 60ch; margin-inline: auto; }

/* ---- Layout ---- */
.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - var(--gutter) * 2, var(--container-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 5vw, 5rem); }
.section--dark { background: var(--noir); color: var(--on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--cream); }
.section--paper2 { background: var(--paper-2); }
.section--forest { background: var(--forest-deep); color: var(--on-dark); }
.section--forest h2, .section--forest h3 { color: var(--cream); }

.section-head { max-width: 62ch; margin-bottom: clamp(2.2rem, 4vw, 3.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 1.1rem; }
.section-head h2 { margin-bottom: 0.7rem; }

.stack > * + * { margin-top: 1.1rem; }
.flow > * + * { margin-top: 1.5rem; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --btn-bg: var(--brand-dark);
  --btn-fg: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 1.7em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn svg { width: 1.05em; height: 1.05em; }
.btn--gold { --btn-bg: var(--gold); --btn-fg: #211a0c; }
.btn--gold:hover { --btn-bg: var(--gold-soft); }
.btn--light { --btn-bg: var(--cream); --btn-fg: var(--brand-dark); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.btn--ghost:hover { --btn-bg: var(--brand-dark); --btn-fg: var(--cream); box-shadow: none; }
.on-dark .btn--ghost, .btn--ghost.on-dark {
  --btn-fg: var(--cream); box-shadow: inset 0 0 0 1px var(--rule-on-dark);
}
.on-dark .btn--ghost:hover { --btn-bg: var(--cream); --btn-fg: var(--brand-dark); }

.textlink {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-weight: 600; font-size: var(--step--1);
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--gold-deep);
  padding-bottom: 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold-deep) 40%, transparent);
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}
.textlink:hover { gap: 0.9em; color: var(--gold); }
.on-dark .textlink, .textlink.on-dark { color: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-soft) 40%, transparent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* =========================================================================
   Header / navigation
   ========================================================================= */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 1.05rem;
}
.site-header.is-solid {
  background: color-mix(in srgb, var(--noir) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--rule-on-dark);
  box-shadow: 0 10px 40px -30px rgba(0,0,0,0.8);
}

.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--cream); }
.brand__crest { width: 34px; height: 40px; flex: none; color: var(--gold); }
.brand__mark { width: 52px; height: auto; flex: none; color: var(--gold); }
.brand__text { display: flex; flex-direction: column; line-height: 1; color: inherit; }
.brand__name {
  font-family: "Pinyon Script", var(--font-display), cursive;
  font-size: 2rem; line-height: 0.86; color: var(--cream);
  padding-top: 0.12em;
}
.brand__text small {
  font-family: var(--font-body); font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold-soft); margin-top: 0.34rem;
}

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 1.6vw, 1.9rem); }
.nav__link {
  font-size: var(--step--1); font-weight: 500; letter-spacing: 0.02em;
  color: var(--on-dark); position: relative; padding-block: 0.4rem;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width 0.3s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--cream); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { width: 100%; }

/* Language switcher */
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rule-on-dark); border-radius: 100px;
  overflow: hidden; font-size: var(--step--2); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.lang-switch a {
  padding: 0.45em 0.85em; color: var(--on-dark-muted);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.lang-switch a[aria-current="true"] { background: var(--gold); color: #211a0c; }
.lang-switch a:not([aria-current="true"]):hover { color: var(--cream); }

.nav-toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav-toggle span {
  position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--cream);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 940px) {
  .nav-toggle { display: block; z-index: 70; }

  /* The fixed full-screen menu must resolve against the viewport. A filtered
     ancestor becomes the containing block for fixed children, so the header's
     .is-solid backdrop-filter would trap the menu inside the thin header bar.
     Drop the blur on mobile and keep the bar opaque instead — visually ~equal. */
  .site-header.is-solid {
    background: color-mix(in srgb, var(--noir) 96%, transparent);
    backdrop-filter: none;
  }

  .nav {
    position: fixed; inset: 0; z-index: 65;
    /* "safe center" keeps the menu vertically centred when it fits, but falls
       back to top-aligned (fully scrollable) on short/landscape screens so no
       link is pushed above the viewport and made unreachable. */
    flex-direction: column; justify-content: safe center;
    gap: 1.6rem; background: color-mix(in srgb, var(--noir) 97%, transparent);
    backdrop-filter: blur(8px);
    transform: translateX(100%); transition: transform 0.4s var(--ease);
    padding: max(2rem, env(safe-area-inset-top)) 2rem max(2rem, env(safe-area-inset-bottom));
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .nav.is-open { transform: translateX(0); }
  .nav__link { font-size: 1.5rem; font-family: var(--font-display); }
  .nav .lang-switch { margin-top: 1rem; }

  /* While the menu is open: lock the page behind it (robust on iOS Safari via
     position:fixed, not just overflow:hidden), lift the header above the
     contact bar, and hide the bar so it can't overlap or steal taps. */
  body.nav-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
  body.nav-open .site-header { z-index: 90; }
  body.nav-open .mobilebar { display: none; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  color: var(--on-dark); overflow: hidden;
  background: var(--noir);
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg::before {
  /* layered atmosphere: misty dawn paddock */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 75% 15%, rgba(191,157,94,0.16), transparent 55%),
    radial-gradient(140% 120% at 20% 100%, rgba(44,58,44,0.65), transparent 60%),
    linear-gradient(160deg, #1b2018 0%, #11140d 55%, #0c0e08 100%);
}
.hero__bg::after {
  /* fine film grain */
  content: ""; position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero__vignette {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(95deg, rgba(10,12,8,0.80) 0%, rgba(10,12,8,0.46) 36%, rgba(10,12,8,0.12) 62%, transparent 82%),
    linear-gradient(180deg, rgba(10,12,8,0.45) 0%, transparent 26%, transparent 52%, rgba(10,12,8,0.82) 100%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(3.5rem, 8vh, 7rem); padding-top: 8rem; }
.hero .eyebrow { color: var(--gold-soft); margin-bottom: 1.6rem; }
.hero h1 { color: var(--cream); max-width: 16ch; margin-bottom: 1.6rem; }
.hero h1 em { color: var(--gold-soft); }
.hero__sub { font-size: var(--step-1); line-height: 1.55; max-width: 52ch; color: var(--on-dark); margin-bottom: 2.4rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; z-index: 3; transform: translateX(-50%);
  font-size: var(--step--2); letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--on-dark-muted); display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.scroll-cue::after { content: ""; width: 1px; height: 42px; background: linear-gradient(var(--gold-soft), transparent); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%,100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* =========================================================================
   Placeholder media (swap for real photos/video)
   ========================================================================= */
.media { position: relative; overflow: hidden; background: var(--noir-2); border-radius: var(--radius); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.ratio-portrait { aspect-ratio: 4 / 5; }
.ratio-landscape { aspect-ratio: 3 / 2; }
.ratio-wide { aspect-ratio: 16 / 9; }
.ratio-square { aspect-ratio: 1 / 1; }

.ph {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.9rem; color: var(--gold-soft); overflow: hidden;
}
.ph::after {
  content: ""; position: absolute; inset: 0; opacity: 0.6; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}
.ph__crest { width: 30%; max-width: 64px; height: auto; opacity: 0.55; position: relative; z-index: 1; }
.ph__label {
  position: relative; z-index: 1;
  font-size: var(--step--2); letter-spacing: 0.22em; text-transform: uppercase;
  color: color-mix(in srgb, var(--gold-soft) 75%, transparent); font-weight: 600;
}
.ph--v0 { background: linear-gradient(150deg, #2a3526, #161c12); }
.ph--v1 { background: linear-gradient(150deg, #2f2a1c, #16130c); }
.ph--v2 { background: linear-gradient(150deg, #25302c, #121712); }
.ph--v3 { background: linear-gradient(150deg, #322a26, #181210); }
.ph--v4 { background: linear-gradient(150deg, #283022, #14180f); }
.ph--v5 { background: linear-gradient(150deg, #2c2922, #161410); }

/* =========================================================================
   Intro / statement
   ========================================================================= */
.intro-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.intro-statement { font-family: var(--font-display); font-weight: 500; font-size: var(--step-3); line-height: 1.18; letter-spacing: -0.005em; color: var(--brand-dark); }
.intro-statement em { color: var(--gold-deep); font-style: italic; }
@media (max-width: 820px) { .intro-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   Pillars (numbered craft steps)
   ========================================================================= */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule-on-dark); border: 1px solid var(--rule-on-dark); border-radius: var(--radius-lg); overflow: hidden; }
.pillar { background: var(--noir); padding: clamp(2rem, 3vw, 3rem); display: flex; flex-direction: column; gap: 1rem; }
.pillar__no { font-family: var(--font-display); font-size: var(--step-2); color: var(--gold); font-weight: 420; }
.pillar h3 { color: var(--cream); }
.pillar p { color: var(--on-dark-muted); font-size: var(--step-0); }
@media (max-width: 820px) { .pillars { grid-template-columns: 1fr; } }

/* =========================================================================
   Horse cards
   ========================================================================= */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: clamp(1.4rem, 2.5vw, 2.2rem); }

.horse-card { display: flex; flex-direction: column; background: var(--cream); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease); }
.horse-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--rule-strong); }
.horse-card__media { position: relative; }
.horse-card__media .media { border-radius: 0; }
.horse-card:hover .horse-card__media .ph { transform: scale(1.04); transition: transform 0.7s var(--ease); }
.horse-card__badges { position: absolute; top: 0.9rem; left: 0.9rem; display: flex; gap: 0.5rem; z-index: 2; }
.horse-card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.horse-card__name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 480; line-height: 1.1; color: var(--brand-dark); }
.horse-card__meta { font-size: var(--step--1); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.4em 0.9em; }
.horse-card__meta b { font-weight: 600; color: var(--text); }
.horse-card__lines { font-size: var(--step--1); color: var(--text-muted); border-top: 1px solid var(--rule); padding-top: 0.8rem; margin-top: 0.2rem; }
.horse-card__lines span { color: var(--gold-deep); font-weight: 600; }
.horse-card__foot { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; justify-content: space-between; }
.horse-card__price { font-size: var(--step--1); color: var(--text-muted); }
.horse-card.is-sold { opacity: 0.85; }

/* status badge */
.badge {
  font-size: var(--step--2); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.4em 0.75em; border-radius: 100px; color: #fff; line-height: 1; backdrop-filter: blur(2px);
}
.badge--available { background: color-mix(in srgb, var(--status-available) 92%, transparent); }
.badge--reserved { background: color-mix(in srgb, var(--status-reserved) 92%, transparent); color: #2a200c; }
.badge--sold { background: color-mix(in srgb, var(--status-sold) 92%, transparent); }
.badge--new { background: color-mix(in srgb, var(--noir) 80%, transparent); color: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--rule-on-dark); }
.badge--cat { background: var(--cream); color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--rule); }
/* "Våra hästar" status badges */
.badge--racing { background: color-mix(in srgb, var(--status-available) 92%, transparent); }
.badge--training { background: color-mix(in srgb, var(--status-reserved) 92%, transparent); color: #2a200c; }
.badge--breeding { background: color-mix(in srgb, var(--oxblood) 92%, transparent); }
.badge--retired { background: color-mix(in srgb, var(--stone) 90%, transparent); }

/* =========================================================================
   Filter bar
   ========================================================================= */
.filterbar { background: var(--cream); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 2.4rem; }
.filterbar__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; align-items: end; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-size: var(--step--2); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.field select, .field input, .form-field select, .form-field input, .form-field textarea {
  width: 100%; padding: 0.75em 0.9em; background: var(--paper); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); font-size: var(--step--1); color: var(--text); transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field select:focus, .form-field :focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); outline: none; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235d5746' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9em center; padding-right: 2.4em; }
.filterbar__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.results-count { font-size: var(--step--1); color: var(--text-muted); }
.results-count b { color: var(--brand-dark); font-weight: 700; }
.filter-reset { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--step--1); font-weight: 600; color: var(--gold-deep); }
.filter-reset:hover { color: var(--gold); }
.toggle { display: inline-flex; align-items: center; gap: 0.55em; font-size: var(--step--1); color: var(--text-muted); cursor: pointer; }
.toggle input { width: 1.05em; height: 1.05em; accent-color: var(--gold-deep); }
.no-results { text-align: center; padding: 4rem 1rem; color: var(--text-muted); font-size: var(--step-1); display: none; }
.is-empty .no-results { display: block; }

/* Empty state — shown when there is no inventory to list (e.g. no horses for sale) */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 32rem; margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
}
.empty-state__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 78px; height: 78px; border-radius: 50%; margin-bottom: 1.7rem;
  color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-deep) 28%, transparent);
}
.empty-state__icon svg { width: 38px; height: 38px; }
.empty-state__title {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 500;
  line-height: 1.16; letter-spacing: -0.005em; color: var(--brand-dark);
}
.empty-state__sub { margin-top: 0.7rem; color: var(--text-muted); font-size: var(--step-0); }
.empty-state__cta { margin-top: 1.9rem; }

/* Error pages (404 / 500) & removed-content state — echoes the empty-state
   visual language (gold disc, serif) so failures still feel on-brand. */
.error-page { min-height: 60vh; display: flex; align-items: center; }
.error-page__inner {
  max-width: 40rem; margin-inline: auto; text-align: center;
  padding-block: clamp(2rem, 6vw, 4rem);
  animation: errorIn 0.7s var(--ease) both;
}
.error-page__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 50%; margin-bottom: 1.5rem;
  color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-deep) 28%, transparent);
}
.error-page__badge svg { width: 38px; height: auto; }
.error-page__code {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(3.2rem, 11vw, 5.6rem); line-height: 0.95;
  letter-spacing: 0.01em; color: var(--gold-deep); margin-bottom: 0.5rem;
}
.error-page__title {
  font-family: var(--font-display); font-weight: 500; font-size: var(--step-3);
  line-height: 1.12; letter-spacing: -0.01em; color: var(--brand-dark);
  max-width: 20ch; margin-inline: auto;
}
.error-page__text {
  margin: 1.1rem auto 0; max-width: 46ch;
  color: var(--text-muted); font-size: var(--step-0); line-height: 1.6;
}
.error-page__actions {
  margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center;
}
.error-page__contextual { margin-top: 1.1rem; }
.error-page__contextual:empty { display: none; }
@keyframes errorIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .error-page__inner { animation: none; } }

/* =========================================================================
   Horse detail
   ========================================================================= */
.horse-hero { padding-top: calc(4.5rem + 60px); padding-bottom: 0; }
.horse-detail { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
@media (max-width: 900px) { .horse-detail { grid-template-columns: 1fr; } }

.gallery-main { margin-bottom: 1rem; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.7rem; }
.gallery-thumbs .media { cursor: pointer; }

.horse-headline { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.8rem; }
.horse-headline h1 { font-size: var(--step-4); }
.horse-headline .badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step-0); vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--text-muted); width: 42%; font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0.04em; }
.spec-table td { font-weight: 500; color: var(--text); }

.detail-block { margin-top: 2.6rem; }
.detail-block > .eyebrow { margin-bottom: 1rem; }
.detail-block h2, .detail-block h3 { font-size: var(--step-2); margin-bottom: 0.9rem; }

/* race-record stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--cream); padding: 1.3rem 1.1rem; text-align: center; }
.stat__num { font-family: var(--font-display); font-size: var(--step-2); font-weight: 460; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--step--2); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.35rem; }

/* pedigree bracket */
.pedigree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; font-size: var(--step--1); }
.ped-col { display: grid; gap: 0.7rem; }
.ped-col--2 { grid-template-rows: repeat(2, 1fr); }
.ped-col--3 { grid-template-rows: repeat(4, 1fr); }
.ped-cell { background: var(--cream); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: var(--radius); padding: 0.7rem 0.85rem; display: flex; flex-direction: column; justify-content: center; }
.ped-cell small { display: block; font-size: var(--step--2); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.2rem; }
.ped-cell b { font-weight: 600; color: var(--brand-dark); font-family: var(--font-display); font-size: var(--step-0); }
.ped-cell.is-empty { opacity: 0.5; }
@media (max-width: 620px) { .pedigree { grid-template-columns: 1fr; } .ped-col--2, .ped-col--3 { grid-template-rows: none; } }

/* sidebar inquiry */
.inquiry-card { background: var(--noir); color: var(--on-dark); border-radius: var(--radius-lg); padding: clamp(1.6rem, 3vw, 2.2rem); position: sticky; top: 90px; }
.inquiry-card h3 { color: var(--cream); margin-bottom: 0.4rem; }
.inquiry-card .lead { color: var(--on-dark-muted); font-size: var(--step-0); margin-bottom: 1.4rem; }
.inquiry-contacts { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule-on-dark); }
.inquiry-contacts a { display: flex; align-items: center; gap: 0.7rem; color: var(--on-dark); font-weight: 500; }
.inquiry-contacts a:hover { color: var(--gold-soft); }
.inquiry-contacts svg { width: 1.1em; height: 1.1em; color: var(--gold); flex: none; }
.price-pill { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 1.2rem; }

/* =========================================================================
   Forms
   ========================================================================= */
.form-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-field label { font-size: var(--step--2); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-muted); }
.on-paper .form-field label { color: var(--text-muted); }
.inquiry-card .form-field input, .inquiry-card .form-field textarea, .inquiry-card .form-field select {
  background: color-mix(in srgb, var(--cream) 8%, transparent); border-color: var(--rule-on-dark); color: var(--cream);
}
.inquiry-card .form-field input::placeholder, .inquiry-card .form-field textarea::placeholder { color: var(--on-dark-faint); }
.form-field textarea { resize: vertical; min-height: 110px; }
.req { color: var(--gold); }
.consent { flex-direction: row; align-items: flex-start; gap: 0.6rem; }
.consent input { margin-top: 0.3rem; width: 1.05em; height: 1.05em; flex: none; accent-color: var(--gold); }
.consent label { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--step--2); line-height: 1.5; }
.form-success { display: none; padding: 1rem 1.2rem; background: color-mix(in srgb, var(--status-available) 22%, transparent); border: 1px solid var(--status-available); border-radius: var(--radius); color: var(--cream); font-size: var(--step--1); margin-bottom: 1rem; }
.form-success.is-visible { display: block; }
/* Shown by main.js only when a submission actually fails (never a silent loss). */
.form-error { padding: 1rem 1.2rem; background: color-mix(in srgb, #a3312b 20%, transparent); border: 1px solid #a3312b; border-radius: var(--radius); color: var(--cream); font-size: var(--step--1); margin-bottom: 1rem; }
.on-paper .form-error { color: #7a231f; }

/* =========================================================================
   Bloodline cards
   ========================================================================= */
.bloodline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1.2rem, 2vw, 1.8rem); }
.bloodline-card { background: var(--noir-3); border: 1px solid var(--rule-on-dark); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.4s var(--ease), border-color 0.4s; }
.bloodline-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.bloodline-card__body { padding: 1.5rem; }
.bloodline-card h3 { color: var(--cream); font-size: var(--step-2); }
.bloodline-card .line-tag { font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-soft); font-weight: 600; }
.bloodline-card p { color: var(--on-dark-muted); font-size: var(--step--1); margin-top: 0.7rem; }

/* =========================================================================
   News cards
   ========================================================================= */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(1.4rem, 2.5vw, 2.2rem); }
.news-card { display: flex; flex-direction: column; background: var(--cream); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.news-card__cat { font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--gold-deep); }
.news-card__date { font-size: var(--step--2); color: var(--text-faint); letter-spacing: 0.05em; }
.news-card h3 { font-size: var(--step-1); }
.news-card p { font-size: var(--step--1); color: var(--text-muted); }
.news-card .textlink { margin-top: auto; padding-top: 0.8rem; }

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery-masonry { columns: 3 260px; column-gap: clamp(0.8rem, 1.5vw, 1.2rem); }
.gallery-masonry .media { margin-bottom: clamp(0.8rem, 1.5vw, 1.2rem); break-inside: avoid; border-radius: var(--radius-lg); }

/* =========================================================================
   Values / about
   ========================================================================= */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.value h4 { font-family: var(--font-display); margin-bottom: 0.5rem; color: var(--brand-dark); }
.value h4::before { content: ""; display: block; width: 30px; height: 2px; background: var(--gold); margin-bottom: 0.9rem; }
.value p { font-size: var(--step--1); color: var(--text-muted); }
@media (max-width: 760px) { .value-grid { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split--reverse > :first-child { order: 2; }
@media (max-width: 820px) { .split, .split--reverse { grid-template-columns: 1fr; } .split--reverse > :first-child { order: 0; } }
.prose p + p { margin-top: 1.1rem; }

/* =========================================================================
   CTA band
   ========================================================================= */
.cta-band { position: relative; overflow: hidden; background: var(--forest-deep); color: var(--on-dark); text-align: center; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 120% at 50% 0%, rgba(191,157,94,0.16), transparent 60%); }
.cta-band__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0.32; }
.cta-band__inner { position: relative; z-index: 1; padding-block: clamp(4rem, 8vw, 7rem); display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.cta-band h2 { color: var(--cream); max-width: 18ch; }
.cta-band p { color: var(--on-dark-muted); max-width: 52ch; }

/* =========================================================================
   Contact
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-detail { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.contact-detail svg { width: 1.4em; height: 1.4em; color: var(--gold-deep); flex: none; margin-top: 0.2rem; }
.contact-detail b { display: block; font-family: var(--font-display); font-size: var(--step-1); color: var(--brand-dark); }
.contact-detail a:hover { color: var(--gold-deep); }
.map-embed { width: 100%; aspect-ratio: 16/10; border: 1px solid var(--rule); border-radius: var(--radius-lg); margin-top: 1.5rem; filter: grayscale(0.3) contrast(1.05); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--noir); color: var(--on-dark-muted); padding-top: clamp(3.5rem, 6vw, 5.5rem); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: clamp(2rem, 4vw, 3.5rem); padding-bottom: 3rem; }
.footer-brand .brand__text { color: var(--cream); }
.footer-brand p { margin-top: 1rem; max-width: 32ch; font-size: var(--step--1); color: var(--on-dark-muted); }
.footer-col h4 { font-family: var(--font-body); font-size: var(--step--2); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 1.1rem; font-weight: 700; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: var(--step--1); color: var(--on-dark-muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--cream); }
.footer-sibling { font-size: var(--step--1); color: var(--on-dark-muted); }
.footer-sibling a { color: var(--gold-soft); border-bottom: 1px solid color-mix(in srgb, var(--gold-soft) 35%, transparent); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.8rem; border-top: 1px solid var(--rule-on-dark); font-size: var(--step--2); letter-spacing: 0.03em; }
.socials { display: flex; gap: 0.8rem; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--rule-on-dark); border-radius: 50%; transition: border-color 0.25s, color 0.25s; }
.socials a:hover { border-color: var(--gold); color: var(--gold-soft); }
.socials svg { width: 18px; height: 18px; }
@media (max-width: 820px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }

/* =========================================================================
   Utilities & reveal animation
   ========================================================================= */
.skip-link { position: absolute; left: 0.5rem; top: 0.5rem; transform: translateY(-150%); background: var(--cream); color: var(--brand-dark); padding: 0.7em 1.1em; border-radius: var(--radius); z-index: 100; transition: transform 0.2s; }
.skip-link:focus { transform: translateY(0); }

.page-head { padding-top: calc(var(--section-y) + 60px); padding-bottom: 0; }
.page-head .eyebrow { margin-bottom: 1.2rem; }
.page-head h1 { max-width: 18ch; margin-bottom: 1rem; }
.page-head .lead { max-width: 56ch; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.divider { height: 1px; background: var(--rule); border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { font-size: var(--step--2); letter-spacing: 0.04em; padding: 0.4em 0.8em; border-radius: 100px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-deep); font-weight: 600; }

/* =========================================================================
   Real logo image — auto-swaps in when a file is added to assets/img/
   ========================================================================= */
.brand__logo { height: 68px; width: auto; display: block; }
.brand__logo--footer { height: 120px; }
@media (max-width: 600px) { .brand__logo { height: 54px; } }

/* =========================================================================
   Sold archive (collapsible <details>)
   ========================================================================= */
.sold-archive { border-top: 1px solid var(--rule); }
.sold-details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.4rem 1.4rem; }
.sold-details > summary::-webkit-details-marker { display: none; }
.sold-details > summary .eyebrow { grid-column: 1; }
.sold-details__title { grid-column: 1; }
.sold-details__title h2 { font-size: var(--step-2); margin: 0.3rem 0 0.4rem; }
.sold-details__chev { grid-column: 2; grid-row: 1 / span 3; font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--gold-deep); width: 50px; height: 50px; flex: none; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; transition: transform 0.35s var(--ease); }
.sold-details[open] .sold-details__chev { transform: rotate(45deg); }
.sold-grid { margin-top: 2rem; }

/* =========================================================================
   Mobile sticky contact bar (conversion)
   ========================================================================= */
.mobilebar { display: none; }
@media (max-width: 760px) {
  .mobilebar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: var(--rule-on-dark);
    box-shadow: 0 -12px 32px -18px rgba(0, 0, 0, 0.75);
  }
  .mobilebar__btn {
    display: flex; align-items: center; justify-content: center; gap: 0.55em;
    min-height: 58px; font-size: var(--step--1); font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
  }
  .mobilebar__btn svg { width: 1.15em; height: 1.15em; }
  .mobilebar__call { background: var(--noir); color: var(--cream); }
  .mobilebar__inq { background: var(--gold); color: #211a0c; }
  body { padding-bottom: 58px; }
  .nav__link { padding-block: 0.7rem; }
  .btn { padding: 1.05em 1.7em; }
  .lang-switch a { padding: 0.6em 1em; }
}
