/*
 * Horses (2026-11-17, Troy: "search where people can look into their fav horses and their stats"). The search at
 * /horses/ and a page for every horse and breed in Meqa's catalogue (build-horses.mjs writes them). Meqa's own ground,
 * ink and rose gold (site.css); light everywhere. On a phone one column, the search pinned under the header, two cards
 * a row; on a computer the cards five or six a row and a horse's page in two columns.
 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- The search ------------------------------------------------------------------------------------------------ */
.hz-search { padding-top: 26px; padding-bottom: 24px; }
.hz-search h1 { font-size: clamp(46px, 6vw, 76px); margin: 12px 0 14px; letter-spacing: -.01em; }
.hz-dek { font-size: 19px; color: var(--ink-soft); max-width: 40em; margin: 0 0 26px; }
.hz-form { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 20; margin: 0 -6px; padding: 6px; border-radius: 26px; background: rgba(251, 247, 242, .86); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
html:not(.js) .hz-form, html:not(.js) .hz-chips, html:not(.js) .hz-count, html:not(.js) .hz-results, html:not(.js) .hz-more-row { display: none; }
.hz-field { position: relative; display: flex; align-items: center; height: 60px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); box-shadow: 0 14px 34px rgba(74, 48, 40, .08); transition: box-shadow .3s ease, border-color .3s ease; }
.hz-field:focus-within { border-color: rgba(158, 90, 78, .45); box-shadow: 0 16px 40px rgba(74, 48, 40, .12), 0 0 0 4px rgba(233, 182, 162, .35); }
.hz-field svg { flex: none; width: 22px; height: 22px; margin: 0 4px 0 20px; fill: none; stroke: var(--ink-faint); stroke-width: 2; stroke-linecap: round; }
.hz-field input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 18px; color: var(--ink); padding: 0 12px; -webkit-appearance: none; appearance: none; }
.hz-field input::placeholder { color: var(--ink-faint); }
.hz-field input::-webkit-search-cancel-button { display: none; }
.hz-clear { flex: none; width: 40px; height: 40px; margin-right: 10px; border: 0; border-radius: 50%; background: var(--linen); color: var(--ink-soft); font-size: 22px; line-height: 1; cursor: pointer; }
.hz-clear:hover { background: #ECE1D6; color: var(--ink); }
.hz-clear:focus-visible, .hz-chip:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.hz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.hz-chip { min-height: 38px; padding: 0 15px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.hz-chip:hover { color: var(--ink); background: #FFF; }
.hz-chip:active { transform: scale(.96); }
.hz-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.hz-count { min-height: 1.6em; margin: 14px 2px 14px; font-size: 14.5px; color: var(--ink-faint); }
.hz-count b { color: var(--ink); font-weight: 600; }
.hz-empty { grid-column: 1 / -1; padding: 40px 20px; border-radius: 24px; background: var(--linen); text-align: center; color: var(--ink-soft); }
.hz-empty b { display: block; font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--ink); margin-bottom: 6px; }

/* --- A horse as a card in a list ------------------------------------------------------------------------------- */
.hz-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; }
.hz-card { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 8px 8px 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); color: inherit; text-decoration: none; box-shadow: 0 10px 26px rgba(74, 48, 40, .06); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.hz-card:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .hz-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(74, 48, 40, .13); color: inherit; } .hz-card:hover .hz-img img { transform: scale(1.04); } }
.hz-img { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--linen); margin-bottom: 8px; }
.hz-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.hz-name { padding: 0 6px; font-family: var(--serif); font-size: 22px; line-height: 1.08; color: var(--ink); overflow-wrap: anywhere; }
.hz-meta { padding: 0 6px; font-size: 13.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-card .hz-tier { margin: 6px 6px 0; }
.hz-more-row { display: flex; justify-content: center; padding: 28px 0 8px; }

/* Her initial, on her tier's colours, where the catalogue has no free photo of her yet. */
.hz-mono { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 90% at 30% 10%, #FFF 0%, var(--linen) 70%); }
.hz-mono b { font-family: var(--serif); font-weight: 500; font-size: 84px; line-height: 1; color: rgba(27, 34, 64, .22); }
.hz-mono.t-legendary { background: radial-gradient(120% 90% at 30% 10%, #FFF8E6 0%, var(--brass-soft) 75%); }
.hz-mono.t-legendary b { color: rgba(140, 104, 30, .38); }
.hz-mono.t-epic { background: radial-gradient(120% 90% at 30% 10%, #FFF 0%, #ECE4F2 75%); }
.hz-mono.t-epic b { color: rgba(90, 70, 120, .3); }
.hz-mono.t-rare { background: radial-gradient(120% 90% at 30% 10%, #FFF 0%, #E9EAEF 75%); }

.hz-tier { align-self: flex-start; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hz-tier.t-legendary { background: var(--brass-soft); color: #7A5A12; }
.hz-tier.t-epic { background: #ECE4F2; color: #5B4580; }
.hz-tier.t-rare { background: #E9EAEF; color: #4D5266; }

/* --- Every horse, A to Z: the whole catalogue as links, the search's fallback ---------------------------------- */
.az { padding-top: 24px; padding-bottom: 72px; }
.js .az.is-hidden { display: none; }
.az h2 { font-size: clamp(30px, 3.4vw, 40px); margin: 0 0 6px; }
.az .az-breeds { margin-top: 48px; }
.az-note { color: var(--ink-faint); margin: 0 0 20px; font-size: 15px; }
.az-group { break-inside: avoid; margin-bottom: 18px; }
.az { columns: 3 260px; column-gap: 40px; }
.az > h2, .az > .az-note { column-span: all; }
.az-group h3 { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--rose); margin: 0 0 6px; }
.az-group ul { list-style: none; margin: 0; padding: 0; }
.az-group li { padding: 3px 0; font-size: 15.5px; line-height: 1.35; }
.az-group a { color: var(--ink); text-decoration: none; }
.az-group a:hover { color: var(--rose); text-decoration: underline; }
.az-group li span { color: var(--ink-faint); font-size: 13.5px; }

/* --- A horse's page ------------------------------------------------------------------------------------------- */
.hz-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; font-size: 14.5px; color: var(--ink-faint); }
.hz-crumbs a { color: var(--ink-soft); text-decoration: none; }
.hz-crumbs a:hover { color: var(--rose); }
.hz-hero { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 22px; padding-bottom: 40px; }
.hz-visual { position: relative; }
.hz-photo { margin: 0; position: relative; border-radius: 26px; overflow: hidden; background: var(--linen); box-shadow: var(--shadow); }
.hz-photo img { width: 100%; height: auto; max-height: 620px; object-fit: cover; }
.hz-photo.is-empty { aspect-ratio: 4 / 5; }
.hz-photo .hz-mono b { font-size: 180px; }
.hz-credit { margin: 12px 4px 0; font-size: 13px; color: var(--ink-faint); }
.hz-credit a { color: var(--ink-soft); }
.hz-card3d { width: min(360px, 100%); margin: 0 auto; }
.hz-card3d .hl-card { display: block; width: 100%; }
.hz-hint { text-align: center; margin: 14px 0 0; font-size: 13.5px; color: var(--ink-faint); }
.hz-head { display: flex; flex-direction: column; align-items: flex-start; padding-top: 8px; }
.hz-head h1 { font-size: clamp(46px, 5.4vw, 78px); margin: 10px 0 6px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hz-show { margin: 0 0 6px; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink-soft); }
.hz-line { margin: 4px 0 14px; font-size: 17px; color: var(--ink-soft); }
.hz-known { margin: 16px 0 0; font-size: 18px; color: var(--ink); max-width: 34em; }
.hz-fact { margin: 22px 0 26px; padding: 18px 22px; border-radius: 20px; background: var(--blush); font-size: 17px; color: var(--ink-soft); max-width: 36em; }
.hz-fact b { display: block; font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.15; color: var(--ink); margin-bottom: 4px; }
.hz-head .cta { margin-top: 4px; }

.hz-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 28px; align-items: start; }
.hz-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hz-col:empty { display: none; }
.hz-panel { padding: 22px 24px 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--hair); box-shadow: 0 10px 26px rgba(74, 48, 40, .05); }
.hz-panel.hz-wide { grid-column: 1 / -1; }
.hz-panel h2 { font-size: 28px; margin: 0 0 12px; }
.hz-panel h3 { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); margin: 14px 0 6px; }
.hz-panel h3:first-of-type { margin-top: 0; }
.hz-dl { margin: 0; }
.hz-dl div { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--hair); }
.hz-dl div:first-child { border-top: 0; padding-top: 2px; }
.hz-dl dt { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); padding-top: 2px; }
.hz-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.hz-record { list-style: none; margin: 0; padding: 0; }
.hz-record li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--hair); }
.hz-record li:first-child { border-top: 0; padding-top: 2px; }
.hz-record b { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--rose); }
.hz-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hz-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border-radius: 999px; background: var(--linen); color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.hz-links a:hover { background: #ECE1D6; color: var(--ink); }
.hz-sources { padding: 6px 0 24px; font-size: 14.5px; color: var(--ink-faint); }
.hz-sources h2 { font-size: 24px; margin: 0 0 6px; color: var(--ink); }
.hz-sources p { margin: 0 0 8px; }
.hz-sources ul { margin: 0; padding-left: 20px; }
.hz-sources a { color: var(--ink-soft); overflow-wrap: anywhere; }
.hz-more { padding-top: 12px; padding-bottom: 64px; }
.hz-rest { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); margin: 28px 0 10px; }
.hz-more h2 { font-size: clamp(30px, 3.4vw, 40px); margin: 0 0 18px; }

/* === Tablet and phone ========================================================================================= */
@media (max-width: 960px) {
  .hz-hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .hz-visual { max-width: 520px; width: 100%; justify-self: center; }
  .hz-panels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .hz-search { padding-top: 14px; }
  .hz-search h1 { font-size: clamp(42px, 12vw, 54px); }
  .hz-dek { font-size: 17px; margin-bottom: 18px; }
  .hz-field { height: 54px; border-radius: 18px; }
  .hz-field input { font-size: 17px; }
  /* One row of chips the thumb scrolls sideways, inside the page's own width. */
  .hz-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -20px; margin-right: -20px; padding: 0 20px 4px; scrollbar-width: none; scroll-padding-left: 20px; }
  .hz-chips::-webkit-scrollbar { display: none; }
  .hz-chip { flex: none; }
  .hz-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hz-card { padding: 6px 6px 12px; border-radius: 18px; }
  .hz-img { border-radius: 13px; }
  .hz-name { font-size: 19px; padding: 0 4px; }
  .hz-meta { padding: 0 4px; font-size: 12.5px; }
  .hz-card .hz-tier { margin: 5px 4px 0; }
  .az { columns: 1; }
  .hz-head h1 { font-size: clamp(42px, 12vw, 56px); }
  .hz-panel { padding: 18px 18px 14px; border-radius: 20px; }
  .hz-dl div { grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr); gap: 10px; }
  .hz-head .cta { width: 100%; }
  .hz-head .cta .button { flex: 1 1 auto; }
}
