/* ============================================================
   COUDELARIA JCL — Main website
   Builds on css/horses.css (the shared horse-page stylesheet)
   ============================================================ */

/* --- Top bar ----------------------------------------------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: rgba(10, 9, 8, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.topbar .container {
  width: min(calc(100% - 80px), var(--max));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand .jcl { font-size: 0.9em; color: var(--gold); }
.topnav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.86rem;
  color: var(--muted);
}
.topnav a { transition: color 0.2s; }
.topnav a:hover { color: var(--gold); }
.topnav .btn { min-height: 42px; padding: 0 20px; font-size: 0.84rem; color: #17120a; }

/* --- Hero (home) ------------------------------------------- */
.hero-home .hero-media { background-position: center 30%; }
.hero-home h1 { max-width: 11ch; }
.hero-credit {
  position: absolute;
  right: 28px;
  bottom: 22px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 14px;
}
.hero-credit .credit-photo { font-style: italic; }
.hero-credit .credit-person { color: var(--gold-bright); }

/* --- Distinctions strip ------------------------------------ */
.stats-grid.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat a { color: var(--gold-soft); }
.stat a:hover { color: var(--gold); }
.stat-horse {
  display: block;
  margin-top: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

/* --- Profile cards (horses with their own page) ------------- */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 42px;
}
.profile-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.profile-card:hover { border-color: var(--line); transform: translateY(-4px); }
.profile-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #120f0d;
}
.profile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.profile-card:hover .profile-media img { transform: scale(1.04); }
.profile-media .gallery-caption { opacity: 0; }
.profile-card:hover .profile-media .gallery-caption { opacity: 1; }
.profile-badges {
  position: absolute;
  top: 16px; left: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(12, 11, 10, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge-sale {
  background: linear-gradient(135deg, var(--gold), #b59458);
  border-color: transparent;
  color: #17120a;
  font-weight: 600;
}
.profile-body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.profile-body small {
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.profile-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  margin: 10px 0 12px;
}
.profile-body p { color: var(--muted); font-size: 0.93rem; margin: 0 0 20px; flex: 1; }
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.profile-link svg { transition: transform 0.25s var(--ease); }
.profile-card:hover .profile-link svg { transform: translate(3px, -3px); }

/* --- Roster (all horses) ------------------------------------ */
.roster-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 42px;
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--line); color: var(--text); }
.chip.active {
  border-color: var(--gold);
  color: #17120a;
  background: linear-gradient(135deg, var(--gold), #b59458);
}
.roster-search input {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  width: 240px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}
.roster-search input:focus { border-color: var(--gold-soft); }
.roster-search input::placeholder { color: #8d8478; }

.roster-group { margin-top: 56px; }
.roster-group-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.roster-group-title span {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.horse-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #110f0d;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.horse-card:hover { border-color: var(--line); transform: translateY(-3px); }
.horse-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(211, 183, 122, 0.12), transparent 60%),
    #15120f;
}
.horse-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.horse-card:hover .horse-card-media img { transform: scale(1.05); }
.horse-card-media .badge { position: absolute; top: 12px; left: 12px; }
.horse-card-media .badge-sale {
  left: 10px; right: auto; top: 10px;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}
.profile-badges .badge-sale { white-space: nowrap; }
.placeholder-mark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--gold-soft);
}
.placeholder-mark b {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.4rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(211, 183, 122, 0.55);
}
.placeholder-mark span {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8d8478;
}
.horse-card-body { padding: 16px 18px 18px; }
.horse-card-body h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.1;
}
.horse-card-body p { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.horse-card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.roster-empty { color: var(--muted); margin-top: 32px; display: none; }

/* --- Horse detail dialog ----------------------------------- */
.horse-dialog {
  width: min(calc(100% - 32px), 1080px);
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: #0f0d0c;
  color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.horse-dialog::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px); }
.horse-dialog[open] { animation: dialogFade 0.35s var(--ease) both; }
@keyframes dialogFade { from { opacity: 0; } to { opacity: 1; } }
.dialog-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 11, 10, 0.6);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}
.dialog-close:hover { background: rgba(211, 183, 122, 0.4); }
.dialog-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.dialog-media { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dialog-main {
  border-radius: 18px;
  overflow: hidden;
  background: #15120f;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  position: relative;
}
.dialog-main img { width: 100%; height: 100%; object-fit: cover; }
.dialog-main.no-photo { cursor: default; }
.dialog-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.dialog-thumbs button {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: #15120f;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}
.dialog-thumbs button:hover, .dialog-thumbs button.active { opacity: 1; border-color: var(--gold-soft); }
.dialog-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dialog-video { border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.dialog-video iframe, .dialog-video video { width: 100%; height: 100%; border: 0; display: block; }
.dialog-copy { padding: 44px 40px 36px 18px; }
.dialog-copy h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 0.95;
  margin: 16px 0 22px;
  letter-spacing: -0.02em;
}
.dialog-copy .facts { margin-bottom: 22px; }
.dialog-copy .fact { grid-template-columns: 96px 1fr; }
.dialog-copy p { color: var(--muted); font-size: 0.95rem; margin: 0 0 14px; }
.dialog-copy .fact-value a { color: var(--gold); }
.dialog-pedigree { margin-top: 22px; }
.dialog-pedigree small {
  display: block;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  margin-bottom: 10px;
}
.dialog-pedigree button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: #f3efe9;
}
.dialog-pedigree img { width: 100%; }


/* --- Pedigree card (HTML version of the printed pedigree cards) --- */
.ped-card {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1.25fr;
  align-items: stretch;
  gap: 0;
  padding: 18px 16px;
  border-radius: 14px;
  background: #f3efe9;
  color: #1d1a16;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.pc-subject {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  padding-right: 10px;
  white-space: nowrap;
}
.pc-col { display: flex; flex-direction: column; justify-content: space-around; }
.pc-parents { border-left: 1.5px solid #3a342c; padding-left: 12px; gap: 18px; }
.pc-grand { padding-left: 10px; gap: 10px; }
.pc-pair { border-left: 1.5px solid #3a342c; padding-left: 12px; display: flex; flex-direction: column; gap: 8px; }
.pc-horse { display: flex; flex-direction: column; line-height: 1.25; }
.pc-horse b { font-size: 0.8rem; font-weight: 700; }
.pc-horse i { font-size: 0.68rem; color: #5a5249; margin-top: 2px; }
.pc-horse em { font-style: normal; font-size: 0.62rem; letter-spacing: 0.04em; color: #8a6d35; margin-top: 3px; }

/* --- Contact extras ---------------------------------------- */
.contact-grid-4 { grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr; }
.map-frame {
  margin-top: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  height: 360px;
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: grayscale(0.6) invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}

/* --- Language switch --------------------------------------- */
.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch a {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.lang-switch a[aria-current="true"] { background: rgba(211, 183, 122, 0.18); color: var(--gold-bright); }
.lang-switch a:hover { color: var(--gold); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- WhatsApp enquiry form --------------------------------- */
.enquiry-panel {
  margin-top: 42px;
  padding: 36px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 0% 0%, rgba(211, 183, 122, 0.12), transparent 45%),
    rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: start;
}
.enquiry-intro h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 600;
  line-height: 0.95;
  margin: 18px 0 14px;
}
.enquiry-intro p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.enquiry-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field span {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d3b77a' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field select option, .field select optgroup { background: #15120f; color: var(--text); }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-soft); }
.field textarea::placeholder { color: #8d8478; }
.enquiry-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.enquiry-actions small { color: #8d8478; font-size: 0.8rem; }
.enquiry-panel + .contact-panel { margin-top: 22px; }

.dialog-ask { margin-top: 24px; gap: 4px; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 1100px) {
  .topbar .container { width: min(calc(100% - 48px), var(--max)); }
  .profiles-grid { grid-template-columns: repeat(2, 1fr); }
  .roster-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid.stats-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid-4 { grid-template-columns: 1fr; }
  .enquiry-panel { grid-template-columns: 1fr; gap: 28px; }
  .topnav { gap: 20px; }
  .topnav > a:nth-of-type(3) { display: none; }
}
@media (max-width: 860px) {
  .dialog-inner { grid-template-columns: 1fr; }
  .dialog-copy { padding: 6px 24px 30px; }
  .dialog-media { padding: 16px 16px 0; }
}
@media (max-width: 720px) {
  .topbar .container { width: min(calc(100% - 28px), var(--max)); height: 64px; }
  .topnav > a:not(.btn) { display: none; }
  .topnav { gap: 14px; }
  .topnav .btn { width: auto; min-height: 38px; padding: 0 16px; }
  .horse-card-media .badge-sale { font-size: 0.5rem; letter-spacing: 0.06em; padding: 4px 8px; top: 8px; left: 8px; max-width: calc(100% - 16px); }
  .placeholder-mark { padding-top: 26px; }
  .placeholder-mark b { font-size: 2.4rem; }
  .placeholder-mark span { font-size: 0.56rem; }
  .enquiry-panel { padding: 24px 20px; gap: 22px; }
  .enquiry-fields { grid-template-columns: 1fr; }
  .enquiry-actions .btn { width: 100%; }
  .dialog-ask { width: 100%; }
  .ped-card { padding: 14px 10px; grid-template-columns: 0.6fr 1fr 1.2fr; }
  .pc-horse b { font-size: 0.72rem; }
  .pc-subject { font-size: 0.64rem; padding-right: 6px; }
  .pc-horse i { font-size: 0.6rem; }
  .brand { font-size: 1.25rem; }
  .hero-home .hero-media { background-position: 32% center; }
  .hero-credit { right: 16px; bottom: 14px; }
  .profiles-grid { grid-template-columns: 1fr; }
  .roster-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stats-grid.stats-4 { grid-template-columns: 1fr; }
  .horse-card-body { padding: 12px 12px 14px; }
  .horse-card-body h4 { font-size: 1.15rem; }
  .horse-card-body p { font-size: 0.74rem; }
  .roster-search, .roster-search input { width: 100%; }
  .horse-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); border-radius: 20px; }
  .dialog-inner { max-height: calc(100vh - 16px); }
  .dialog-thumbs { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .map-frame { height: 280px; }
}
