/* ==========================================================================
   Larspeenghar — public website stylesheet  ("Look A": forest & gold)
   Used by index.html only. admin.html keeps css/styles.css.

   Brand colours come from the admin theme (--primary / --accent are set on <html>
   by applyTheme()); every other shade below is derived from them.
   Fonts: "Bricolage Grotesque" (headings) + "Instrument Sans" (text) are used when
   present (see css/fonts.css); otherwise the system sans-serif stack is used.
   ========================================================================== */

:root {
  --primary: #0f3b2a;
  --accent: #e2ae2f;

  --primary-deep: #0a2a1e;
  --primary-2: #174f39;
  --accent-ink: #8a6410;          /* gold used as TEXT on light backgrounds (AA) */
  --accent-soft: #f2d58a;         /* gold used as text on dark backgrounds */

  --ink: #14231b;
  --paper: #f6f4ee;
  --sage: #e6ede5;
  --line: #dce3d9;
  --line-strong: #b9c7bc;
  --muted: #4f5f55;
  --on-dark: #cfe0d5;
  --on-dark-muted: #9db8a8;

  --radius: 20px;
  --radius-lg: 28px;
  --font-display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --primary-deep: color-mix(in srgb, var(--primary) 70%, #000);
    --primary-2: color-mix(in srgb, var(--primary) 86%, #fff);
    --accent-ink: color-mix(in srgb, var(--accent) 58%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 60%, #fff);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); color: var(--ink); background: var(--paper);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
section { padding: clamp(56px, 7vw, 88px) 0; scroll-margin-top: 84px; }
.d, h1, h2, h3, .brand-name { font-family: var(--font-display); }

/* ---- Section headings ---- */
.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em;
  font-weight: 700; color: var(--ink); margin-bottom: 12px; position: relative; padding-top: 20px;
}
.section-title::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 0;
  width: 44px; height: 4px; border-radius: 4px; background: var(--accent);
}
.section-sub { color: var(--muted); margin-bottom: 40px; max-width: 680px; font-size: 1.06rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--ink); font-weight: 700; font-size: 1rem;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.45); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-2); }
.btn-sm { min-height: 46px; padding: 0 22px; font-size: .95rem; }

/* ---- Top bar ---- */
.topbar { background: var(--primary-deep); color: var(--on-dark); font-size: .82rem; }
.topbar .container {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 24px;
  flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px;
}
.topbar-links { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.topbar a { color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.topbar a:hover { text-decoration: underline; }
.topbar svg { stroke: var(--accent); flex-shrink: 0; }
.topbar:empty, .topbar-empty { display: none; }

/* ---- Header ---- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.brand > div { min-width: 0; }
.brand img { height: 50px; width: auto; max-width: 64px; object-fit: contain; flex-shrink: 0; }
@media (max-width: 520px) {
  .brand img { height: 42px; }
  .brand .brand-name { font-size: 1rem; }
  .brand .brand-tag { display: none; }
}
.brand .brand-name { font-weight: 700; font-size: 1.12rem; line-height: 1.15; letter-spacing: -.01em; color: var(--primary); }
.brand .brand-tag { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.nav-panel { display: flex; align-items: center; gap: 18px; margin-inline-start: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-list a {
  display: block; padding: 10px 15px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  color: var(--ink); transition: background-color .15s, color .15s;
}
.nav-list a:hover { background: var(--sage); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--sage); }
.lang-switch button {
  min-width: 44px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: .8rem; font-weight: 700; background: transparent; color: var(--ink);
}
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.nav-toggle {
  display: none; width: 48px; height: 48px; flex-shrink: 0; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--primary); cursor: pointer;
}

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; margin-inline-start: auto; }
  .nav-panel {
    display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px clamp(20px, 4vw, 48px) 20px;
    box-shadow: 0 18px 30px rgba(10,42,30,.12);
  }
  .nav-panel.open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a { border-radius: 0; padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid #eef2ec; }
  .nav-list a:hover { background: transparent; }
  .nav-actions { justify-content: space-between; flex-wrap: wrap; }
  .lang-switch button { height: 44px; min-width: 48px; }
}

/* ---- Hero ---- */
.hero { background: var(--primary); color: #fff; padding: clamp(40px, 6vw, 88px) 0 0; }
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-text { display: flex; flex-direction: column; gap: 26px; }
.hero-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: var(--accent-soft);
}
.hero-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1.05; letter-spacing: -.025em; font-weight: 700;
}
.hero-text p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6; color: var(--on-dark); max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn { min-height: 56px; }
.hero-media-wrap { position: relative; }
.hero-media {
  border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 5 / 4; background: var(--primary-2);
}
.hero-slideshow { position: relative; width: 100%; height: 100%; }
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.hero-slide.active { opacity: 1; }
.hero-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; gap: 7px; justify-content: center; z-index: 2; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); transition: all .3s; }
.hero-dot.active { background: #fff; width: 22px; border-radius: 5px; }
.hero-media-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 5rem; background: var(--primary-2); }
.hero-feature {
  position: absolute; inset-inline-start: 20px; bottom: 20px; z-index: 3;
  display: flex; align-items: center; gap: 14px; padding: 10px 18px 10px 10px; text-align: start;
  border: 0; border-radius: 18px; background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 0 14px 34px rgba(0,0,0,.22); max-width: calc(100% - 40px);
  transition: transform .15s ease;
}
.hero-feature:hover { transform: translateY(-2px); }
.hero-feature img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.hero-feature-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hero-feature-text strong { font-family: var(--font-display); font-size: 1.15rem; }
.hero-feature-text span { font-size: .82rem; color: var(--muted); }
.hero-stats {
  margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid rgba(255,255,255,.16);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; padding: 30px 0 40px;
}
.hero-stat b { display: block; font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.hero-stat span { font-size: .88rem; color: var(--on-dark-muted); }

/* ---- Partners (section #companies) ---- */
#companies { background: var(--paper); }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,59,42,.14); border-color: var(--line-strong); }
.card-img { width: 100%; aspect-ratio: 3 / 2; display: block; border-bottom: 1px solid #eef2ec; }
img.card-img { object-fit: contain; object-position: center; background: #fff; }
div.card-img { background: var(--sage); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-body h3 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.card-body p { color: var(--muted); font-size: .96rem; line-height: 1.55; flex: 1; }
.card-meta { font-size: .85rem; color: var(--muted); }
.card-meta strong { color: var(--ink); }
.tag {
  align-self: flex-start; display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; background: var(--sage); color: var(--primary); padding: 4px 12px; border-radius: 999px;
}
.price { font-weight: 700; color: var(--ink); }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 14px; margin-top: auto; border-top: 1px solid #e9eee7;
}
.view-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: .9rem; }
.card:hover .view-link { text-decoration: underline; }

.company-card .company-logo-wrap {
  height: 112px; display: flex; align-items: center; justify-content: center; padding: 16px; background: #fff;
  border-bottom: 1px solid #eef2ec;
}
.company-logo { max-height: 80px; max-width: 100%; object-fit: contain; }
.company-placeholder { font-weight: 700; color: var(--primary); font-size: 1.2rem; text-align: center; }
.company-desc { color: var(--muted); font-size: .95rem; line-height: 1.6; max-height: 7.6em; overflow: hidden; position: relative; }
.company-desc p { margin-bottom: 8px; }
.company-card.expanded .company-desc { max-height: none; }
.company-card:not(.expanded) .company-desc.is-clipped::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2.6em;
  background: linear-gradient(rgba(255,255,255,0), #fff);
}
.co-more {
  align-self: flex-start; background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--primary); font-weight: 700; font-size: .9rem;
}
.co-more:hover { text-decoration: underline; }

/* ---- Sires ---- */
#sires { background: #fff; }
.sire-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-btn {
  height: 46px; padding: 0 20px; border-radius: 999px; cursor: pointer; font-size: .95rem; font-weight: 600;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); transition: background-color .15s, color .15s, border-color .15s;
}
.filter-btn:hover { border-color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.sire-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 24px; }
.sire-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; outline: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.sire-card:hover, .sire-card:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,59,42,.14); border-color: var(--line-strong); }
.sire-media { position: relative; aspect-ratio: 4 / 3; background: var(--sage); }
.sire-photo { width: 100%; height: 100%; object-fit: cover; }
.sire-photo-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--muted); }
.sire-idx {
  position: absolute; top: 14px; inset-inline-start: 14px; display: inline-flex; align-items: baseline; gap: 7px;
  padding: 6px 13px; border-radius: 999px; background: var(--primary); color: #fff;
}
.sire-idx b { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.sire-idx i { font-style: normal; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.sire-rank {
  position: absolute; top: 14px; inset-inline-end: 14px; min-width: 34px; height: 34px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: rgba(255,255,255,.94); color: var(--primary); font-weight: 700; font-size: .8rem;
}
.sire-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.sire-body h3 { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.01em; }
.sire-meta { margin-top: 4px; font-size: .88rem; color: var(--muted); }
.sire-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; border-top: 1px solid #e9eee7; }
.sire-stats span { display: block; font-size: .76rem; color: var(--muted); }
.sire-stats b { font-size: 1rem; }
.sire-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.sire-foot .sire-code { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .sire-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .sire-body { padding: 12px 12px 14px; gap: 10px; }
  .sire-body h3 { font-size: 1.15rem; }
  .sire-meta { font-size: .8rem; }
  .sire-idx { top: 10px; inset-inline-start: 10px; padding: 4px 10px; }
  .sire-idx i { font-size: 1rem; }
  .sire-rank { top: 10px; inset-inline-end: 10px; min-width: 28px; height: 28px; font-size: .7rem; }
  .sire-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---- Products ---- */
#products { background: var(--paper); }
.product-card { cursor: pointer; }
.product-card:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.card-desc-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Systems + feasibility (dark band) ---- */
#systems, #feasibility { background: var(--primary); color: #fff; }
#systems { padding-bottom: 0; }
#systems + #feasibility { padding-top: 40px; }
#systems .section-title { color: #fff; }
#systems .section-sub { color: var(--on-dark); }
.systems-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.system-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius);
  color: #fff; overflow: hidden;
}
.system-card:hover { background: rgba(255,255,255,.11); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: none; }
.system-img, .system-img-empty { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; border-bottom: 1px solid rgba(255,255,255,.12); }
.system-img-empty { display: flex; align-items: center; justify-content: center; font-size: 2.6rem; background: rgba(226,174,47,.14); }
.system-card .card-body h3 { color: #fff; font-size: 1.3rem; }
.system-card .card-body p.system-tagline { color: var(--on-dark); font-size: .96rem; line-height: 1.55; flex: 1; }
.system-card .system-url { font-size: .82rem; color: var(--on-dark-muted); word-break: break-all; }
.system-btn { align-self: flex-start; min-height: 46px; padding: 0 22px; font-size: .92rem; }

.feas-promo {
  background: var(--paper); color: var(--ink); border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(28px, 4vw, 56px); align-items: center;
}
.feas-promo-text { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.feas-promo .section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--ink); margin: 0; padding-top: 0; }
.feas-promo .section-title::before { display: none; }
.feas-promo .section-sub { margin: 0; font-size: 1rem; }
.feas-tag {
  display: inline-block; background: var(--primary); color: var(--accent-soft); font-weight: 700; font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px;
}
.feas-list { list-style: none; display: grid; gap: 10px; }
.feas-list li { display: flex; gap: 12px; align-items: flex-start; font-size: .96rem; }
.feas-list li::before {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.feas-promo-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feas-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feas-stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; letter-spacing: -.02em; color: var(--primary); }
.feas-stat span { display: block; font-size: .88rem; color: var(--muted); }

/* ---- About ---- */
#about { background: #fff; }
.about-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.about-text p { margin-bottom: 18px; color: #3a4a41; font-size: 1.06rem; line-height: 1.7; }
#about-image {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 40px); display: flex; align-items: center; justify-content: center;
}
#about-image img { width: 100%; max-width: 460px; height: auto; border-radius: 16px; }
.about-placeholder { min-height: 240px; width: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* ---- Team ---- */
#team { background: var(--paper); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 20px; }
@media (max-width: 520px) { .team-grid { gap: 14px; } .team-body { padding: 12px 14px 16px; } .team-name { font-size: 1rem; } }
.team-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.team-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,59,42,.14); }
.team-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; display: block; background: var(--sage); }
.team-photo-empty { display: flex; align-items: center; justify-content: center; font-size: 3.4rem; color: #9fb3a8; }
.team-body { padding: 16px 18px 20px; }
.team-name { font-size: 1.1rem; line-height: 1.25; color: var(--ink); margin: 0 0 4px; }
.team-role { font-size: .9rem; color: var(--muted); margin: 0; }
.team-bio { font-size: .88rem; color: var(--muted); line-height: 1.55; margin: 8px 0 0; }

/* ---- Visits (balanced photo rows) ----
   On phones: 2 columns. From 780px: a 12-column grid where main.js sets --s on each
   tile so every row is full (rows of 3–4 tiles), whatever the number of photos. */
#visits { background: var(--sage); }
.visit-gallery { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit-gallery .visit-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
.visit-item {
  position: relative; margin: 0; border-radius: 22px; overflow: hidden; background: #cbd7cc;
  cursor: zoom-in; aspect-ratio: 4 / 3;
}
.visit-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.visit-item:hover img { transform: scale(1.04); }
.visit-item figcaption {
  position: absolute; inset-inline-start: 12px; bottom: 12px; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: 999px; background: rgba(10,42,30,.88); color: #fff; font-size: .82rem; font-weight: 600;
}
@media (min-width: 780px) {
  .visit-gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .visit-gallery .visit-item { grid-column: span var(--s, 3); }
  .visit-gallery .visit-item:last-child:nth-child(odd) { grid-column: span var(--s, 3); }
}

/* ---- Contact ---- */
#contact { background: #fff; }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
#contact-info { display: flex; flex-direction: column; }
.contact-item {
  display: flex; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--sage);
  color: inherit;
}
.contact-item:last-child { border-bottom: 0; }
.contact-item .ico {
  width: 48px; height: 48px; border-radius: 14px; background: var(--sage); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-item strong { display: block; font-size: .82rem; font-weight: 500; color: var(--muted); }
.contact-item .ci-val { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.contact-item a.ci-val:hover { text-decoration: underline; }
.contact-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 40px);
}
.contact-card form { display: flex; flex-direction: column; gap: 16px; }
.contact-card input, .contact-card textarea {
  width: 100%; padding: 0 16px; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: #fff; font-size: 1rem; color: var(--ink);
}
.contact-card textarea { padding: 14px 16px; resize: vertical; line-height: 1.5; }
.contact-card input::placeholder, .contact-card textarea::placeholder { color: #6b7a71; }
.contact-card .btn { min-height: 56px; }
#contact-fb { margin-top: 48px; }
.social-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 24px; }
.social-card { width: 400px; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.fb-preview iframe { display: block; width: 100%; height: 500px; border: 0; background: #fff; }
.yt-preview { display: flex; flex-direction: column; }
.yt-preview iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.yt-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 240px; padding: 28px; color: var(--primary); text-align: center;
}
.yt-card:hover { background: #fafafa; }
.yt-card .yt-logo { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 46px; background: #f00; color: #fff; border-radius: 12px; font-size: 1.5rem; }
.yt-card strong { font-size: 1.1rem; }
.yt-card .yt-go { font-size: .9rem; color: var(--accent-ink); word-break: break-all; }
@media (max-width: 520px) { .social-card { width: 100%; } }

/* ---- Footer ---- */
footer { background: var(--primary-deep); color: var(--on-dark); padding: clamp(48px, 6vw, 72px) 0 28px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 40px; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.3fr); }
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.footer-brand .fb-name { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff; }
.footer-brand img { height: 52px; width: 60px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.footer-brand p { font-size: .95rem; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--font-body); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: .95rem; }
.footer-col a:hover { color: var(--accent-soft); }
.footer-bottom {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .88rem; color: var(--on-dark-muted);
}

/* ---- Modals (sire profile + product article) ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,22,16,.65); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px 40px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 880px; width: 100%;
  padding: 30px 30px 34px; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,.28);
}
.modal-close {
  position: absolute; top: 16px; inset-inline-end: 16px; z-index: 2; background: var(--sage); color: var(--primary);
  border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; line-height: 1;
  transition: background-color .15s;
}
.modal-close:hover { background: var(--line); }

/* Sire detail */
.sdl-top { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; margin-bottom: 24px; align-items: start; }
.sdl-hero-col { display: flex; flex-direction: column; gap: 14px; }
.sdl-hero-img { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 400px; display: block; }
.sdl-hero-empty { width: 100%; height: 260px; background: var(--sage); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.sdl-pedigree { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: 14px; padding: 14px 16px; }
.ped-item { flex: 1; min-width: 0; }
.ped-role { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.ped-item strong { font-size: .92rem; color: var(--primary); word-break: break-word; }
.ped-x { font-size: 1.4rem; color: var(--muted); font-weight: 700; flex-shrink: 0; }
.sdl-info-col { display: flex; flex-direction: column; gap: 16px; align-self: start; }
.sdl-name { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; color: var(--ink); letter-spacing: -.02em; margin: 8px 0 0; line-height: 1.05; }
.sdl-code { font-size: .95rem; color: var(--muted); margin-bottom: 8px; }
.sdl-meta { font-size: .88rem; display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.sdl-meta div { display: flex; gap: 8px; }
.sdl-meta span { color: var(--muted); width: 72px; flex-shrink: 0; font-size: .82rem; }
.sdl-hapl { font-size: .82rem; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 8px 12px; line-height: 1.5; }
.sdl-idx-badge { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.sdl-idx-top { display: flex; align-items: baseline; gap: 10px; }
.sdl-ival { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.sdl-itype { font-size: 1rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.sdl-irel { font-size: .85rem; color: var(--on-dark); margin-top: 6px; }
.sdl-idh { font-size: .82rem; color: var(--on-dark-muted); margin-top: 2px; }

.sdl-gallery-row { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.sdl-gallery-label, .sdl-photo-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.sdl-gallery-label { margin-bottom: 12px; }
.sdl-gallery-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.sdl-photo-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.sdl-photo-label { padding: 10px 12px 6px; background: var(--paper); }
.sdl-photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; transition: transform .18s; }
.sdl-photo-card img:hover { transform: scale(1.03); }
.sdl-photo-img-empty { aspect-ratio: 4 / 3; background: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.sdl-photo-cap { padding: 10px 12px; flex: 1; }
.sdl-photo-cap strong { display: block; font-size: .86rem; color: var(--ink); margin-bottom: 2px; }
.sdl-photo-cap span { font-size: .76rem; color: var(--muted); display: block; }
.sdl-herd { font-style: italic; }

.sdl-data { padding-top: 4px; }
.sdl-section { margin-bottom: 26px; }
.sdl-sec-title {
  font-family: var(--font-body); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ltr-scale-note { font-size: .74rem; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.sdl-composites { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.comp-chip { background: var(--sage); border-radius: 14px; padding: 10px 20px; text-align: center; min-width: 88px; }
.comp-chip span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.comp-chip strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--primary); font-weight: 700; }

.gen-group { margin: 14px 0 4px; }
.gen-group-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary);
  margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gen-card { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.gen-card-label { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.gen-card-val { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--primary); }

.ltr-group { margin-bottom: 20px; }
.ltr-group-title {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink);
  padding: 5px 0 4px; margin-bottom: 6px; border-bottom: 1px dashed var(--line-strong);
}
.ltr-header, .ltr-row { display: grid; grid-template-columns: 155px 70px 1fr 70px 46px; }
.ltr-header { font-size: .7rem; color: var(--muted); padding-bottom: 4px; }
.ltr-lo-h { text-align: end; padding-inline-end: 6px; }
.ltr-row { align-items: center; gap: 4px; margin-bottom: 7px; }
.ltr-name { font-size: .86rem; color: #3a4a41; }
.ltr-lo { font-size: .74rem; color: var(--muted); text-align: end; padding-inline-end: 6px; }
.ltr-bar { position: relative; height: 11px; background: var(--sage); border-radius: 999px; }
.ltr-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 999px; transition: width .2s; }
.ltr-avg { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--accent); border-radius: 2px; }
.ltr-hi { font-size: .74rem; color: var(--muted); padding-inline-start: 6px; }
.ltr-val { font-weight: 700; color: var(--primary); font-size: .95rem; text-align: end; }
.sdl-bullets { padding-inline-start: 20px; margin: 0; }
.sdl-bullets li { margin-bottom: 7px; color: #3a4a41; font-size: .96rem; }

@media (max-width: 680px) {
  .modal { padding: 20px 16px 26px; }
  .sdl-top { grid-template-columns: 1fr; }
  .sdl-hero-img { max-height: 280px; }
  .ltr-row, .ltr-header { grid-template-columns: 110px 54px 1fr 54px 36px; }
  .ltr-lo, .ltr-hi { font-size: .66rem; }
  .ltr-name { font-size: .78rem; }
}

/* Product article */
.product-modal { max-width: 840px; }
.pm-article { padding: 4px 2px; }
.pm-head { margin-bottom: 18px; padding-inline-end: 44px; }
.pm-title { color: var(--ink); margin: 12px 0 6px; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -.02em; }
.pm-price { font-weight: 700; color: var(--accent-ink); font-size: 1.1rem; }
.pm-hero {
  width: 100%; max-height: 460px; object-fit: contain; background: var(--paper);
  border-radius: var(--radius); margin-bottom: 22px; display: block; cursor: zoom-in; border: 1px solid var(--line);
}
.pm-desc { color: #3a4a41; line-height: 1.8; font-size: 1.04rem; }
.pm-desc p { margin-bottom: 14px; }
.pm-desc h1 { font-size: 1.7rem; color: var(--ink); margin: .6em 0 .3em; }
.pm-desc h2 { font-size: 1.4rem; color: var(--ink); margin: .6em 0 .3em; }
.pm-desc h3 { font-size: 1.2rem; color: var(--ink); margin: .6em 0 .3em; }
.pm-desc h4 { font-size: 1.05rem; color: var(--ink); margin: .6em 0 .3em; }
.pm-desc ul, .pm-desc ol { margin: .6em 0; padding-inline-start: 26px; }
.pm-desc blockquote { border-inline-start: 3px solid var(--accent); margin: 1em 0; padding: 8px 18px; color: #555; background: var(--paper); border-radius: 0 10px 10px 0; }
.pm-desc pre { background: #f3f4f3; padding: 12px 16px; border-radius: 10px; font-family: monospace; overflow: auto; }
.pm-desc a { color: var(--primary); text-decoration: underline; }
.pm-desc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.pm-desc table, .company-desc table { border-collapse: collapse; margin: 14px 0; }
.pm-desc table td, .company-desc table td { border: 1px solid var(--line); padding: 7px 11px; }
.pm-desc ul.rt-checklist, .company-desc ul.rt-checklist, #about-body ul.rt-checklist { list-style: none; padding-inline-start: 4px; }
.pm-desc ul.rt-checklist li, .company-desc ul.rt-checklist li { margin: 4px 0; }
.pm-desc figure { margin: 16px 0; }
.pm-desc figure img { max-width: 100%; border-radius: 12px; display: block; cursor: zoom-in; }
.pm-desc figure figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 6px; font-style: italic; }
.pm-desc figure.rt-img-small  { width: 35%; }
.pm-desc figure.rt-img-medium { width: 60%; }
.pm-desc figure.rt-img-large  { width: 85%; }
.pm-desc figure.rt-img-full   { width: 100%; }
.pm-desc figure.rt-img-center { margin-left: auto; margin-right: auto; }
.pm-desc figure.rt-img-left   { float: left; margin: 6px 20px 12px 0; max-width: 50%; }
.pm-desc figure.rt-img-right  { float: right; margin: 6px 0 12px 20px; max-width: 50%; }
.pm-desc figure.rt-img-inline { display: inline-block; vertical-align: top; margin: 4px 10px; }
.pm-desc::after { content: ""; display: block; clear: both; }

/* free-positioned (overlapping) images — front of / behind text */
.pm-desc, #about-body, .company-desc { position: relative; isolation: isolate; }
.pm-desc figure.rt-img-front,  #about-body figure.rt-img-front,  .company-desc figure.rt-img-front  { position: absolute; z-index: 30; margin: 0; }
.pm-desc figure.rt-img-behind, #about-body figure.rt-img-behind, .company-desc figure.rt-img-behind { position: absolute; z-index: -1; margin: 0; }

/* Rich-content figures in About & Partners */
#about-body figure, .company-desc figure { margin: 16px 0; }
#about-body figure img, .company-desc figure img { max-width: 100%; border-radius: 12px; display: block; }
#about-body figure figcaption, .company-desc figure figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 6px; font-style: italic; }
#about-body figure.rt-img-small,  .company-desc figure.rt-img-small  { width: 35%; }
#about-body figure.rt-img-medium, .company-desc figure.rt-img-medium { width: 60%; }
#about-body figure.rt-img-large,  .company-desc figure.rt-img-large  { width: 85%; }
#about-body figure.rt-img-full,   .company-desc figure.rt-img-full   { width: 100%; }
#about-body figure.rt-img-center, .company-desc figure.rt-img-center { margin-left: auto; margin-right: auto; }
#about-body figure.rt-img-left,   .company-desc figure.rt-img-left   { float: left; margin: 6px 20px 12px 0; max-width: 50%; }
#about-body figure.rt-img-right,  .company-desc figure.rt-img-right  { float: right; margin: 6px 0 12px 20px; max-width: 50%; }
#about-body figure.rt-img-inline, .company-desc figure.rt-img-inline { display: inline-block; vertical-align: top; margin: 4px 10px; }
#about-body::after, .company-desc::after { content: ""; display: block; clear: both; }
body.rtl .pm-desc figure.rt-img-left { float: right; margin: 6px 0 12px 20px; }
body.rtl .pm-desc figure.rt-img-right { float: left; margin: 6px 20px 12px 0; }
@media (max-width: 640px) {
  .pm-desc figure.rt-img-small, .pm-desc figure.rt-img-medium,
  .pm-desc figure.rt-img-large, .pm-desc figure.rt-img-left, .pm-desc figure.rt-img-right { width: 100%; max-width: 100%; float: none; margin: 16px 0; }
}
.pm-sub { color: var(--ink); font-size: 1.2rem; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pm-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pm-features li { position: relative; padding-inline-start: 32px; color: #3a4a41; font-size: 1rem; line-height: 1.5; }
.pm-features li::before {
  content: "✔"; position: absolute; inset-inline-start: 0; top: 1px; color: #fff; background: var(--primary);
  width: 21px; height: 21px; border-radius: 50%; font-size: .7rem; display: flex; align-items: center; justify-content: center;
}
.pm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pm-gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; cursor: zoom-in;
  transition: transform .15s, box-shadow .2s; border: 1px solid var(--line);
}
.pm-gallery img:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.pm-actions { margin-top: 28px; }

/* ---- Photo lightbox ---- */
.photo-lb { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.88); align-items: center; justify-content: center; }
.photo-lb.open { display: flex; }
.lb-img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 12px; display: block; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.lb-close {
  position: fixed; top: 20px; right: 24px; background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: 50%; width: 44px; height: 44px; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: background .15s;
}
.lb-close:hover { background: rgba(255,255,255,.3); }

/* ---- Right-to-left (Pashto / Dari) ----
   <html dir="rtl"> already mirrors the grid/flex layouts; only fonts need help. */
body.rtl { font-family: "Noto Naskh Arabic", "Segoe UI", "Tahoma", system-ui, sans-serif; }
body.rtl .d, body.rtl h1, body.rtl h2, body.rtl h3, body.rtl .brand-name,
body.rtl .hero-stat b, body.rtl .sire-idx i { font-family: "Noto Naskh Arabic", "Segoe UI", "Tahoma", system-ui, sans-serif; }
body.rtl .hero h1 { line-height: 1.25; letter-spacing: 0; font-size: clamp(2rem, 4.4vw, 3.4rem); }
body.rtl .section-title { letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .sire-card, .team-card, .hero-feature, .hero-slide, .visit-item img { transition: none; }
  .btn:hover, .card:hover, .sire-card:hover, .team-card:hover, .hero-feature:hover { transform: none; }
}
