/* ============================================
   HARAS TEMPRANILLO — Main Stylesheet
   ============================================ */

/* ----- CSS Custom Properties ----- */
:root {
  --color-primary: #82232B;
  --color-primary-dark: #5C181E;
  --color-primary-light: #A63038;
  --color-secondary: #B6EBFF;
  --color-bg: #FAF8F5;
  --color-text: #1A1A1A;
  --color-text-muted: #6B6B6B;
  --color-white: #FFFFFF;
  --color-border: #E8E4DF;
  --font-family: 'Inter', sans-serif;
  --font-family-serif: 'Playfair Display', serif;
  --container-max: 1200px;
  --nav-height: 72px;
  --transition-base: 0.3s ease;
}


/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Serif headings — Playfair Display */
.hero-content h1,
.home-farm-teaser h2,
.home-section h2,
.home-remate h2,
.home-contact-cta h2,
.page-header h1,
.horse-profile h1 {
  font-family: var(--font-family-serif);
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}


/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  line-height: 1.2;
}

h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 2.2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.2rem; font-weight: 600; }

p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

p:last-child { margin-bottom: 0; }


/* ============================================
   CONTAINER & LAYOUT UTILITIES
   ============================================ */

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.hidden { display: none !important; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 3rem; }


/* ============================================
   PAGE TRANSITION
   ============================================ */

#app {
  transition: opacity 0.2s ease;
  min-height: 100vh;
}


/* ============================================
   NAVBAR
   ============================================ */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

#navbar.scrolled,
#navbar.page-nav {
  background: rgba(250, 248, 245, 0.97);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
}

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

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 40px;
  width: auto;
  display: block;
  transition: opacity var(--transition-base);
}

/* Default (transparent/hero): show white, hide color */
.nav-logo-color { display: none; }
.nav-logo-white { display: block; }

/* Scrolled or inner page: show color, hide white */
#navbar.scrolled .nav-logo-color,
#navbar.page-nav .nav-logo-color { display: block; }

#navbar.scrolled .nav-logo-white,
#navbar.page-nav .nav-logo-white { display: none; }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition-base);
}

#navbar.scrolled .nav-links a,
#navbar.page-nav .nav-links a {
  color: var(--color-text);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: width var(--transition-base);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active::after {
  width: 100%;
  background-color: var(--color-primary);
}

.nav-links a:hover,
.nav-links a.active {
  color: inherit;
}

#navbar.scrolled .nav-links a.active,
#navbar.page-nav .nav-links a.active {
  color: var(--color-primary);
}

/* Language Toggle */
.lang-toggle {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  color: var(--color-white);
  background: transparent;
  transition: all var(--transition-base);
  cursor: pointer;
}

#navbar.scrolled .lang-toggle,
#navbar.page-nav .lang-toggle {
  border-color: var(--color-border);
  color: var(--color-text);
}

.lang-toggle:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition-base);
}

#navbar.scrolled .hamburger span,
#navbar.page-nav .hamburger span {
  background-color: var(--color-text);
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.nav-links.open {
  display: flex;
}


/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  /* fallback color */
  background-color: var(--color-primary-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  will-change: transform;
  animation: heroKenBurns 12s ease-in-out infinite alternate;
}

@keyframes heroKenBurns {
  from { transform: scale(1.0); }
  to { transform: scale(1.08); }
}

/* Bottom-heavy dark gradient overlay */
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.08) 35%,
    rgba(0, 0, 0, 0.55) 65%,
    rgba(0, 0, 0, 0.82) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 4rem 6rem;
  max-width: 760px;
  animation: heroFadeUp 1.2s ease both;
}

.hero-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.hero-logo-icon {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  color: var(--color-white);
}

.hero-logo-name {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.7);
}

.hero-content h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 2.5rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  max-width: 520px;
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  color: var(--color-white);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all var(--transition-base);
  background: transparent;
}

.hero-cta:hover {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-primary-dark);
}


/* ============================================
   HOME SECTIONS
   ============================================ */

/* Farm Teaser */
.home-farm-teaser {
  padding: 6rem 0;
  background: var(--color-bg);
}

.home-farm-teaser .teaser-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.teaser-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
}

.home-farm-teaser h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
  line-height: 1.25;
}

.home-farm-teaser p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.75;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap var(--transition-base);
}

.link-arrow::after {
  content: '→';
  transition: transform var(--transition-base);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* Accent strip */
.accent-strip {
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Section — generic */
.home-section {
  padding: 5rem 0;
}

.home-section.bg-white {
  background: var(--color-white);
}

.home-section.bg-light {
  background: var(--color-bg);
}

/* Section accent highlight */
.home-section.accent-border {
  border-top: 3px solid var(--color-secondary);
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.section-header-row h2 {
  margin-bottom: 0;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.section-link {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  white-space: nowrap;
  transition: color var(--transition-base);
}

.section-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-dark);
  text-underline-offset: 3px;
}

/* Remate Teaser (homepage) */
/* Remate Teaser — split layout */
.home-remate {
  display: flex;
  min-height: 420px;
  color: var(--color-white);
  position: relative;
}

.remate-photo-col {
  flex: 0 0 50%;
  position: relative;
  background-image: url('/images/remate.jpg');
  background-size: cover;
  background-position: center;
}

.remate-photo-col::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 40%, #82232B 100%);
}

.remate-text-col {
  flex: 0 0 50%;
  background: #82232B;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  gap: 1.25rem;
}

.home-remate h2 {
  color: var(--color-white);
  font-size: 2.4rem;
  font-family: var(--font-family-serif);
  margin-bottom: 0;
}

.home-remate p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin: 0;
  max-width: 420px;
  line-height: 1.7;
}

.home-remate .remate-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.25rem;
}

/* Notify me form (homepage remate teaser) */
.notify-form-inline {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  min-width: 300px;
}

.notify-form-inline input {
  flex: 1;
  padding: 11px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: 0.9rem;
  outline: none;
}

.notify-form-inline input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.notify-form-inline button {
  padding: 11px 20px;
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-base);
}

.notify-form-inline button:hover {
  background: var(--color-bg);
}

.notify-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Stats Band */
.home-stats {
  background: #1A1A1A;
  padding: 4rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-divider {
  display: none;
}

.stat-item {
  padding: 1rem 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* Contact CTA */
.home-contact-cta {
  padding: 7rem 0;
  background: #2A2A2A;
  text-align: center;
}

.home-contact-cta h2 {
  color: var(--color-white);
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.home-contact-cta p {
  color: rgba(255, 255, 255, 0.6);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}


/* ============================================
   PAGE HEADERS
   ============================================ */

.page-header {
  padding-top: 120px;
  padding-bottom: 60px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 { margin-bottom: 0.5rem; }

.page-header p {
  color: var(--color-text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}


/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  line-height: 1;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

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

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-secondary {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

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

.btn-outline-white {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

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


/* ============================================
   CARDS & GRID
   ============================================ */

.card-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image img {
  transform: scale(1.04);
}

.card-content,
.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.card-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}


/* ============================================
   MARE/LOT DETAIL MODAL
   ============================================ */

.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.72);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
}

.modal-content {
  background: var(--color-white);
  border-radius: 8px;
  max-width: 840px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.35s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-text);
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition-base);
  border: none;
}

.modal-close:hover {
  background: var(--color-border);
}

.modal-photos {
  width: 100%;
  overflow-x: auto;
  display: flex;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.modal-photo {
  width: 100%;
  min-width: 100%;
  height: 420px;
  object-fit: cover;
  scroll-snap-align: start;
  display: block;
}

.modal-info {
  padding: 2rem 2.5rem;
}

.modal-info h2 {
  margin-bottom: 1.5rem;
}

/* Pedigree tree display */
.modal-pedigree {
  margin-top: 1.5rem;
}

.modal-pedigree h4,
.modal-notes h4 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.pedigree-tree {
  display: grid;
  grid-template-columns: 2fr 1px 1fr;
  gap: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.9rem;
}

.pedigree-text-block {
  padding: 1rem 1.25rem;
  line-height: 1.65;
  font-size: 0.95rem;
  white-space: pre-wrap;
  color: var(--color-text);
}

.pedigree-divider {
  background: var(--color-border);
}

.pedigree-label-col {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  background: rgba(182, 235, 255, 0.18);
}

.pedigree-label-col span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.modal-notes {
  margin-top: 1.5rem;
}

.modal-notes p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.lot-badge-modal {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ============================================
   FARM PAGE
   ============================================ */

.farm-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.farm-story p {
  font-size: 1.15rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.farm-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--color-border);
}

.farm-values-title {
  grid-column: 1 / -1;
  margin-bottom: -0.5rem;
}

.value-card {
  padding: 1.5rem 1.25rem;
  border-left: 3px solid var(--color-primary);
  background: var(--color-white);
  border-radius: 0 6px 6px 0;
}

/* Blue accent on values */
.value-card:nth-child(3) {
  border-left-color: var(--color-secondary);
}

.value-card h4 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.value-card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}

.farm-location {
  margin-top: 3.5rem;
  padding: 2rem 2.5rem;
  background: rgba(182, 235, 255, 0.18);
  border: 1px solid var(--color-secondary);
  border-radius: 6px;
}

.farm-location h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.farm-location p {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.7;
}

/* ---- Farm Gallery ---- */
.farm-gallery-section {
  padding: 4rem 0 5rem;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.farm-gallery-section h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.haras-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.haras-gallery-grid .gallery-photo {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-border);
}

.haras-gallery-grid .gallery-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.haras-gallery-grid .gallery-photo:hover img {
  transform: scale(1.04);
}


/* ============================================
   GRADUATES GALLERY
   ============================================ */

.graduates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.graduate-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.graduate-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.graduate-item:hover img {
  transform: scale(1.06);
}

.graduate-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.62) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.graduate-item:hover .graduate-overlay {
  opacity: 1;
}

.graduate-overlay span {
  color: var(--color-white);
  font-weight: 600;
  font-size: 1rem;
}


/* ============================================
   AUCTION
   ============================================ */

.auction-inactive-section {
  padding: 5rem 2rem;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.auction-inactive-section h2 {
  margin-bottom: 0.75rem;
}

.auction-inactive-section > p {
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.accent-line {
  width: 48px;
  height: 3px;
  background: var(--color-primary);
  margin: 1.25rem auto 2rem;
  border-radius: 2px;
}

/* Notify form (auction page full) */
.auction-notify-form {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
}

.auction-notify-form input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 0.95rem;
  outline: none;
}

.auction-notify-form button {
  padding: 12px 22px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-base);
}

.auction-notify-form button:hover {
  background: var(--color-primary-dark);
}

.auction-notify-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auction-notify-status.success {
  color: #2A7A4A;
}

.auction-notify-status.error {
  color: var(--color-primary);
}

/* Lot card */
.lot-card {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.lot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.lot-number {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 20px;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  z-index: 5;
  letter-spacing: 0.04em;
}


/* ============================================
   CONTACT
   ============================================ */

.contact-section {
  margin-top: 72px;
}

.contact-wrap {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  min-height: calc(100vh - 72px);
  align-items: stretch;
}

.contact-form-panel {
  display: flex;
  flex-direction: column;
}

.contact-form-inner {
  padding: 4rem;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.contact-form-inner h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.contact-subtitle-text {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.contact-form-inner .breadcrumb {
  margin-bottom: 1.5rem;
}

.contact-form-inner .contact-form-panel h2 {
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color var(--transition-base);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Optional label hint */
.label-optional {
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Select field */
.form-group select {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color var(--transition-base);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.form-group select:focus {
  border-bottom-color: var(--color-primary);
}

/* Hero logo image */
.hero-logo-img {
  height: 64px;
  width: auto;
  display: block;
}

/* Honeypot — hidden from humans */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

.contact-info-panel {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-info-panel h3 {
  color: var(--color-white);
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.contact-channel svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.contact-channel a,
.contact-channel button {
  color: var(--color-white);
  font-size: 0.95rem;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-base);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.contact-channel a:hover,
.contact-channel button:hover {
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

/* Reveal-email button style reset */
.reveal-email {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}


/* ============================================
   FOOTER
   ============================================ */

#footer {
  background: #1A1A1A;
  color: var(--color-white);
  padding: 4rem 0 2rem;
}

.footer-inner {}

.footer-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 1rem;
}

.footer-logo-img {
  max-width: 140px;
  height: auto;
  display: block;
  opacity: 0.9;
}

.footer-logo-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: var(--color-white);
  flex-shrink: 0;
}

.footer-logo-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-white);
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color var(--transition-base);
  letter-spacing: 0.02em;
}

.footer-nav a:hover {
  color: var(--color-white);
}

.footer-contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-social-link,
.footer-email-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color var(--transition-base);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.footer-social-link:hover,
.footer-email-btn:hover {
  color: var(--color-white);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-location {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

.footer-copy {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

.footer-legal {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  max-width: 680px;
  margin: 1.5rem auto 0;
  line-height: 1.7;
  grid-column: 1 / -1;
}


/* ============================================
   ADMIN PANEL
   ============================================ */

.admin-login {
  max-width: 420px;
  margin: 120px auto 4rem;
  padding: 2.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
}

.admin-login h2 {
  margin-bottom: 1.5rem;
}

.admin-login .form-group input {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 12px 14px;
}

.admin-login .form-group input:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* Drag handle for sortable rows */
.drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  user-select: none;
  width: 32px;
  text-align: center;
}

.drag-handle:active {
  cursor: grabbing;
}

tr.sortable-ghost {
  opacity: 0.4;
  background: var(--color-bg);
}

.col-drag {
  width: 32px;
}

.admin-dashboard {
  padding-top: calc(var(--nav-height) + 2rem);
  min-height: 100vh;
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.admin-tabs button {
  padding: 12px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.admin-tabs button:hover {
  color: var(--color-text);
}

.admin-tabs button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table thead {
  background: var(--color-bg);
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(130, 35, 43, 0.03);
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(250, 248, 245, 0.5);
}

.admin-table tbody tr:nth-child(even):hover {
  background: rgba(130, 35, 43, 0.03);
}

.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.admin-modal.active {
  display: flex;
}

.admin-modal-content {
  background: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.admin-modal-content h3 {
  margin-bottom: 1.5rem;
}

.admin-modal-content .form-group input,
.admin-modal-content .form-group textarea,
.admin-modal-content .form-group select {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 10px 14px;
}

.admin-modal-content .form-group input:focus,
.admin-modal-content .form-group textarea:focus,
.admin-modal-content .form-group select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.admin-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle .toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 28px;
  cursor: pointer;
  transition: background var(--transition-base);
}

.admin-toggle .toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform var(--transition-base);
}

.admin-toggle input:checked + .toggle-slider {
  background: var(--color-primary);
}

.admin-toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-section-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.admin-form-modal {
  max-width: 860px;
  padding: 2.5rem 2rem;
}
.admin-form-modal #mare-form,
.admin-form-modal #lot-form,
.admin-form-modal #grad-form {
  padding: 0 0.5rem;
}

.admin-form-modal h2 {
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}

.btn-icon {
  background: none;
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-base);
  margin-right: 0.25rem;
}

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.action-cell { white-space: nowrap; }
.empty-cell {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem !important;
}
.msg-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-message {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-status.success { color: #2A7A4A; }
.form-status.error { color: var(--color-primary); }


/* ============================================
   SECTIONS — General
   ============================================ */

.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.mares-content,
.graduates-content,
.auction-content {
  padding: 4rem 0;
}


/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }


/* ============================================
   ACCESSIBILITY
   ============================================ */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 4px;
  z-index: 9999;
  font-size: 0.9rem;
}

.skip-link:focus { top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================
   RESPONSIVE — 1024px
   ============================================ */

@media (max-width: 1024px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.9rem; }
  h3 { font-size: 1.3rem; }

  .hero-content {
    padding: 0 3rem 5rem;
  }

  .home-farm-teaser .teaser-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .farm-values {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-form-inner,
  .contact-info-panel {
    padding: 3rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}


/* ============================================
   RESPONSIVE — 768px
   ============================================ */

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Navbar hamburger mode */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 1050;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    color: var(--color-text) !important;
    font-size: 1.1rem;
  }

  .menu-toggle {
    display: block;
  }

  /* Hero */
  .hero-content {
    padding: 0 1.5rem 4rem;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  /* Home sections */
  .home-remate {
    flex-direction: column;
  }
  .remate-photo-col {
    flex: 0 0 300px;
    min-height: 300px;
  }
  .remate-photo-col::after {
    background: linear-gradient(to bottom, transparent 40%, #82232B 100%);
  }
  .remate-text-col {
    flex: none;
    padding: 3rem 2rem;
  }

  .notify-form-inline {
    min-width: 0;
    width: 100%;
  }

  /* Page header */
  .page-header {
    padding-top: 100px;
    padding-bottom: 40px;
  }

  /* Cards */
  .card-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Farm */
  .farm-values {
    grid-template-columns: 1fr;
  }

  .farm-content {
    padding: 3rem 1.25rem 4rem;
  }

  /* Contact */
  .contact-wrap {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .contact-form-inner {
    padding: 2.5rem 1.5rem;
    max-width: 100%;
  }

  .contact-info-panel {
    padding: 2.5rem 1.5rem;
  }

  /* Modal */
  .modal-photo {
    height: 280px;
  }

  .modal-info {
    padding: 1.5rem;
  }

  /* Admin */
  .admin-table {
    font-size: 0.85rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 10px;
  }

  .section {
    padding: 3.5rem 0;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Stats band */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 1rem;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  /* CTA */
  .cta-actions {
    flex-direction: column;
  }

  /* Section header row */
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}


/* ============================================
   RESPONSIVE — 480px
   ============================================ */

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }
  p { font-size: 1rem; }

  .hero-content h1 { font-size: 1.9rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .btn {
    padding: 12px 22px;
    font-size: 0.8rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .page-header {
    padding-top: 90px;
    padding-bottom: 30px;
  }

  .card-body, .card-content {
    padding: 1.25rem;
  }

  .farm-story p {
    font-size: 1rem;
  }

  .contact-form-inner,
  .contact-info-panel {
    padding: 2rem 1rem;
  }

  .admin-login {
    margin: 100px 1rem 3rem;
    padding: 2rem 1.5rem;
  }

  .admin-modal-content {
    padding: 1.5rem;
  }

  .footer-top {
    padding-bottom: 2rem;
  }

  #footer {
    padding: 3rem 0 1.5rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .home-contact-cta {
    padding: 4rem 0;
  }
}


/* ============================================
   HORSE PROFILE PAGE
   ============================================ */

.page-header-sm {
  padding: 1rem 0;
  padding-top: calc(72px + 1rem);
  min-height: auto;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.75rem 0;
}
.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity var(--transition-base);
}
.breadcrumb a:hover { opacity: 0.75; }
.breadcrumb-sep {
  color: var(--color-text-muted);
  user-select: none;
}
.breadcrumb-current {
  color: var(--color-text-muted);
}

.breadcrumb-back {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}
.breadcrumb-back:hover { color: var(--color-primary); }

.horse-profile {
  padding: 3rem 0 5rem;
}

.horse-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 3.5rem;
}
@media (max-width: 768px) {
  .horse-profile-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---- Gallery ---- */
.gallery-main {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--color-border);
  margin-bottom: 0.75rem;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumb:hover { opacity: 0.85; }
.gallery-thumb.active { opacity: 1; border-color: var(--color-primary); }

/* ── Image copy protection ─────────────────────────────────────────────── */
.card-image img,
.gallery-photo img,
.gallery-main img,
.gallery-thumb {
  -webkit-user-drag: none;
  user-select: none;
}

.card-image,
.gallery-photo,
.gallery-main {
  position: relative;
}
.card-image::after,
.gallery-photo::after,
.gallery-main::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* ---- Info panel ---- */
.horse-header { margin-bottom: 1.25rem; }
.horse-name {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
}
.lot-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.horse-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  row-gap: 1.5rem;
  margin-bottom: 2rem;
}
.info-row {
  display: flex;
  flex-direction: column;
}
.info-label {
  font-size: 0.7rem;
  font-weight: 600;
  font-variant: small-caps;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #82232B;
  margin-bottom: 0.2rem;
}
.info-value {
  font-size: 1rem;
  font-weight: 400;
  color: #3D3D3D;
}

.horse-ext-link { margin-bottom: 1.5rem; }

.section-sub-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

/* ---- Video embed ---- */
.horse-video { margin-bottom: 3rem; }
.video-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--color-text);
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ---- Notes ---- */
.horse-notes {
  margin-top: 2.5rem;
  margin-bottom: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.horse-notes-text {
  color: var(--color-text-muted);
  line-height: 1.85;
}


/* ============================================
   PEDIGREE TREE
   ============================================ */

.horse-pedigree-section {
  background: #F5F0E8;
  padding: 3.5rem 0 0.5rem;
}
.horse-pedigree-section > .container > :last-child { margin-bottom: 3rem; }
.horse-pedigree { margin-bottom: 3rem; }

.ped-tree-wrap {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.ped-tree {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.ped-subject { flex-shrink: 0; }

.ped-h-line {
  flex-shrink: 0;
  width: 1.5rem;
  height: 2px;
  background: var(--color-primary);
  align-self: center;
}
.ped-h-line-sm { width: 1rem; }

.ped-tree-body {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0;
}

/* Vertical bar connecting sire branch midpoint to dam branch midpoint */
.ped-tree-body::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 2px;
  background: var(--color-primary);
}

.ped-branch {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  position: relative;
  padding-left: 1.5rem;
}

/* Horizontal connector from vertical bar to parent node */
.ped-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5rem;
  height: 2px;
  background: var(--color-primary);
  transform: translateY(-50%);
}

.ped-node-subject {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.65rem 1.1rem;
  border-radius: 5px;
  min-width: 9rem;
  text-align: center;
  flex-shrink: 0;
}
.ped-node-subject .ped-name { color: var(--color-white); font-weight: 600; font-size: 0.93rem; }

.ped-node-parent {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  min-width: 9rem;
  flex-shrink: 0;
}

.ped-gps {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0;
}

/* Vertical bar connecting sire_sire to sire_dam midpoints */
.ped-gps::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 2px;
  background: var(--color-primary);
}

.ped-node-gp {
  padding: 0.4rem 0.7rem 0.4rem 1.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin: 0.3rem 0;
  min-width: 10rem;
  flex-shrink: 0;
  position: relative;
}

/* Horizontal connector to grandparent */
.ped-node-gp::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1rem;
  height: 2px;
  background: var(--color-primary);
  transform: translateY(-50%);
}

.ped-role {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 2px;
}
.ped-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  display: block;
}

/* ---- Pedigree tree editor (admin) ---- */
.ped-tree-editor {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg);
}
.ped-tree.ped-tree-edit { padding-bottom: 0; }
.ped-tree.ped-tree-edit .ped-node-parent,
.ped-tree.ped-tree-edit .ped-node-gp {
  background: var(--color-white);
  min-width: 11rem;
}
.ped-input {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 0.15rem 0;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  outline: none;
  min-width: 8rem;
}
.ped-input:focus { border-bottom-color: var(--color-primary); }
.ped-input::placeholder { font-weight: 400; color: var(--color-text-muted); }


/* ============================================
   ADMIN PHOTO MANAGER
   ============================================ */

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.admin-gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-border);
}

.admin-gallery-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.admin-gallery-delete {
  position: absolute;
  top: 4px; right: 4px;
}

.photo-manager { }

.existing-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  min-height: 0;
}

.photo-thumb-wrap {
  position: relative;
  width: 80px;
  height: 60px;
  flex-shrink: 0;
}
.photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
}
.thumb-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  z-index: 1;
  padding: 0;
}
.thumb-delete:hover { background: var(--color-primary-dark); }

.new-photo-thumb { border: 2px solid #4caf50; border-radius: 6px; }
.new-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: #4caf50;
  color: #fff;
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.photo-thumb-wrap[draggable="true"] {
  cursor: grab;
}
.photo-thumb-wrap.dragging {
  opacity: 0.4;
}
.photo-thumb-wrap.drag-over {
  border-left: 3px solid #82232B;
}

.upload-area {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px dashed var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: border-color var(--transition-base), color var(--transition-base);
}
.upload-area:hover { border-color: var(--color-primary); color: var(--color-primary); }
.upload-area input[type="file"] { display: none; }

.form-group-sm { max-width: 120px; }
