/* NAV-MENUS — תפריט נפתח רב-עמודות בהדר (דסקטופ), אקורדיון בתפריט ההמבורגר
   (נייד), והתאמת גובה הפוטר לעמודות הארוכות. נטען אחרי header.css / footer.css
   ולכן גובר עליהם. כל הערכים בקנבס 1920 של ההדר/פוטר, שמוקטן ב-transform. */

/* ─────────────────────────────────────────────
   1. Mega menu — desktop only (the whole 1920 bar is hidden ≤1024px).
   ───────────────────────────────────────────── */
.site-header__nav .mey-has-mega {
    position: relative;
}

.site-header__nav .mey-mega {
    position: absolute;
    top: calc(100% + 22px);
    right: 0;
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    pointer-events: none;
}

/* Bridges the gap between the nav item and the panel so the pointer can
   travel without the panel closing. */
.site-header__nav .mey-mega::before {
    content: "";
    position: absolute;
    top: -26px;
    left: 0;
    right: 0;
    height: 26px;
}

.site-header__nav .mey-has-mega:hover > .mey-mega,
.site-header__nav .mey-has-mega:focus-within > .mey-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.site-header__nav .mey-mega__inner {
    display: flex;
    align-items: flex-start;
    gap: 54px;
    padding: 32px 42px 36px;
    background: rgba(10, 10, 12, 0.97);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
    text-align: right;
    direction: rtl;
}

.site-header__nav .mey-mega__col {
    min-width: 150px;
}

.site-header__nav .mey-mega__col-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    font-family: var(--f-uppercase);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.35;
    color: var(--c-gold-1);
    white-space: nowrap;
}

.site-header__nav .mey-mega__col-title a {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.site-header__nav .mey-mega__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-header__nav .mey-mega__list li {
    display: block;
    position: static;
}

.site-header__nav .mey-mega__list a {
    display: block;
    font-family: var(--f-body);
    font-weight: 300;
    font-size: 16.5px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    transition: color 0.18s ease;
}

.site-header__nav .mey-mega__list a:hover,
.site-header__nav .mey-mega__list a:focus-visible {
    color: #ffffff;
}

/* The shared underline animation is anchored to the item; inside the panel it
   would sit under the wrong edge, so re-anchor it. */
.site-header__nav .mey-mega a::after {
    right: 0;
    bottom: -2px;
}

/* Keyboard focus must be visible on the dark panel. */
.site-header__nav .mey-mega a:focus-visible,
.site-menu__group-title:focus-visible {
    outline: 2px solid var(--c-gold-1);
    outline-offset: 3px;
}

/* ─────────────────────────────────────────────
   2. Mobile — accordion columns inside the hamburger menu.
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* With sub-menus open the panel is taller than the viewport. */
    .site-menu {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-menu__sub {
        list-style: none;
        margin: 0;
        padding: 0 0 6px;
    }

    .site-menu__nav .site-menu__sub li {
        border-bottom: 0;
    }

    .site-menu__group {
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .site-menu__nav .site-menu__group-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
        padding: 16px 26px;
        background: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        -webkit-appearance: none;
        appearance: none;
        font-family: var(--f-body);
        font-weight: 400;
        font-size: 17px;
        line-height: 1.3;
        color: var(--c-gold-1);
        text-align: right;
        cursor: pointer;
    }

    .site-menu__chev {
        flex: 0 0 13px;
        width: 13px;
        height: 13px;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10' fill='none'><path d='M1 1l7 7 7-7' stroke='%23efdcc3' stroke-width='1.5' stroke-linecap='round'/></svg>");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        transition: transform 0.3s ease;
    }

    .site-menu__group.is-open .site-menu__chev {
        transform: rotate(180deg);
    }

    .site-menu__group-list {
        list-style: none;
        margin: 0;
        padding: 0 38px;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition:
            max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            padding-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .site-menu__group.is-open .site-menu__group-list {
        max-height: 720px;
        opacity: 1;
        padding: 8px 38px 16px;
    }

    .site-menu__nav .site-menu__group-list a,
    .site-menu__nav .site-menu__sub-item a {
        padding: 12px 0;
        font-size: 16px;
        color: rgba(255, 255, 255, 0.82);
    }

    .site-menu__nav .site-menu__sub-item a {
        padding: 12px 26px;
    }
}

/* ─────────────────────────────────────────────
   3. Footer — the regrouped columns hold up to 9 links, which overran the
      490-px Figma canvas (bottom row sits at y=421). The canvas grows to 570
      and the bottom row / back-to-top move with it, so the proportions and the
      100vw scaling stay exactly as designed. Desktop only — ≤1024px the footer
      is height:auto.
   ───────────────────────────────────────────── */
@media (min-width: 1025px) {
    body.mey-footer-menu .footer {
        height: calc(100vw * 570 / 1920);
    }

    body.mey-footer-menu .footer__stage {
        height: 570px;
    }

    body.mey-footer-menu .footer__bottom {
        top: 501px;
    }

    body.mey-footer-menu .footer__back-to-top {
        top: 430px;
    }

    /* 5 columns x up to 10 links: let the gaps breathe but never overflow. */
    body.mey-footer-menu .footer__columns {
        gap: 20px;
    }

    body.mey-footer-menu .footer__column {
        gap: 40px;
    }

    body.mey-footer-menu .footer__column-list {
        gap: 16px;
    }
}
