/* Hero Banner: only what parts/common/hero-banner.css lacks - this block
   carries element-04's classes. */

/* Full screen: fills the screen below the header.
   - min-height, not height, so tall content grows the banner instead of
     overflowing it.
   - dvh so mobile browser toolbars can't cut the bottom off; vh first as the
     fallback for browsers without it.
   - Both header heights are subtracted: scripts.js measures the hidden one as
     0, so only the header actually showing counts. */
.element-29.version-2.banner-height-full {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--headerHeight, 0px) - var(--mobiHeaderHeight, 0px));
  min-height: calc(100dvh - var(--headerHeight, 0px) - var(--mobiHeaderHeight, 0px));
}

/* Block editor: let Banner Height size the preview as it does the page.
   - Nothing sets --headerHeight there, so element-04's calc() padding is invalid.
   - element-04 pins the preview image to 50vh, overriding that padding. */
.acf-block-preview .element-29 {
  --headerHeight: 0px;
}

.acf-block-preview .element-29.element-04.version-2 > [id^="frontpage-single-image_"] {
  height: auto;
}

/* element-04 caps the image section at one screen when the menu isn't transparent. */
[id^="frontpage_single_slide_"].element-29.version-2.banner-height-full > section {
  max-height: none !important;
}

.element-29.version-2.banner-height-full > [id^="frontpage-single-image_"] {
  flex: 1 0 auto;
}

.element-29.version-2.banner-height-full .frontpage_single_slide_center > .wpt-container {
  align-items: center;
  padding: 40px 0;
}

.element-29.version-2.banner-height-full.floating-search-true .frontpage_single_slide_center > .wpt-container {
  padding-bottom: 180px;
}

@media (min-width: 992px) {
  /* First on the page, element-04 pulls the block up under the header (any menu
     transparency), so the banner already contains it.
     - Full height: subtracting the header again leaves the banner a header short.
     - Pad the content down to clear it, as element-04's own heights do. */
  .element-29.version-2.banner-height-full:first-of-type {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .element-29.version-2.banner-height-full:first-of-type .frontpage_single_slide_center > .wpt-container {
    padding-top: calc(40px + var(--headerHeight, 0px));
  }
}

/* Text Alignment is its own setting here, but element-04 ties its text rules
   to content-align-*, which this block uses only for the search layout. */
.element-29.e29-text-align-left {
  --e29-text-justify: flex-start;
  --e29-text-align: left;
}

.element-29.e29-text-align-middle {
  --e29-text-justify: center;
  --e29-text-align: center;
}

.element-29.e29-text-align-right {
  --e29-text-justify: flex-end;
  --e29-text-align: right;
}

/* - The [id^=] prefix outranks element-04's longest selector at any width.
   - Child combinators: the search section nests its own .wpt-row > .col-12
     (.e04-form-desktop), which must keep element-04's justification. */
[id^="frontpage_single_slide_"].element-29.element-04.version-2 .frontpage_single_slide_center > .wpt-container > .wpt-row > .col-12 {
  justify-content: var(--e29-text-justify, center);
}

[id^="frontpage_single_slide_"].element-29.element-04.version-2 .frontpage_single_slide_center > .wpt-container .col-12 .intro-text {
  align-items: var(--e29-text-justify, center);
}

[id^="frontpage_single_slide_"].element-29.element-04.version-2 .intro-text :is(.hero, .sub-hero, h1, h2, h3, h4, .h1, .h2, .h3, .h4) {
  text-align: var(--e29-text-align, center);
}

/* element-04 aligns its root's items by content-align-*; full screen makes
   the root a flex column, where that shrinks the image to its content. */
[id^="frontpage_single_slide_"].element-29.element-04.version-2 {
  align-items: stretch;
}

/* The Block Divider is pulled up over the block's bottom 80px (50px at 768px
   and below). Reserve that space so the wave cuts into the background, never
   into the search form or scroll hint. */
.element-29 {
  --e29-divider-space: 0px;
  --e29-hint-space: 0px;
}

.element-29.has-block-divider {
  --e29-divider-space: 80px;
}

/* Room for the hint's 2rem offset, arrow, label and bounce. */
.element-29.has-scroll-hint:is(.floating-search-true, .e29-search-under-text) {
  --e29-hint-space: 6rem;
}

@media (max-width: 768px) {
  .element-29.has-block-divider {
    --e29-divider-space: 50px;
  }
}

/* Search bar below the banner: grow the bar, so the wave cuts into its colour. */
.element-29.has-block-divider > .outside-availability {
  padding-bottom: calc(15px + var(--e29-divider-space));
}

@media (max-width: 600px) {
  .element-29.has-block-divider > .outside-availability {
    padding-bottom: calc(5px + var(--e29-divider-space));
  }
}

/* No bar below: the image's own bottom edge holds the floating search and the
   scroll hint, so extend the image and lift them clear. */
.element-29.has-block-divider:is(.floating-search-true, .e29-search-under-text, .availability-hide) > [id^="frontpage-single-image_"] {
  padding-bottom: var(--e29-divider-space);
}

.element-29.has-scroll-hint:is(.floating-search-true, .e29-search-under-text) > [id^="frontpage-single-image_"] {
  padding-bottom: calc(var(--e29-divider-space) + var(--e29-hint-space));
}

.element-29.element-04.version-2.floating-search-true .frontpage_single_slide_center section[id^="check-availability_"] {
  bottom: calc(var(--e29-divider-space) + var(--e29-hint-space));
}

.element-29.has-block-divider:is(.floating-search-true, .e29-search-under-text, .availability-hide) .scroll-hint {
  bottom: calc(2rem + var(--e29-divider-space));
}

/* element-04 puts the floating search back in flow here, where an offset
   would pull it over the heading instead. */
@media (max-width: 450px) {
  .element-29.element-04.version-2.floating-search-true .frontpage_single_slide_center section[id^="check-availability_"] {
    bottom: auto;
  }
}

/* Search under the heading and buttons: in flow inside the banner at every
   width, as a transparent bar like the floating search. element-04 hides the
   in-banner search below 992px for every layout but floating. */
.element-29.element-04.version-2.e29-search-under-text .frontpage_single_slide_center section[id^="check-availability_"] {
  display: block;
  width: 100%;
  background: unset !important;
}

/* One row, as floating gets: element-04 stacks a slider's fields full width. */
@media (min-width: 451px) {
  .element-29.element-04.version-2.e29-search-under-text .frontpage_slider [id^="check-availability_"] .wpt-row > div {
    width: unset;
  }
}

/* element-04 uppercases every <p> in the banner; a paragraph sub heading
   follows the Uppercase Sub Heading toggle instead, as a heading does. */
.element-29 .intro-text p.intro-text--sub-hero {
  text-transform: none;
}

/* element-04's 50% white disappears on a light photo. */
.element-29 .scroll-hint span {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.element-29 .scroll-hint svg {
  stroke: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* Pause control for slider and video backgrounds. */
.element-29 .e29-motion-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  /* hero-banner.css turns pointer events off for the whole image section. */
  pointer-events: auto;
}

.element-29.has-block-divider:is(.floating-search-true, .e29-search-under-text, .availability-hide) .e29-motion-toggle {
  bottom: calc(1rem + var(--e29-divider-space));
}

/* Lift a floating search clear of the toggle, as for the scroll hint. */
.element-29.has-motion-toggle.floating-search-true:not(.has-scroll-hint) {
  --e29-hint-space: 4.5rem;
}

.element-29.has-motion-toggle.floating-search-true:not(.has-scroll-hint) > [id^="frontpage-single-image_"] {
  padding-bottom: calc(var(--e29-divider-space) + var(--e29-hint-space));
}

.element-29 .e29-motion-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.element-29 .e29-motion-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.element-29 .e29-motion-toggle .e29-motion-toggle__play,
.element-29 .e29-motion-toggle[aria-pressed="true"] .e29-motion-toggle__pause {
  display: none;
}

.element-29 .e29-motion-toggle[aria-pressed="true"] .e29-motion-toggle__play {
  display: block;
}
