/**
 * WP Fullscreen Glass Menu - CSS
 * Fullscreen modal menu with glass effect styling
 */

/* Reset & Base Styles */
.fullscreen-menu,
.menu-container,
.menu-content,
.menu-items,
.menu-items * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Menu Trigger Button - For any element with .show_mobilemenu class */
.show_mobilemenu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.show_mobilemenu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Fullscreen Menu Overlay */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.2); /* Glass effect base */
    backdrop-filter: blur(15px); /* Glass blur effect */
    -webkit-backdrop-filter: blur(15px); /* For Safari */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fullscreen-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Container */
.menu-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 50px 20px;
}

/* Close Button */
.menu-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    transition: transform 0.3s ease;
}

.menu-close .menu-close-icon {
    width: 30px;
    height: 30px;
    display: block;
}

.menu-close:hover {
    transform: rotate(90deg);
}

/* Menu Content */
.menu-content {
    width: 100%;
}

/* Main Menu Items */
.menu-items {
    list-style: none;
    padding: 0;
    width: 100%;
}

.menu-item {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
}

.menu-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.menu-link {
    display: block;
    text-decoration: none;
    color: #000000;
    font-size: 28px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.menu-link:hover {
    color: #000;
}

/* Menu Item Wrapper for parent items */
.menu-item-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Submenu Toggle Button */
.submenu-toggle {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: transform 0.3s ease;
}

/* SVG-based +/- icon (cross-browser reliable, incl. iOS Safari) */
.submenu-toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    overflow: visible;
}

.submenu-toggle-bar-h,
.submenu-toggle-bar-v {
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: 12px 12px; /* SVG coord center */
}

/* Active state: hide vertical bar → becomes minus */
.submenu-toggle.active .submenu-toggle-bar-v {
    opacity: 0;
    transform: scaleY(0);
}

/* Submenu wrapper — CSS-grid collapse.
   Animates smoothly at ANY nesting depth (unlimited child levels):
   when a nested level expands it grows this 1fr row automatically,
   so no fixed max-height is needed and nothing ever gets clipped. */
.submenu-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.submenu-wrap.active {
    grid-template-rows: 1fr;
}

/* Submenu list — the single grid child.
   min-height:0 + overflow:hidden let the 0fr row clip it shut. */
.submenu {
    list-style: none;
    min-height: 0;
    overflow: hidden;
    padding-left: 18px; /* indent compounds one step per nested level */
    border-left: 2px solid #3fde3a; /* tree guide line, one per level */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submenu-wrap.active > .submenu {
    opacity: 1;
    padding-top: 14px;
}

.submenu-item {
    margin: 10px 0;
}

.submenu-link {
    color: #000000;
    text-decoration: none;
    /* Progressive sizing: shrinks 2px per nesting level, floored at 15px,
       so deep children stay readable and tidy. --mi-depth set per <li>. */
    font-size: clamp(15px, calc(25px - var(--mi-depth, 1) * 2px), 22px);
    line-height: 1.3;
    transition: color 0.3s ease;
    display: block;
}

.submenu-link:hover {
    color: #000;
}

/* Animation for menu items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fullscreen-menu.active .menu-item {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

/* Stagger the animation for each item */
.fullscreen-menu.active .menu-item:nth-child(1) { animation-delay: 0.1s; }
.fullscreen-menu.active .menu-item:nth-child(2) { animation-delay: 0.2s; }
.fullscreen-menu.active .menu-item:nth-child(3) { animation-delay: 0.3s; }
.fullscreen-menu.active .menu-item:nth-child(4) { animation-delay: 0.4s; }
.fullscreen-menu.active .menu-item:nth-child(5) { animation-delay: 0.5s; }
.fullscreen-menu.active .menu-item:nth-child(6) { animation-delay: 0.6s; }
.fullscreen-menu.active .menu-item:nth-child(7) { animation-delay: 0.7s; }
.fullscreen-menu.active .menu-item:nth-child(8) { animation-delay: 0.8s; }

/* WordPress admin bar compatibility */
.admin-bar .fullscreen-menu {
    top: 32px;
    height: calc(100vh - 32px);
}

.fullscreen-menu.active,
.admin-bar .fullscreen-menu{
    background-color: rgba(255, 255, 255, 0.7);
}

@media screen and (max-width: 782px) {
    .admin-bar .fullscreen-menu {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .menu-link {
        font-size: 24px;
    }

    .submenu-link {
        font-size: clamp(14px, calc(22px - var(--mi-depth, 1) * 2px), 19px);
    }

    .menu-container {
        padding: 60px 20px 40px;
    }
}

@media (max-width: 480px) {
    .menu-link {
        font-size: 20px;
    }

    .submenu-link {
        font-size: clamp(13px, calc(20px - var(--mi-depth, 1) * 2px), 17px);
    }

    /* Tighter indent on small screens so deep levels don't run off-screen */
    .submenu {
        padding-left: 12px;
    }

    .menu-container {
        padding: 50px 15px 30px;
    }

    .menu-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
    
    .logo-main img{ width:125px !important; }
    .logo-sub img{ height:40px !important; }
}

:root :where(.wp-block-search .wp-element-button,.wp-block-search .wp-block-button__link){
    margin-left: 0px;
}

/* No-js fallback */
.no-js .submenu-wrap {
    grid-template-rows: 1fr;
}

.no-js .submenu {
    opacity: 1;
    padding-top: 14px;
}

/* ============================================================
   Defensive fallback: render visual icons even if page cache
   is still serving OLD markup with <span class="dashicons ...">
   (dashicons font is no longer enqueued in v1.1.0+)
   ============================================================ */

/* Reset dashicons font so no tofu/icon glyph appears */
.menu-close .dashicons,
.submenu-toggle .dashicons {
    font-family: inherit !important;
    font-size: 0 !important;
    line-height: 1 !important;
    position: relative;
    display: inline-block;
    color: inherit;
}

/* Override dashicons own ::before that prints a glyph char */
.menu-close .dashicons::before,
.submenu-toggle .dashicons::before {
    content: "" !important;
    font-family: inherit !important;
}

/* --- Close button X fallback --- */
.menu-close .dashicons {
    width: 30px;
    height: 30px;
}

.menu-close .dashicons::before,
.menu-close .dashicons::after {
    content: "" !important;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
}

.menu-close .dashicons::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-close .dashicons::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* --- Submenu toggle +/- fallback --- */
.submenu-toggle .dashicons {
    width: 20px;
    height: 20px;
}

.submenu-toggle .dashicons::before,
.submenu-toggle .dashicons::after {
    content: "" !important;
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: currentColor;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Horizontal bar (always visible) */
.submenu-toggle .dashicons::before {
    width: 16px;
    height: 2px;
    transform: translate(-50%, -50%);
}

/* Vertical bar (hidden when minus / toggle active) */
.submenu-toggle .dashicons::after {
    width: 2px;
    height: 16px;
    transform: translate(-50%, -50%);
}

.submenu-toggle.active .dashicons::after,
.submenu-toggle .dashicons.dashicons-minus::after {
    transform: translate(-50%, -50%) scaleY(0);
    opacity: 0;
}