/* IrishBredEventingResults (IBER)
   Laptop-first. Irish flag colours: green (a darker shade of the flag green, so text reads clearly), white and orange. Fraunces headings, Inter body. */

:root {
  --navy: #0F6741;            /* green: header, footer, headings, horse names */
  --navy-deep: #0F6741;
  --navy-soft: #0F6741;
  --gold: #0F6741;            /* small labels and placings (flag orange is too light for text) */
  --gold-bright: #FF883E;     /* flag orange: stripes, underlines, highlights */
  --gold-pale: #FFFFFF;
  --cream: #FFFFFF;
  --cream-2: #F3F4F2;
  --paper: #FFFFFF;
  --ink: #1C1B17;
  --ink-soft: #46443C;
  --ink-faint: #6E6A5C;
  --rule: #E3E5E2;
  --rule-strong: #C9CDC8;
  --alert: #9E1B2F;            /* errors and "Unverified" only */
  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --page: 1320px;
  --side: 170px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 2px;
}

.container { max-width: var(--page); margin: 0 auto; padding: 0 32px; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold-bright); }
.hdr-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 22px 0 18px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: #fff; min-width: 0; }
.brand-mark {
  flex: none; width: 58px; height: 58px; border: 1.5px solid var(--gold-bright);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
  font-size: 15px; letter-spacing: 0.08em; color: var(--gold-bright);
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 36px; line-height: 1.05; letter-spacing: -0.01em; overflow-wrap: anywhere; margin: 0; }
.brand-name span { color: #fff; }
.hdr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; flex: none; }
.hdr-search { position: relative; width: 400px; margin: 0; }
.hdr-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.hdr-search input {
  width: 100%; border: 1px solid transparent; border-radius: 2px; background: #fff; color: var(--ink);
  font: 15px var(--sans); padding: 11px 14px 11px 40px;
}
.hdr-search input::placeholder { color: #8A8676; }
.hdr-search input:focus { outline: none; border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(255,136,62,.35); }
.nav { display: flex; gap: 30px; }
.nav a {
  color: #FFFFFF; text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 0; border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--gold-bright); }

/* ---------- Adverts: each page's pinned top banner and its six side boxes ---------- */
.topbar { position: sticky; top: 0; z-index: 40; }
html { scroll-padding-top: calc(var(--top-h, 260px) + 12px); }
.banner-bar { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 10px 0; }
.banner {
  display: flex; align-items: center; justify-content: center; height: 110px; background: var(--paper);
  border: 1px solid var(--rule); color: var(--ink-faint); text-decoration: none; overflow: hidden; position: relative;
  transition: border-color .15s;
}
.banner:hover { border-color: var(--rule-strong); }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner picture, .ad-box picture { display: block; width: 100%; height: 100%; }
.ad-label {
  position: absolute; top: 0; left: 0; z-index: 1; font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); background: rgba(255,255,255,.88); padding: 1px 5px; line-height: 1.5; pointer-events: none;
}
.ad-open { border-style: dashed; border-color: var(--rule-strong); background: var(--cream-2); }
.ad-open-text { font-size: 13px; font-weight: 600; color: var(--navy); text-align: center; padding: 14px 10px 6px; }
.ad-open:hover { border-color: var(--gold-bright); }
.ad-open:hover .ad-open-text { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Page grid: three ad boxes down each side of the content ---------- */
.page {
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--side); gap: 32px; align-items: start;
  max-width: calc(var(--page) + 2 * var(--side) + 64px);
}
.container.page { padding-top: 32px; padding-bottom: 44px; }
.side { position: sticky; top: calc(var(--top-h, 260px) + 16px); display: grid; gap: 12px; }
.ad-box {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); position: relative;
  aspect-ratio: 1 / 1; text-decoration: none; color: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s;
  max-height: calc((100vh - var(--top-h, 260px) - 56px) / 3);
}
.ad-box:not(.ad-open):hover { border-color: var(--rule-strong); box-shadow: 0 2px 10px rgba(22,35,63,.06); }
.ad-box .ad-body { flex: 1; min-height: 0; display: grid; place-items: center; }
.ad-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-box.ad-open { align-items: center; justify-content: center; }
.ad-box .ad-name { font-family: var(--serif); font-weight: 600; color: var(--navy); text-align: center; padding: 0 10px; }
/* Below 1200px there is no room beside the content: the six boxes sit in a tidy block underneath it. */
@media (max-width: 1199px) {
  .page { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .page > main { grid-row: 1; }
  .side { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .side-left { grid-row: 2; margin-top: 36px; }
  .side-right { grid-row: 3; margin-top: 12px; }
  .ad-box { max-height: none; }
}

/* ---------- Type ---------- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.page-title { font-size: 40px; line-height: 1.1; color: var(--navy); margin: 0 0 10px; }
.page-intro { font-size: 16px; color: var(--ink-soft); max-width: 680px; margin: 0 0 28px; }
.section-title { font-size: 24px; color: var(--navy); margin: 0 0 14px; }
.meta-line { font-size: 14px; color: var(--ink-faint); margin: 0 0 20px; }
.meta-line b { color: var(--ink-soft); font-weight: 600; }
.text-link { color: var(--navy); font-weight: 600; font-size: 14px; text-decoration: none; border-bottom: 1px solid var(--gold-bright); padding-bottom: 1px; }
.text-link:hover { color: var(--gold); }
.view { display: none; }
.view.active { display: block; }
.empty-state { padding: 36px 0; color: var(--ink-faint); font-size: 15px; text-align: center; }

/* ---------- Results tables ---------- */
.rtable-wrap { background: var(--paper); border: 1px solid var(--rule); }
.rtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rtable th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); padding: 12px 14px; border-bottom: 1px solid var(--rule-strong); background: var(--paper); white-space: nowrap;
}
.rtable td { padding: 13px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
.rtable tbody tr.row:hover td { background: #FFFFFF; }
.rtable .c-pl { width: 56px; font-family: var(--serif); font-weight: 600; color: var(--gold); font-size: 15px; white-space: nowrap; }
.rtable .c-score { text-align: right; white-space: nowrap; }
.rtable .c-score b { font-weight: 600; color: var(--ink); }
.rtable .c-score small { display: block; font-size: 12px; color: var(--ink-faint); }
.horse-link { font-family: var(--serif); font-weight: 600; font-size: 16.5px; color: var(--navy); text-decoration: none; }
.horse-link:hover { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sub { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.x { color: var(--gold); padding: 0 4px; }
.unv-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--alert); border: 1px solid currentColor; padding: 0 5px; margin-left: 6px; vertical-align: 2px;
}
.oio-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--navy); border: 1px solid currentColor; padding: 0 5px; margin-left: 6px; vertical-align: 2px;
}
.grp-country td {
  background: var(--navy); color: #fff; font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 12px 14px; border-top: 0;
}
.grp-event td { background: var(--cream-2); padding: 12px 14px; border-top: 1px solid var(--rule-strong); }
.grp-event b { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--navy); }
.grp-event span { font-size: 12.5px; color: var(--ink-faint); margin-left: 10px; letter-spacing: .04em; }
.grp-class td { padding: 10px 14px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); border-top: 1px solid var(--rule); }
.more-row td { text-align: center; padding: 14px; }
.btn-quiet {
  appearance: none; background: none; border: 1px solid var(--rule-strong); color: var(--navy); font: 600 13px var(--sans);
  letter-spacing: .06em; text-transform: uppercase; padding: 9px 18px; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-quiet:hover { background: var(--cream); border-color: var(--gold-bright); }

/* ---------- Home ---------- */
.week-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.week-head .page-title { margin: 0; }
.week-head .meta-line { margin: 6px 0 0; }
.home-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; margin-top: 44px; }
.card { background: var(--paper); border: 1px solid var(--rule); padding: 26px 28px; }
.card h3 { font-size: 23px; line-height: 1.25; color: var(--navy); margin: 0 0 10px; }
.card p { color: var(--ink-soft); margin: 0 0 14px; font-size: 15px; }

/* ---------- Filters ---------- */
.seasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.seasons.months { margin-top: -8px; }
.months .chip { padding: 5px 10px; font-size: 11.5px; background: var(--cream); }
.months .chip.active { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--ink); }
.months .chip.empty { color: var(--ink-faint); border-style: dashed; font-weight: 500; }
.months .chip.empty.active { background: #FFE6D5; border-color: var(--gold-bright); color: var(--ink); }
.chip {
  appearance: none; background: var(--paper); border: 1px solid var(--rule-strong); color: var(--navy);
  font: 600 12.5px var(--sans); letter-spacing: .06em; padding: 7px 13px; cursor: pointer; transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--gold-bright); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; background: var(--paper); border: 1px solid var(--rule); padding: 16px 18px; margin-bottom: 14px; }
.filters label { display: grid; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.filters select { font: 14.5px var(--sans); color: var(--ink); background: var(--cream); border: 1px solid var(--rule-strong); border-radius: 0; padding: 9px 10px; width: 100%; }
.filter-count { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legend-toggle { background: none; border: 0; color: var(--navy); font: 600 13.5px var(--sans); cursor: pointer; padding: 0; border-bottom: 1px solid var(--gold-bright); }
.legend { display: none; background: var(--paper); border: 1px solid var(--rule); border-left: 2px solid var(--gold-bright); padding: 18px 22px; margin: 0 0 16px; }
.legend.open { display: block; }
.legend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 26px; font-size: 13.5px; color: var(--ink-soft); }
.legend-grid b { display: block; color: var(--navy); font-size: 14px; }
.legend-grid p { margin: 2px 0 0; }

/* ---------- Search ---------- */
.search-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* ---------- Horse page ---------- */
.back-link { display: inline-block; margin-bottom: 18px; font-size: 13.5px; color: var(--ink-faint); text-decoration: none; }
.back-link:hover { color: var(--navy); }
.horse-former { font-style: italic; color: var(--ink-faint); margin: -4px 0 16px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--paper); margin-bottom: 30px; }
.facts div { padding: 14px 18px; border-left: 1px solid var(--rule); min-width: 0; }
.facts div:first-child { border-left: 0; }
.facts span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.facts b { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--navy); overflow-wrap: anywhere; }
.horse-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-bottom: 34px; }
.pedigree { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); gap: 6px; }
.ped { border: 1px solid var(--rule); background: var(--paper); padding: 9px 12px; min-width: 0; }
.ped span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.ped b { font-family: var(--serif); font-weight: 600; color: var(--navy); font-size: 15px; overflow-wrap: anywhere; }
.ped.sire { grid-column: 1; grid-row: 1 / span 2; }
.ped.dam { grid-column: 1; grid-row: 3 / span 2; }
.ped.ss { grid-column: 2; grid-row: 1; } .ped.sd { grid-column: 2; grid-row: 2; }
.ped.ds { grid-column: 2; grid-row: 3; } .ped.dd { grid-column: 2; grid-row: 4; }
.ped.missing { border-style: dashed; background: none; }
.ped.missing b { color: var(--ink-faint); font-family: var(--sans); font-weight: 400; font-size: 13px; font-style: italic; }
.stats { border: 1px solid var(--rule); background: var(--paper); }
.stats div { display: flex; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--rule); font-size: 14.5px; }
.stats div:first-child { border-top: 0; }
.stats b { font-family: var(--serif); font-weight: 600; color: var(--navy); }
.stats small { display: block; font-size: 11.5px; color: var(--ink-faint); }
.form-table .grp-class td { padding-top: 14px; }
.note { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; }

/* ---------- News ---------- */
.article { display: flex; gap: 22px; padding: 24px 0; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.article:first-child { border-top: 0; padding-top: 0; }
.article-thumb { flex: none; width: 200px; height: 134px; overflow: hidden; background: var(--cream-2); }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-title { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.25; color: var(--navy); margin: 0 0 6px; }
.article:hover .article-title { color: var(--gold); }
.article-date { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.article-snippet { font-size: 15px; color: var(--ink-soft); }

/* ---------- Overlay (news article) ---------- */
.overlay { display: none; position: fixed; inset: 0; background: rgba(13,21,38,.6); z-index: 50; padding: 6vh 16px; overflow-y: auto; }
.overlay.active { display: block; }
.modal { background: var(--paper); max-width: 720px; margin: 0 auto; padding: 36px 40px 40px; position: relative; border-top: 3px solid var(--gold-bright); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; background: var(--paper); border: 1px solid var(--rule-strong); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-soft); z-index: 1; }
.modal-close:hover { border-color: var(--gold-bright); }
.modal-photo { margin: -36px -40px 24px; max-height: 340px; overflow: hidden; }
.modal-photo img { width: 100%; display: block; }
.modal-title { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.2; color: var(--navy); margin: 0 40px 8px 0; }
.modal-body { font-size: 16.5px; line-height: 1.75; color: var(--ink-soft); }
.modal-body p { margin: 0 0 16px; }

/* ---------- Forms ---------- */
.block { margin-top: 48px; }
.form { display: grid; gap: 14px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy); }
.form input, .form textarea, .form select {
  font: 15px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 0; padding: 11px 13px; width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(255,136,62,.25); }
.form textarea { min-height: 110px; resize: vertical; }
.btn {
  appearance: none; justify-self: start; border: 0; background: var(--navy); color: #fff; font: 600 13.5px var(--sans);
  letter-spacing: .08em; text-transform: uppercase; padding: 13px 24px; cursor: pointer; transition: background .15s; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--navy-deep); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #7D5F19; }
.form-note { font-size: 12.5px; color: var(--ink-faint); }
.form-done { font-size: 14px; font-weight: 600; color: var(--navy); }
.form-done:empty { display: none; }
.ts-slot:empty { display: none; }
.cm-item { padding: 16px 0; border-top: 1px solid var(--rule); }
.cm-item b { font-family: var(--serif); font-weight: 600; font-size: 16.5px; color: var(--navy); }
.cm-item small { color: var(--ink-faint); margin-left: 8px; }
.cm-item p { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); }

/* Sign-up */
.signup { background: var(--navy); color: #fff; padding: 26px 28px; }
.signup h3 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.signup p { color: #FFFFFF; font-size: 14.5px; margin: 0 0 16px; }
.signup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-row input { flex: 1 1 200px; min-width: 0; border: 0; padding: 12px 14px; font: 15px var(--sans); }
.signup-row input:focus { outline: 2px solid var(--gold-bright); }
.signup .btn { background: var(--navy); color: #fff; border: 1.5px solid #fff; font-weight: 600; }
.signup .btn:hover { background: #fff; color: var(--navy); }
.signup .form-note { color: rgba(255,255,255,.85); margin-top: 10px; }
.signup .form-done { color: var(--gold-pale); margin-top: 10px; }
.signup .ts-slot { margin-top: 10px; }

/* ---------- About ---------- */
.about-photo { height: 320px; overflow: hidden; margin-bottom: 30px; background: var(--cream-2); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.prose { font-size: 16.5px; color: var(--ink-soft); max-width: 700px; }
.prose p { margin: 0 0 16px; }
.panel { background: var(--paper); border: 1px solid var(--rule); padding: 28px 30px; margin-top: 30px; }
.panel h2 { font-size: 26px; color: var(--navy); margin: 0 0 8px; }
.panel > p { color: var(--ink-soft); margin: 0 0 18px; }
.contact-list { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 15px; margin: 0; }
.contact-list dt { color: var(--ink-faint); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding-top: 3px; }
.contact-list dd { margin: 0; }
.privacy-copy { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------- Notice ---------- */
.notice { margin-top: 18px; background: var(--paper); border: 1px solid var(--rule); border-left: 2px solid var(--gold-bright); padding: 12px 16px; font-size: 14.5px; font-weight: 600; color: var(--navy); }

/* ---------- Footer ---------- */
.site-foot { background: var(--navy); color: #FFFFFF; font-size: 14px; border-top: 3px solid var(--gold-bright); }
.foot-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding: 40px 0 28px; }
.foot-brand { font-family: var(--serif); font-weight: 600; font-size: 22px; color: #fff; margin-bottom: 6px; overflow-wrap: anywhere; }
.foot-brand span { color: #fff; }
.site-foot h4 { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot p { margin: 0 0 6px; }
.foot-base { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0 22px; font-size: 12.5px; color: rgba(255,255,255,.85); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =========================================================
   Smaller screens. Laptop is the design target; these keep
   tablets and phones working with no sideways scrolling.
   ========================================================= */
@media (max-width: 1180px) {
  .hdr-search { width: 330px; }
  .brand-name { font-size: 30px; }
}
@media (max-width: 980px) {
  .container { padding: 0 24px; }
  .hdr-inner { flex-direction: column; align-items: stretch; gap: 16px; }
  .hdr-right { align-items: stretch; }
  .hdr-search { width: 100%; }
  .nav { gap: 22px; }
  .home-lower, .horse-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .legend-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .brand { gap: 12px; }
  .brand-mark { width: 44px; height: 44px; font-size: 11px; }
  .brand-name { font-size: 21px; }
  .nav { justify-content: space-between; gap: 8px; }
  .nav a { font-size: 12px; letter-spacing: .08em; }
  .banner { height: 56px; }
  .banner-bar { padding: 6px 0; }
  .ad-open-text { font-size: 12px; }
  .container.page { padding-top: 24px; padding-bottom: 32px; }
  .ad-label { font-size: 8.5px; letter-spacing: .06em; padding: 1px 4px; }
  .page-title { font-size: 30px; }
  .side { gap: 10px; }
  .side-left { margin-top: 28px; }
  .side-right { margin-top: 10px; }
  .filters { grid-template-columns: 1fr; }
  .legend-grid, .form-row, .foot-inner { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .article { flex-direction: column; gap: 12px; }
  .article-thumb { width: 100%; height: 180px; }
  .modal { padding: 26px 20px 28px; }
  .modal-photo { margin: -26px -20px 20px; }
  .modal-title { font-size: 24px; }
  .about-photo { height: 200px; }
  .panel, .card, .signup { padding: 20px; }
  .contact-list { grid-template-columns: 1fr; gap: 2px 0; }
  .contact-list dd { margin-bottom: 10px; }

  /* Results tables become stacked cards */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr.row { position: relative; padding: 12px 14px 12px 54px; border-top: 1px solid var(--rule); }
  .rtable tr.row td { border: 0; padding: 2px 0; }
  .rtable tr.row .c-pl { position: absolute; left: 14px; top: 13px; width: auto; }
  .rtable tr.row .c-score { text-align: left; }
  .rtable tr.row .c-score small { display: inline; margin-left: 6px; }
  .rtable td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; }
}

/* ---------- Link cards (News page, "Elsewhere") ---------- */
.rcard {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); overflow: hidden;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.rcard:hover { border-color: var(--rule-strong); box-shadow: 0 2px 10px rgba(22,35,63,.06); }
.rcard:hover b { color: var(--gold); }
.card-img { flex: 0 0 46%; min-height: 0; overflow: hidden; background: var(--cream-2); display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; background: var(--navy); color: var(--gold-bright);
  font-family: var(--serif); font-weight: 600; letter-spacing: .1em; font-size: 15px;
}
.card-body { flex: 1; min-height: 0; padding: 10px 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.card-kicker { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.rcard b {
  font-family: var(--serif); font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--navy); transition: color .15s;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: none;
}
.card-teaser { font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.banner-name { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--navy); }

/* Horse record pop-up */
.horse-modal { max-width: 900px; }
.horse-title { margin-right: 40px; }
.horse-modal .horse-grid { margin-bottom: 26px; }
.modal-source { font-size: 14px; color: var(--ink-faint); border-top: 1px solid var(--rule); padding-top: 14px; margin: 8px 0 0; }
.modal-source a { color: var(--navy); font-weight: 600; }
@media (max-width: 720px) {
  .horse-modal .page-title { font-size: 26px; }
}
.order-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.order-btns { display: flex; flex-direction: column; gap: 4px; }
.order-btns .btn { padding: 4px 10px; }
.order-btns .btn:disabled { opacity: .35; cursor: default; }

/* ---------- Stallions: six listings, each with a progeny breakdown ---------- */
.stallion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stallion-card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); text-decoration: none; color: inherit;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.stallion-card:hover { border-color: var(--rule-strong); box-shadow: 0 2px 10px rgba(22,35,63,.06); }
.stallion-card:hover .stallion-name { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.stallion-photo { display: block; aspect-ratio: 4 / 3; background: var(--cream-2); overflow: hidden; }
.stallion-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stallion-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.stallion-name { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--navy); line-height: 1.2; }
.stallion-blurb { font-size: 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stallion-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 6px; border-top: 1px solid var(--rule); padding-top: 10px; }
.stallion-specs dt { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.3; }
.stallion-specs dd { margin: 2px 0 0; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--navy); }
.stallion-body .btn { margin-top: auto; align-self: flex-start; }
.btn.sm { padding: 9px 16px; font-size: 12px; }
.stallion-card.open { border-style: dashed; border-color: var(--rule-strong); background: var(--cream-2); min-height: 260px; justify-content: center; }
.stallion-open { display: flex; flex-direction: column; gap: 6px; padding: 20px; text-align: center; font-size: 14px; color: var(--ink-soft); }
.stallion-open b { font-family: var(--serif); font-size: 18px; color: var(--navy); }
.stallion-head { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: start; margin: 8px 0 28px; }
.stallion-head .stallion-photo { border: 1px solid var(--rule); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--paper); margin-bottom: 30px; }
.stat-tiles div { padding: 14px 18px; border-left: 1px solid var(--rule); }
.stat-tiles div:first-child { border-left: 0; }
.stat-tiles span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.stat-tiles b { font-family: var(--serif); font-weight: 600; font-size: 30px; color: var(--navy); }
.bar-chart { display: grid; gap: 8px; background: var(--paper); border: 1px solid var(--rule); padding: 18px 18px 16px; margin-bottom: 14px; }
.bar-row { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; outline: none; }
.bar-label { font-size: 13.5px; color: var(--ink-soft); }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { display: block; height: 18px; background: var(--navy); border-radius: 0 4px 4px 0; transition: opacity .15s; }
.bar-value { font-size: 13px; font-weight: 600; color: var(--ink); }
.bar-chart:hover .bar-row:not(:hover) .bar { opacity: .55; }
.bar-tip {
  position: absolute; left: 162px; bottom: calc(100% + 4px); z-index: 2; background: var(--ink); color: #fff; font-size: 12.5px;
  padding: 5px 9px; border-radius: 3px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.bar-row:hover .bar-tip, .bar-row:focus-visible .bar-tip { opacity: 1; }
.level-table { margin-bottom: 0; }
#stallion-detail .rtable-wrap { margin-bottom: 28px; }
#news-links { margin-top: 30px; }
@media (max-width: 980px) {
  .stallion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stallion-grid, .stallion-head { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .stat-tiles div:nth-child(3) { border-left: 0; }
  .stat-tiles div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .stat-tiles b { font-size: 24px; }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
  .bar-label { font-size: 12.5px; }
  .bar-tip { left: auto; right: 0; white-space: normal; max-width: 100%; }
  /* The small level table stays a table on phones (four short columns fit). */
  .rtable.level-table { display: table; }
  .rtable.level-table thead { display: table-header-group; }
  .rtable.level-table tbody { display: table-row-group; }
  .rtable.level-table tr, .rtable.level-table tr.row { display: table-row; padding: 0; }
  .rtable.level-table th, .rtable.level-table tr.row td { display: table-cell; width: auto; padding: 10px 10px; border-top: 1px solid var(--rule); }
  .rtable.level-table th { border-top: 0; font-size: 10px; letter-spacing: .06em; white-space: normal; }
  .rtable.level-table th, .rtable.level-table tr.row td { padding: 9px 8px; }
}

/* ---------- Phones (768px and under): a bigger site name and an easier menu ----------
   Desktop and tablet layouts are not affected. The site name breaks only between its words
   (IrishBred / Eventing / Results), never mid-word. */
@media (max-width: 768px) {
  .hdr-inner { padding-top: 26px; padding-bottom: 12px; gap: 18px; }
  .brand { gap: 12px; }
  .brand-mark { width: 50px; height: 50px; font-size: 12px; }
  .brand-name { font-size: clamp(28px, 8.2vw, 38px); line-height: 1.02; overflow-wrap: normal; text-wrap: balance; }
  /* All five menu items on one line. */
  .nav { display: flex; justify-content: space-between; gap: 2px; }
  .nav a {
    display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 2px;
    font-size: clamp(14px, 4.2vw, 18px); letter-spacing: 0; text-transform: none; border-bottom-width: 3px; white-space: nowrap;
  }
}
