/* MotorLB home: FEATURED CARS row + smaller headline when the row is showing (class "fh-on" set by featured.js).
   Undo: see Archive/Code-backups/featured-home-v1-backup/UNDO.sh */

/* ---- smaller headline so the featured cars sit above the fold ---- */
html.fh-on .hero.has-photo { padding-top: 28px; padding-bottom: 26px; }
html.fh-on .hero h1 { font-size: clamp(1.9rem, 8.2vw, 2.7rem); line-height: 1.08; max-width: none; }
/* the small news/offer banner is not shown on Home while the featured row is (it stays on the Cars page) */
html.fh-on .promo-wrap { display: none; }
html.fh-on .promo-wrap + .hero.has-photo { margin-top: 84px; }
html.fh-on.is-app .promo-wrap + .hero.has-photo { margin-top: calc(66px + env(safe-area-inset-top)); }
html.fh-on .hero .lede, html.fh-on .hero .hero-note { display: none; }
html.fh-on .hero .eyebrow { margin-bottom: 8px; }
html.fh-on .hero-cta { margin-top: 16px; flex-direction: row; flex-wrap: nowrap; gap: 10px; align-items: center; }
html.fh-on .hero-cta .btn { flex: 1 1 0; min-height: 46px; justify-content: center; white-space: nowrap; padding-left: 14px; padding-right: 14px; }

/* ---- the row ---- */
.fh-sec { padding: 12px 0 0; }
.fh-sec .wrap { padding-left: 16px; padding-right: 16px; }
.fh-head { margin-bottom: 12px; }
.fh-spon { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim, #86868b); }
.fh-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 16px; padding: 2px 16px 14px; margin: 0 -16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fh-row::-webkit-scrollbar { display: none; }
.fh-card {
  flex: none; width: min(86vw, 390px); scroll-snap-align: start; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px; color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, #1b1b1e 0%, #0b0b0c 100%); box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.65);
  transition: transform 0.12s ease;
}
.fh-card:active { transform: scale(0.985); }
.fh-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 70%), #121214; }
.fh-img > img { display: block; }
.fh-img.fit-cover > img { width: 100%; height: 100%; object-fit: cover; }
.fh-img.fit-contain > img { position: absolute; left: 6%; top: 10%; width: 88%; height: 82%; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.55)); }
.fh-tag { position: absolute; left: 12px; top: 12px; padding: 4px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.18); }
.fh-logo { position: absolute; right: 12px; top: 12px; width: 52px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; padding: 5px 7px; }
.fh-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fh-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.fh-body b { font-size: 1.12rem; letter-spacing: -0.01em; line-height: 1.25; }
.fh-body span { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); line-height: 1.4; }
.fh-body em { font-style: normal; font-size: 0.78rem; color: rgba(255, 255, 255, 0.5); }
.fh-cta { font-style: normal; margin-top: 10px; font-size: 0.9rem; font-weight: 700; color: #fff; }

@media (min-width: 860px) {
  .fh-row { display: grid; overflow: visible; margin: 0; padding: 2px 0 6px; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fh-row[data-count="1"] { grid-template-columns: minmax(0, 520px); }
  .fh-row[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fh-card { width: auto; }
  html.fh-on .hero.has-photo { padding-top: 40px; padding-bottom: 36px; }
  html.fh-on .hero h1 { font-size: 3.4rem; }
  html.fh-on .hero-cta .btn { flex: 0 0 auto; }
}

/* brand label + split title: only used by the compact phone cards (below) */
.fh-brand, .fh-body u { display: none; text-decoration: none; }
.fh-body s { text-decoration: none; }

/* ---- Phones (2026-11-14): the featured cars sit SIDE BY SIDE and EQUAL, like on the big screen, instead of a swipe row where only the
   first car is seen (fairness for the brands that pay for a featured place). 3 cars = 3 equal columns, 2 = 2 columns, 1 = one full card.
   Polish: photo melts into the card (no hard edge), brand as a small gold label over the model name, round arrow instead of text. ---- */
@media (max-width: 859px) {
  .fh-row { display: grid; overflow: visible; scroll-snap-type: none; margin: 0; padding: 2px 0 6px; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fh-row[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fh-row[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
  .fh-card { width: auto; }
  .fh-row:not([data-count="1"]) .fh-card {
    border-radius: 18px; background: linear-gradient(172deg, #1d1d20 0%, #0b0b0c 70%);
    border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 30px -22px rgba(0, 0, 0, 0.8);
  }
  .fh-row:not([data-count="1"]) .fh-img { aspect-ratio: 1 / 0.9; background: radial-gradient(ellipse 80% 55% at 50% 48%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 72%), #131315; }
  .fh-row:not([data-count="1"]) .fh-img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(to top, #0e0e10 4%, rgba(14, 14, 16, 0)); pointer-events: none; }
  .fh-row:not([data-count="1"]) .fh-img.fit-contain > img { left: 4%; top: 14%; width: 92%; height: 60%; }
  .fh-row:not([data-count="1"]) .fh-img.fit-cover > img { height: 100%; }
  .fh-row:not([data-count="1"]) .fh-tag { left: 7px; top: 7px; padding: 2px 6px; font-size: 0.48rem; letter-spacing: 0.1em; background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.14); z-index: 2; }
  .fh-row:not([data-count="1"]) .fh-logo { display: none; }
  .fh-row:not([data-count="1"]) .fh-body { padding: 0 10px 11px; margin-top: -20px; position: relative; z-index: 1; gap: 3px; flex: 1; }
  .fh-row:not([data-count="1"]) .fh-brand { display: block; font-size: 0.54rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #c9ab7c; }
  .fh-row:not([data-count="1"]) .fh-bp { display: none; }
  .fh-row:not([data-count="1"]) .fh-body b { font-size: 0.8rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
  .fh-row:not([data-count="1"]) .fh-body span, .fh-row:not([data-count="1"]) .fh-body em { display: none; }
  .fh-row:not([data-count="1"]) .fh-cta { margin-top: auto; align-self: flex-end; font-size: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14); }
  .fh-row:not([data-count="1"]) .fh-cta::after { content: "\2192"; font-size: 0.82rem; line-height: 1; color: #fff; }
  .fh-row:not([data-count="1"]) .fh-body b + .fh-cta, .fh-row:not([data-count="1"]) .fh-body b { margin-bottom: 8px; }
  .fh-row[data-count="2"] .fh-img { aspect-ratio: 4 / 3.4; }
  .fh-row[data-count="2"] .fh-body { padding: 0 13px 13px; }
  .fh-row[data-count="2"] .fh-brand { font-size: 0.62rem; }
  .fh-row[data-count="2"] .fh-body b { font-size: 0.98rem; }
  .fh-row[data-count="2"] .fh-cta { width: 30px; height: 30px; }
}

/* ---- Category row on the Cars page (a body type / fuel type filter is on): same cards, smaller heading ---- */
.fh-cat { margin: 4px 0 18px; }
.fh-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fh-cat-head b { font-size: 0.98rem; letter-spacing: -0.01em; color: var(--text, inherit); }
