/* Pure-CSS/JS replacements for behaviour Elementor's frontend JS used to drive. */

/* -------- Desktop nav: reveal submenu on hover / focus-within. ----------- */
.elementor-nav-menu .menu-item-has-children {
    position: relative;
}
.elementor-nav-menu .menu-item-has-children:hover > .elementor-nav-menu--dropdown,
.elementor-nav-menu .menu-item-has-children:focus-within > .elementor-nav-menu--dropdown,
.elementor-nav-menu .menu-item-has-children:hover > .sub-menu,
.elementor-nav-menu .menu-item-has-children:focus-within > .sub-menu {
    display: block !important;
    top: 100%;
    right: 0;      /* anchor to right edge so long items don't clip viewport */
    left: auto;
    min-width: 240px;
    max-width: min(360px, 90vw);
    z-index: 9999;
}
.elementor-nav-menu .menu-item-has-children > .sub-menu .elementor-sub-item,
.elementor-nav-menu .menu-item-has-children > .elementor-nav-menu--dropdown .elementor-sub-item {
    white-space: normal;
}

/* -------- Mobile popup (burger menu). ------------------------------------ */
/* Make the inline popup behave like a side-drawer modal when toggled open. */
.elementor-location-popup.popup-open {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(11, 10, 45, 0.8); /* matches Elementor's popup backdrop */
    overflow-y: auto;
}
.elementor-location-popup.popup-open > .elementor-section-wrap,
.elementor-location-popup.popup-open > section {
    margin-left: auto;
    width: min(420px, 100%);
    min-height: 100vh;
    background-color: var(--e-global-color-secondary, #141e8c);
}
body.popup-lock {
    overflow: hidden;
}

/* Close "×" button inside mobile popup. */
.mobile-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-popup-close svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Post-grid thumbnails: Elementor's "has-item-ratio" class (added via JS) is
   missing here, so images render at natural size leaving a gap below. Force
   cover-fit so the padding-bottom ratio box is filled. */
.elementor-posts-container .elementor-post__thumbnail {
    position: relative;
    overflow: hidden;
}
.elementor-posts-container .elementor-post__thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* Mobile popup: top-level menu must stay visible; only NESTED submenus are
   collapsed until parent li is tapped open. */
.elementor-location-popup .menu-item-has-children > .sub-menu {
    display: none;
}
.elementor-location-popup .menu-item-has-children.sub-open > .sub-menu {
    display: block;
    position: static;      /* stack in flow inside popup, not absolute */
    background: transparent;
    padding-left: 1em;
    min-width: 0;
    max-width: none;
    top: auto;
    right: auto;
}
