/*
 * Gutenberg hall-panel stacks (Outdoor Facilities replacement).
 *
 * The published Outdoor Facilities page is a PHP template: its panels live in
 * `.hall-showcase` and each one is a `.hall-panel` (theme rules in ozen.css).
 * The Gutenberg replacement stacks `ozen/cinematic-slider` blocks
 * (`layout: halls-panel`) inside a `core/group` and marks that group with
 *
 *     ozen-hall-showcase                     stack geometry, reusable
 *     ozen-hall-showcase--outdoor            the Outdoor Facilities page
 *
 * so the stack reproduces the published measurements that the generic block CSS
 * cannot: the phone gap and the shorter first (pool) panel. Everything here is
 * gated by those two content classes, so no other page — Gutenberg or template —
 * changes. Values are copied from the `.hall-showcase` / `.hall-panel` /
 * `.outdoor-page .hall-copy` rules in ozen.css.
 */

/* Panel gap: the theme closes the gap to a flat 14px at <=800px, while the editor
   stores the desktop gap as an inline margin (clamp(18px, 3vw, 34px)) that cannot
   carry a media query. Neutralise it on phones only; above 800px the inline value
   already equals the theme's gap. */
@media (max-width: 800px) {
  .ozen-hall-showcase > .wp-block-group:not(:last-child) {
    margin-bottom: 14px !important;
  }
}

/* First panel: `body.outdoor-page .hall-showcase > .hall-panel:first-child` keeps the
   desktop clamp at every width, so the pool panel is 500px at 768/390/320 while the
   other four are 620/520. */
.ozen-hall-showcase--outdoor > .wp-block-group:first-child .ozen-cinematic-slider.ocs-layout--halls-panel {
  min-height: clamp(500px, 62vw, 760px);
}

/* Panel basis for units 2 and 4 (QA F8). The published Accommodation and Dining
   pages do not size their panels from the shared `.hall-panel` clamp the block
   reproduces: `.accommodation-panel` is clamp(480px, 58vw, 700px) and
   `.dining-showcase .hall-panel` is clamp(500px, 59vw, 740px), which is why the
   block rendered 759.99/635 where the published pages render 699.99/594.03 and
   740/604.28 at 1440/1024. Apply above 800px, including fractional widths: at
   <=800px the theme's own `min(620px, 118svh)` and `520px` rules already produce
   identical panel heights. The Halls unit uses the shared `.hall-panel` clamp and
   needs no override. */
@media not all and (max-width: 800px) {
  .ozen-hall-showcase--accommodation .ozen-cinematic-slider.ocs-layout--halls-panel {
    min-height: clamp(480px, 58vw, 700px);
  }

  .ozen-hall-showcase--dining .ozen-cinematic-slider.ocs-layout--halls-panel {
    min-height: clamp(500px, 59vw, 740px);
  }
}

/* Panel copy on phones: `.outdoor-page .hall-copy h2/p` is smaller and tighter than
   the halls default (clamp(25px, 7.4vw, 42px) / 1.42), so the outdoor page overrides
   it. The extra class keeps this above the block's own `.ocs-copy` declarations. */
@media (max-width: 560px) {
  .ozen-hall-showcase--outdoor .ozen-cinematic-slider[data-ozen-cinematic-slider].ocs-layout--halls-panel .ocs-copy h2 {
    font-size: clamp(22px, 6vw, 26px);
  }

  .ozen-hall-showcase--outdoor .ozen-cinematic-slider[data-ozen-cinematic-slider].ocs-layout--halls-panel .ocs-copy .ocs-description {
    line-height: 1.36;
  }
}

/* Location destination cards (QA F3). The published Location template renders the
   nearby grid as `.location-nearby a`, which ozen.css floors at min-height 260px
   (270px <=560px) beside an aspect-ratio of 1.32/1. The Gutenberg replacement uses
   core/cover cards whose stored dimensions carry only the explicit 1.32/1 ratio; WP
   core's wp_render_dimensions_support() emits `min-height:unset;height:unset` next to
   it, so the ratio survives but the published floors are lost (253.32px at 1024 and
   231.36px at 320 against 260/270 published). Restore the floors only — the ratio is
   left to the block's inline style, exactly as WP renders it. The `!important` is
   required because the inline `min-height:unset` cannot be outranked otherwise.

   `width:100%` and `min-width:0` are not decoration: a grid item with an explicit
   aspect-ratio whose block size is stretched/definite transfers that ratio into its
   inline size. With only the floor, a cover renders 343.2px wide inside a 266.39px
   track (1024/820/561) and 356.4px inside a 305.39px single-column track (320),
   scrolling the page sideways. Pinning the inline size to the track and zeroing the
   automatic minimum reproduces the published card's own `width:100%` /
   `min-width:0` pair from ozen.css.

   Scoped to direct core/cover children of the nearby grid inside the Gutenberg
   wrapper: the published anchor cards (`.location-nearby a`, no `.wp-block-cover`
   class) and every other cover on the site are untouched. */
.editorial-main.gutenberg-page .location-page .location-nearby-links > .wp-block-cover {
  min-height: 260px !important;
  width: 100%;
  min-width: 0;
}

@media (max-width: 560px) {
  .editorial-main.gutenberg-page .location-page .location-nearby-links > .wp-block-cover {
    min-height: 270px !important;
  }
}
