/* Astra Tower: tablet and phone overrides (loaded after site.css).
 * Breakpoints from the brief: 1280, 1100, 900, 760 (the phone/desktop split). */

@media (max-width: 1280px) {
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .ex-body { grid-template-columns: minmax(0, 1fr); }
  .ex-side { position: static; }
  .ex-results { max-height: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tower-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; }
  .levels { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
  .residents { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .section-head, .split, .detail, .faq-group, .split-list { grid-template-columns: minmax(0, 1fr); }
  .chapter, .journey-step { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .chapter figure, .chapter.flip figure, .chapter-text, .chapter.flip .chapter-text, .chapter-text.wide, .chapter.flip .chapter-text.wide,
  .journey-step figure, .journey-step.flip figure, .journey-step > div, .journey-step.flip > div { grid-column: 1; grid-row: auto; }
  .tour-band { grid-template-columns: minmax(0, 1fr); }
  .ph-media { grid-template-columns: 1fr; }
  .vt-spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vt-layouts { display: block; }
  .vt-layouts li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .vt-layouts .vt-l-meta { grid-column: 1; }
}

@media (max-width: 760px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .site-header .brand, .site-header:not(.home-header) .brand { font-size: 26px; }
  .header-actions .ha-secondary { display: none; }
  .header-actions .btn-tour { padding: 0 14px; min-height: 40px; }
  .side-menu-panel { width: 92vw; clip-path: polygon(0 0, 100% 0, 100% 86%, 88% 86%, 88% 100%, 0 100%); padding: 20px 22px 32px; }
  .side-menu nav { padding: 32px 0; }
  .side-menu nav a { padding: 9px 0; }
  .page-intro { padding: 48px var(--gutter) 36px; }
  .page-intro h1 { font-size: clamp(40px, 12vw, 56px); }
  .page-intro .intro-body { font-size: 16px; }
  .section { padding: 58px var(--gutter); }
  .chapter, .chapter-wide { margin-bottom: 58px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .arrival-white-step { width: 82%; }
  .arrival-scroll { left: calc(82% - 36px); }
  .arrival-identity { font-size: 12vw; }
  .next-chapter h1 { font-size: 26px; text-indent: 0; }
  .tower-preview { grid-template-columns: minmax(0, 1fr); padding: 58px var(--gutter); }
  .tower-preview-figure { max-width: 420px; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .plan-tile-info h3 { font-size: 20px; }
  .gallery-seq { columns: 2; }
  .person { grid-template-columns: 1fr; gap: 16px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-perks { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-map { aspect-ratio: 4 / 5; min-height: 0; }
  .data-table.fees td:last-child, .data-table.fees th:last-child { display: none; }

  /* Amenities: the tower becomes a narrow strip beside each chapter heading. */
  .levels { grid-template-columns: minmax(0, 1fr); }
  .levels-tower { display: none; }
  .level { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 14px; }
  .level > *:not(.level-strip) { grid-column: 2; }
  .level-strip { display: block; grid-column: 1; grid-row: 1 / span 2; width: 72px; height: auto; background: var(--mist); }

  /* Explorer on phones: filters in a sheet, stage 3:4 full bleed, gauge on the right edge. */
  .explorer { padding: 0 0 58px; }
  .explorer-head, .ex-toolbar, .ex-side, .ex-status, .ex-note, .ex-plan-note, .ex-stepper { padding-left: 22px; padding-right: 22px; }
  .ex-filter-toggle { display: inline-flex; width: 100%; justify-content: center; }
  .ex-filters { display: none; }
  .ex-filters.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 18px; position: fixed; inset: auto 0 0 0; z-index: 70; background: #fff;
    padding: 20px 22px 24px; max-height: 88dvh; overflow: auto; box-shadow: 0 -12px 44px rgba(47, 54, 57, 0.2); border-top: 0;
  }
  .ex-filters.is-open .ex-group { flex-direction: column; align-items: stretch; gap: 8px; }
  .ex-filters-head { order: -1; margin: 0; display: flex; justify-content: space-between; width: 100%; }
  .ex-filters-head > span { display: inline; font-size: 18px; }
  .ex-filters-close { display: inline-flex; justify-content: center; }
  .ex-chipset button { min-height: 44px; flex: 1 0 auto; }
  .ex-date input[type="date"] { flex: 1 1 auto; min-height: 44px; font-size: 16px; }
  .ex-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ex-tabs { width: 100%; }
  .ex-tabs button { flex: 1 1 0; }
  /* Five band chips share the row: label over count, never wider than the screen. */
  .ex-bar > * { min-width: 0; }
  .ex-bands { margin-left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; width: 100%; }
  .ex-bands button { min-width: 0; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.1; font-size: 12px; }
  .ex-bands .count { margin-left: 0; height: 16px; min-width: 20px; font-size: 10px; }
  .g-band em { display: none; }
  .ex-stage { height: auto; aspect-ratio: 3 / 4; min-height: 0; max-height: 82svh; }
  .ex-gauge { left: auto; right: 8px; top: 64px; bottom: 64px; width: 44px; }
  .g-band i { margin-left: 6px; width: 8px; }
  .g-band.has i { width: calc(5px + var(--n, 1) * 3px); }
  .g-band b { display: none; }
  .g-thumb { right: auto; left: -20px; }
  .ex-compass { left: 10px; right: auto; top: 10px; width: 40px; height: 40px; }
  .ex-controls { left: 8px; right: 8px; bottom: 8px; overflow-x: auto; }
  .ex-controls button { min-width: 44px; height: 44px; padding: 0 8px; }
  .ex-hint { display: none; }
  .ex-sort button { min-height: 40px; }
  .ex-res { padding: 10px 12px; }
  .unit-card[open] {
    position: fixed; inset: auto 0 0 0; width: 100vw; max-width: 100vw; height: calc(100svh - 128px); max-height: calc(100svh - 128px); margin: 0; border-radius: 12px 12px 0 0;
    box-shadow: 0 -12px 44px rgba(47, 54, 57, 0.2); animation: uc-up 0.35s var(--ease-out); padding: 20px 22px 28px;
  }
  .unit-card::backdrop { background: rgba(47, 54, 57, 0.62); backdrop-filter: blur(3px); }
  @keyframes uc-up { from { transform: translateY(24px); } to { transform: none; } }
  .uc-actions { flex-direction: column; bottom: -28px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  html:has(.unit-card[open]:modal) { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .unit-card[open] { animation: none; }
  .ex-fade { display: none; }
  .levels-tower img { transition: none; }
}
