/* ============================================
   Detail page — gallery, floorplan, calculator,
   filmstrip, story. Mobile-first.
   ============================================ */

/* --- Detail Hero --- */
.detail-hero {
  position: relative; min-height: 70svh;
  display: flex; align-items: flex-end;
  padding: 0 20px 32px; overflow: hidden;
}
.detail-hero__bg { position: absolute; inset: 0; }
.detail-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 50%);
}
.detail-hero__content { position: relative; z-index: 1; }
.detail-hero__back {
  font-size: 13px; color: var(--blue-bright);
  display: inline-block; margin-bottom: 16px;
}
.detail-hero__title {
  font-size: 32px; font-weight: 700; line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 4px;
}
.detail-hero__meta { font-size: 15px; color: var(--text-2); margin-bottom: 12px; }
.detail-hero__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-hero__tags span {
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}

/* --- Highlights scroll --- */
.highlights {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.highlights::-webkit-scrollbar { display: none; }
.highlights__track {
  display: flex; gap: 0; min-width: max-content;
  padding: 0 20px;
}
.highlights__item {
  text-align: center; padding: 8px 24px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.highlights__item:last-child { border-right: none; }
.highlights__item strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.highlights__item span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Gallery horizontal scroll --- */
.gallery { padding: 48px 0 0; overflow: hidden; }

.gallery__wrap { position: relative; }

.gallery__track {
  display: flex; gap: 12px;
  padding: 0 20px 16px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.gallery__track::-webkit-scrollbar { display: none; }

.gallery__slide {
  flex-shrink: 0; width: 85vw;
  scroll-snap-align: start;
  position: relative; border-radius: var(--radius);
  overflow: hidden;
}
.gallery__slide img {
  width: 100%; height: 50vw; min-height: 200px;
  object-fit: cover;
}
.gallery__slide span {
  position: absolute; bottom: 12px; left: 12px;
  font-size: 12px; font-weight: 500; color: var(--white);
  background: rgba(0,0,0,0.5); padding: 4px 10px;
  border-radius: 6px; backdrop-filter: blur(4px);
}

/* Progress bar */
.gallery__progress {
  width: 60px; height: 3px; margin: 12px auto 32px;
  background: var(--dark-surface); border-radius: 2px;
  overflow: hidden;
}
.gallery__bar {
  width: 33%; height: 100%; background: var(--blue);
  border-radius: 2px; transition: width 0.15s ease;
}

/* --- Floorplan --- */
.floorplan { padding: 48px 0; }

.floorplan__tabs {
  display: flex; gap: 8px; padding: 0 20px;
  margin-bottom: 24px;
}
.floorplan__tab {
  flex: 1; padding: 14px 16px;
  border-radius: var(--radius); text-align: left;
  border: 1.5px solid rgba(0,0,0,0.1);
  background: var(--white);
  transition: all var(--dur);
}
.floorplan__tab strong { display: block; font-size: 15px; margin-bottom: 2px; color: var(--near-black); }
.floorplan__tab span { font-size: 12px; color: rgba(0,0,0,0.45); }
.floorplan__tab.active {
  border-color: var(--blue); background: rgba(0,113,227,0.04);
}
.floorplan__tab.active strong { color: var(--blue); }

.floorplan__viewer { padding: 0 20px; margin-bottom: 20px; }
.floorplan__img { display: none; }
.floorplan__img.active { display: block; }
.floorplan__img img { width: 100%; border-radius: var(--radius); }

/* Classic Adobe-red PDF button */
.pdf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #bb2026; color: var(--white);
  border-radius: 6px; padding: 12px 28px;
  border: 1px solid #9e141a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  margin: 0 auto; display: flex; width: fit-content;
}
.pdf-btn:hover {
  background: #a31920; transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}
.pdf-btn:active { transform: scale(0.96); }
.pdf-btn__text {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* --- Calculator --- */
.calculator { padding: 48px 0; }

.calculator__card {
  margin: 0 20px; padding: 24px 20px;
  background: var(--dark-surface);
  border-radius: var(--radius);
}

.calculator__field {
  margin-bottom: 24px;
}
.calculator__field label {
  font-size: 13px; color: var(--text-2);
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.calculator__field output {
  font-size: 13px; font-weight: 600; color: var(--white);
}

/* Range slider */
.calculator__field input[type="range"] {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 2px; outline: none;
}
.calculator__field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
  border: 3px solid var(--dark-surface);
  box-shadow: 0 0 0 2px var(--blue);
}
.calculator__field input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
  border: 3px solid var(--dark-surface);
}

.calculator__result {
  text-align: center; padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.calculator__result span { font-size: 13px; color: var(--text-3); display: block; margin-bottom: 4px; }
.calculator__result strong {
  font-size: 32px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--blue-bright); display: block; margin-bottom: 4px;
}
.calculator__result small { font-size: 11px; color: var(--text-3); }

/* --- Filmstrip --- */
.filmstrip { padding: 48px 0; overflow: hidden; }

.filmstrip__marquee { overflow: hidden; }
.filmstrip__track {
  display: flex; gap: 10px; width: max-content;
  animation: filmstrip-scroll 35s linear infinite;
}
.filmstrip__marquee:hover .filmstrip__track { animation-play-state: paused; }

.filmstrip__item {
  flex-shrink: 0; width: 200px; position: relative;
  border-radius: var(--radius); overflow: hidden;
}
.filmstrip__item img {
  width: 100%; height: 240px; object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.filmstrip__item:hover img { transform: scale(1.04); }
.filmstrip__item span {
  position: absolute; bottom: 10px; left: 10px;
  font-size: 12px; font-weight: 600; color: var(--white);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

@keyframes filmstrip-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Story (sticky text + images) --- */
.story { padding: 48px 0; }

.story__inner {
  padding: 0 20px;
}

/* Mobile: interleaved (JS handles reorder) */
.story__text { position: relative; }
.story__block {
  margin-bottom: 16px;
}
.story__block h2 {
  font-size: 22px; font-weight: 600; line-height: 1.15;
  margin-bottom: 6px; color: var(--near-black);
}
.story__block p { font-size: 14px; color: rgba(0,0,0,0.55); line-height: 1.6; }

.story__img {
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 12px;
}
.story__img img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

/* CTA detail */
.cta__btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ===== DESKTOP ===== */
@media (min-width: 769px) {
  .detail-hero { min-height: 80vh; padding: 0 48px 64px; }
  .detail-hero__title { font-size: 56px; }

  .highlights__track { justify-content: center; padding: 0; }
  .highlights__item { padding: 12px 48px; }
  .highlights__item strong { font-size: 32px; }

  .gallery { padding: 80px 0 0; }
  .gallery__track {
    overflow: visible; padding: 0 24px 24px;
    /* GSAP will pin + scrub this */
  }
  .gallery__slide { width: clamp(500px, 60vw, 800px); }
  .gallery__slide img { height: 65vh; min-height: 400px; }
  .gallery__progress { width: 120px; margin: 24px auto 0; }

  .floorplan { padding: 80px 0; }
  .floorplan__tabs {
    max-width: 480px; margin-left: auto; margin-right: auto;
    padding: 0;
  }
  .floorplan__viewer { max-width: 700px; margin-left: auto; margin-right: auto; padding: 0; }

  .calculator { padding: 80px 0; }
  .calculator__card {
    max-width: 560px; margin: 0 auto;
    padding: 40px 36px;
  }
  .calculator__result strong { font-size: 44px; }

  .filmstrip { padding: 80px 0; }
  .filmstrip__item { width: 280px; }
  .filmstrip__item img { height: 320px; }

  .story { padding: 80px 0; }
  .story__inner {
    max-width: 980px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  }
  .story__text {
    position: sticky; top: 30vh; align-self: start;
    perspective: 500px;
  }
  .story__block {
    position: absolute; top: 0; left: 0; right: 0;
    opacity: 0; pointer-events: none;
  }
  .story__block.active { position: relative; opacity: 1; pointer-events: auto; }
  .story__block h2 { font-size: 32px; }
  .story__block p { font-size: 16px; }
  .story__block h2 .line,
  .story__block p .line { display: block; transform-origin: 50% 50% -100px; }

  .story__images { display: flex; flex-direction: column; gap: 24px; }
  .story__img img { aspect-ratio: 4/3; }
}
