/* =============================================================
   pages/radioactive-car-wrapping.css
   Hero (same pattern as other project pages) + continuous
   marquee carousel for the final-result shots.
   ============================================================= */

/* ── Full-bleed hero ─────────────────────────────────────────── */
.car-hero {
  position: relative;
  width: 100%;
  background: #080C1D;
}

.car-hero__image-wrap {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 520px;
  overflow: hidden;
}

.car-hero__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Bottom-fade gradient that blends the hero into the page bg */
.car-hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 60%,
    rgba(8, 12, 29, 0.55) 80%,
    #080C1D 100%
  );
  pointer-events: none;
}

/* Title block — same horizontal padding as .project-detail so the
   hero copy aligns with the rest of the body content. */
.car-hero__text {
  padding: 40px 235px 56px;
  background: #080C1D;
  max-width: none;
}

.car-hero__title {
  font-family: var(--font-headings);
  font-size: clamp(36px, 5vw, 68px);
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-display);
  color: var(--white);
  line-height: 1.08;
  margin-bottom: 20px;
}

.car-hero__desc {
  font-family: var(--font-text);
  font-size: var(--fs-16);
  font-weight: var(--fw-body);
  color: var(--gray-900);
  line-height: 26px;
  margin-bottom: 10px;
  max-width: 720px;
}
.car-hero__desc:last-child { margin-bottom: 0; }

/* ── Continuous marquee carousel ─────────────────────────────── */
.car-marquee {
  position: relative;
  margin: 0 0 64px;
  overflow: hidden;
  /* Side fade mask — images dissolve into the page bg on both edges */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    black 6%,
    black 94%,
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    black 6%,
    black 94%,
    transparent 100%
  );
}

.car-marquee__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--purple-900);
  margin-bottom: 14px;
}
.car-marquee__label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-500);
  box-shadow: 0 0 10px rgba(143, 0, 216, 0.7);
}

.car-marquee__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;        /* let vertical scroll through */
}
.car-marquee__viewport:active { cursor: grabbing; }

.car-marquee__track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.car-marquee__slide {
  flex: 0 0 auto;
  /* Fixed HEIGHT, auto WIDTH — slide width follows each image's
     natural aspect ratio so nothing is cropped. */
  height: clamp(280px, 36vw, 520px);
  width: auto;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(170, 172, 241, 0.04);
  border: 1px solid var(--purple-card-border);
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.18s;
}
.car-marquee__slide:hover {
  border-color: var(--purple-border);
  transform: translateY(-2px);
}
.car-marquee__slide:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 3px;
}

.car-marquee__slide img {
  height: 100%;               /* fill the slide height */
  width: auto;                /* width follows natural aspect — full image visible */
  display: block;
  pointer-events: none;       /* let drag work without image drag */
  -webkit-user-drag: none;
}

/* ── Lightbox overlay (image zoom, with FLIP open/close animation) ─ */
.car-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;              /* above topbar, custom cursor, and page veil */
  display: flex;              /* always laid out so FLIP can read rects */
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Backdrop fades over 0.28s, visibility flips off only AFTER the
     0.42s image FLIP-close animation finishes (longest of the two). */
  transition: opacity 0.28s ease, visibility 0s linear 0.42s;
}
.car-lightbox[data-open='true'] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.car-lightbox__img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  /* JS sets transform + transition inline for the FLIP animation.
     transform-origin is center (default) — translate + scale center-based. */
  will-change: transform;
  backface-visibility: hidden;
  transform-origin: center center;
}

@media (prefers-reduced-motion: reduce) {
  .car-lightbox { transition: opacity 0.15s ease, visibility 0s linear 0.15s; }
  .car-lightbox[data-open='true'] { transition: opacity 0.15s ease, visibility 0s linear 0s; }
}

.car-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.car-lightbox__close:hover { background: rgba(255, 255, 255, 0.18); }

.car-lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  color: var(--gray-900);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 14px;
  border-radius: 999px;
  max-width: 80vw;
  text-align: center;
}
.car-lightbox__caption:empty { display: none; }

/* Lock body scroll while lightbox is open */
body.car-lightbox-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  /* JS will detect this and stop the auto-scroll, but mask still applies. */
  .car-marquee__viewport { cursor: default; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .car-hero__text { padding-left: 100px; padding-right: 100px; }
}

@media (max-width: 900px) {
  .car-hero__image-wrap { height: 68vh; min-height: 460px; }
  .car-hero__text       { padding: 32px 40px 44px; }
  .car-marquee__slide   { height: clamp(240px, 50vw, 380px); }
}

@media (max-width: 640px) {
  .car-hero__image-wrap { height: 60vh; min-height: 380px; }
  .car-hero__text       { padding: 28px 20px 36px; }
  .car-marquee          {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 4%, black 96%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, black 4%, black 96%, transparent 100%);
  }
}
