/* Header styles */

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
}

.site-logo__home-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.site-logo__mark {
    width: 112px;
}

.site-logo__group-link {
    display: block;
    line-height: 0;
}

.site-logo__group {
    width: 72px;
}

.site-logo__info {
    display: inline-flex;
    flex-direction: column;
}

.site-logo__tagline {
    font-size: var(--text-xs);
    font-weight: 500;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: #fff;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 32px;
    transition: padding 0.3s ease;
}

.site-header.is-scrolled {
    padding-top: 16px;
    padding-bottom: 16px;
}

/* ── Nav layout ─────────────────────────────── */
.site-header nav.nav-menu ul:not(.sub-menu) {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}

.site-header nav.nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
    font-size: var(--text-nav);
    font-weight: bold;
}

/* ── Desktop-only: plus icon + hover panel ── */
@media (min-width: 1024px) {

    /* Containing block for the centered sub-menu */
    .site-header .menu-item-has-children {
        position: relative;
    }

    /* Plus icon only on items with children */
    .site-header .menu-item-has-children > a::after {
        content: "+";
        font-size: 1.1em;
        line-height: 1;
        color: var(--color-blue-light);
    }

    /* Hidden sub-menu panel — centered under parent */
    .site-header .sub-menu {
        position: absolute;
        top: calc(100% + 48px);
        left: 50%;
        width: max-content;
        display: flex;
        flex-direction: column;
        gap: 12px;
        background: white;
        padding: 24px 32px;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(-6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* Transparent bridge — fills the gap so the cursor doesn't
       trigger mouseleave on the parent as it moves to the panel */
    .site-header .sub-menu::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        height: 56px;
    }

    /* Tighter gap when header is shrunk */
    .site-header.is-scrolled .sub-menu {
        top: calc(100% + 24px);
    }

    .site-header.is-scrolled .sub-menu::before {
        height: 32px;
    }

    /* Lighter weight for sub-menu links */
    .site-header nav.nav-menu .sub-menu a {
        font-weight: var(--fw-medium);
    }

    /* Caret after sub-menu links */
    .site-header nav.nav-menu .sub-menu a::after {
        content: '';
        display: inline-block;
        width: 6px;
        height: 10px;
        margin-left: 0.5em;
        background: url('../images/icon/caret-right-blue-light.svg') center / contain no-repeat;
        vertical-align: middle;
    }

    /* Reveal when JS adds .is-open */
    .site-header .menu-item-has-children.is-open > .sub-menu {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }

}

/* ── Right side group (nav + lang switcher) ── */
.site-header__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── CTA nav buttons ─────────────────────── */
.site-header nav.nav-cta ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}

.site-header nav.nav-cta a {
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-medium);
    border-radius: 4px;
    background-color: white;
    border: 1px solid var(--color-green);
    color: var(--color-green);
    font-size: var(--text-md);
    padding: 4px 16px;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.site-header nav.nav-cta a:hover {
    background-color: var(--color-green);
    color: white;
}

.site-header nav.nav-cta li.cta-orange a {
    background-color: var(--color-orange);
    border: none;
    color: white;
}
.site-header nav.nav-cta li.cta-orange a:hover {
    opacity: 0.85;
    background-color: var(--color-orange);
    color: white;
}

.site-header nav.nav-cta li.cta-green a {
    background-color: white;
    border: 1px solid var(--color-green);
    color: var(--color-green);
}
.site-header nav.nav-cta li.cta-green a:hover {
    background-color: var(--color-green);
    color: white;
    opacity: 1;
}


/* ── Language switcher ───────────────────── */
.lang-switcher {
    display: flex;
    background: #d4d5dc;
    gap: 2px;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    border-radius: 16px;
}

.lang-switcher__item {
    padding: 4px 12px;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    color: #888;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-switcher__item:not(.is-active):hover {
    color: #444;
}

.lang-switcher__item.is-active {
    background: var(--color-blue-dark);
    border-radius: 16px;
    color: #fff;
}

/* ── Below 1024px: hide sub-menu entirely ── */
@media (max-width: 1023px) {
    .site-header .sub-menu {
        display: none;
    }
}

/* ════════════════════════════════════════════
   Mobile nav
   ════════════════════════════════════════════ */

/* ── Hamburger toggle button ── */
/* position: fixed puts it in the root stacking context, above the overlay */
.nav-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 20px;
    z-index: 400;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Static dark circle — z-index: -1 keeps it behind the flex item spans */
.nav-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--color-blue-light);
    z-index: -1;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

/* X state */
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1024px) {
    /* Hide mobile-only elements on desktop */
    .nav-toggle,
    .nav-overlay { display: none !important; }
}

@media (max-width: 1023px) {
    /* !important overrides wp-block-group display:flex from core block CSS */
    .site-header__right { display: none !important; }
    .nav-toggle         { display: flex; }
    .site-header        { padding: 20px 24px; }
}

/* ── Full-screen overlay ── */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--color-blue-light);

    /* Invisible at rest — only animates on open/close */
    --cx: calc(100% - 22px);
    --cy: 36px;
    clip-path: circle(0% at var(--cx) var(--cy));
    transition: clip-path 0.65s cubic-bezier(0.77, 0, 0.18, 1);

    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    pointer-events: none;
}

body.nav-open .nav-overlay {
    clip-path: circle(200% at var(--cx) var(--cy));
    pointer-events: auto;
}

/* Prevent body scroll while open */
body.nav-open { overflow: hidden; }

/* ── Overlay inner content ── */
.nav-overlay__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 80px 32px 48px;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease 0.4s, transform 0.3s ease 0.4s;
}

body.nav-open .nav-overlay__inner {
    opacity: 1;
    transform: translateY(0);
}

/* ── Nav links inside overlay ── */
.nav-overlay nav.nav-menu {
    width: 100%;
}

.nav-overlay nav.nav-menu ul:not(.sub-menu) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}


.nav-overlay nav.nav-menu > ul > li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 20px;
}

.nav-overlay nav.nav-menu a {
    color: #fff;
    font-size: var(--text-xl);
    font-weight: 700;
    padding: 8px 0;
}

/* Always show sub-menus flat inside overlay */
.nav-overlay .sub-menu {
    position: static !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    background: none;
    box-shadow: none;
    padding: 4px 0 0 0;
    list-style: none;
}

/* Smaller text for sub-menu items in overlay */
.nav-overlay nav.nav-menu .sub-menu a {
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    opacity: 0.85;
}

.nav-overlay nav.nav-menu .sub-menu a::before {
    content: '– ';
}

/* Hide the + icon inside overlay */
.nav-overlay .menu-item-has-children > a::after { display: none; }

/* ── CTA nav inside overlay ── */
.nav-overlay nav.nav-cta ul {
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}

.nav-overlay nav.nav-cta a {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-base);
    font-weight: var(--fw-medium);
    border-radius: 4px;
    background-color: var(--color-green);
    color: white;
    padding: 8px 20px;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.nav-overlay nav.nav-cta li.cta-orange a {
    background-color: var(--color-orange);
    color: #fff;
}

.nav-overlay nav.nav-cta li.cta-green a {
    background-color: var(--color-green);
    color: #fff;
}

.nav-overlay nav.nav-cta a:hover {
    opacity: 0.85;
}


/* ── Lang switcher inside overlay (white variant) ── */
.nav-overlay .lang-switcher {
    background: rgba(255, 255, 255, 0.15);
}

.nav-overlay .lang-switcher__item { color: rgba(255, 255, 255, 0.6); }
.nav-overlay .lang-switcher__item.is-active {
    background: #fff;
    color: var(--color-blue-dark);
}