/* Tablet and phone overrides, loaded after site.css. Phone/desktop split at
 * 760px . */

@media (max-width: 1100px) {
  .ex-body { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .chapter-text { grid-column: 9 / span 4; }
  .chapter.flip .chapter-text { grid-column: 1 / span 4; }
  .detail { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .header-actions .ha-secondary { display: none; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .site-header { gap: 12px; }
  .site-header .brand { font-size: 26px; }
  .footer-brand-col .brand { font-size: 30px; }
  .header-actions { gap: 12px; }
  .header-actions .btn-tour { padding: 0 14px; min-height: 40px; letter-spacing: 0.04em; }

  .side-menu-panel { width: 92vw; padding: 24px 28px 35px; clip-path: polygon(0 0, 100% 0, 100% 82%, 88% 82%, 88% 100%, 0 100%); }
  .side-menu-top { padding-left: 54px; }
  .side-menu nav { padding: 32px 0; }
  .side-menu nav a { font-size: 20px; padding: 10px 0; }
  .side-menu-bottom { padding-right: 14%; }

  .next-chapter { padding: 58px 22px 45px; }
  .next-chapter h1 { text-indent: 0; font-size: 26px; }

  .section { padding: 58px 22px; }
  .section-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 28px; }
  .page-intro { padding: 48px 22px 36px; }
  .page-intro h1 { margin-bottom: 18px; }
  .page-intro .intro-body { font-size: 16px; }

  .chapter, .chapter.flip { grid-template-columns: minmax(0, 1fr); padding: 0 22px; margin-bottom: 56px; gap: 22px; }
  .chapter figure, .chapter.flip figure, .chapter-text, .chapter.flip .chapter-text { grid-column: 1; grid-row: auto; }
  .chapter-wide { padding: 0; margin-bottom: 56px; }
  .chapter-wide img { height: 56svh; }

  .tour-band { grid-template-columns: minmax(0, 1fr); padding: 58px 22px; gap: 28px; }

  .site-footer { padding: 44px 22px 22px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-eho { grid-template-columns: 36px minmax(0, 1fr); }

  .plan-filter { margin: 0 22px; }
  .plan-grid { margin: 0 22px; grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .plan-note { margin: 32px 22px 58px; }

  /* Explorer: one Filters control opens a sheet; chips show what is active. */
  .explorer { padding: 0 0 56px; }
  main > .explorer .explorer-head, main > .explorer .ex-toolbar, main > .explorer .ex-side, main > .explorer .ex-status { padding-left: 22px; padding-right: 22px; }
  .ex-filter-toggle { display: inline-flex; }
  .ex-bar > .ex-group { width: 100%; }
  .ex-bar > .ex-group > .label { display: none; }
  .ex-tabs { display: flex; width: 100%; }
  .ex-tabs button { flex: 1 1 0; min-width: 0; padding: 0 6px; }
  .ex-filter-toggle { width: 100%; justify-content: center; }
  .ex-filters { display: none; }
  .ex-filters.is-open {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 70; background: var(--paper); flex-direction: column; align-items: stretch;
    padding: 18px 22px 22px; gap: 16px; border-top: 1px solid var(--line); box-shadow: 0 -12px 44px color-mix(in srgb, var(--ink) 20%, transparent); max-height: 80dvh; overflow: auto;
  }
  .ex-filters.is-open .ex-group { justify-content: space-between; }
  .ex-filters-close { display: inline-flex; }
  .ex-chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .ex-chips button { min-height: 36px; padding: 0 12px; font-size: 12px; background: var(--mist); display: inline-flex; gap: 8px; align-items: center; }
  .ex-stage { aspect-ratio: 4 / 3; min-height: 0; }
  .ex-hint { display: none; }
  .ex-compass { width: 42px; height: 42px; }
  .ex-controls { left: 8px; bottom: 8px; right: 8px; }
  .ex-controls button { min-width: 44px; padding: 0 8px; }

  .unit-card { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 86dvh; border: 0; border-radius: 0; box-shadow: 0 -12px 44px color-mix(in srgb, var(--ink) 20%, transparent); }
  .unit-card[open] { animation: sheet-in 0.35s var(--ease-out); }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

  .detail { padding: 0 22px 58px; gap: 32px; }
  .facts dd { font-size: 18px; }
  .gallery-seq { padding: 0 22px 58px; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .split { grid-template-columns: minmax(0, 1fr); padding: 0 22px 58px; gap: 36px; }
  .contact-map-band { padding: 0 22px 58px; }
  .contact-map { aspect-ratio: 4 / 3; min-height: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-group { grid-template-columns: minmax(0, 1fr); padding: 0 22px; gap: 8px; }
  .prose { padding: 0 22px 58px; }
  .data-table.stack thead { display: none; }
  .data-table.stack tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .data-table.stack td { border: 0; padding: 2px 0; }
  .data-table.services tr { grid-template-columns: minmax(0, 1fr); }
  .data-table.services td:first-child { font-weight: 500; }
  .dlg-bar h2 { font-size: 15px; }
  .dlg-bar .lbl { display: none; }
}

@media (min-width: 761px) {
  .ex-filters-close { display: none; }
}

/* Phone: header mark size and home chapter spacing. */
@media (max-width: 760px) {
  .site-header .brand { font-size: 24px; }
  .header-actions .btn-tour { white-space: nowrap; }
  .side-menu-top { font-size: 32px; }
  .ex-filters { display: none; }
  .ex-filters.is-open .ex-group { flex-direction: column; align-items: stretch; gap: 8px; }
  .ex-filters-head { order: -1; margin: 0; justify-content: space-between; width: 100%; }
  .ex-filters-head > span { display: inline; font-size: 18px; }
  .ex-chipset button { min-height: 44px; flex: 1 0 auto; }
  .ex-sort button { min-height: 40px; }
  .ex-results { max-height: none; padding-right: 0; }
  .ex-res { gap: 12px; padding: 10px 58px 10px 14px; }
  .tour-360.ex-res-tour { right: 9px; }
  /* The ladder needs height: a square stage on phones. */
  .ex-stage { aspect-ratio: 1 / 1; }
  .ex-ladder { left: 8px; gap: 6px; }
  .ex-rung { width: 54px; height: 40px; font-size: 13px; }
  .ex-rung.is-all { font-size: 12px; }
  .ex-empty { left: 64px; right: 8px; }
  .ex-date { flex-wrap: nowrap; }
  .ex-date input[type="date"] { flex: 1 1 auto; min-height: 44px; font-size: 16px; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .plan-grid-inset { margin: 0; }
  .plan-tile-image { padding: 10px; }
  .plan-tile-info h3 { font-size: 20px; }
  .tour-360 { left: 6px; top: 6px; }
  .plan-avail-list a { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .pa-f { grid-row: 2; }
  .pa-date { grid-row: 2; grid-column: 2; }
  .vt { padding: 0 22px 40px; }
  .vt-spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vt-space-name { left: 6px; bottom: 6px; font-size: 14px; }
  .vt-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vt-plan { grid-template-columns: 52px minmax(0, 1fr); column-gap: 8px; padding: 6px 8px 6px 6px; min-height: 60px; }
  .vt-plan img { width: 52px; }
  .vt-plan-name { font-size: 17px; }
  .vt-plan-meta { font-size: 12.5px; white-space: normal; text-wrap: pretty; }
  .gallery-seq { columns: 2; column-gap: 6px; padding: 0 22px 58px; }
  .gallery-seq figure { margin-bottom: 6px; }
}
