/* Behavior and accessibility fixes only; the original design remains in all-pages.php and each page. */
/* Preserve the page's existing width while the drawer locks background scrolling. */
html.house-drawer-open,
html.house-drawer-open .fixed-content { width: calc(100% - var(--page-scrollbar-width, 0px)); }
/* The drawer must reach the viewport edge, outside the compensated picker container. */
.fixed-content > .alle-hauser-wrapper { position: fixed; }
.alle-hauser { scrollbar-gutter: stable; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--sunset-mustard) !important; outline-offset: 4px; }
.alle-hauser[inert] { visibility: hidden; }
.photo-controller > button { appearance: none; width: 16px; height: 16px; padding: 0; border: 1px solid var(--dark-blue); border-radius: 50%; background: var(--clear-gray); cursor: pointer; position: relative; }
.photo-controller > button::after { content: ''; position: absolute; inset: -8px; }
.photo-controller > button:is(:hover, [aria-pressed="true"]) { background: var(--sunset-mustard); }
.editorial-accordion-trigger { display: block; width: 100%; border: 0; padding: 8px 0; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.faq-section [hidden] { display: none !important; }
@media (max-width: 900px) {
  nav { width: 100%; }
  body .heading-section { display: flex; flex-direction: column; justify-content: center; background-attachment: scroll; width: 100%; min-height: max(420px, 100svh); height: auto; padding: 140px 24px 72px; }
  body .heading-section > h1, body .heading-section > h2 { position: static; transform: none; flex-shrink: 0; width: 100%; max-width: 100%; margin: 0; overflow-wrap: break-word; }
  body .heading-section > h2 { margin-top: 16px; }
  body .text-box > h3, body .text-area > h3 { margin-top: 8px; }
  body #mapContainer { min-width: 0; max-width: 100%; }
}
/* Anchor the submenu to its trigger as the header changes height. */
.menu .houses-item { height: 100%; display: flex; align-items: center; }
.menu .houses-item > a { line-height: normal; }
.houses-item > .houses-more {
  top: 100%;
  left: -4px; /* Align the first submenu label with the trigger's 25px inset. */
  right: auto;
  line-height: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms ease-in-out, visibility 0s linear 500ms, background-position 500ms ease-in-out;
}
.houses-item:hover > .houses-more,
.houses-item:focus-within > .houses-more { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.menu .item a, .houses-more > a { transition: background-position 150ms ease-out, border-color 150ms ease-out; }
.menu .item a:focus-visible, .houses-more > a:focus-visible { background-position: 0 0; border-color: var(--sunset-mustard); }
.availability-search { transition: background-position 500ms ease-in-out, height 1s linear, top 1s linear; }
.availability-search:hover, .availability-search:focus-within { background-position: 0 100%; }
@media (min-width: 901px) {
  /* Keep the controls and backdrop's top edge in place; extend blue to the bottom. */
  .fixed-content > .availability-search { background-image: none; }
  .fixed-content > .availability-search::before {
    content: '';
    position: absolute;
    left: 0;
    top: max(0px, calc(50% - 30px));
    bottom: 0;
    width: 100%;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(transparent 50%, var(--dark-blue) 50%);
    background-size: 100% 200%;
    background-position: inherit;
    background-repeat: no-repeat;
  }
  nav { transition: background-position 500ms ease-in-out; }
  nav:hover, nav:focus-within,
  nav:is(:hover, :focus-within) .houses-more { background-position: 0 0; }
  /* Pages with dark header text need the existing light treatment over blue. */
  body.nav-alt:not(.stop-scrolling) nav:is(:hover, :focus-within) .menu:not(.menu-height) .item a {
    background-image: linear-gradient(to bottom, var(--sunset-mustard) 50%, var(--clear-gray) 50%), linear-gradient(to bottom, var(--clear-gray) 50%, var(--sunset-mustard) 50%);
  }
  .nav-alt:not(.stop-scrolling) nav:is(:hover, :focus-within) .menu:not(.menu-height) .logo > img { display: block; }
  .nav-alt:not(.stop-scrolling) nav:is(:hover, :focus-within) .menu:not(.menu-height) .logo > img.logo-alt { display: none; }
  .compact-navigation .nav-alt:not(.stop-scrolling) nav:is(:hover, :focus-within):not(.blue-nav) .responsive-nav > .logo { display: block; }
  .compact-navigation .nav-alt:not(.stop-scrolling) nav:is(:hover, :focus-within):not(.blue-nav) .responsive-nav > .logo-alt { display: none; }
  .compact-navigation .nav-alt nav:is(:hover, :focus-within) #menu-hamburger > span { background-color: var(--clear-gray); }
}
/* Neutralize native button chrome while preserving the original control styling. */
button.houses-btn { border: 0; font: inherit; }
button#menu-hamburger { border: 0; background: transparent; padding: 0; }
/* Expand the hit areas without moving or resizing the visible icons. */
#menu-hamburger::after { content: ''; position: absolute; inset: -12px; }
.responsive-menu {
  top: var(--menu-header-height, 120px);
  height: calc(100dvh - var(--menu-header-height, 120px));
  max-height: calc(100dvh - var(--menu-header-height, 120px));
  padding-top: calc(140px - var(--menu-header-height, 120px));
  padding-right: 15vw;
  overflow-y: auto;
  overscroll-behavior: contain;
  row-gap: 12px;
  justify-content: flex-start;
  font-size: 1.5rem;
  line-height: 1.4;
}
/* Scroll links below the header instead of underneath the logo and picker. */
.stop-scrolling nav { background-color: var(--dark-blue); }
.responsive-menu > a { display: block; flex-shrink: 0; width: 100%; max-width: 100%; min-height: 44px; padding-block: 5px; overflow-wrap: anywhere; }
.responsive-menu > a.more { font-size: 1.25rem; padding-left: 24px; }
.responsive-menu.hidden { pointer-events: none; }
/* Switch the header before its links compete with the logo. Keep the page's
   existing content and availability breakpoints independent of the header. */
nav .menu > .item { flex-shrink: 0; white-space: nowrap; }
.compact-navigation nav { width: 100%; padding: 0 clamp(16px, 3vw, 32px); }
.compact-navigation #menu-hamburger { right: 12px; }
.compact-navigation nav .responsive-nav { display: block; height: 120px; }
.compact-navigation nav .menu {
  display: flex;
  position: absolute;
  inset: 0 25px auto;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
}
.compact-navigation nav.blue-nav { background-color: var(--dark-blue); }
.responsive-nav > .logo { max-width: calc(100% - 60px); object-fit: contain; }
/* Tablet navigation has one row; centre it and follow the desktop scroll height. */
@media (min-width: 901px) {
  .compact-navigation nav { --menu-header-height: 120px; }
  .compact-navigation nav.blue-nav { --menu-header-height: 75px; }
  .compact-navigation nav .responsive-nav { height: var(--menu-header-height); transition: height 500ms ease-in-out; }
  .compact-navigation .responsive-nav > .logo { position: absolute; top: 50%; margin: 0; transform: translateY(-50%); }
  .compact-navigation #menu-hamburger { top: 50%; transform: translateY(-50%); }
  .compact-navigation .responsive-menu { padding-top: 20px; }
}
.parallax { transition: translate 120ms linear; }
.slideAnimation { transition: translate 600ms ease-out !important; }
/* A photo inside a sliding group must not inherit and repeat its parent's offset. */
.parallax, .slideAnimation { --reveal-x: 0px; }
.reveal-left { --reveal-x: -100vw; }
.reveal-right { --reveal-x: 100vw; }
.parallax, .slideAnimation { translate: var(--reveal-x, 0px) var(--parallax-y, 0px); }
@media (max-width: 900px) {
  body.th-direct-booking { --menu-header-height: 75px; }
  /* Keep the white booking controls readable after the header becomes sticky. */
  nav.blue-nav { background-color: var(--dark-blue); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .parallax, .slideAnimation { translate: none; }
  .heading-section { background-attachment: scroll; }
}
