/* Short, soft fades blend the photographs into the graphite card surface. */
.car-picture { background: var(--surface); }
.car-picture::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--surface) 0%,
    rgb(var(--surface-rgb) / 30%) 4%,
    rgb(var(--surface-rgb) / 8%) 8%,
    transparent 14%,
    transparent 86%,
    rgb(var(--surface-rgb) / 8%) 92%,
    rgb(var(--surface-rgb) / 30%) 96%,
    var(--surface) 100%
  );
}
.car-picture .car-category { z-index: 2; }
.car-category { font-size: .8125rem; letter-spacing: .08em; }

/* Car page: a full-screen page, not a floating window. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.car-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100svh;
  max-height: 100svh;
  /* As tall as the screen at every moment (browser bars shown or hidden): no black band at the bottom on phones. */
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  background: var(--site-bg);
  scroll-padding-top: 82px;
}
.car-dialog::backdrop { background: var(--site-bg); backdrop-filter: none; }
/* The site header (app.js placeHeader) at the top of a car page: the same bar as the homepage once scrolled,
   kept in place while the page scrolls, never over the photos. */
.car-dialog > .site-header { position: sticky; top: 0; height: 82px; background: rgb(var(--site-bg-rgb) / 94%); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* Hero: one close-up fills the screen, the name sits bottom-left. */
.detail-hero {
  position: relative;
  height: calc(100svh - 82px);
  min-height: 460px;
  overflow: hidden;
  background: var(--site-bg);
  touch-action: pan-y;
}
.detail-hero-open { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
.detail-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
/* A lightly blurred copy shows only along the bottom edge, softening the photo before it fades into the page. */
.detail-hero-soft {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 75%) 8%, rgb(0 0 0 / 35%) 16%, rgb(0 0 0 / 10%) 23%, transparent 30%);
  mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 75%) 8%, rgb(0 0 0 / 35%) 16%, rgb(0 0 0 / 10%) 23%, transparent 30%);
}
/* Eased fade: the photo dissolves into the page colour with no visible edge. */
.detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top,
      var(--site-bg) 0%,
      rgb(var(--site-bg-rgb) / 94%) 8%,
      rgb(var(--site-bg-rgb) / 78%) 17%,
      rgb(var(--site-bg-rgb) / 55%) 27%,
      rgb(var(--site-bg-rgb) / 32%) 38%,
      rgb(var(--site-bg-rgb) / 14%) 50%,
      rgb(var(--site-bg-rgb) / 4%) 62%,
      transparent 72%),
    linear-gradient(to bottom, rgb(var(--site-bg-rgb) / 35%), transparent 18%);
}
.detail-hero-title {
  position: absolute;
  left: clamp(20px, 6.5vw, 125px);
  right: clamp(20px, 6.5vw, 125px);
  bottom: clamp(40px, 11svh, 110px);
  z-index: 2;
  pointer-events: none;
}
.detail-hero-brand { margin: 0 0 14px; font-family: 'Barlow Condensed', Arial, sans-serif; font-size: clamp(1.4rem, 2.2vw, 2.1rem); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: #f1f1ee; }
.detail-hero-title h2 { margin: 0 0 30px; font-size: clamp(3rem, 6vw, 5.4rem); font-weight: 700; line-height: .98; letter-spacing: .01em; text-transform: uppercase; text-shadow: 0 2px 18px rgb(0 0 0 / 35%); }
.detail-hero-title h2 span { display: block; }
/* Names on two lines share the words evenly (no lone word on the last line); public/app.js fitTitles keeps them to two. */
.detail-hero-title h2, .detail-overview-title { text-wrap: balance; }
/* Long names on the photo (public/app.js titleLength, api/page.js titleClass): the same steps as the summary title. */
.detail-hero-title h2.is-long { font-size: clamp(2.6rem, 5vw, 4.4rem); }
.detail-hero-title h2.is-xlong { font-size: clamp(2.3rem, 4.2vw, 3.6rem); }
.detail-hero-title h2.is-xxlong { font-size: clamp(2rem, 3.4vw, 3rem); }
.detail-hero-more {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 17px 32px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.detail-hero-more:hover { background: #d9232e; color: #fff; }
.detail-hero-more svg { width: 18px; height: 18px; }
/* Breathing space between the two photographs, carrying a short introduction to the model. */
.detail-transition { display: flex; align-items: center; justify-content: center; min-height: clamp(220px, 30vw, 380px); padding: clamp(36px, 6vw, 80px) clamp(20px, 6.5vw, 125px); background: var(--site-bg); }
.detail-intro { max-width: 640px; margin: 0; text-align: center; line-height: 1.7; white-space: pre-line; font-family: 'Barlow Condensed', Arial, sans-serif; font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 300; letter-spacing: .02em; color: #e4e4e1; }
.detail-intro::before { content: ''; display: block; width: 40px; height: 2px; margin: 0 auto 26px; background: #e32630; }

/* Overview: a large photo of the car, sharp on the right, softening into the page behind the specifications. */
.detail-overview {
  position: relative;
  isolation: isolate;
  min-height: min(860px, 92svh);
  display: flex;
  align-items: center;
  padding: clamp(60px, 8vw, 110px) clamp(20px, 6.5vw, 125px) clamp(40px, 5vw, 70px);
  background: var(--site-bg);
  overflow: hidden;
}
.detail-showcase { position: absolute; inset: 0 0 0 12%; z-index: -1; pointer-events: none; }
.detail-showcase img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
/* A blurred copy shows through on the left, the sharp photo on the right; masks keep the change gradual. */
.detail-showcase-soft {
  filter: blur(19px);
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 34%, transparent 66%);
  mask-image: linear-gradient(to right, #000 0%, #000 34%, transparent 66%);
}
.detail-showcase-sharp {
  -webkit-mask-image: linear-gradient(to right, transparent 18%, rgb(0 0 0 / 35%) 36%, rgb(0 0 0 / 80%) 50%, #000 62%);
  mask-image: linear-gradient(to right, transparent 18%, rgb(0 0 0 / 35%) 36%, rgb(0 0 0 / 80%) 50%, #000 62%);
}
.detail-showcase::after {
  content: '';
  position: absolute;
  inset: -40px -40px 0 -40px;
  background:
    linear-gradient(to right, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 96%) 12%, rgb(var(--site-bg-rgb) / 86%) 24%, rgb(var(--site-bg-rgb) / 66%) 34%, rgb(var(--site-bg-rgb) / 38%) 44%, rgb(var(--site-bg-rgb) / 14%) 53%, transparent 62%),
    linear-gradient(to bottom, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 82%) 7%, rgb(var(--site-bg-rgb) / 50%) 15%, rgb(var(--site-bg-rgb) / 18%) 24%, transparent 32%, transparent 72%, rgb(var(--site-bg-rgb) / 14%) 80%, rgb(var(--site-bg-rgb) / 36%) 87%, rgb(var(--site-bg-rgb) / 66%) 93%, rgb(var(--site-bg-rgb) / 90%) 97.5%, var(--site-bg) 100%);
}
.detail-info { position: relative; width: min(600px, 48%); padding: 0; min-width: 0; }
.detail-info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.detail-info-head > div:first-child { min-width: 0; }
.detail-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; color: var(--text-secondary); }
.detail-category { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: .9375rem; font-weight: 500; letter-spacing: .18em; color: var(--text); }
.detail-category::before, .detail-category.is-collectors::after { content: ''; width: 32px; height: 2px; background: #e32630; flex-shrink: 0; }
.detail-make { font-size: 1rem; font-weight: 500; letter-spacing: .3em; color: #f1f1ee; }
.detail-tier { font-size: .75rem; letter-spacing: .3em; }
.detail-overview-title { margin: 0 0 16px; font-size: clamp(3rem, 5.2vw, 4.6rem); letter-spacing: .1em; text-transform: uppercase; font-weight: 400; }
/* A name kept on one line (lib/vehicle-details.js `model`): slightly tighter so it fits beside the share icons. */
.detail-overview-title.is-one-line { white-space: nowrap; font-size: clamp(2.6rem, 4.2vw, 4rem); letter-spacing: .08em; }
/* Long names (public/app.js titleLength): the same style, smaller, so they stay within about three lines. */
.detail-overview-title.is-long { font-size: clamp(2.5rem, 4vw, 3.6rem); }
.detail-overview-title.is-xlong { font-size: clamp(2.2rem, 3.3vw, 3rem); letter-spacing: .08em; }
.detail-overview-title.is-xxlong { font-size: clamp(1.9rem, 2.7vw, 2.5rem); letter-spacing: .06em; }
.detail-info .detail-price { font-size: 2.125rem; margin: 0 0 28px; color: #fff; }
.detail-vat { margin-left: 14px; font-size: .75rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--text-secondary); vertical-align: .32em; white-space: nowrap; }
.detail-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(40px, 5vw, 72px); margin-bottom: 0; border-top: 1px solid var(--line); }
.detail-specs .spec dt { font-size: .8125rem; color: var(--text-secondary); }
.detail-specs .spec dd { font-size: 1.0625rem; }
.car-dialog:focus { outline: none; }
/* Buttons sit below the photo, before the divider of the gallery. */
.detail-actions-row { padding: 0 clamp(20px, 6.5vw, 125px); }
/* Desktop: the photo behind the specifications runs on until the middle of the buttons.
   The section grows by half a button (26px) and the buttons are pulled up by the same amount, so nothing moves. */
@media (min-width: 1001px) {
  .detail-overview { min-height: calc(min(860px, 92svh) + 26px); padding-bottom: calc(clamp(40px, 5vw, 70px) + 26px); }
  .detail-actions-row { position: relative; z-index: 1; margin-top: -26px; }
  /* The photo fills the section from top to bottom, anchored to the right edge and never cropped (its own width at
     the section's height): the whole car shows beside the specifications. The section is as tall as the photo can be
     while staying to the right of the specifications (--specs-end), within the old limits; on narrower desktops the
     photo starts a little behind them and fades into the dark. A blurred copy fills the rest of the section. */
  .detail-overview {
    --gutter: clamp(20px, 6.5vw, 125px);
    --specs-end: calc(var(--gutter) + min(600px, (100vw - 2 * var(--gutter)) * .48));
    min-height: calc(clamp(600px, (100vw - var(--specs-end)) / 1.45, min(860px, 92svh)) + 26px);
  }
  .detail-showcase { inset: 0; }
  .detail-showcase-soft {
    filter: blur(26px) brightness(.55);
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 40%, transparent 75%);
    mask-image: linear-gradient(to right, #000 0%, #000 40%, transparent 75%);
  }
  .detail-showcase img.detail-showcase-sharp {
    left: auto; right: 0; width: auto; max-width: 100%; height: 100%; object-fit: contain; object-position: 100% 50%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / 60%) 7%, #000 16%);
    mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / 60%) 7%, #000 16%);
  }
  .detail-showcase::after {
    inset: 0;
    background:
      linear-gradient(to right, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 85%) calc(var(--specs-end) * .55), rgb(var(--site-bg-rgb) / 30%) var(--specs-end), transparent calc(var(--specs-end) + 6%)),
      linear-gradient(to bottom, var(--site-bg) 0%, transparent 9%, transparent 86%, var(--site-bg) 100%);
  }
}
.detail-actions { max-width: 600px; }
.detail-actions .button { font-weight: 500; letter-spacing: .02em; border-color: #ffffff40; background: rgb(var(--site-bg-rgb) / 35%); backdrop-filter: blur(4px); }
.detail-actions .button:hover { background: #f4f4f0; border-color: #f4f4f0; color: #090909; }
/* Buttons centred under "I dettagli dell'eccellenza" when that section comes first (lib/vehicle-details.js). */
.detail-actions-row.is-centered { margin-top: 0; }
.detail-actions-row.is-centered .detail-actions { margin-inline: auto; justify-content: center; }
/* Three equal buttons centred in one row (F12tdf): capitals, thin light border, red accent on hover. */
/* Without the service history the other buttons (Configurazione, Maggiori informazioni) stand in the centre, set like
   the three: same style, narrower row. */
.detail-actions-row.is-trio .detail-actions, .detail-actions-row.is-pair .detail-actions { max-width: 1080px; margin-inline: auto; justify-content: center; gap: 14px; flex-wrap: nowrap; }
.detail-actions-row.is-pair .detail-actions { max-width: 720px; }
.detail-actions-row.is-trio .button, .detail-actions-row.is-pair .button { flex: 1 1 0; min-width: 0; text-transform: uppercase; letter-spacing: .1em; font-size: .8125rem; color: #fff; border-color: rgb(255 255 255 / 30%); }
.detail-actions-row.is-trio .button:hover, .detail-actions-row.is-trio .button:focus-visible, .detail-actions-row.is-pair .button:hover, .detail-actions-row.is-pair .button:focus-visible { background: rgb(227 38 48 / 14%); border-color: #e32630; color: #fff; box-shadow: 0 0 22px rgb(227 38 48 / 18%); }

/* Share: four thin icons, no heavy buttons. */
.detail-share { position: relative; display: flex; gap: 4px; flex-shrink: 0; padding-top: 2px; }
.detail-share > a, .detail-share > button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--text-secondary); transition: color .2s, border-color .2s; }
.detail-share > a:hover, .detail-share > button:hover { color: #fff; border-color: #ffffff40; }
.detail-share svg { width: 19px; height: 19px; }
.detail-share-status { position: absolute; right: 0; top: calc(100% + 6px); white-space: nowrap; font-size: .75rem; letter-spacing: .08em; color: var(--text-secondary); opacity: 0; transition: opacity .2s; }
.detail-share.notice .detail-share-status { opacity: 1; }

/* Shortcuts to the exterior and interior sections of the gallery. */
.detail-gallery-intro { margin: clamp(56px, 7vw, 100px) clamp(20px, 6.5vw, 125px) 0; padding: clamp(28px, 3vw, 40px) 0 70px; border-top: 1px solid var(--line); }
.detail-gallery-heading { display: flex; align-items: center; gap: 16px; margin: 0 0 clamp(24px, 3vw, 36px); font-size: .8125rem; font-family: Inter, Arial, sans-serif; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--text-secondary); }
.detail-gallery-heading::before { content: ''; width: 40px; height: 2px; background: #e32630; }
.detail-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
/* Computer and tablet: the tiles go two by two; a tile left alone on the last row (e.g. Dettagli after Esterni and
   Interni) sits in the middle, not on the left. */
@media (min-width: 701px) {
  .detail-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-shortcut { grid-column: span 2; }
  .detail-shortcut:last-child:nth-child(odd) { grid-column: 2 / span 2; }
}
/* Esterni and Interni on top; Dettagli and Dotazioni below, side by side, half as tall (lib/vehicle-details.js). */
.detail-shortcut.is-half { aspect-ratio: 16 / 3.5; }
.detail-shortcut.is-half span { left: 24px; bottom: 18px; }
.detail-shortcut.is-half strong { font-size: clamp(1.5rem, 2.2vw, 2rem); }
.detail-shortcut.is-empty { display: flex; background: linear-gradient(135deg, var(--surface-deep), rgb(var(--site-bg-rgb) / 60%)); border: 1px solid var(--line); cursor: default; }
.detail-shortcut.is-empty::after { content: none; }
.detail-shortcut.is-empty strong { color: var(--text-secondary); }
.detail-shortcut small { font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); }
.detail-shortcut { position: relative; aspect-ratio: 16 / 7; padding: 0; border: 0; overflow: hidden; background: var(--surface-deep); text-align: left; }
.detail-shortcut img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.detail-shortcut::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 70%), transparent 60%); }
.detail-shortcut span { position: absolute; left: 28px; bottom: 24px; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.detail-shortcut strong { font-family: 'Barlow Condensed', Arial, sans-serif; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.detail-shortcut:hover img { transform: scale(1.04); }
.detail-shortcut:hover strong { color: #ff5a62; }


.detail-mosaic { container-type: inline-size; padding: 60px clamp(20px, 6.5vw, 125px) 40px; }
.detail-mosaic:last-child { padding-bottom: 90px; }
.mosaic-title { max-width: 1280px; margin: 0 auto 22px; display: flex; align-items: center; gap: 16px; font-size: 1.9rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.mosaic-title::before { content: ''; width: 40px; height: 2px; background: #e32630; }
.mosaic-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: calc((min(100cqw, 1280px) - 15px) / 4 / 1.45);
  gap: 5px;
}
.mosaic-grid li.big { grid-column: span 2; grid-row: span 2; }
.mosaic-grid button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--surface-deep); overflow: hidden; cursor: zoom-in; }
.mosaic-grid img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.mosaic-grid button:hover img { opacity: .85; }

@media (max-width: 1000px) {
  /* Photo on top, fading downward into the specifications; no lateral blur on narrow screens. */
  .detail-overview { display: block; min-height: 0; padding-top: 0; }
  /* The photo at its own shape (3:2), so the whole car shows, from the rear to the front. */
  .detail-showcase { position: relative; inset: auto; aspect-ratio: 3 / 2; margin: 0 calc(-1 * clamp(20px, 6.5vw, 125px)) -40px; z-index: 0; }
  .detail-showcase-soft { display: none; }
  .detail-showcase-sharp { -webkit-mask-image: none; mask-image: none; object-position: 50% 50%; }
  .detail-showcase::after { inset: -1px 0; background: linear-gradient(to bottom, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 35%) 8%, transparent 16%, transparent 80%, rgb(var(--site-bg-rgb) / 60%) 92%, var(--site-bg) 100%); }
  .detail-info { width: auto; }
}
@media (max-width: 700px) {
  .car-dialog > .site-header { height: 78px; }
  .car-dialog { scroll-padding-top: 78px; }
  .detail-hero { height: calc(100svh - 78px); min-height: 420px; }
  .detail-hero-title { right: 20px; bottom: 96px; }
  .detail-hero-title h2 { font-size: clamp(2.4rem, 12vw, 3.4rem); margin-bottom: 22px; }
  .detail-hero-title h2.is-long { font-size: clamp(2.1rem, 10vw, 2.9rem); }
  .detail-hero-title h2.is-xlong { font-size: clamp(1.9rem, 8.5vw, 2.5rem); }
  .detail-hero-title h2.is-xxlong { font-size: clamp(1.7rem, 7vw, 2.1rem); }
  .detail-hero-more { padding: 14px 24px; font-size: .8125rem; }
  .detail-overview { padding: 0 20px 50px; }
  .detail-showcase { margin: 0 -20px -30px; }
  .detail-make, .detail-tier { letter-spacing: .2em; }
  .detail-info-head { flex-direction: column; gap: 8px; }
  .detail-share { margin: -8px 0 18px -10px; }
  .detail-share-status { left: 10px; right: auto; }
  .detail-overview-title { font-size: 2.75rem; letter-spacing: .08em; }
  .detail-overview-title.is-long { font-size: 2.3rem; }
  .detail-overview-title.is-xlong { font-size: 2rem; letter-spacing: .06em; }
  .detail-overview-title.is-xxlong { font-size: 1.7rem; letter-spacing: .05em; }
  .detail-category { font-size: .8125rem; letter-spacing: .16em; margin-bottom: 16px; }
  .detail-info .detail-price { font-size: 1.75rem; }
  .detail-specs .spec dd { font-size: 1rem; }
  .detail-specs { gap: 0 28px; }
  .detail-actions { flex-direction: column; }
  .detail-actions-row { padding: 0 20px; }
  .detail-actions-row.is-trio .detail-actions, .detail-actions-row.is-pair .detail-actions { flex-direction: column; flex-wrap: wrap; }
  .detail-actions-row.is-trio .button, .detail-actions-row.is-pair .button { flex: none; padding-inline: 12px; letter-spacing: .06em; font-size: .75rem; }
  .detail-gallery-intro { margin: 44px 20px 0; padding: 26px 0 40px; }
  .detail-shortcuts { grid-template-columns: 1fr; gap: 8px; }
  .detail-shortcuts.is-paired { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-shortcuts.is-paired .detail-shortcut:not(.is-half) { grid-column: 1 / -1; }
  .detail-shortcut.is-half { aspect-ratio: 16 / 8; }
  .detail-shortcut.is-half span { left: 14px; bottom: 12px; }
  .detail-shortcut.is-half strong { font-size: 1.3rem; }
  .detail-shortcut small { font-size: .5625rem; letter-spacing: .14em; }
  .detail-shortcut { aspect-ratio: 16 / 8; }
  .detail-shortcut span { left: 20px; bottom: 18px; }
  .detail-mosaic { padding: 36px 20px 24px; }
  .mosaic-title { font-size: 1.5rem; }
  .mosaic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc((100cqw - 4px) / 2 / 1.09); gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .mosaic-grid img, .detail-shortcut img { transition: none; }
  .info-dialog[open], .info-dialog.closing, .info-dialog[open]::backdrop, .info-dialog.closing::backdrop { animation: none; }
}

/* Pop-up for equipment and further information. */
.info-dialog {
  width: min(880px, calc(100vw - 48px));
  max-height: min(84svh, 860px);
  padding: 0;
  border: 1px solid #ffffff1a;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgb(0 0 0 / 45%);
  overflow: hidden;
  overscroll-behavior: contain;
}
.info-dialog[open] { display: flex; flex-direction: column; animation: info-in .38s cubic-bezier(.2, .7, .2, 1); }
.info-dialog::backdrop { background: rgb(var(--surface-deep-rgb) / 55%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.info-dialog[open]::backdrop { animation: info-fade .38s ease; }
.info-dialog.closing { animation: info-out .26s ease forwards; }
.info-dialog.closing::backdrop { animation: info-fade .26s ease reverse forwards; }
@keyframes info-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes info-out { to { opacity: 0; transform: translateY(12px); } }
@keyframes info-fade { from { opacity: 0; } to { opacity: 1; } }
.info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 34px 40px 22px; border-bottom: 1px solid var(--line); }
.info-eyebrow { margin: 0 0 10px; font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; color: var(--text-secondary); }
.info-title { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: .06em; text-transform: uppercase; }
.info-close { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; margin: -6px -10px 0 0; border: 0; background: none; color: var(--text-secondary); transition: color .2s, transform .2s; }
.info-close:hover { color: #fff; transform: rotate(90deg); }
.info-close svg { width: 24px; height: 24px; }
.info-body { overflow-y: auto; padding: 26px 40px 40px; scrollbar-width: thin; scrollbar-color: #ffffff40 transparent; }
.info-equipment { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.info-equipment li, .info-facts li { break-inside: avoid; position: relative; padding: 11px 0 11px 22px; border-bottom: 1px solid #ffffff12; font-size: .9375rem; line-height: 1.5; color: #e4e4e1; }
.info-equipment li::before, .info-facts li::before { content: ''; position: absolute; left: 0; top: 1.18em; width: 9px; height: 1px; background: #e32630; }
.info-text { max-width: 680px; }
.info-facts { list-style: none; margin: 0 0 22px; padding: 0; }
.info-text p { margin: 0 0 22px; white-space: pre-line; color: #d6d6d3; line-height: 1.75; }
.info-service { list-style: none; margin: 0; padding: 0; max-width: 680px; }
.info-service li { display: grid; grid-template-columns: 110px 1fr; gap: 4px 24px; position: relative; padding: 13px 0 13px 22px; border-bottom: 1px solid #ffffff12; font-size: .9375rem; line-height: 1.5; color: #e4e4e1; }
.info-service li::before { content: ''; position: absolute; left: 0; top: calc(13px + .75em); width: 9px; height: 1px; background: #e32630; }
.service-date { font-variant-numeric: tabular-nums; }
.service-km { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.service-note { grid-column: 1 / -1; color: #d6d6d3; }
.service-km + .service-note, .service-date + .service-beside { grid-column: 2; }
.info-empty { max-width: 560px; margin: 0; color: #d6d6d3; line-height: 1.75; }
/* "Maggiori informazioni" of a car with its own Cronologia service button: the history lives in that pop-up only,
   so the remaining facts get larger, brighter type in two balanced columns. */
.info-dialog.is-spacious .info-body { padding: 34px 48px 48px; }
.info-dialog.is-spacious .info-text { max-width: none; }
.info-dialog.is-spacious .info-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; margin: 0; }
.info-dialog.is-spacious .info-facts li { padding: 18px 0 18px 28px; font-size: 1.125rem; line-height: 26px; letter-spacing: .01em; color: var(--text); border-bottom-color: #ffffff17; }
.info-dialog.is-spacious .info-facts li::before { top: 30px; width: 12px; height: 2px; }
.info-dialog.is-spacious .info-text p { font-size: 1.0625rem; color: #e4e4e1; }
@media (max-width: 700px) {
  .info-dialog { width: 100vw; max-width: 100vw; max-height: 88svh; margin: auto 0 0; border-width: 1px 0 0; }
  .info-head { padding: 24px 20px 16px; }
  .info-body { padding: 18px 20px 32px; }
  .info-equipment { columns: 1; }
  .info-dialog.is-spacious .info-body { padding: 22px 20px 36px; }
  .info-dialog.is-spacious .info-facts { grid-template-columns: 1fr; }
  .info-dialog.is-spacious .info-facts li { padding-block: 15px; font-size: 1.0625rem; line-height: 24px; }
  .info-dialog.is-spacious .info-facts li::before { top: 26px; }
}

/* Enquiry at the end of the photo gallery: centred, the same outline button as the rest of the page. */
.detail-request { display: flex; justify-content: center; padding: clamp(40px, 5vw, 64px) 20px clamp(56px, 7vw, 90px); }
.detail-request .button { width: 260px; max-width: 100%; font-weight: 500; letter-spacing: .02em; border-color: #ffffff40; background: rgb(var(--site-bg-rgb) / 35%); transition: background .3s, border-color .3s, color .3s, transform .3s; }
.detail-request .button:hover { background: #f4f4f0; border-color: #f4f4f0; color: #090909; transform: translateY(-2px); }
/* The site's closing footer, shown at the end of every car page too. */
.car-dialog .footer-closing { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .detail-request .button:hover { transform: none; } }

/* "Esterni" shortcut: the box is wider than the photo, so part of it is cut. The car usually sits in the lower part
   of the photo: showing that part keeps the wheels inside the box (instead of cutting the bottom of the car). */
.detail-shortcut[data-scroll-to="gallery-exteriors"] img { object-position: 50% 72%; }

/* First screen of a car page sent by the server (api/page.js carInstant): the photo, brand and model exactly where the
   car page shows them, until public/app.js opens the page and removes it. Never left on screen: after 8 s it fades out
   by itself and stops catching touches. */
.car-instant { position: fixed; inset: 0; z-index: 19; padding-top: 82px; background: var(--site-bg); pointer-events: none; animation: car-instant-out .4s ease 8s forwards; }
.car-instant .detail-hero { pointer-events: none; }
@keyframes car-instant-out { to { opacity: 0; visibility: hidden; } }
@media (max-width: 700px) { .car-instant { padding-top: 78px; } }

/* Report responsive M2: a phone held sideways (or any very low window). The first screen of a car page kept at least
   460 px, taller than the screen, and the bottom of a long title (and "Scopri di più") fell below it. Here it is as
   tall as the screen, and the title is sized on the height so that two lines and the button fit. */
@media (orientation: landscape) and (max-height: 500px) {
  .detail-hero { height: calc(100svh - 78px); min-height: 0; }
  .detail-hero-title { bottom: 18px; }
  .detail-hero-brand { margin-bottom: 6px; font-size: clamp(1rem, 4.5svh, 1.4rem); }
  .detail-hero-title h2 { margin-bottom: 12px; font-size: clamp(1.6rem, 11svh, 2.8rem); }
  .detail-hero-title h2.is-long { font-size: clamp(1.5rem, 10svh, 2.5rem); }
  .detail-hero-title h2.is-xlong { font-size: clamp(1.4rem, 8.5svh, 2.2rem); }
  .detail-hero-title h2.is-xxlong { font-size: clamp(1.3rem, 7.5svh, 2rem); }
  .detail-hero-more { padding: 10px 20px; }
}

/* Back arrow over the first photo of a car page: phones only (27/11/2026). A thin white circle on a slightly
   transparent ground, no text; it closes the car (public/app.js closeCar): back to the page and scroll it came from,
   the collection when the car was opened from a link. Hidden on larger screens, where nothing changes. */
.car-back { display: none; }
@media (max-width: 700px), (orientation: landscape) and (max-height: 500px) {
  .car-back { display: grid; place-items: center; position: fixed; z-index: 15; top: 92px; left: max(14px, env(safe-area-inset-left, 0px)); width: 40px; height: 40px; padding: 0; border: 1px solid rgb(255 255 255 / 55%); border-radius: 50%; background: rgb(0 0 0 / 22%); color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); -webkit-tap-highlight-color: transparent; transition: background-color .2s ease, border-color .2s ease; }
  .car-back svg { width: 18px; height: 18px; }
  .car-back:active { background: rgb(0 0 0 / 38%); border-color: #fff; }
  .car-back:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
}
/* Fixed under the bar of the car page while the page scrolls: 14 px below it (78 px on phones, 82 px when wider). */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 701px) { .car-back { top: 96px; } }
