/* Event vehicles lineup. Colours come only from the Varan palette and its
   tints and shades: navy #2C4569 and turquoise #33B5B6 carry the large
   areas, mist #C7E1E4 the light surfaces and edges, amber #FAA831 is a
   small accent. Turquoise darkens along its own ramp (#167879) where it
   has to read on white; it never drifts toward green. */
/* .ev-cards carries the same tokens for the vehicle card
   (partials/vehicle_card.html) outside an event, on the vehicles page. */
.ev-lineup,
.ev-cards {
  /* The site canvas (brand-palette.css), so home, event and vehicle
     pages share one background in both themes. */
  --lu-canvas: var(--bg, #0d1726);
  --lu-card: var(--brand-ink, #152d43);
  --lu-edge: rgb(199 225 228 / 14%);
  --lu-line: rgb(199 225 228 / 24%);
  --lu-ink: #eef7f7;
  --lu-muted: #b1cfd5;
  --lu-accent: var(--brand-turquoise, #33b5b6);
  --lu-on-accent: #10263a;
  --lu-reserved: var(--brand-amber, #faa831);
  --lu-reserved-ink: #faa831;
  --lu-photo: #20334e;
  --lu-tile: rgb(255 255 255 / 5%);
  --lu-track: #12233a;
  --lu-brand: var(--brand-turquoise, #33b5b6);
  --lu-price: #fff;
  --lu-ok: var(--brand-turquoise, #33b5b6);
  --lu-accent-hover: color-mix(in srgb, var(--lu-accent) 82%, #fff);
}

.ev-lineup {
  position: relative;
  z-index: 1;
  padding: clamp(64px, 8vw, 104px) 0 clamp(80px, 9vw, 120px);
  background: var(--lu-canvas);
  color: var(--lu-ink);
}

/* Light: navy takes the actions, as on the hero and home page; turquoise's
   darker shade marks the brand, icons and stock; mist tints are the floor. */
:root[data-theme="light"] .ev-lineup,
:root[data-theme="light"] .ev-cards {
  --lu-card: #fff;
  --lu-edge: #d6e9eb;
  --lu-line: #c7e1e4;
  --lu-ink: #20334e;
  --lu-muted: #526e7a;
  --lu-accent: #2c4569;
  --lu-accent-hover: #20334e;
  --lu-on-accent: #fff;
  --lu-reserved: #faa831;
  --lu-reserved-ink: #8a5a12;
  --lu-photo: #e3f0f2;
  --lu-tile: #f2f8f9;
  --lu-track: #fff;
  --lu-brand: #167879;
  --lu-price: #2c4569;
  --lu-ok: #167879;
}

.ev-lineup__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header: heading and the event's description, then the cards' horizon
   device at section scale — body-type filters sit on the line as markers
   and the vehicle count marks its far end. */
.ev-lineup__header { margin-bottom: 40px; }

.ev-lineup__heading {
  margin: 0;
  color: var(--lu-ink);
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  font-weight: 400;
  line-height: 1.4;
}

.ev-lineup__about {
  max-width: 60ch;
  margin: 4px 0 0;
  color: var(--lu-muted);
  font-size: 0.9375rem;
  line-height: 1.9;
  text-wrap: pretty;
}

.ev-lineup__rule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}



/* Body-type filters: one track with a solid indicator that slides to the
   chosen type (placed by event-lineup.js). Its radii step down from the
   cards: card 22, track 14, indicator 10. */
.ev-lineup__filters {
  position: relative;
  isolation: isolate;
  display: flex;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--lu-edge);
  border-radius: 14px;
  background: var(--lu-track);
}

.ev-lineup__filter {
  flex: none;
  padding: 6px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--lu-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.7;
  cursor: pointer;
  transition: color 0.25s ease, background 0.2s ease;
}

.ev-lineup__filter:hover { color: var(--lu-ink); }
.ev-lineup__filter:focus-visible { outline: 2px solid var(--lu-accent); outline-offset: 1px; }

/* Without the script the pressed button paints its own fill. */
.ev-lineup__filter[aria-pressed="true"] {
  background: var(--lu-accent);
  color: var(--lu-on-accent);
}
.ev-lineup__filters[data-indicator] .ev-lineup__filter[aria-pressed="true"] { background: transparent; }

.ev-lineup__indicator {
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 10px;
  background: var(--lu-accent);
  box-shadow: 0 6px 14px -8px rgb(13 29 46 / 55%);
  transition: translate 0.4s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.4s cubic-bezier(0.3, 0.9, 0.3, 1);
}

/* The line runs only between the track and the count, so nothing has to
   mask it over the section's dot pattern. */
.ev-lineup__line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--lu-line);
}

/* The count marks the far end of the line: the row's only number. */
.ev-lineup__count {
  position: relative;
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--lu-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.ev-lineup__count-num {
  display: inline-block;
  min-width: 1ch;
  color: var(--lu-brand);
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1;
}

.ev-car[hidden] { display: none; }

.ev-lineup__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
}

.ev-lineup__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 48px 0;
  color: var(--lu-muted);
  text-align: center;
}

.ev-lineup__empty a { color: var(--lu-accent); text-decoration: underline; text-underline-offset: 4px; }

/* Card (after the "Spec Grid" reference): photo, make and model, a 2×2
   spec grid, price and one full-width action. The stock status lives in a
   tab of the card's own surface cut into the photo's lower corner, so the
   photo's edge still carries it the way the horizon line used to. */
.ev-car {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--lu-edge);
  border-radius: 22px;
  background: var(--lu-card);
  box-shadow: 0 1px 2px rgb(20 40 70 / 4%), 0 12px 32px -12px rgb(20 40 70 / 14%);
  transition: border-color 0.25s ease;
}

.ev-car:hover,
.ev-car:focus-within { border-color: color-mix(in srgb, var(--lu-accent) 50%, transparent); }

.ev-car__photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.78 / 1;
  overflow: hidden;
  border-radius: 16px;
  /* The tab covers this corner; rounding it would clip the tab. */
  border-end-end-radius: 0;
  background: var(--lu-photo);
}

/* No tab (a vehicle outside any sale event): the corner stays round. */
.ev-car__photo:not(:has(.ev-car__tab)) { border-end-end-radius: 16px; }

.ev-car__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  transition: filter 0.3s ease;
}

.ev-car__placeholder { width: 72px; height: 72px; color: var(--lu-muted); opacity: 0.4; }

/* The tab: square to the photo's corner, rounded on its open corner, and
   joined to the photo's edges by two concave fillets. */
.ev-car__tab {
  --r: 14px;
  position: absolute;
  /* Bleeds a pixel past the photo's edges so no sliver of image shows. */
  inset-inline-end: -1px;
  bottom: -1px;
  padding: 8px 16px 1px 15px;
  border-start-start-radius: var(--r);
  background: var(--lu-card);
}
.ev-car__tab::before,
.ev-car__tab::after {
  content: "";
  position: absolute;
  width: var(--r);
  height: var(--r);
  background: radial-gradient(circle at 100% 0, transparent calc(var(--r) - 0.5px), var(--lu-card) var(--r));
}
.ev-car__tab::before { bottom: 100%; left: 0; }
.ev-car__tab::after { bottom: 0; left: 100%; }
[dir="ltr"] .ev-car__tab::before { left: auto; right: 0; transform: scaleX(-1); }
[dir="ltr"] .ev-car__tab::after { left: auto; right: 100%; transform: scaleX(-1); }

.ev-car__stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lu-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
}
.ev-car__stock::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.ev-car__stock[data-state="available"] { color: var(--lu-ok); }
.ev-car__stock[data-state="available"]::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lu-ok) 22%, transparent); }
.ev-car__stock[data-state="fully_reserved"] { color: var(--lu-reserved-ink); }
.ev-car__stock[data-state="fully_reserved"]::before { background: var(--lu-reserved); }

.ev-car:has(.ev-car__stock[data-state="sold"]) .ev-car__img { filter: saturate(0.25) brightness(0.85); }

.ev-car__title { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }

.ev-car__brand {
  margin: 0;
  text-align: right;
  color: var(--lu-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ev-car__name {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--lu-ink);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
  text-transform: capitalize;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.ev-car__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0 6px;
}

.ev-car__spec {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--lu-tile);
}

.ev-car__spec-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff;
  color: var(--lu-brand);
  box-shadow: 0 1px 2px rgb(20 40 70 / 8%);
}
.ev-car__spec-icon svg { width: 17px; height: 17px; }

.ev-car__spec dt { color: var(--lu-muted); font-size: 0.6875rem; line-height: 1.4; }
.ev-car__spec dd {
  margin: 0;
  text-transform: capitalize;
  overflow: hidden;
  color: var(--lu-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ev-car__deal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: auto 6px 0;
  padding: 10px 0 2px;
  border-top: 1px dashed var(--lu-line);
}

.ev-car__price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: var(--lu-muted);
  font-size: 0.8125rem;
}
.ev-car__amount { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ev-car__amount strong { color: var(--lu-price); font-size: 1.375rem; font-weight: 600; line-height: 1.3; }

.ev-car__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 13px;
  background: var(--lu-accent);
  color: var(--lu-on-accent);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

/* Whole card opens the vehicle; the button stays the visible target. */
.ev-car__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ev-car__cta:hover { background: var(--lu-accent-hover); color: var(--lu-on-accent); }
.ev-car__cta:focus-visible { outline: none; }
.ev-car:has(.ev-car__cta:focus-visible) { outline: 2px solid var(--lu-accent); outline-offset: 3px; }

@media (max-width: 1100px) {
  .ev-lineup__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ev-lineup__inner { padding: 0 20px; }
  .ev-lineup__header { margin-bottom: 28px; }
  .ev-lineup__rule { gap: 10px; }
  .ev-lineup__filters { overflow-x: auto; scrollbar-width: none; }
  .ev-lineup__filters::-webkit-scrollbar { display: none; }
  .ev-lineup__filter { padding: 5px 12px; font-size: 0.75rem; }
  .ev-lineup__count-num { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .ev-lineup__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ev-car__amount strong { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ev-car, .ev-car__img, .ev-car__cta { transition: none; }
}
