/* ==========================================================================
   THE PROMENADE RESIDENCES - RESPONSIVE LAYER
   Loaded last. Desktop (>= 993px) keeps the 1920px canvas design; rules here
   only fix overflow/clipping there. Tablet and mobile refinements live in the
   max-width queries below.

   Breakpoints used
     >= 993px     desktop canvas (scaled by .site-wrapper zoom)
     <= 1200px    laptop / small desktop
     <= 992px     tablet + mobile (stacked layout)
     <= 600px     phones
     <= 380px     small phones (375 / 360 / 320)
   ========================================================================== */

/* ---------- Global safety ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: clip; }        /* no sideways scroll; `clip` keeps position: sticky working */
img { image-rendering: auto; }
button, a, input, select, textarea, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid #2f6fae; outline-offset: 2px; }

/* ==========================================================================
   1. DESKTOP: let content-heavy sections grow instead of clipping
   (sections that are taller than one screen are pinned by their bottom edge
   from responsive.js, so the stacking reveal still works)
   ========================================================================== */
@media (min-width: 993px) {
  #location, .location-map-section,
  #siteProgress, .progress-section,
  #conversation, .conversation-section {
    height: auto !important;
    min-height: var(--screen-viewport-height, 100vh) !important;
  }
}

@media (min-width: 993px) and (max-width: 1200px) {
  #interior, .interior-tour-section {
    height: auto !important;
    min-height: var(--screen-viewport-height, 100vh) !important;
  }
}

/* Unit plans: once plan + view stack (<= 1200px) the stage must grow with them */
@media (max-width: 1200px) {
  .angst-tour-stage { max-height: none !important; height: auto !important; }
}

/* Tablet/mobile: sections size to their content (min one screen) instead of clipping */
@media (max-width: 992px) {
  #interior, .interior-tour-section,
  #conversation, .conversation-section { height: auto !important; }
}

/* ==========================================================================
   2. ENQUIRY POPUP - fits every screen, scrolls internally when needed
   ========================================================================== */
.modal-overlay { padding: 12px; overscroll-behavior: contain; z-index: 10060; } /* above header (10001) and mobile CTA bar (9999) */
.modal-box {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
}
.modal-header { flex: 0 0 auto; }
.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-close-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 992px) {
  .modal-box { max-width: min(560px, 100%); }
}
@media (max-width: 600px) {
  .modal-header { padding: 14px 16px 14px 20px; }
  .modal-title { font-size: clamp(14px, 4.2vw, 17px); line-height: 1.3; padding-right: 8px; }
  .modal-body { padding: 16px 20px 20px; }
  #modalEnquiryForm .form-input-bar { height: 46px !important; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  #modalEnquiryForm textarea.form-input-bar { height: 84px !important; }
}

/* ==========================================================================
   3. SCROLL-TO-TOP BUTTON
   ========================================================================== */
.pr-scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;                     /* below modal (2000), drawer and lightbox */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #174582;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(9, 24, 36, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background-color 0.25s ease;
}
.pr-scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.pr-scroll-top:hover { background: #132c3c; }
.pr-scroll-top svg { width: 20px; height: 20px; }
/* Desktop: clear the sticky enquiry bar at the bottom of the screen */
@media (min-width: 993px) {
  .pr-scroll-top { bottom: calc(var(--pr-leadbar-clear, 24px)); }
}
/* Tablet/mobile: sit above the fixed "Enquire Now / Call" bar */
@media (max-width: 992px) {
  .pr-scroll-top { right: 16px; bottom: calc(var(--pr-cta-clear, 84px) + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }
}
body.pr-overlay-open .pr-scroll-top { opacity: 0 !important; visibility: hidden !important; }

/* ==========================================================================
   4. TABLET + MOBILE (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {

  /* ---- Typography: fluid scale, same families and hierarchy ---- */
  .unified-section-heading,
  .layouts-main-title,
  .angst-tour-title,
  .amenities-main-heading,
  .spec-sub-heading,
  .location-main-title,
  .conn-header-title,
  .progress-main-title,
  .footer-legacy-title {
    font-size: clamp(21px, 2.4vw + 13px, 34px) !important;
    overflow-wrap: break-word;
    text-wrap: balance;
  }
  .pool-quote-heading,
  .conversation-main-title { font-size: clamp(21px, 2.6vw + 12px, 34px) !important; text-wrap: balance; }
  .about-hl-main { font-size: clamp(21px, 2.2vw + 13px, 32px) !important; text-wrap: balance; }

  .section-subheading-gold,
  .about-hl-sub,
  .angst-tour-subtitle,
  .spec-gold-eyebrow,
  .conn-header-eyebrow,
  .conversation-sub-title { font-size: clamp(10px, 0.4vw + 9px, 12px) !important; letter-spacing: 0.18em !important; }

  .unified-section-para,
  .about-para,
  .layouts-subtitle,
  .progress-main-subtitle,
  .conversation-para,
  .footer-dev-narrative-text { font-size: clamp(13px, 0.35vw + 12px, 15.5px) !important; line-height: 1.6 !important; }

  .hero-main-title { font-size: clamp(26px, 3.4vw + 15px, 46px); line-height: 1.15; text-wrap: balance; }
  .hero-tagline { font-size: clamp(10.5px, 0.5vw + 9px, 13px); text-wrap: balance; }

  /* ---- Hero: keep the tower in frame on portrait screens ---- */
  .hero-still { object-position: 18% 50%; transform-origin: 25% 60%; }

  /* ---- Header & drawer: touch-friendly ---- */
  .header-mobile-toggle { min-width: 44px; min-height: 44px; }
  .mobile-drawer-close { min-width: 44px; min-height: 44px; }
  .mobile-drawer-link { display: flex; align-items: center; min-height: 44px; }
  .mobile-drawer-content { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* Drawer opens ABOVE the header (10001) and the bottom CTA bar (9999), below the popup (10060),
     so its own logo, close button and Enquire button are visible and tappable */
  .header-mobile-drawer { z-index: 10040 !important; }
  .mobile-drawer-logo { filter: brightness(0) invert(1); }
  .mobile-drawer-close { color: #ffffff; font-size: 30px; line-height: 1; }

  /* ---- Contact form fields: 44px+ touch targets, 16px text (no iOS zoom) ---- */
  .conversation-input { min-height: 46px; font-size: 16px !important; }
  .conversation-textarea { min-height: 72px; }
  .conversation-country-select-wrap { min-height: 46px; min-width: 76px; }
  .conversation-country-code { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .conversation-country-select-wrap { position: relative; }
  .lead-bar .form-input-bar { font-size: 16px; }

  /* ---- Buttons ---- */
  .g-arrow-btn, .spec-arrow-btn, .amenity-grid-nav-btn { min-width: 44px; min-height: 44px; }
  .angst-tab-btn { min-height: 44px; }
  .unified-cta-btn, .btn-conversation-send, .footer-rera-gold-btn { min-height: 46px; }

  /* ---- Amenity tabs: smooth horizontal swipe, no cropped labels mid-word ---- */
  .amenities-tabs-list { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .amenities-tabs-list::-webkit-scrollbar { display: none; }
  .amenity-tab-btn { scroll-snap-align: center; flex-shrink: 0; }
  .amenity-icon-name { overflow-wrap: anywhere; hyphens: auto; }

  /* ---- Unit plans: show the whole 3D unit, not a crop ---- */
  .angst-tour-stage { gap: 20px; }
  .angst-render-display { height: auto !important; max-height: none !important; }
  .angst-render-frame { height: clamp(220px, 58vw, 420px) !important; background: #ffffff; }
  .angst-render-frame img.is-plan-3d { object-fit: contain !important; padding: 12px !important; }

  /* ---- Portrait crops: keep the towers in frame ---- */
  .gallery-slide-img[src*="night_riverfront"],
  .conversation-bg-img { object-position: 20% 50% !important; }
  .gallery-slide-img[src*="project_top_view"],
  .gallery-slide-img[src*="master_layout"] { object-position: 50% 50% !important; }

  /* ---- Location directory ---- */
  .pr-nb-col li span:first-child { min-width: 0; overflow-wrap: anywhere; }

  /* ---- Footer ---- */
  .footer-rera-link, .footer-col-link { overflow-wrap: anywhere; }
  .footer-col-link { display: flex; align-items: center; width: fit-content; min-height: 40px; }
}

/* ==========================================================================
   5. TABLET (601px - 992px)
   ========================================================================== */
@media (min-width: 601px) and (max-width: 992px) {
  .pr-neighbourhood-grid { grid-template-columns: repeat(2, 1fr); gap: 0 32px; padding: 0 8px; }
  .pr-nb-col:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
  .pr-nb-col:last-child .pr-nb-title:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .pr-nb-col:last-child ul:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .footer-legacy-stats.pr-stats-5 { grid-template-columns: repeat(3, 1fr); }
  .footer-legacy-stats.pr-stats-5 .footer-stat-col:nth-child(n+4) { grid-column: auto; }
  .footer-legacy-stats.pr-stats-5 .footer-stat-col:last-child { grid-column: span 2; }
}

/* ==========================================================================
   6. PHONES (<= 600px)
   ========================================================================== */
@media (max-width: 600px) {
  .pr-neighbourhood-grid { margin-top: 28px; }
  .pr-nb-title { font-size: 12px; }
  .pr-amenity-intro { font-size: clamp(14.5px, 1.2vw + 10px, 16px); }
  .pr-plan-note { font-size: 11px; }
}

/* ==========================================================================
   7. SMALL PHONES (<= 380px: 375 / 360 / 320)
   ========================================================================== */
@media (max-width: 380px) {
  .hero-eyebrow { font-size: 15px; }
  .hero-tagline { letter-spacing: 0.1em; }
  .pr-nb-col li { font-size: 12.5px; gap: 10px; }
  .footer-rera-reg-text { font-size: 12px; }
  .pr-scroll-top { right: 12px; }
}

/* ==========================================================================
   8. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  /* :not(#a):not(#b) lifts specificity above the original class/ID-level !important rules */
  *:not(#pr-rm-a):not(#pr-rm-b),
  *:not(#pr-rm-a):not(#pr-rm-b)::before,
  *:not(#pr-rm-a):not(#pr-rm-b)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-still { animation: none !important; }
}
