/* Beverlynn Upvan landing page: phones held sideways (wide but short).
   The page is landscape-only on phones, so this is their layout, not a tweak of another one.
   Every section is a frame: heading pinned in a left column, the material beside it, sized to
   the height at hand. Loaded last so these rules win over the width-based ones.
   Threshold: phones are at most about 480 CSS px tall sideways (a 1.5x-density phone in
   fullscreen, where no toolbar takes its 80 px), 7-inch tablets start at 600. An earlier 460
   dropped the "Open in landscape" fullscreen view back to the generic wide layout. */
@media (max-height: 560px) {
  :root { --sec: 40px; --hdr: 52px; --bar: calc(50px + env(safe-area-inset-bottom)); }
  .hdr__logo img { height: 34px; }
  .h2 { font-size: clamp(1.35rem, 0.85rem + 1.5vw, 1.8rem); }
  .lead { margin-top: 8px; font-size: 0.875rem; line-height: 1.5; }

  /* walk + loader */
  .walk__h { font-size: 1.35rem; }
  .walk__h--hero { font-size: 1.6rem; } /* must come AFTER .walk__h: same specificity, both match the h1 */
  .walk__text p { font-size: 0.9375rem; }
  .walk--live .walk__card { bottom: calc(var(--chrome) + 18px); }
  .walk--live .walk__rail { display: none; } /* a desktop hover affordance; on a wide phone it would sit over the frames */
  .loader__logo { height: 52px; margin-bottom: 8px; }
  .loader__num { font-size: 2.6rem; }
  .loader__in { gap: 10px; }

  /* the frame: a pinned heading column. It rides under the header only while the header is
     showing (scroll-up), so the common reading state keeps the full height. */
  .frame { grid-template-columns: minmax(180px, 28%) minmax(0, 1fr); column-gap: 24px; row-gap: 0; align-items: start; }
  .sec__head {
    position: sticky; top: 12px; top: min(12px, calc(100svh - var(--bar) - var(--head-h, 0px) - 10px));
    align-self: start; transition: top 0.45s var(--ease);
  }
  html:has(.hdr:not(.is-hidden)) .sec__head {
    top: calc(var(--hdr) + 8px); top: min(calc(var(--hdr) + 8px), calc(100svh - var(--bar) - var(--head-h, 0px) - 10px));
  }
  .chips { gap: 6px; margin-top: 14px; }
  .chip { min-height: 34px; padding: 0 12px; font-size: 0.8125rem; }

  /* stats: one row */
  .stats { padding-block: 14px; }
  .stats__row { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .stats__row li { padding: 2px 12px; }
  .stats__num { font-size: clamp(1.3rem, 0.6rem + 1.9vw, 1.75rem); }
  .stats__label { font-size: 0.8125rem; }

  /* site plan */
  .site__info { min-height: 0; margin-top: 10px; font-size: 0.8125rem; }
  .site__plan { padding: 10px; }
  .site__plan figcaption { margin-top: 6px; font-size: 0.75rem; }

  /* homes: tabs become one-line rows; the plan and the details sit side by side */
  .tabs { max-width: none; margin-top: 14px; }
  .tabs [role="tab"] { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 8px; padding: 8px 12px; }
  .tabs [role="tab"] b { font-size: 0.9375rem; }
  .tabs [role="tab"] span { font-size: 0.75rem; }
  .hp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; padding: 12px; }
  .hp__stage { min-height: 0; padding: 10px; }
  .hp__stage--photo { padding: 0; } /* the showroom photo fills its stage, no dark frame */
  .hp__plan img { max-height: min(300px, calc(100vh - 150px)); }
  .hp__plan--tall img { max-height: min(330px, calc(100vh - 120px)); }
  .hp__body { gap: 10px; }
  .hp__head .h3 { font-size: 1.3rem; }
  .hp__count { font-size: 0.8125rem; }
  .rooms button { padding: 5px 10px; font-size: 0.8125rem; }
  .hp__extras, .hp__copy { font-size: 0.8125rem; }
  .hp .btn { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }

  /* garden: head (with the picked place's card) | aerial, strip */
  .gcard { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; margin-top: 12px; padding: 8px 10px 8px 8px; }
  .gcard__img { width: 64px; height: 64px; }
  .gcard__h { font-size: 0.875rem; }
  .gcard__p { font-size: 0.75rem; }
  .garden__body { gap: 14px; }
  .aerial figcaption { margin-top: 6px; font-size: 0.75rem; }
  .pin { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
  .strip__track { grid-auto-columns: 50%; grid-auto-columns: 50cqw; gap: 10px; padding-inline: 25%; }
  .strip img { aspect-ratio: 16 / 10; }
  .strip figcaption { margin-top: 6px; font-size: 0.8125rem; }
  .strip__nav { margin-top: 8px; }
  .strip__btn { width: 34px; height: 34px; }
  .ticker { margin-top: 24px; padding-block: 10px; }
  .ticker__row { font-size: 0.9375rem; }

  /* build: head | picture | accordion, in one screen; credits below */
  .build__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px; }
  .build__media { position: sticky; top: 12px; transition: top 0.45s var(--ease); }
  html:has(.hdr:not(.is-hidden)) .build__media { top: calc(var(--hdr) + 8px); }
  .acc button { gap: 10px; padding: 10px 0; font-size: 0.9375rem; }
  .acc__panel p { padding-bottom: 12px; font-size: 0.8125rem; }
  .credits { margin-top: 22px; gap: 20px; grid-template-columns: 1fr auto; }
  .credits p { font-size: 0.8125rem; }
  .credits img { max-width: 360px; }

  /* location: head | map | the list and the maps button */
  .loc__grid { grid-template-columns: minmax(170px, 26%) minmax(0, 1fr) minmax(150px, 0.62fr); column-gap: 18px; }
  .map { padding: 8px; }
  .map__svg { left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .loc__side { gap: 12px; }
  .places button { padding: 6px 10px; font-size: 0.8125rem; }
  .loc__btn { min-height: 40px; padding: 0 14px; font-size: 0.8125rem; }

  /* enquiry: head | the form (name and number side by side), the steps under it */
  .enq__in { grid-template-areas: "head card" "head steps"; }
  .enq__in > .sec__head { grid-area: head; }
  .enq__in > .card { grid-area: card; }
  .enq__in > .steps { grid-area: steps; margin-top: 18px; }
  .card { padding: 18px 20px; }
  .card form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .card form > .field { align-content: start; } /* the name field must not stretch to the taller number field */
  .card form > fieldset, .card form > .btn-w, .card form > .fine { grid-column: 1 / -1; }

  /* footer and the contact bar, slimmer */
  .ftr { padding: 28px 0 calc(16px + 56px); }
  .ftr__rera { margin-top: 18px; padding-top: 14px; }
  .stick { gap: 8px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); grid-template-columns: auto auto 1fr; }
  .stick .btn { min-height: 38px; padding: 0 16px; font-size: 0.875rem; }
  .custom-alert { bottom: 64px !important; }

  /* full-screen plan: slimmer bars, so the drawing gets the height */
  .zoom__bar { padding: 5px 8px 5px 16px; }
  .zoom__close { width: 38px; height: 38px; }
  .zoom__hint { padding: 5px 16px calc(5px + env(safe-area-inset-bottom)); font-size: 0.75rem; }
}

/* narrow phones held sideways (iPhone SE and the like): the heading column is at its 180 px floor */
@media (max-height: 560px) and (max-width: 739px) {
  .chip { padding: 0 10px; }
  .loc__btn-pre { display: none; } /* "Google Maps" alone fits the list column */
}
