:root {
  --bg: #fefdfb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #fffefc;
  --ink: #241c15;
  --muted: #6c5f52;
  --line: rgba(61, 47, 30, 0.12);
  --gold: #d4ed31;
  --gold-dark: #7f9120;
  --gold-soft: rgba(212, 237, 49, 0.18);
  --forest: #55624d;
  --forest-dark: #384335;
  --shadow: 0 10px 25px rgba(43, 28, 13, 0.06);
  --radius-xl: 3px;
  --radius-lg: 3px;
  --radius-md: 3px;
  --radius-sm: 3px;
  --container: min(1200px, calc(100vw - 2rem));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

@media (min-width: 1025px) {
  html {
    font-size: 80%;
  }
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(212, 237, 49, 0.06), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #fffefc 26%, var(--bg) 100%);
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.section {
  padding: 2.25rem 0;
}

.eyebrow {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.horse-card .eyebrow,
.modal-copy .eyebrow {
  font-size: 0.52rem;
  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  line-height: 1.18;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.4rem, 2.65vw, 2.25rem);
}

h2 {
  font-size: clamp(1.1rem, 1.75vw, 1.65rem);
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  font-size: 1.05rem;
  max-width: 62ch;
}

.site-header {
  position: relative;
  overflow: clip;
  padding-bottom: 2rem;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(12, 11, 10, 0.34), rgba(12, 11, 10, 0.22)),
    radial-gradient(circle at right top, rgba(212, 237, 49, 0.12), transparent 28%),
    url("https://www.palac-galiny.pl/upload/2015/12/top-18.jpg");
  background-size: cover;
  background-position: center center;
  z-index: -2;
}

.site-header::after {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  padding: 1.4rem 0;
  width: 100%;
  max-width: 100%;
  color: #f8f0e4;
  background: rgba(10, 10, 9, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  backdrop-filter: blur(2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 65px;
  height: 65px;
  transform: translate(-50%, -50%);
  background-image: url("logo-stadnina-biale.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.brand {
  display: grid;
  gap: 0.1rem;
}

.brand > span {
  display: block;
}

.brand-mark {
  font-family: "Libre Baskerville", serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}

.brand-copy {
  font-size: 0.72rem;
  opacity: 1;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  font-size: 0.95rem;
  opacity: 0.86;
  color: rgba(255, 248, 239, 0.96);
}

.hero {
  padding: 2.4rem 0 4.25rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(336px, 0.72fr);
  gap: 2rem;
  align-items: start;
}

.hero-copy {
  color: #ffffff;
}

.hero-copy p {
  color: #ffffff;
}

.hero-copy h1 {
  font-size: clamp(1.5rem, 2.9vw, 2.4rem);
}

.hero-panel,
.intro-strip,
.filters,
.contact-card,
.admin-form-card,
.admin-list-card,
.landing-card,
.horse-card,
.process-steps article,
.admin-item,
.modal-content {
  backdrop-filter: blur(14px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
}

.filters,
.contact-card,
.admin-form-card,
.admin-list-card,
.landing-card,
.horse-card,
.process-steps article,
.admin-item,
.modal-content {
  background: var(--surface-strong);
}

.hero-panel {
  position: static;
  width: min(294px, 100%);
  justify-self: end;
  align-self: start;
  margin-top: 10.4rem;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-service-actions {
  display: grid;
  gap: 0.63rem;
}

.hero-service-button {
  border: 1px solid rgba(142, 120, 88, 0.52);
  background: rgba(95, 75, 51, 0.82);
  color: #f3ecdf;
  text-align: center;
  text-transform: uppercase;
  min-height: 62px;
  padding: 0.77rem 0.8rem;
  border-radius: 2px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: "Libre Baskerville", serif;
  font-size: 1.19rem;
  line-height: 1.2;
  font-weight: 400;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-service-button:hover {
  background: rgba(116, 90, 62, 0.86);
  border-color: rgba(167, 142, 108, 0.58);
}

.hero-service-button:hover {
  transform: translateY(-1px);
}

.hero-service-button:focus,
.hero-service-button:focus-visible {
  outline: none;
  box-shadow: none;
}

.hero-actions,
.landing-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.hero-actions .hero-service-button {
  width: min(294px, 100%);
  min-height: 62px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.hero-facts div {
  min-width: 150px;
  padding: 0.9rem 1rem;
  border-radius: 2px;
  background: rgba(58, 45, 30, 0.92);
  border: 1px solid rgba(109, 88, 62, 0.66);
}

.hero-facts strong {
  display: block;
  font-size: 1.4rem;
  color: #f5eee1;
}

.hero-facts span {
  font-size: 0.9rem;
  color: rgba(243, 236, 223, 0.92);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.3rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #e5f85e, var(--gold));
  color: #241c15;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(162, 184, 32, 0.28);
}

.button-secondary {
  background: rgba(255, 248, 239, 0.06);
  color: #fff8ef;
  border-color: rgba(255, 248, 239, 0.24);
}

.hero-actions .button-primary,
.hero-actions .button-secondary {
  background: rgba(95, 75, 51, 0.82);
  color: #f3ecdf;
  border-color: rgba(142, 120, 88, 0.52);
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(48, 33, 18, 0.12);
}

.button-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.landing-card .button-secondary,
.admin-actions .button-secondary,
.admin-form-card .button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.intro-strip {
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.intro-strip::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  pointer-events: none;
}

.editorial-section {
  padding-top: 0;
  padding-bottom: 1.125rem;
}

.services-section {
  padding-top: 0;
  padding-bottom: 1.125rem;
}

.services-shell {
  display: grid;
  gap: 1.2rem;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-xl);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(248, 247, 243, 0.98), rgba(246, 244, 238, 0.98));
  border: 1px solid rgba(61, 47, 30, 0.08);
  box-shadow: var(--shadow);
}

.services-header {
  display: grid;
  gap: 0.5rem;
}

.services-header h2 {
  font-size: clamp(0.8rem, 1.2vw, 1.15rem);
}

.services-stack {
  display: grid;
  gap: 1rem;
}

.service-card {
  display: grid;
  grid-template-columns: 32% minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 47, 30, 0.08);
}

.service-card-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(85, 98, 77, 0.84), rgba(36, 28, 21, 0.9)),
    radial-gradient(circle at top right, rgba(212, 237, 49, 0.18), transparent 42%);
}

.service-card-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.service-card-copy {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.service-card h3 {
  font-size: 1.05rem;
}

.service-card p {
  margin: 0;
}

.service-lead {
  color: var(--ink);
  font-weight: 500;
}

.service-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.service-fact {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(212, 237, 49, 0.12);
  border: 1px solid rgba(178, 214, 58, 0.22);
}

.service-fact strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.service-fact span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.service-includes {
  display: grid;
  gap: 0.45rem;
}

.service-includes ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.service-includes li + li {
  margin-top: 0.35rem;
}

.services-cta {
  display: grid;
  grid-template-columns: 32% minmax(0, 1fr);
}

.services-cta .button {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.editorial-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem;
  align-items: end;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-xl);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(248, 247, 243, 0.98), rgba(246, 244, 238, 0.98));
  border: 1px solid rgba(61, 47, 30, 0.08);
  box-shadow: var(--shadow);
}

.editorial-card-alt {
  background:
    radial-gradient(circle at top right, rgba(212, 237, 49, 0.1), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 254, 250, 0.98));
}

.editorial-card-full {
  width: 100%;
  max-width: 100%;
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
  padding-left: max(1rem, calc((100vw - var(--container)) / 2));
  padding-right: max(1rem, calc((100vw - var(--container)) / 2));
  border-left: 0;
  border-right: 0;
}

.intro-grid,
.section-heading,
.process-grid,
.contact-card,
.admin-layout {
  display: grid;
  gap: 4rem;
}

.intro-grid,
.section-heading,
.contact-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.editorial-card,
.process-grid,
.admin-layout,
.modal-layout {
  align-items: center;
}

.intro-grid h2,
.editorial-card h2 {
  font-size: clamp(0.8rem, 1.2vw, 1.15rem);
}

.editorial-main {
  display: grid;
  gap: 0.75rem;
}

.editorial-main p {
  margin: 0;
}

.editorial-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding-left: 2.25rem;
  border-left: 1px solid rgba(61, 47, 30, 0.12);
}

.offer-context-switcher {
  margin: 1.15rem 0 0;
  padding-left: 0;
  border-left: 0;
  gap: 1.4rem;
  background-image: linear-gradient(
    to right,
    transparent calc(50% - 0.5px),
    rgba(61, 47, 30, 0.12) calc(50% - 0.5px),
    rgba(61, 47, 30, 0.12) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.breeding-subcontext-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
}

.context-card {
  font: inherit;
  text-align: center;
  cursor: pointer;
  min-height: 100%;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(178, 214, 58, 0.18);
  border: 1px solid rgba(178, 214, 58, 0.28);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  display: grid;
  place-items: center;
}

.subcontext-card {
  font: inherit;
  text-align: center;
  cursor: pointer;
  padding: 0.75rem 0.95rem;
  border-radius: 4px;
  background: rgba(167, 190, 96, 0.2);
  border: 1px solid rgba(140, 161, 73, 0.26);
  color: #32411a;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.subcontext-card:hover,
.subcontext-card.is-active {
  background: rgba(183, 208, 95, 0.38);
  border-color: rgba(127, 145, 32, 0.42);
}

.subcontext-card:hover {
  transform: translateY(-1px);
}

.context-card:hover,
.context-card.is-active {
  background: rgba(212, 237, 49, 0.82);
  border-color: rgba(127, 145, 32, 0.42);
}

.context-card:hover {
  transform: translateY(-1px);
}

.editorial-tiles h3 {
  font-size: 0.95rem;
  margin: 0;
}

.editorial-tiles p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.context-card.is-active p {
  color: rgba(31, 36, 20, 0.86);
}

.intro-copy {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(0.8rem, 1.2vw, 1.15rem);
  line-height: 1.18;
  color: var(--ink);
}

.intro-side-copy p {
  margin-top: 0;
}

.hero-panel,
.process-steps article,
.contact-card,
.editorial-card,
.services-shell,
.intro-grid {
  text-align: left;
}

.results-count {
  text-align: right;
  font-weight: 700;
}

.filters-section {
  padding-top: 2rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin: 2rem 0;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 600;
}

label span {
  font-size: 0.9rem;
}

label small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.horse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
  align-items: stretch;
}

.horse-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: clamp(220px, 18vw, 280px) 1fr;
  height: 100%;
  min-width: 0;
}

.horse-card-media {
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(85, 98, 77, 0.82), rgba(36, 28, 21, 0.82)),
    linear-gradient(45deg, rgba(212, 237, 49, 0.35), transparent 60%);
  position: relative;
  min-height: 0;
}

.horse-card-media:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.horse-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.horse-card-media::after {
  content: attr(data-name);
  position: absolute;
  inset: auto 1rem 1rem;
  color: rgba(255, 248, 239, 0.82);
  font-family: "Libre Baskerville", serif;
  font-size: 2rem;
  pointer-events: none;
}

.horse-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  gap: 1rem;
  padding: 1.2rem;
  min-width: 0;
}

.horse-card-body > * {
  min-width: 0;
}

.horse-card-body > .meta-list {
  align-items: flex-start;
  align-content: flex-start;
}

.horse-card-body > .button-secondary {
  align-self: end;
}

.horse-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  flex-wrap: wrap;
}

.horse-card-top > div:first-child {
  flex: 1 1 180px;
  min-width: 0;
}

.horse-card h3 {
  font-size: 1.4rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-form-card h1 {
  font-size: clamp(1.1rem, 1.55vw, 1.5rem);
}

.price-tag {
  font-weight: 800;
  color: var(--forest-dark);
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 100%;
  font-size: 1.05rem;
  white-space: nowrap;
  text-align: right;
}

.price-tag-muted {
  color: var(--gold-dark);
  font-weight: 700;
}

.meta-list,
.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-pill {
  border-radius: 4px;
  background: #b2d63a;
  color: var(--forest-dark);
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.horse-card .button-secondary {
  display: block;
  width: min(80%, 260px);
  max-width: calc(100% - 20px);
  margin: 0 auto;
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.empty-state {
  text-align: center;
  padding: 2rem;
}

.process-grid {
  grid-template-columns: 0.8fr 1.2fr;
  align-items: start;
}

.mail-contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
}

.mail-contact-form-wide,
.mail-contact-status,
.mail-contact-note,
.mail-contact-submit {
  grid-column: 1 / -1;
}

.mail-contact-status {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.mail-contact-status.is-success {
  background: rgba(171, 196, 136, 0.18);
  border-color: rgba(114, 137, 82, 0.3);
  color: #304226;
}

.mail-contact-status.is-warning {
  background: rgba(208, 177, 107, 0.16);
  border-color: rgba(166, 126, 58, 0.28);
  color: #5e4522;
}

.mail-contact-status.is-error {
  background: rgba(176, 89, 89, 0.12);
  border-color: rgba(142, 55, 55, 0.24);
  color: #7b2c2c;
}

.mail-contact-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.form-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.mail-contact-submit {
  justify-self: start;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.process-steps article,
.contact-card,
.admin-form-card,
.admin-list-card,
.landing-card,
.modal-content {
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.contact-details {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
  text-align: right;
}

.contact-details a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-dark);
}

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

.horse-modal {
  width: min(1080px, calc(100vw - 1.5rem));
  border: 0;
  padding: 0;
  background: transparent;
}

.horse-modal::backdrop {
  background: rgba(26, 20, 15, 0.72);
  backdrop-filter: blur(6px);
}

.modal-shell {
  display: flex;
  justify-content: flex-end;
}

.modal-close {
  margin-bottom: 0.7rem;
  border: 0;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.88);
  cursor: pointer;
}

.modal-layout {
  display: grid;
  gap: 1.4rem;
}

.modal-top {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 1.28fr);
  gap: 1.4rem;
  align-items: stretch;
}

.modal-bottom {
  display: grid;
  padding-top: 1rem;
  border-top: 1px solid rgba(61, 47, 30, 0.12);
}

.modal-gallery {
  display: grid;
  gap: 0.9rem;
}

.modal-main-image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(85, 98, 77, 0.84), rgba(36, 28, 21, 0.9)),
    radial-gradient(circle at top right, rgba(212, 237, 49, 0.18), transparent 42%);
}

.modal-main-image-button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.modal-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.7rem;
}

.thumb-grid button {
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

.thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  grid-template-columns: minmax(56px, 84px) minmax(0, 1fr) minmax(56px, 84px);
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(12, 10, 8, 0.88);
}

.lightbox:not([open]) {
  display: none;
}

.lightbox::backdrop {
  background: rgba(12, 10, 8, 0.88);
}

.lightbox-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.lightbox-image {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.lightbox-nav {
  width: 56px;
  height: 56px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-prev {
  justify-self: start;
}

.lightbox-next {
  justify-self: end;
}

.modal-copy {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.modal-video-section {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.25rem;
}

.modal-copy h3 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.pedigree-section {
  display: grid;
  min-width: 0;
  gap: 0.45rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(239, 236, 228, 0.9);
}

.pedigree-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #7f9120 #e4e5dd;
  padding: 0 0 0.5rem;
}

.pedigree-scroll:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 3px;
}

.pedigree-tree {
  --pedigree-gap: 20px;
  --pedigree-line: #acb1a3;
  display: grid;
  grid-template-columns: repeat(4, minmax(175px, 1fr));
  grid-template-rows: repeat(16, minmax(34px, 1fr));
  column-gap: var(--pedigree-gap);
  min-width: 760px;
  align-items: stretch;
}

.pedigree-cell {
  display: grid;
  min-width: 0;
  align-items: center;
  position: relative;
  padding: 2px 0;
}

.pedigree-cell:not(.pedigree-generation-1)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--pedigree-gap) / -2);
  width: calc(var(--pedigree-gap) / 2);
  border-top: 1px solid var(--pedigree-line);
}

.pedigree-cell:not(.pedigree-generation-4)::after {
  content: "";
  position: absolute;
  top: 25%;
  right: calc(var(--pedigree-gap) / -2);
  width: 0;
  height: 50%;
  border-right: 1px solid var(--pedigree-line);
  pointer-events: none;
}

.pedigree-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--pedigree-gap) / -2);
  width: calc(var(--pedigree-gap) / 2);
  border-top: 1px solid var(--pedigree-line);
}

.pedigree-generation-4 .pedigree-node::after {
  content: none;
}

.pedigree-axis {
  display: grid;
  place-items: center;
}

.pedigree-axis-core {
  display: grid;
  gap: 0.2rem;
  min-width: min(180px, 100%);
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(61, 47, 30, 0.1);
}

.pedigree-axis-core span {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pedigree-axis-core strong {
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pedigree-node {
  display: grid;
  position: relative;
  min-width: 0;
  align-content: center;
  gap: 1px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 47, 30, 0.08);
  overflow-wrap: anywhere;
}

.pedigree-node span {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.pedigree-node strong {
  font-size: 14px;
  line-height: 1.35;
}

.pedigree-node-sire span,
.pedigree-node-sire strong {
  color: #55624d;
}

.pedigree-node-dam span,
.pedigree-node-dam strong {
  color: #8a6b3d;
}

.video-grid {
  display: grid;
  gap: 0.8rem;
}

.video-embed-wrap {
  display: grid;
  gap: 0.45rem;
}

.video-embed {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-embed iframe,
.video-embed video {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-external-link {
  color: var(--color-ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.video-external-link:hover,
.video-external-link:focus-visible {
  text-decoration: underline;
}

.admin-header::after {
  display: none;
}

.admin-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: start;
}

.section-heading.compact,
.landing-card {
  grid-template-columns: 1fr;
}

.admin-form,
.form-grid,
.admin-list {
  display: grid;
  gap: 1rem;
}

.pedigree-editor {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(61, 47, 30, 0.08);
}

.pedigree-form-split {
  display: grid;
  gap: 1rem;
}

.pedigree-importer {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed rgba(61, 47, 30, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.pedigree-import-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pedigree-import-actions .button {
  width: auto;
}

.pedigree-import-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pedigree-import-status.is-success {
  color: #334016;
  font-weight: 700;
}

.pedigree-import-status.is-error {
  color: #7b2c2c;
  font-weight: 700;
}

.pedigree-form-branch {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(61, 47, 30, 0.08);
}

.pedigree-form-title {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pedigree-form-branch-sire .pedigree-form-title {
  color: #55624d;
}

.pedigree-form-branch-dam .pedigree-form-title {
  color: #8a6b3d;
}

.pedigree-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pedigree-generation-1 span {
  color: #7f9120;
}

.pedigree-generation-2 span {
  color: #55624d;
}

.pedigree-generation-3 span {
  color: #8a6b3d;
}

.pedigree-generation-4 span {
  color: #6b5b78;
}


.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.checkbox-field input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--gold);
}

.checkbox-field span {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.upload-preview {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px dashed rgba(61, 47, 30, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
}

.upload-preview:empty {
  display: none;
}

.upload-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: -0.25rem;
}

.upload-actions .button {
  width: auto;
}

.upload-actions .button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.upload-actions .button.is-uploading {
  opacity: 1;
  cursor: wait;
  background: var(--forest-dark);
  color: #fff;
}

.upload-actions .button.is-complete {
  opacity: 1;
  background: #b2d63a;
  color: var(--forest-dark);
}

.upload-status {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.upload-status strong {
  color: var(--ink);
}

.upload-status.is-success {
  background: rgba(178, 214, 58, 0.18);
  color: #334016;
}

.upload-status.is-progress {
  background: rgba(212, 237, 49, 0.16);
  color: var(--gold-dark);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.upload-preview-item {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 128px auto;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0.65rem;
  border: 1px solid rgba(61, 47, 30, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
}

.upload-preview-item img {
  width: 100%;
  height: 128px;
  min-width: 0;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: rgba(61, 47, 30, 0.08);
}

.upload-preview-item div {
  min-width: 0;
  overflow: hidden;
}

.upload-preview-item span,
.upload-preview-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.upload-preview-item span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.upload-preview-item small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.admin-item {
  padding: 1rem;
  border-radius: var(--radius-md);
}

.admin-item-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.admin-item h3 {
  font-size: 1.8rem;
}

.admin-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.admin-context-label,
.admin-sale-label {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-context-label {
  background: rgba(178, 214, 58, 0.24);
  color: var(--forest-dark);
}

.admin-sale-label.is-live {
  background: rgba(178, 214, 58, 0.36);
  color: #334016;
}

.admin-sale-label.is-hidden {
  background: rgba(61, 47, 30, 0.1);
  color: var(--muted);
}

.admin-item-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.admin-item button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
}

.admin-item button:hover,
.topnav a:hover,
.contact-details a:hover {
  color: var(--gold-dark);
}

.admin-note {
  max-width: 36ch;
}

.landing-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.landing-shell {
  width: var(--container);
  padding: 2rem 0;
}

.landing-card {
  max-width: 760px;
  margin: 0 auto;
}

.landing-notes {
  margin: 1.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.site-footer {
  margin-top: 4rem;
}

.footer-bottom {
  background: #050505;
  color: #ffffff;
}

.footer-contact {
  background: #ffffff;
}

.footer-contact-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
  gap: 0;
  align-items: stretch;
}

.footer-contact-card {
  background: rgba(240, 244, 243, 0.9);
  padding: 2.25rem;
  text-align: center;
}

.footer-logo {
  width: 120px;
  margin: 0 auto 1rem;
  filter: brightness(0);
}

.footer-place {
  color: var(--ink);
  font-weight: 700;
}

.footer-contact-card p {
  margin: 0.55rem 0;
}

.footer-contact-card a {
  color: var(--ink);
}

.footer-map-wrap {
  position: relative;
  min-height: 420px;
}

.footer-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  display: block;
}

.footer-socials {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 1rem;
}

.footer-socials a {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.footer-socials img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-bottom {
  padding: 1rem 0;
}

.footer-awards {
  background: #ffffff;
  padding: 1.2rem 0;
  border-top: 1px solid rgba(61, 47, 30, 0.08);
}

.footer-awards-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: center;
}

.footer-awards-grid a {
  display: grid;
  place-items: center;
  min-height: 120px;
}

.footer-awards-grid img {
  max-width: 100%;
  max-height: 104px;
  width: auto;
  height: auto;
  object-fit: contain;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer-links a,
.footer-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .hero-grid,
  .intro-grid,
  .section-heading,
  .process-grid,
  .contact-card,
  .admin-layout,
  .modal-layout,
  .modal-top,
  .editorial-card,
  .services-shell,
  .footer-contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-awards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .horse-grid,
  .process-steps,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card,
  .service-facts {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    width: auto;
    margin-top: 0;
    justify-self: stretch;
  }

  .contact-details {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 3.2rem 0;
  }

  .hero-actions,
  .landing-actions,
  .admin-actions,
  .topnav {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    align-items: start;
    gap: 0.9rem;
    padding: 1rem;
  }

  .topbar::after {
    display: none;
  }

  .brand {
    gap: 0.2rem;
  }

  .brand-mark {
    font-size: 1rem;
    letter-spacing: 0.03em;
  }

  .brand-copy {
    font-size: 0.68rem;
  }

  .topnav {
    gap: 0.45rem;
  }

  .topnav a {
    font-size: 0.9rem;
  }

  .horse-grid,
  .process-steps,
  .filters,
  .editorial-tiles,
  .offer-context-switcher,
  .breeding-subcontext-switcher,
  .mail-contact-form,
  .pedigree-form-split,
  .pedigree-form-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .pedigree-section {
    padding: 0.5rem;
  }

  .hero {
    padding: 1.4rem 0 2.25rem;
  }

  .editorial-tiles,
  .offer-context-switcher {
    padding-left: 0;
    padding-top: 1rem;
    border-left: 0;
    border-top: 1px solid rgba(61, 47, 30, 0.12);
    background-image: none;
  }

  .hero-grid {
    gap: 1.25rem;
    align-items: start;
  }

  .hero-copy h1 {
    font-size: 1.15rem;
  }

  .hero-copy .lead {
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: none;
  }

  .hero-actions {
    margin-top: 1.2rem;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.2rem;
  }

  .hero-facts div {
    min-width: 0;
    padding: 0.8rem 0.85rem;
  }

  .hero-facts strong {
    font-size: 1.05rem;
  }

  .hero-facts span {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .hero-panel {
    width: 100%;
    margin-top: 0;
  }

  .horse-card-top,
  .admin-item-head {
    flex-direction: column;
  }

  .horse-card-body {
    gap: 0.75rem;
  }

  .horse-card-top {
    gap: 0.35rem;
  }

  .horse-card-top > div:first-child {
    flex-basis: auto;
  }

  .horse-card h3 {
    margin-bottom: 0;
  }

  .footer-awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-socials {
    position: static;
    transform: none;
    grid-auto-flow: column;
    justify-content: center;
    padding: 1rem 0 1.5rem;
  }

  .lightbox {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 1rem;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: 82vh;
  }
}
