/* "Fotografie in arrivo": a car published before its photo shoot (car.photosPending in public/app.js).
   An editorial preview stands in for each photo, filling exactly the box of the picture it replaces: when the photos
   arrive from Drive they take its place with no other change to the page. */
.photo-pending {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  background:
    radial-gradient(120% 90% at 78% 18%, rgb(255 255 255 / 7%) 0%, transparent 55%),
    radial-gradient(90% 80% at 10% 100%, rgb(0 0 0 / 55%) 0%, transparent 70%),
    linear-gradient(155deg, #303131 0%, #262727 42%, #1b1b1b 100%);
  user-select: none;
}
/* The model's name, set very large and almost dissolved into the background. */
.photo-pending-ghost {
  position: absolute;
  right: -.04em;
  bottom: -.2em;
  font-family: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  font-size: 36cqh;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(to bottom, rgb(255 255 255 / 9%), rgb(255 255 255 / 1.5%) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
}
.photo-pending-copy {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  bottom: 12cqh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.photo-pending-brand {
  margin-bottom: .55em;
  font-size: clamp(.6875rem, 2.6cqw, .875rem);
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.photo-pending-model {
  font-family: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  font-size: clamp(1.9rem, 10.5cqw, 3.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}
.photo-pending-rule { display: block; width: 32px; height: 2px; margin: 1.15em 0 .95em; background: #e32630; flex-shrink: 0; }
.photo-pending-label {
  font-size: clamp(.625rem, 2.1cqw, .75rem);
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
/* Cards: the faded name runs along the top, clear of the note at the bottom. */
.car-picture .photo-pending-ghost, .arrival-photo .photo-pending-ghost, .collector-photo-stage .photo-pending-ghost { bottom: auto; top: -.16em; font-size: 46cqh; }
/* Cards: no zoom effect on hover, the preview stays still. */
.car-picture.is-pending, .arrival-photo.is-pending { background: #1f1f1f; }
.car-card:hover .car-picture.is-pending .photo-pending, .car-card:focus-visible .car-picture.is-pending .photo-pending { transform: none; }
.collector-photo-stage.is-pending { position: relative; aspect-ratio: 3 / 2; }

/* Car page: same height as the photo; the name, year and "Scopri di più" stay where they always are. */
.detail-hero.is-pending .photo-pending { z-index: auto; }
.detail-hero.is-pending .photo-pending-ghost { right: auto; left: 50%; bottom: auto; top: 50%; transform: translate(-50%, -62%); font-size: min(19cqw, 52cqh); }
.photo-pending-copy.is-hero {
  left: auto;
  right: clamp(20px, 6.5vw, 125px);
  bottom: clamp(40px, 11svh, 110px);
  z-index: 2;
  width: min(360px, 34vw);
  align-items: flex-end;
  text-align: right;
}
/* A long name (e.g. 348 "ZAGATO ELABORAZIONE") wraps before the note on the right instead of running under it. */
.detail-hero.is-pending .detail-hero-title { right: calc(clamp(20px, 6.5vw, 125px) + min(360px, 34vw) + 48px); }
.photo-pending-copy.is-hero .photo-pending-rule { margin: 0 0 18px; }
.photo-pending-copy.is-hero .photo-pending-label { font-size: .8125rem; color: var(--text); }
.photo-pending-text { margin: 14px 0 0; font-size: .9375rem; line-height: 1.7; color: var(--text-secondary); }

/* Behind the specifications: only the faded name, on the right. */
.detail-showcase.is-pending .photo-pending { background: none; }
.detail-showcase.is-pending .photo-pending-ghost { right: 4%; bottom: auto; top: 50%; transform: translateY(-50%); font-size: 15cqw; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%); mask-image: linear-gradient(to right, transparent 0%, #000 45%); }
/* Without the photo the section only needs the height of the specifications. */
.detail-overview:has(.detail-showcase.is-pending) { min-height: 0; }

/* In place of the gallery. */
.detail-photo-shoot { display: flex; flex-direction: column; align-items: center; padding: clamp(40px, 6vw, 80px) 20px 0; text-align: center; }
.detail-photo-shoot .photo-pending-rule { margin: 0 0 22px; }
.detail-photo-shoot h3 { margin: 0 0 14px; font-family: Inter, Arial, sans-serif; font-size: .8125rem; line-height: 1.7; font-weight: 500; letter-spacing: .32em; color: var(--text); }
.detail-photo-shoot p { max-width: 460px; margin: 0; font-size: .9375rem; line-height: 1.7; color: var(--text-secondary); }

@media (max-width: 1000px) {
  .detail-showcase.is-pending { display: none; }
}
@media (max-width: 700px) {
  /* Phones: the note sits at the top of the hero, clear of the name and button at the bottom. */
  .photo-pending-copy.is-hero { left: 20px; right: 20px; top: 15%; bottom: auto; width: auto; align-items: flex-start; text-align: left; }
  .detail-hero.is-pending .detail-hero-title { right: 20px; }
  .photo-pending-text { font-size: .875rem; }
  .detail-hero.is-pending .photo-pending-ghost { top: 50%; font-size: min(19cqw, 40cqh); }
}
/* Photo "IN ARRIVO" (Google Drive, folder IN ARRIVO), blurred, behind every "Fotografie in arrivo" preview.
   Saved already blurred and small (assets/in-arrivo-sfondo.webp, ~19 KB): no filter work for the browser. */
.photo-pending::before {
  content: '';
  position: absolute;
  inset: -3%;
  background:
    linear-gradient(155deg, rgb(20 20 20 / 55%) 0%, rgb(20 20 20 / 35%) 45%, rgb(12 12 12 / 75%) 100%),
    url('assets/in-arrivo-sfondo.webp?v=2') center / cover no-repeat;
  pointer-events: none;
}
.photo-pending > * { z-index: 1; }
/* Cards: the copy grows upward from the bottom but never reaches the category badge in the top-left corner (16px +
   its height); a long model name gets smaller with the card's height and stays within two lines. */
.photo-pending-copy:not(.is-hero) { top: 62px; justify-content: safe flex-end; }
.photo-pending-copy:not(.is-hero) .photo-pending-model {
  font-size: clamp(1.5rem, min(10.5cqw, 16cqh), 3.6rem);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* Short cards (latest arrivals on tablets, ~170px high): the name keeps its full height and is never squeezed; the
   red rule and the spacing around it shrink with the card instead. */
.photo-pending-copy:not(.is-hero) .photo-pending-model { flex-shrink: 0; line-height: 1.08; padding-bottom: .04em; }
.photo-pending-copy:not(.is-hero) .photo-pending-brand { flex-shrink: 0; margin-bottom: min(.55em, 3.5cqh); }
.photo-pending-copy:not(.is-hero) .photo-pending-rule { margin: min(1.15em, 7cqh) 0 min(.95em, 5.5cqh); }

/* Report responsive M1: the name moved by about 11 px when its typeface (Barlow Condensed 600) arrived, a jump of the
   whole picture for the browser. It is drawn only once the typeface is ready (public/app.js, class pending-font on
   <html>): appearing is not a jump. If the typeface never arrives, it shows anyway after 3 seconds. */
.photo-pending-ghost { visibility: hidden; animation: pending-ghost-late 0s 3s forwards; }
html.pending-font .photo-pending-ghost { visibility: visible; animation: none; }
@keyframes pending-ghost-late { to { visibility: visible; } }
