/*
 * avant-runtime.css - the ONLY hand-written CSS in the site.
 *
 * Everything visual comes from the original Elementor / LaKit / Ciri stylesheets (see src/lib/wp-styles.ts).
 * This file only covers things those stylesheets expect JavaScript or paid plugins to provide:
 *   1. Elementor container slideshow background (swiper in WP, plain fade here)
 *   2. Elementor Pro popup modal chrome (Pro's popup CSS is not part of the free plugin we have)
 *   3. RevSlider replacement ("avs"): project cards on the home page + apartment-plan galleries
 *   4. Lightbox for Elementor/LaKit "open lightbox" links
 * Design tokens are NOT redefined here: gold #C7A580, navy #000336, cream #F1EEE9 come from post-19.css (kit).
 * Keep this file small; if something looks wrong, fix the extraction, not by restyling here.
 */

/* ---------------------------------------------------------------- 0. Elementor container quirk */
/*
 * "Cards" container da40e4c on the home page has no --display set by its post CSS, so
 * `display: var(--display)` computes to `inline` (Elementor bug). WP's browser render shows no extra
 * line boxes around it (the container contributes only its block child, 520px), while an inline box
 * in our static DOM adds two empty 28.8px lines (+57px page height). `contents` reproduces the WP
 * result exactly; containers that do set --display are untouched.
 */
.e-con,
.e-con > .e-con-inner {
  display: var(--display, contents);
}

/* ---------------------------------------------------------------- 1. hero slideshow */
.avant-bg-slideshow .avant-bg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  /* Elementor setting background_slideshow_transition_duration = 500ms, type fade */
  transition: opacity 0.5s ease;
}
.avant-bg-slideshow .avant-bg-slide.is-active {
  opacity: 1;
}

/* ---------------------------------------------------------------- 2. popup modal */
.elementor-popup-modal[hidden] {
  display: none !important;
}
.elementor-popup-modal {
  display: flex;
  z-index: 99999;
  /* post-XXXX.css supplies justify/align + overlay colour (rgba(0,0,0,.8)) */
  overflow: hidden;
}
.elementor-popup-modal .dialog-widget-content {
  position: relative;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  pointer-events: all;
  background-color: #fff;
  border-radius: 0;
  animation: avant-popup-in 0.3s ease;
}
.elementor-popup-modal .dialog-message {
  max-width: 100vw;
  max-height: 100vh;
  overflow: auto;
}
.elementor-popup-modal .dialog-close-button {
  z-index: 2;
  top: 20px;
  right: 20px;
  margin-top: 0;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
/* "close_button_position: outside" popups (360 tours): button sits above the frame, on the dark overlay */
.elementor-popup-modal.avant-close-outside .dialog-close-button {
  top: -36px;
  right: 0;
  color: #fff;
}
html.dialog-prevent-scroll,
html.dialog-prevent-scroll body {
  overflow: hidden;
}
@keyframes avant-popup-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------- 2b. nav dropdown hover bridge */
/*
 * LaKit submenus sit at top:100% with a default translateY(20px) open animation. The empty
 * pixels between the trigger and the panel are NOT part of the <li>, so mouseout fires and
 * the menu collapses before the cursor reaches it. Bridge the gap + keep the open panel
 * flush under the trigger.
 */
.lakit-nav--horizontal > .menu-item-has-children {
  position: relative;
}
.lakit-nav--horizontal > .menu-item.lakit-nav-hover > .lakit-nav__sub.lakit-nav-depth-0 {
  transform: translateY(0) !important;
  top: 100% !important;
  left: 0 !important;
  margin-top: 0;
}
.lakit-nav--horizontal > .menu-item-has-children > .lakit-nav__sub.lakit-nav-depth-0::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -24px;
  height: 24px;
}

/* ---------------------------------------------------------------- 3. RevSlider replacement */
/*
 * Geometry per breakpoint (grid width/height, layer x/y/size) is generated inline by
 * scripts/wp/extract.mjs from the RevSlider data-* attributes. Here: structure + shared look.
 * --avs-s is the fullwidth-layout scale factor set by wp-runtime.ts (min(1, available / grid)).
 */

/* WP RevSlider custom CSS: mobile material arrows are desktop-hidden; bounce SVGs are mid-range-hidden. */
@media screen and (min-width: 1025px) {
  .avs-w-mobile-left,
  .avs-w-mobile-right {
    display: none !important;
  }
}
@media screen and (min-width: 797px) and (max-width: 1025px) {
  .avs-w-left-bounce,
  .avs-w-right-bounce {
    display: none !important;
  }
}

.avs {
  position: relative;
  width: 100%;
  --avs-gw: 1240;
  --avs-gh: 520;
  --avs-pl: 0;
  --avs-pr: 0;
  --avs-s: 1;
  font-family: 'Roboto', Arial, sans-serif;
  text-align: left;
}
.avs-stage {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: calc(var(--avs-gh) * var(--avs-s) * 1px);
  transition: height 0.2s;
}
.avs-grid {
  position: absolute;
  top: 0;
  left: calc(50% + (var(--avs-pl) - var(--avs-pr)) * 0.5px);
  width: calc(var(--avs-gw) * 1px);
  height: calc(var(--avs-gh) * 1px);
  transform-origin: 0 0;
  transform: translateX(calc(var(--avs-gw) * var(--avs-s) * -0.5px)) scale(var(--avs-s));
}
.avs-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.avs-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}
.avs-layer {
  position: absolute;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Roboto', Arial, sans-serif;
  /* rs "w:normal" text layers wrap; they size to content */
  white-space: normal;
  text-decoration: none;
}
.avs-t-button {
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.avs-t-image {
  overflow: hidden;
  display: block;
}
.avs-t-image img {
  display: block;
  width: 100%;
  /* 100% of an auto-height layer resolves to auto, so gallery plans keep their aspect ratio */
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avs-t-svg img {
  display: block;
  width: 100%;
  height: 100%;
}
.avs-t-shape {
  cursor: pointer;
}
.avs-act {
  cursor: pointer;
}
.avs-layer span {
  /* plan-room rows ("Holl.......3.54 m2") rely on inline spans not wrapping */
  white-space: pre-wrap;
}
/* hover behaviours that RevSlider kept in its "Custom CSS" (copied from the slider settings) */
.avs-w-left-bounce,
.avs-w-right-bounce,
.avs-w-colored-arrow {
  transition: translate 0.5s ease;
}
.avs-w-left-bounce:hover {
  translate: -10px 0;
}
.avs-w-right-bounce:hover,
.avs-w-colored-arrow:hover {
  translate: 10px 0;
}
.avs-w-colored-arrow img {
  transition: transform 0.5s ease;
}
.avs-w-hover-layer:hover ~ .avs-w-colored-arrow img {
  transform: translateX(10px);
}
/* between 797-1025px the bounce arrows were hidden in the slider CSS */
@media (min-width: 797px) and (max-width: 1025px) {
  .avs-w-left-bounce img,
  .avs-w-right-bounce img {
    display: none;
  }
}
/* rs "ares" bullets */
.avs-bullets {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  z-index: 5;
}
.avs-bullet {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f6f6f6;
  cursor: pointer;
}
.avs-bullet.selected {
  background: #c7a580;
}
.avs.is-fs {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #fff;
  display: flex;
  align-items: center;
}
.avs.is-fs .avs-stage {
  width: 100%;
}

/* ---------------------------------------------------------------- 4. lightbox */
.avant-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}
.avant-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.avant-lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
  padding: 12px 18px;
}
.avant-lightbox .avant-lb-close {
  top: 8px;
  right: 12px;
}
.avant-lightbox .avant-lb-prev {
  left: 8px;
  top: 50%;
}
.avant-lightbox .avant-lb-next {
  right: 8px;
  top: 50%;
}
