/* =====================================================
   HÄSTSTAM — NORDIC FOREST MINIMALISM
   v1.1 — Cormorant Garamond + Jost
   ===================================================== */

:root {
  --linen:      #F5F0E8;
  --linen-dark: #EDE6D6;
  --card:       #FDFAF5;
  --forest:     #2D4A2D;
  --forest-mid: #4A6741;
  --forest-lt:  #6B8F5E;
  --bark:       #8B7355;
  --sand:       #C8B89A;
  --sand-lt:    #DED3BC;
  --charcoal:   #2A2118;
  --ink:        #3D3020;
  --mist:       #9FA89A;
  --terracotta: #C4704A;
  --terra-tint: #FFF0E8;
  --terra-border: #E89070;
  --dup-green:  #2D4A2D;
  --white:      #FFFFFF;
  --charcoal-soft: rgba(42,33,24,0.45);
  --shadow-sm:  0 1px 3px rgba(42,33,24,0.08);
  --shadow-md:  0 4px 16px rgba(42,33,24,0.10);
  --shadow-lg:  0 12px 40px rgba(42,33,24,0.14);
  --radius-sm:  4px;
  --radius:     6px;
  --radius-lg:  12px;
  --transition: 220ms ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--linen);
  color: var(--charcoal);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, .serif {
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.2;
  color: var(--charcoal);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 600; }

p { color: var(--ink); }
a { color: var(--forest-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--forest); }

/* ---------- LAYOUT ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 80px 0; }
.section-pad-sm { padding: 60px 0; }

/* ---------- SECTION LABELS ---------- */
.eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 10px;
  display: block;
}

.section-title {
  margin-bottom: 8px;
}
.section-subtitle {
  color: var(--bark);
  font-size: 1rem;
  margin-bottom: 48px;
}

/* ---------- DISPLAY UTILITIES ---------- */
.display-xl {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.display-lg {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.display-md {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
}

/* ---------- DIVIDER ---------- */
.divider {
  width: 48px;
  height: 2px;
  background: var(--forest-mid);
  margin: 20px 0 40px;
}

/* ===================================================
   NAVIGATION
   =================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--forest);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--linen) !important;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-icon {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.92;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(245,240,232,0.78);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--linen);
  background: rgba(255,255,255,0.10);
}

.nav-cta > a {
  border: 1px solid rgba(245,240,232,0.35) !important;
  border-radius: 4px;
}
.nav-cta > a:hover {
  background: rgba(245,240,232,0.12) !important;
  border-color: rgba(245,240,232,0.6) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--linen);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-mobile {
  display: none;
  background: var(--forest);
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-mobile.open { display: block; }

.nav-mobile a {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(245,240,232,0.80);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--linen); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ===================================================
   HERO
   =================================================== */
.hero {
  background: var(--linen);
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(74,103,65,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 80%, rgba(45,74,45,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-kicker {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-mid);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--forest-mid);
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 400;
  color: var(--charcoal);
  max-width: 700px;
  line-height: 1.18;
  margin-bottom: 12px;
}
.hero-title em {
  font-style: italic;
  color: var(--forest-mid);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--bark);
  margin-bottom: 52px;
  font-weight: 300;
}

.hero-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.65);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 52px;
  border: 1px solid var(--sand);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-cell {
  padding: 28px 24px;
  border-right: 1px solid var(--sand);
  position: relative;
}
.stat-cell:last-child { border-right: none; }

.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--forest);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
}

.stat-detail {
  font-size: 0.72rem;
  color: var(--mist);
  margin-top: 2px;
  font-style: italic;
}

@media (max-width: 700px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { border-bottom: 1px solid var(--sand); }
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-cell:nth-child(3) { border-bottom: none; }
  .stat-cell:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
  .stats-strip { grid-template-columns: 1fr 1fr; }
}

/* Quick search */
.hero-search-wrap {
  max-width: 580px;
}

.hero-search-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 10px;
  display: block;
}

.search-bar {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--forest);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(45,74,45,0.15), var(--shadow-sm);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 18px;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
}
.search-bar input::placeholder { color: var(--mist); }

.search-bar button {
  background: var(--forest);
  color: var(--linen);
  border: none;
  cursor: pointer;
  padding: 13px 22px;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-bar button:hover { background: var(--forest-mid); }

.search-hint {
  font-size: 0.76rem;
  color: var(--mist);
  margin-top: 8px;
}

/* ===================================================
   RECENTLY UPLOADED PHOTOS
   =================================================== */
.photos-section {
  background: var(--card);
  border-top: 1px solid var(--sand-lt);
  border-bottom: 1px solid var(--sand-lt);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 900px) { .photos-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .photos-grid { grid-template-columns: repeat(2, 1fr); } }

.photo-card {
  background: var(--linen);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--sand-lt);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.photo-card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--linen-dark);
}
.photo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--linen-dark) 0%, var(--sand-lt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.horse-silhouette {
  width: 65%;
  opacity: 0.22;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(42,33,24,0.55) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}
.photo-card:hover .photo-overlay { opacity: 1; }

.photo-meta {
  padding: 10px 12px;
}
.photo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.photo-breed {
  font-size: 0.72rem;
  color: var(--bark);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-credit {
  font-size: 0.68rem;
  color: var(--mist);
  margin-top: 3px;
}

/* ===================================================
   BREED DIRECTORY
   =================================================== */
.breeds-section {
  background: var(--linen);
}

.breeds-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) { .breeds-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .breeds-grid { grid-template-columns: 1fr; } }

.breed-card {
  background: var(--card);
  border: 1px solid var(--sand-lt);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.breed-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--forest-lt);
}

.breed-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.breed-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.3;
}

.breed-count {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--forest);
  white-space: nowrap;
  margin-left: 10px;
}

.breed-bar-track {
  height: 4px;
  background: var(--sand-lt);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.breed-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest) 0%, var(--forest-mid) 100%);
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.breed-card-link {
  font-size: 0.72rem;
  color: var(--bark);
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.breed-card-link::after { content: '\2192'; }

/* ===================================================
   HORSE CARD GRID
   =================================================== */
.horse-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.horse-card {
  background: var(--card);
  border: 1px solid var(--sand-lt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.horse-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--forest-lt);
}

.horse-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--linen-dark) 0%, var(--sand-lt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.horse-card-body {
  padding: 14px 16px;
}

.horse-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.horse-card-breed {
  font-size: 0.75rem;
  color: var(--bark);
  font-style: italic;
}

/* ===================================================
   HORSE PROFILE
   =================================================== */
.profile-section {
  background: var(--card);
  border-top: 1px solid var(--sand-lt);
  border-bottom: 1px solid var(--sand-lt);
}

.profile-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.profile-photos {}

.profile-main-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--linen-dark) 0%, var(--sand-lt) 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid var(--sand);
  position: relative;
}

.profile-horse-svg {
  width: 70%;
  opacity: 0.28;
}

.photo-copyright {
  font-size: 0.7rem;
  color: var(--mist);
  font-style: italic;
  margin-bottom: 10px;
  text-align: center;
}

.profile-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.profile-thumb {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--linen-dark) 0%, var(--sand-lt) 100%);
  border-radius: 4px;
  cursor: pointer;
  border: 1.5px solid transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}
.profile-thumb:first-child { border-color: var(--forest); }
.profile-thumb:hover { border-color: var(--forest-mid); }

.profile-thumb svg { width: 55%; opacity: 0.25; }

.photo-credit-line {
  font-size: 0.73rem;
  color: var(--bark);
  text-align: center;
  margin-bottom: 4px;
}

.profile-info {}

.profile-title-block {
  margin-bottom: 28px;
}

.profile-horse-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.1;
  margin-bottom: 8px;
}

.profile-studbook-line {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  color: var(--forest-mid);
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studbook-tag {
  background: rgba(45,74,45,0.10);
  border: 1px solid rgba(45,74,45,0.20);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--forest);
}

.profile-studbook-note {
  font-size: 0.75rem;
  color: var(--mist);
  font-style: italic;
  margin-bottom: 20px;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--linen);
  border-radius: var(--radius);
  border: 1px solid var(--sand-lt);
}

.meta-item {}
.meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 2px;
}
.meta-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
}

/* ===================================================
   HORSE GALLERY (integrated in header)
   =================================================== */
.horse-gallery {
  flex-shrink: 0;
  width: 380px;
  max-width: 100%;
}
.horse-gallery-main {
  width: 100%;
  background: var(--linen-dark);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--sand-lt);
  margin-bottom: 8px;
  line-height: 0;
}
.horse-gallery-main img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
  background: var(--linen-dark);
}
.horse-gallery .img-credit {
  font-size: 0.72rem;
  color: var(--bark);
  font-style: italic;
  padding: 4px 2px 0;
  line-height: 1.4;
  min-height: 1.2em;
}
.horse-gallery-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  border: 2px solid var(--sand-lt);
  background: var(--linen-dark);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover  { border-color: var(--forest-mid); }
.gallery-thumb.active { border-color: var(--forest); }

/* Horse header layout with gallery */
.horse-header-inner {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.horse-header-info {
  flex: 1;
  min-width: 0;
}
@media (max-width: 780px) {
  .horse-header-inner { flex-direction: column; }
  .horse-gallery { width: 100%; }
}

/* Meta list (dt/dd pairs) */
.horse-meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin-top: 16px;
}
.horse-meta-list dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  padding-top: 2px;
}
.horse-meta-list dd {
  font-size: 0.92rem;
  color: var(--ink);
}

/* img-credit outside gallery */
.img-credit {
  font-size: 0.72rem;
  color: var(--bark);
  font-style: italic;
  margin-top: 4px;
}

/* ===================================================
   BREED DIRECTORY LIST (breed/list.php)
   =================================================== */
.breed-card-wrap {
  display: flex;
  flex-direction: column;
}
.breed-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 6px;
  line-height: 1.3;
}
.breed-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--bark);
  margin-bottom: 6px;
}
.breed-card-bar {
  height: 3px;
  background: var(--sand-lt);
  border-radius: 2px;
  overflow: hidden;
}
.breed-card-bar-fill {
  height: 100%;
  background: var(--forest-mid);
  border-radius: 2px;
}
.breed-card--extinct { opacity: 0.65; }
.breed-badge-extinct {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sand-lt);
  color: var(--bark);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.breed-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--linen-dark);
  border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--sand-lt);
  border-top: none;
}
.breed-sub-link {
  font-size: 0.78rem;
  color: var(--forest-mid);
  text-decoration: none;
}
.breed-sub-link:hover { color: var(--forest); text-decoration: underline; }

/* "Övriga raser" toggle */
.other-breeds-toggle {
  border: 1px solid var(--sand-lt);
  border-radius: var(--radius);
  overflow: hidden;
}
.other-breeds-summary {
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  padding: 14px 20px;
  background: var(--linen-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.other-breeds-summary::-webkit-details-marker { display: none; }
.other-breeds-summary::before {
  content: '+';
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--forest-mid);
  width: 18px;
  text-align: center;
}
details[open] .other-breeds-summary::before { content: '\2212'; }
.other-breeds-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
  list-style: none;
  padding: 12px 20px 16px;
  background: var(--card);
}
.other-breeds-list li { padding: 4px 0; }
.other-breeds-list a {
  font-size: 0.84rem;
  color: var(--forest-mid);
  text-decoration: none;
}
.other-breeds-list a:hover { color: var(--forest); text-decoration: underline; }

/* ===================================================
   BOOKS LIST (book/list.php)
   =================================================== */
.book-group {}
.book-group-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--charcoal);
  border-bottom: 2px solid var(--sand-lt);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.books-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px 16px;
}
.books-list-link {
  font-size: 0.88rem;
  color: var(--forest-mid);
  text-decoration: none;
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--linen-dark);
}
.books-list-link:hover { color: var(--forest); }
.books-list-count {
  color: var(--bark);
  font-size: 0.80rem;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ===================================================
   ARTICLES LIST (start.php "Uppdaterat")
   =================================================== */
.articles-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--sand-lt);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-item {
  border-bottom: 1px solid var(--sand-lt);
}
.article-item:last-child { border-bottom: none; }
.article-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 20px;
  text-decoration: none;
  background: var(--card);
  transition: background var(--transition);
}
.article-link:hover { background: var(--linen-dark); }
.article-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  flex: 1;
}
.article-meta {
  font-size: 0.76rem;
  color: var(--bark);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===================================================
   FORM CONTROLS (search, submit forms)
   =================================================== */
.form-label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius);
  background: var(--linen);
  color: var(--charcoal);
  padding: 10px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 44px;
}
.form-control:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45,74,45,0.10);
}
select.form-control {
  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='%238B7355' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid var(--sand);
  background: transparent;
  color: var(--bark);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  height: 44px;
}
.btn-ghost:hover {
  border-color: var(--forest-lt);
  color: var(--forest);
  background: var(--linen-dark);
}

/* ===================================================
   BREED TINT CLASSES
   =================================================== */

/* Engelskt Fullblod (Thoroughbred) */
.englishbreed .ped-cell-inner,
.ped-cell-inner.englishbreed {
  background: var(--terra-tint);
  border-color: var(--terra-border);
}
.englishbreed .ped-cell-inner:hover,
.ped-cell-inner.englishbreed:hover {
  background: #ffe8d8;
}

/* Arabiskt Fullblod */
.arabicbreed .ped-cell-inner,
.ped-cell-inner.arabicbreed {
  background: #F0F5FF;
  border-color: #A0B4D6;
}
.arabicbreed .ped-cell-inner:hover,
.ped-cell-inner.arabicbreed:hover {
  background: #e4edff;
}

/* Anglo-Arabiskt Fullblod */
.angloarabicbreed .ped-cell-inner,
.ped-cell-inner.angloarabicbreed {
  background: #FFF5F0;
  border-color: #D6A08C;
}
.angloarabicbreed .ped-cell-inner:hover,
.ped-cell-inner.angloarabicbreed:hover {
  background: #ffe8dc;
}

/* ===================================================
   PEDIGREE TREE
   =================================================== */
.pedigree-section {}

.pedigree-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pedigree-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand);
}

.pedigree-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

/* Horizontal tree using flexbox */
.pedigree-tree {
  display: flex;
  align-items: stretch;
  min-width: 900px;
  font-size: 0; /* remove whitespace gaps */
}

.pedigree-gen {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pedigree-gen-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark);
  text-align: center;
  padding: 6px 4px;
  background: var(--linen-dark);
  border-bottom: 1px solid var(--sand-lt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pedigree-col {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Container for cells in one generation column */
.pedigree-cells {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* SVG connector strip between generation columns */
.ped-connector-strip {
  display: flex;
  flex-direction: column;
  width: 28px;
  flex-shrink: 0;
}
.ped-connector-label-spacer {
  height: 31px; /* matches .pedigree-gen-label height */
  background: var(--linen-dark);
  border-bottom: 1px solid var(--sand-lt);
}
.ped-connector-body {
  flex: 1;
  position: relative;
}

/* No-data fallback */
.ped-no-data {
  color: var(--charcoal-soft);
  font-size: 0.9rem;
  padding: 24px 0;
}

/* Each cell group pairs a sire/dam cell and draws connectors */
.pedigree-group {
  display: flex;
  flex: 1;
  position: relative;
}

.pedigree-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  position: relative;
}

.pedigree-connector::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--sand);
  transform: translateX(-50%);
}

.pedigree-connector::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 1px;
  background: var(--sand);
}

/* A pedigree cell */
.ped-cell {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding: 4px 2px;
  position: relative;
}

.ped-cell-inner {
  flex: 1;
  background: var(--linen);
  border: 1px solid var(--sand-lt);
  border-radius: 4px;
  padding: 6px 8px 6px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  font-size: 16px; /* reset from parent */
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}

.ped-cell-inner:hover {
  background: var(--card);
  border-color: var(--forest-lt);
}

/* Duplicate ancestor — right border highlight; JS sets --dup-color inline per node */
.ped-cell-inner.dup {
  border-right: 5px solid var(--dup-color, #2D4A2D);
}

/* Thoroughbred tint (legacy class) */
.ped-cell-inner.thoroughbred {
  background: var(--terra-tint);
  border-color: var(--terra-border);
}
.ped-cell-inner.thoroughbred:hover {
  background: #ffe8d8;
}

/* Generation shorthand classes */
.ped-gen-0 { flex: 0 0 18%; }
.ped-gen-1 { flex: 0 0 20%; }
.ped-gen-2 { flex: 0 0 20%; }
.ped-gen-3 { flex: 0 0 20%; }
.ped-gen-4 { flex: 1; }

/* Pedigree node (used by JS-rendered trees) */
.ped-node {
  background: var(--linen);
  border: 1px solid var(--sand-lt);
  border-radius: 4px;
  padding: 6px 8px 6px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  font-size: 0.82rem;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.ped-node:hover {
  background: var(--card);
  border-color: var(--forest-lt);
}
.ped-node.dup {
  border-right: 5px solid var(--dup-color, #2D4A2D);
}
.ped-node.englishbreed { background: var(--terra-tint); border-color: var(--terra-border); }
.ped-node.englishbreed:hover { background: #ffe8d8; }
.ped-node.arabicbreed { background: #F0F5FF; border-color: #A0B4D6; }
.ped-node.arabicbreed:hover { background: #e4edff; }
.ped-node.angloarabicbreed { background: #FFF5F0; border-color: #D6A08C; }
.ped-node.angloarabicbreed:hover { background: #ffe8dc; }

/* Pedigree column labels */
.ped-labels {
  display: flex;
  gap: 0;
  margin-bottom: 4px;
}

.ped-labels-col {
  flex: 1;
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark);
  text-align: center;
  padding: 6px 4px;
  background: var(--linen-dark);
  border-bottom: 1px solid var(--sand-lt);
}

.ped-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ped-breed {
  font-size: 0.65rem;
  color: var(--bark);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.ped-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 3px;
}

.ped-badge {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(45,74,45,0.10);
  color: var(--forest);
}

.ped-badge.tb {
  background: rgba(196,112,74,0.15);
  color: var(--terracotta);
  font-style: italic;
}

/* Camera icon badge */
.cam-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--forest-mid);
  border-radius: 50%;
  flex-shrink: 0;
}
.cam-badge svg {
  width: 8px;
  height: 8px;
  fill: white;
}

/* Subject (gen 0) cell — larger */
.ped-subject.ped-cell-inner,
.ped-subject .ped-cell-inner,
.ped-node.ped-subject {
  background: var(--forest);
  border-color: var(--forest);
  padding: 14px 14px;
}
.ped-subject .ped-name,
.ped-node.ped-subject .ped-name {
  font-size: 1rem;
  color: var(--linen);
}
.ped-subject .ped-breed,
.ped-node.ped-subject .ped-breed {
  color: var(--sand);
}

/* Empty slot */
.ped-empty {
  background: transparent;
  border: 1px dashed var(--sand-lt);
  min-height: 48px;
  border-radius: 4px;
}

/* Born year */
.ped-born {
  font-size: 0.72rem;
  color: var(--charcoal-soft);
  margin-top: 2px;
}

/* Unknown horse label */
.ped-unknown {
  color: var(--charcoal-soft);
  font-style: italic;
}

/* Pedigree legend — flex row of colored swatches below tree */
.ped-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--linen-dark);
  border-radius: var(--radius);
  border: 1px solid var(--sand-lt);
}

.ped-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink);
}

.legend-swatch {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-swatch.dup-swatch {
  border-right: 5px solid var(--dup-green);
  background: var(--linen);
  border-top: 1px solid var(--sand);
  border-bottom: 1px solid var(--sand);
  border-left: 1px solid var(--sand);
}

.legend-swatch.tb-swatch {
  background: var(--terra-tint);
  border: 1px solid var(--terra-border);
}

/* ===================================================
   OFFSPRING TABLE
   =================================================== */
.offspring-section {
  margin-top: 40px;
}

.offspring-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.offspring-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--sand-lt);
}

.data-table thead tr {
  background: var(--linen-dark);
  border-bottom: 2px solid var(--sand);
}

.data-table th {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--bark);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sand-lt);
  color: var(--ink);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  background: var(--card);
  transition: background var(--transition);
}
.data-table tbody tr:hover { background: var(--linen); }

.data-table a {
  color: var(--forest-mid);
  font-weight: 500;
}
.data-table a:hover { color: var(--forest); }

.gender-badge {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0;
}
.gender-f {
  background: rgba(139,115,85,0.15);
  color: var(--bark);
}
.gender-m {
  background: rgba(45,74,45,0.12);
  color: var(--forest);
}

/* ===================================================
   STAMMATCH
   =================================================== */
.stammatch-section {
  background: var(--forest);
  position: relative;
  overflow: hidden;
}

.stammatch-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 90% 50%, rgba(106,143,94,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 5% 20%, rgba(200,184,154,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.stammatch-section .eyebrow { color: var(--sand); }
.stammatch-section h2 { color: var(--linen); }
.stammatch-section .section-subtitle { color: var(--sand); }

.stammatch-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .stammatch-grid {
    grid-template-columns: 1fr;
  }
  .stammatch-x { display: none; }
}

.stammatch-x {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--sand);
  font-style: italic;
  text-align: center;
  line-height: 1;
}

.stammatch-field {}
.stammatch-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 7px;
}
.stammatch-field input {
  width: 100%;
  border: 1.5px solid rgba(200,184,154,0.35);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: var(--linen);
  padding: 12px 16px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.stammatch-field input::placeholder { color: rgba(200,184,154,0.50); }
.stammatch-field input:focus {
  border-color: var(--sand);
  background: rgba(255,255,255,0.10);
}

.btn-primary {
  background: var(--linen);
  color: var(--forest);
  border: none;
  padding: 14px 32px;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: inline-block;
}
.btn-primary:hover {
  background: var(--sand-lt);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 13px 30px;
  border-radius: var(--radius);
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  border: 1.5px solid rgba(245,240,232,0.45);
  background: transparent;
  color: var(--linen);
}
.btn-secondary:hover {
  background: rgba(245,240,232,0.1);
  border-color: var(--linen);
  color: var(--linen);
  transform: translateY(-1px);
}

.stammatch-note {
  font-size: 0.74rem;
  color: rgba(200,184,154,0.60);
  margin-top: 12px;
  font-style: italic;
}

/* ===================================================
   ADVANCED SEARCH
   =================================================== */
.search-section {
  background: var(--linen);
}

.search-card {
  background: var(--card);
  border: 1px solid var(--sand-lt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.search-tabs {
  display: flex;
  border-bottom: 1px solid var(--sand-lt);
  background: var(--linen-dark);
}

.search-tab {
  padding: 14px 24px;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--bark);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.search-tab:hover { color: var(--forest); background: rgba(45,74,45,0.04); }
.search-tab.active {
  color: var(--forest);
  border-bottom-color: var(--forest);
  background: var(--card);
}

.search-panel {
  display: none;
  padding: 32px;
}
.search-panel.active { display: block; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group datalist {
  width: 100%;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius);
  background: var(--linen);
  color: var(--charcoal);
  padding: 10px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  outline: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45,74,45,0.10);
}

.form-group select {
  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='%238B7355' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-year-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.form-year-range span {
  font-size: 0.8rem;
  color: var(--mist);
  text-align: center;
}

.form-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--sand);
  border-radius: 3px;
  background: var(--linen);
  cursor: pointer;
  appearance: none;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}
.form-check input[type="radio"] { border-radius: 50%; }
.form-check input[type="checkbox"]:checked,
.form-check input[type="radio"]:checked {
  background: var(--forest);
  border-color: var(--forest);
}
.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 8px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}
.form-check input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: white;
  border-radius: 50%;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sand-lt);
}

.btn-search {
  background: var(--forest);
  color: var(--linen);
  border: none;
  padding: 12px 28px;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-search:hover { background: var(--forest-mid); }

.btn-reset {
  background: none;
  color: var(--bark);
  border: 1.5px solid var(--sand);
  padding: 12px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-reset:hover { border-color: var(--bark); color: var(--ink); }

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  background: var(--charcoal);
  color: rgba(245,240,232,0.70);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand {}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--linen);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo svg { opacity: 0.7; }

.footer-about {
  font-size: 0.84rem;
  line-height: 1.7;
  color: rgba(245,240,232,0.55);
  max-width: 280px;
}

.footer-col-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.84rem;
  color: rgba(245,240,232,0.55);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--linen); }

.footer-contact-item {
  font-size: 0.84rem;
  color: rgba(245,240,232,0.55);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-contact-item a {
  color: rgba(245,240,232,0.55);
  transition: color var(--transition);
}
.footer-contact-item a:hover { color: var(--linen); }

.footer-divider {
  height: 1px;
  background: rgba(245,240,232,0.10);
  margin-bottom: 24px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.76rem;
  color: rgba(245,240,232,0.35);
}

.footer-sponsor {
  font-size: 0.76rem;
  color: rgba(245,240,232,0.35);
}
.footer-sponsor a { color: rgba(245,240,232,0.50); }
.footer-sponsor a:hover { color: var(--linen); }

/* ===================================================
   SCROLL ANIMATIONS
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }
.reveal-delay-6 { transition-delay: 0.60s; }

/* ===================================================
   SECTION SEPARATOR
   =================================================== */
.sep-rule {
  max-width: 1180px;
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--sand-lt);
}

/* ===================================================
   SITE MAIN WRAPPER
   =================================================== */
.site-main {
  min-height: 60vh;
}

/* ===================================================
   UTILITY
   =================================================== */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 6px; }
::-webkit-scrollbar-track { background: var(--linen-dark); }
::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bark); }

/* ===================================================
   RESPONSIVE — MOBILE PEDIGREE
   On screens < 768px, stack pedigree generations vertically
   =================================================== */
@media (max-width: 767px) {
  .pedigree-tree {
    flex-direction: column;
    min-width: 0;
  }

  .pedigree-gen {
    flex-direction: row;
    flex: none;
    width: 100%;
  }

  .pedigree-col {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .pedigree-cells {
    flex-direction: row;
    flex-wrap: wrap;
    flex: none;
    width: 100%;
  }

  .pedigree-group {
    flex-direction: column;
    width: 100%;
  }

  .pedigree-connector {
    width: 100%;
    height: 16px;
    flex-direction: row;
  }

  .pedigree-connector::before {
    top: 50%;
    left: 25%;
    right: 25%;
    bottom: auto;
    width: auto;
    height: 1px;
    transform: translateY(-50%);
  }

  .pedigree-connector::after {
    top: 50%;
    left: 50%;
    width: 1px;
    height: 50%;
    transform: translateX(-50%);
  }

  .ped-cell {
    width: 100%;
    padding: 3px 4px;
  }

  .ped-gen-0,
  .ped-gen-1,
  .ped-gen-2,
  .ped-gen-3,
  .ped-gen-4 {
    flex: none;
    width: 100%;
  }

  .pedigree-scroll {
    overflow-x: visible;
  }
}
