/* ==========================================================================
   East Side Auto - page-level blocks
   Each section on the home page uses a different layout family on purpose.
   ========================================================================== */

/* ----------------------------------------------- home: split hero (1/6) -- */

.hero {
  border-bottom: 1px solid var(--rule);
  background: var(--surface-sunk);
}

.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  min-height: min(84dvh, 720px);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 6rem);
}

.hero__copy { display: grid; gap: 1.75rem; justify-items: start; }
.hero__copy h1 { font-size: var(--text-display); }
.hero__copy h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__figure {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--rule);
}
/* Absolute fill rather than height:100%: a percentage height does not resolve
   against a parent sized only by aspect-ratio. */
.hero__figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__tag {
  position: absolute;
  left: 0; bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  background: var(--surface-sunk);
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.hero__tag .price { font-size: 1.25rem; }
.hero__tag span { font-size: var(--text-meta); color: var(--ink-dim); }

@media (max-width: 940px) {
  .hero .shell { grid-template-columns: 1fr; min-height: 0; }
  .hero__figure { aspect-ratio: 3 / 2; }
}

/* --------------------------------------- home: featured rail (2/6) ------ */

.rail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.rail-head h2 { font-size: var(--text-h2); }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) var(--surface-sunk);
}
.rail > * { scroll-snap-align: start; }

/* -------------------------------------- home: full-width statement (3/6) -- */

.statement {
  border-block: 1px solid var(--rule);
  background: var(--surface-raised);
  padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem);
}

.statement blockquote {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.9rem, 1rem + 3.4vw, 3.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  text-transform: uppercase;
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.statement blockquote b { color: var(--amber); font-weight: inherit; }

.statement__body {
  margin-top: 2rem;
  max-width: 46ch;
  color: var(--ink-dim);
}

/* ------------------------------------ home: vertical process stack (4/6) -- */

.stack { border-top: 1px solid var(--rule); }

.stack__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(1rem, 0.5rem + 2vw, 3rem);
  padding-block: clamp(1.75rem, 1rem + 2vw, 2.75rem);
  border-bottom: 1px solid var(--rule);
}

.stack__row h3 {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  color: var(--ink);
}
.stack__row p { color: var(--ink-dim); max-width: 56ch; }

@media (max-width: 760px) {
  .stack__row { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* --------------------------------------------- home: make marquee (5/6) -- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--rule);
  background: var(--surface-sunk);
  padding-block: 1.5rem;
}

.marquee__track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  padding-left: 3.5rem;
}

.marquee__track span {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 108;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.marquee__track span:nth-child(3n) { color: var(--amber); }

@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: drift 38s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}

@keyframes drift {
  to { transform: translateX(-50%); }
}

/* --------------------------------------- home: location split (6/6) ----- */

.locate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: start;
}

.locate h2 { font-size: var(--text-h2); margin-bottom: 1.5rem; }

.locate dl { margin: 0; display: grid; gap: 1.5rem; }
.locate dt {
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}
.locate dd { margin: 0; color: var(--ink); }
.locate dd a { text-decoration: none; color: var(--amber); }

.map-frame {
  border: 1px solid var(--rule);
  aspect-ratio: 3 / 2;
  background: var(--surface-sunk);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 880px) {
  .locate { grid-template-columns: 1fr; }
  .map-frame { aspect-ratio: 16 / 10; }
}

/* ------------------------------------------------------- page headers --- */

.page-head {
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 2rem + 3vw, 5rem);
}
.page-head h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem); }
.page-head p { margin-top: 1.25rem; max-width: 58ch; color: var(--ink-dim); }

/* The page head already carries the top breathing room. */
.page-head + .section { padding-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }

/* --------------------------------------------------- inventory filters -- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.filters__field { display: grid; gap: 0.4rem; }

.filters__field label {
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.filters select {
  min-width: 170px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-sunk);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}
.filters select:focus { border-color: var(--amber); outline: 2px solid var(--amber); outline-offset: -2px; }

.filters__count {
  margin-left: auto;
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.filters__reset {
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
}

/* -------------------------------------------------------- vdp gallery --- */

.vdp-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
}
.vdp-back:hover { color: var(--amber); }

.vdp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.vdp-head h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.25rem); }

/* Was-price sits above the asking price, small, so the eye lands on the number
   that matters last. Right-aligned as a block, not by padding the text. */
.vdp-price {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
  flex: none;
}
.vdp-price .price { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); line-height: 1; }
.vdp-price .was-price { line-height: 1; }

.vdp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: start;
}

@media (max-width: 940px) {
  .vdp-grid { grid-template-columns: 1fr; }
}

.gallery { position: relative; border: 1px solid var(--rule); background: var(--surface-sunk); }

/* The stage is a button: clicking or pressing it opens the full-screen viewer. */
.gallery__stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__zoom {
  position: absolute;
  left: 0; bottom: 0;
  padding: 0.4rem 0.75rem;
  background: rgb(15 18 20 / 0.82);
  font-size: var(--text-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  pointer-events: none;
  transition: color var(--fast) var(--ease);
}
.gallery__stage:hover ~ .gallery__zoom,
.gallery__stage:focus-visible ~ .gallery__zoom { color: var(--amber); }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 64px;
  border: 0;
  background: rgb(15 18 20 / 0.82);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.gallery__nav:hover { background: var(--amber); color: var(--on-amber); }
.gallery__nav--prev { left: 0; }
.gallery__nav--next { right: 0; }

.gallery__count {
  position: absolute;
  right: 0; bottom: 0;
  padding: 0.4rem 0.75rem;
  background: rgb(15 18 20 / 0.82);
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 1px;
  margin-top: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  max-height: 260px;
  overflow-y: auto;
}

.thumbs button {
  padding: 0;
  border: 0;
  background: var(--surface-sunk);
  cursor: pointer;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  opacity: 0.55;
  transition: opacity var(--fast) var(--ease);
}
.thumbs button:hover { opacity: 0.85; }
.thumbs button[aria-current="true"] { opacity: 1; outline: 2px solid var(--amber); outline-offset: -2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ----------------------------------------------------------- vdp specs -- */

.specs { border: 1px solid var(--rule); background: var(--surface-raised); }

.specs h2 {
  font-size: var(--text-h3);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.specs dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
}
.specs dt,
.specs dd {
  margin: 0;
  padding: 0.7rem 1.5rem;
  font-size: 0.9375rem;
}
.specs dt {
  color: var(--ink-faint);
  font-size: var(--text-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.specs dd { text-align: right; font-variant-numeric: tabular-nums; }
.specs dt:nth-of-type(even),
.specs dd:nth-of-type(even) { background: var(--surface-sunk); }

.vdp-aside { display: grid; gap: 1.5rem; }

.inquire { border: 1px solid var(--rule); background: var(--surface-raised); padding: 1.5rem; }
.inquire h2 { font-size: var(--text-h3); margin-bottom: 1.25rem; }
.inquire .btn { width: 100%; }

.vdp-story { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.vdp-story h2 { font-size: var(--text-h2); margin-bottom: 1.5rem; }
.vdp-story p { color: var(--ink-dim); max-width: 72ch; }
.vdp-story p + p { margin-top: 1.1rem; }

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.feature-chips li {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--rule-strong);
  font-size: var(--text-meta);
  color: var(--ink-dim);
}

/* --------------------------------------------------------- prose pages -- */

.prose { max-width: 68ch; }
/* Smaller than a section head: these sit inside a 68ch measure and must not wrap. */
.prose h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2.125rem);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-dim); }
.prose p + p { margin-top: 1.1rem; }

.prose ul {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.85rem;
}
.prose ul li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--ink-dim);
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 8px; height: 2px;
  background: var(--amber);
}

/* --------------------------------------------------------------- faq ---- */

.faq { max-width: 78ch; border-top: 1px solid var(--rule); }

.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.5rem;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-h3);
  font-weight: 800;
  font-variation-settings: "wdth" 106;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: color var(--fast) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--amber); }

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  color: var(--amber);
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }

.faq details > p {
  padding-bottom: 1.75rem;
  color: var(--ink-dim);
  max-width: 66ch;
}

/* ------------------------------------------------------ contact layout -- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}

@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-form { border: 1px solid var(--rule); background: var(--surface-raised); padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.contact-form h2 { font-size: var(--text-h3); margin-bottom: 1.75rem; }
.contact-form .btn { width: 100%; }

/* ------------------------------------------------ photoswipe theming ---- */

.pswp {
  --pswp-bg: #0f1214;
  --pswp-placeholder-bg: #1b1f22;
  --pswp-icon-color: #ece9e3;
  --pswp-icon-color-secondary: #14171a;
  --pswp-icon-stroke-color: transparent;
  --pswp-error-text-color: #ff8a73;
}

.pswp__button:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }

.pswp__counter {
  font-family: var(--font);
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  opacity: 1;
}

.pswp__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(to top, rgb(15 18 20 / 0.92), transparent);
  font-size: 0.9375rem;
  color: var(--ink-dim);
  text-align: center;
  pointer-events: none;
}
.pswp__caption b { color: var(--amber); font-weight: 700; }
