/* ==========================================================================
   REVORA — Discover page
   ========================================================================== */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.dhead { padding: calc(var(--nav-h) + clamp(64px, 11vw, 160px)) 0 clamp(48px, 7vw, 96px); position: relative; overflow: hidden; }
.dhead::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 20%, rgba(184,154,106,.10), transparent 70%); pointer-events: none; }
.dhead__inner { position: relative; }
.dhead__title { font-family: var(--f-head); font-weight: 700; font-size: clamp(40px, 7.4vw, 120px); line-height: .96; letter-spacing: -.045em; text-transform: uppercase; margin: 26px 0 clamp(32px, 5vw, 64px); }
.dhead__title em { text-transform: none; color: var(--gold); letter-spacing: -.02em; }
.dhead__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; border-top: 1px solid var(--hair-dark); padding-top: 28px; }
.dhead__lede { max-width: 44ch; color: var(--paper-soft); }
.dhead__count { display: flex; align-items: center; gap: 16px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--silver); line-height: 1.6; }
.dhead__count b { font-family: var(--f-head); font-weight: 600; font-size: clamp(40px, 5vw, 72px); letter-spacing: -.04em; color: var(--ivory); line-height: 1; }
html.js .dhead__title .mask__in { transform: translateY(110%); }
html.js .dhead .label, html.js .dhead__row { opacity: 0; }

/* Filter bar */
.filters { position: sticky; top: var(--nav-h); z-index: 60; background: rgba(244,242,237,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair-light); color: var(--ink); }
.filters__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 16px; border: 1px solid var(--hair-light); border-radius: 100px; font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; transition: background .35s var(--ease), color .35s var(--ease), border-color .35s; }
.chip small { font-size: 10px; opacity: .55; letter-spacing: .04em; font-weight: 600; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.filters__tools { display: flex; gap: 12px; flex: none; }
.finder { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--hair-light); transition: border-color .3s; }
.finder:focus-within { border-color: var(--ink); }
.finder input { width: 190px; background: none; border: 0; outline: 0; padding: 11px 0; font: inherit; font-size: 14px; color: inherit; min-width: 0; }
.sorter select { appearance: none; -webkit-appearance: none; background: none; border: 0; border-bottom: 1px solid var(--hair-light); padding: 11px 26px 11px 4px; font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: inherit; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23111315' stroke-width='1.4'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; }

/* Results */
.results { padding: clamp(32px, 4vw, 56px) 0 clamp(96px, 12vw, 180px); min-height: 70vh; }
.results__meta { font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: clamp(24px, 3vw, 40px); }

/* Editorial grid: repeating 7-card rhythm (7+5 / 4+4+4 / 5+7) */
.vgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(36px, 4vw, 64px) clamp(16px, 2vw, 32px); align-items: start; }
.vcard { display: block; grid-column: span 4; }
.vcard:nth-child(7n+1) { grid-column: span 7; } .vcard:nth-child(7n+1) figure { aspect-ratio: 3/2; }
.vcard:nth-child(7n+2) { grid-column: span 5; } .vcard:nth-child(7n+2) figure { aspect-ratio: 16/15; }
.vcard:nth-child(7n+6) { grid-column: span 5; } .vcard:nth-child(7n+6) figure { aspect-ratio: 16/15; }
.vcard:nth-child(7n+7) { grid-column: span 7; } .vcard:nth-child(7n+7) figure { aspect-ratio: 3/2; }
.vcard figure { aspect-ratio: 4/5; overflow: hidden; background: var(--grey); position: relative; }
.vcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.vcard:hover img, .vcard:focus-visible img { transform: scale(1.05); }
.vcard__tag { position: absolute; left: 0; top: 0; padding: 8px 14px; background: var(--ivory); font-family: var(--f-head); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.vcard__meta { padding-top: 16px; display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: start; }
.vcard__make { grid-column: 1 / -1; font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.vcard h3 { font-family: var(--f-head); font-weight: 600; font-size: clamp(20px, 1.9vw, 30px); letter-spacing: -.03em; line-height: 1.1; }
.vcard__sub { grid-column: 1; font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.vcard__go { grid-column: 2; grid-row: 2 / span 2; align-self: center; width: 26px; height: 1px; background: currentColor; position: relative; transition: width .5s var(--ease); }
.vcard__go::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.vcard:hover .vcard__go { width: 44px; }

.empty { text-align: center; padding: 80px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ink-soft); }
.empty[hidden] { display: none; }
.empty__title { font-family: var(--f-serif); font-style: italic; font-size: clamp(28px, 3.4vw, 46px); color: var(--ink); }
.empty .btn { margin-top: 16px; }

/* Vehicle detail dialog */
.vehicle { width: 100%; height: 100%; margin: 0; background: var(--black); color: var(--ivory); overflow-y: auto; overscroll-behavior: contain; }
.vehicle[open] { animation: sheetIn .6s var(--ease); }
.vehicle::backdrop { background: var(--black); }
.vehicle__bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); background: linear-gradient(var(--black), rgba(8,9,10,0)); }
.vehicle__grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 96px); padding: 0 var(--gutter) clamp(48px, 7vw, 96px); max-width: var(--max); margin-inline: auto; align-items: start; }
.vehicle__main { aspect-ratio: 4/3; overflow: hidden; background: var(--graphite); }
.vehicle__main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .5s; }
.vehicle__thumbs { display: flex; gap: 10px; margin-top: 10px; }
.vehicle__thumbs button { width: 96px; aspect-ratio: 4/3; overflow: hidden; opacity: .5; border: 1px solid transparent; transition: opacity .3s, border-color .3s; }
.vehicle__thumbs button.is-active, .vehicle__thumbs button:hover { opacity: 1; border-color: var(--gold); }
.vehicle__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.vehicle__info { padding-top: 8px; position: sticky; top: 72px; }
.vehicle__name { font-family: var(--f-head); font-weight: 600; font-size: clamp(34px, 4.4vw, 68px); letter-spacing: -.04em; line-height: 1; margin: 14px 0 16px; }
.vehicle__name small { display: block; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--silver); font-weight: 600; margin-bottom: 12px; }
.vehicle__blurb { font-family: var(--f-serif); font-style: italic; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.3; color: var(--ivory); margin-bottom: 26px; }
.specs--dark { margin-bottom: 22px; }
.vehicle__story { font-size: 14px; color: var(--paper-soft); margin-bottom: 28px; }
.vehicle__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.vehicle__note { font-size: 12px; color: var(--silver); opacity: .75; margin-bottom: 28px; }
.vehicle__nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hair-dark); }
.vnav { display: flex; align-items: center; gap: 14px; padding: 18px 0; text-align: left; transition: opacity .3s; }
.vnav--next { justify-content: flex-end; text-align: right; border-left: 1px solid var(--hair-dark); padding-left: 16px; }
.vnav:not(.vnav--next) { padding-right: 16px; }
.vnav small { display: block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--silver); }
.vnav b { font-family: var(--f-head); font-weight: 600; font-size: 15px; letter-spacing: -.01em; display: block; margin-top: 2px; }
.vnav i { width: 22px; height: 1px; background: currentColor; position: relative; flex: none; transition: width .4s var(--ease); }
.vnav i::after { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.vnav--next i::after { left: auto; right: 0; border: 0; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }
.vnav:hover i { width: 36px; }
.vnav:disabled { opacity: .3; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .dhead__title .mask__in { transform: none !important; }
  html.js .dhead .label, html.js .dhead__row { opacity: 1 !important; }
}

/* Responsive */
@media (max-width: 960px) {
  .filters__inner { flex-direction: column; align-items: stretch; gap: 10px; padding-block: 10px; }
  .filters__tools { justify-content: space-between; }
  .finder { flex: 1; padding-left: 0; }
  .finder input { width: 100%; }
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .vcard, .vcard:nth-child(n) { grid-column: span 1; }
  .vcard:nth-child(n) figure { aspect-ratio: 4/3.4; }
  .vcard:nth-child(3n+1) { grid-column: 1 / -1; }
  .vcard:nth-child(3n+1) figure { aspect-ratio: 16/10; }
  .vehicle__grid { grid-template-columns: 1fr; }
  .vehicle__info { position: static; }
}
@media (max-width: 600px) {
  .vgrid { grid-template-columns: 1fr; gap: 36px; }
  .vcard:nth-child(n) { grid-column: 1; }
  .vcard:nth-child(n) figure { aspect-ratio: 4/3; }
  .dhead__row { flex-direction: column; align-items: flex-start; }
  .vehicle__thumbs button { width: 72px; }
  .vehicle__actions .btn { flex: 1; justify-content: center; }
}
@media (hover: none) { .vcard:hover img { transform: none; } }
