/* ═══════════════════════════════════════════════════════════════
   Default Header – Floating Navbar with Megamenu
   ═══════════════════════════════════════════════════════════════ */

/* ─── Floating Bar ─── */
.logged-in.admin-bar {
    section.header-default {
        top: var(--size-40);
    }
}

section.header-default {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--size-20) 0;
    transition: padding 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-default__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-white);
    border-radius: .75rem;
    box-shadow: 0 var(--size-2) var(--size-19) rgba(17, 54, 68, 0.12);
    padding: var(--size-10) var(--size-40);
    /* max-width: 1312px; */
    margin-left: auto;
    margin-right: auto;
    position: relative;
    transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-default .container {
    width: 100%;
    max-width: 1280px;
    padding-left: 0;
    padding-right: 0;
}

/* ─── Logo ─── */
.header-default__logo {
    flex-shrink: 0;
    margin-right: var(--size-40);
}

.header-default__logo a {
    display: flex;
    align-items: center;
}

.header-default__logo img {
    display: block;
    max-height: var(--size-55);
    width: auto;
}

/* ─── Navigation ─── */
.header-default__nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.header-default__menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--size-25);
}

/* ─── Menu Items ─── */
.header-default__menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: var(--size-4);
    color: #4a4a4a;
    font-size: var(--size-15);
    padding: var(--size-10) 0;
    text-decoration: none;
    border-radius: .75rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-default__menu > li > a:hover {
    color: var(--c-teal-dark-800, #1a4a5e);
}

.header-default__menu > li.current-menu-item > a,
.header-default__menu > li.current-page-ancestor > a {
    color: var(--c-teal-dark-900, #113644);
    font-weight: 700;
}

/* Chevron */
.header-default__menu .menu-chevron {
    transition: transform 0.2s;
    opacity: 0.5;
}

.header-default__menu > li:hover .menu-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ─── CTA Button ─── */
.header-default__menu > li.nav-cta > a {
    background: #E1E61E;
    border: var(--size-1) solid #E1E61E;
    color: var(--c-teal-dark-900, #003a49);
    padding: var(--size-10) var(--size-18);
    border-radius: var(--size-8);
    font-size: var(--size-16);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}

.header-default__menu > li.nav-cta > a:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.header-default__menu > li.nav-cta > a .menu-chevron {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   Regular Dropdown
   ═══════════════════════════════════════════════════════════════ */
.header-default__menu > li.has-dropdown {
    position: static;
}

.header-default__menu > li.has-dropdown > .dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    padding-top: var(--size-12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 100;
}

.header-default__menu > li.has-dropdown:hover > .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-panel .sub-menu {
    background: var(--c-white);
    border-radius: .75rem;
    box-shadow: 0 var(--size-8) var(--size-30) rgba(0, 0, 0, 0.1);
    padding: var(--size-12) 0;
    width: max-content;
    min-width: 220px;
    max-width: 300px;
    list-style: none;
    margin: 0;
    position: relative;
    left: var(--dropdown-left, 0);
}

.dropdown-panel .sub-menu li a {
    display: block;
    padding: var(--size-12, 12px) var(--size-16, 16px);
    margin: 0 var(--size-8, 8px);
    color: var(--c-teal-dark-900, #113644);
    font-size: var(--size-14);
    font-weight: 400;
    text-decoration: none;
    border-radius: .75rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-panel .sub-menu li a:hover {
    background: var(--c-grey-50, #f8f9fa);
    color: var(--c-teal-dark-800, #1a4a5e);
}

.dropdown-panel .sub-menu li.current-menu-item a {
    font-weight: 600;
}

/* Nested dropdown (3rd level) */
.dropdown-panel .sub-menu .sub-menu {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    padding-left: var(--size-12);
    border-left: var(--size-2) solid rgba(17, 54, 68, 0.1);
    margin: var(--size-4) 0 var(--size-4) var(--size-24);
}

.dropdown-panel .sub-menu .sub-menu li a {
    font-size: var(--size-13);
    padding: var(--size-8) var(--size-16);
    color: var(--c-grey-600, #6b7280);
}

/* ═══════════════════════════════════════════════════════════════
   Megamenu Panel
   ═══════════════════════════════════════════════════════════════ */
.header-default__menu > li.has-megamenu {
    position: static;
}

.header-default__menu > li.has-megamenu > .megamenu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    padding-top: var(--size-12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 100;
}

.header-default__menu > li.has-megamenu:hover > .megamenu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.megamenu-panel > .container {
    background: var(--c-white);
    border-radius: .75rem;
    box-shadow: 0 var(--size-12) var(--size-40) rgba(0, 0, 0, 0.12);
    padding: var(--size-32) var(--size-40);
}

/* Two-column megamenu layout */
.megamenu-inner {
    display: flex;
    gap: var(--size-40, 40px);
}

/* Left column: links with labels + descriptions */
.megamenu-links-col {
    min-width: 0;
    column-gap: var(--size-24, 24px);
}

/* 1 link col + posts: links 30-35%, posts get the rest (~65-70%) */
.megamenu-panel--cols-1.megamenu-panel--with-posts .megamenu-links-col {
    flex: 0 0 33%;
}

/* 2 link cols + posts: all 3 sections equal (33% each) */
.megamenu-panel--cols-2.megamenu-panel--with-posts .megamenu-links-col {
    flex: 0 0 60%;
}

/* 3 link cols + posts: links 75%, posts 25% */
.megamenu-panel--cols-3.megamenu-panel--with-posts .megamenu-links-col {
    flex: 0 0 75%;
}

/* No posts: links fill available space */
.megamenu-panel:not(.megamenu-panel--with-posts) .megamenu-links-col {
    flex: 1;
}

.megamenu-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.megamenu-link-item {
    break-inside: avoid;
    margin-bottom: var(--size-4, 4px);
}

.megamenu-link {
    display: block;
    text-decoration: none;
    padding: var(--size-12, 12px) var(--size-16, 16px);
    border-radius: .75rem;
    transition: background 0.2s ease;
}

.megamenu-link:hover {
    background: var(--c-grey-50, #f8f9fa);
}

.megamenu-link__label {
    display: block;
    font-size: var(--size-15, 15px);
    font-weight: 600;
    color: var(--c-teal-dark-900, #113644);
    margin-bottom: var(--size-2, 2px);
}

.megamenu-link__desc {
    display: block;
    font-size: var(--size-13, 13px);
    color: var(--c-grey-500, #6b7280);
    line-height: 1.4;
}

.megamenu-link:hover .megamenu-link__label {
    color: var(--c-teal-dark-800, #1a4a5e);
}

/* Nested sub-links inside megamenu */
.megamenu-sub-links {
    list-style: none;
    margin: 0 0 0 var(--size-16, 16px);
    padding: 0;
}

.megamenu-sub-links li a {
    display: block;
    font-size: var(--size-14, 14px);
    color: var(--c-teal-dark-800, #1a4a5e);
    text-decoration: none;
    padding: var(--size-4, 4px) var(--size-16, 16px);
    transition: color 0.15s;
}

.megamenu-sub-links li a:hover {
    color: var(--c-teal-dark-900, #113644);
}

/* Right column: featured posts — takes remaining space */
.megamenu-featured-col {
    flex: 1;
    border-left: 1px solid var(--c-grey-200, #e5e7eb);
    padding-left: var(--size-40, 40px);
}

.megamenu-featured__heading {
    font-size: var(--size-12, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-grey-500, #6b7280);
    margin-bottom: var(--size-16, 16px);
}

.megamenu-featured__posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--size-20, 20px);
}

/* 2-3 link columns: posts stack vertically */
.megamenu-panel--cols-2 .megamenu-featured__posts,
.megamenu-panel--cols-3 .megamenu-featured__posts {
    /* grid-template-columns: 1fr; */
    display: flex;
    flex-direction: column;
    gap: var(--size-16, 16px);
    
}

.megamenu-featured__post {
    display: flex;
    flex-direction: column;
    gap: var(--size-10, 10px);
    text-decoration: none;
    padding: var(--size-8, 8px);
    border-radius: .75rem;
    transition: background 0.2s ease;
}

.megamenu-featured__post:hover {
    background: var(--c-grey-50, #f8f9fa);
}

.megamenu-panel--cols-2 .megamenu-featured__posts {
    .megamenu-featured__post {
        flex-direction: row;
    }

}

.megamenu-featured__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: .75rem;
    overflow: hidden;
}

.megamenu-featured__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.megamenu-featured__post:hover .megamenu-featured__image img {
    transform: scale(1.03);
}

.megamenu-featured__title {
    font-size: var(--size-14, 14px);
    font-weight: 600;
    color: var(--c-teal-dark-900, #113644);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.megamenu-featured__post:hover .megamenu-featured__title {
    color: var(--c-teal-dark-800, #1a4a5e);
}

/* Without featured posts — constrain width based on columns */
.megamenu-panel:not(.megamenu-panel--with-posts).megamenu-panel--cols-1 .megamenu-inner {
    max-width: 400px;
}
.megamenu-panel:not(.megamenu-panel--with-posts).megamenu-panel--cols-2 .megamenu-inner {
    max-width: 600px;
}
.megamenu-panel:not(.megamenu-panel--with-posts).megamenu-panel--cols-3 .megamenu-inner {
    max-width: 800px;
}

/* Legacy column classes (backwards compat) */
.megamenu-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--size-32);
}

.megamenu-column-title {
    font-size: var(--size-13);
    font-weight: 700;
    color: var(--c-teal-dark-900, #113644);
    margin: 0 0 var(--size-14);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.megamenu-column-title a {
    color: inherit;
    text-decoration: none;
}

.megamenu-column-title a:hover {
    color: var(--c-teal-dark-800, #1a4a5e);
}

.megamenu-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.megamenu-column ul li {
    margin-bottom: var(--size-6);
}

.megamenu-column ul li a {
    display: block;
    color: var(--c-teal-dark-800, #1a4a5e);
    font-size: var(--size-14);
    font-weight: 400;
    text-decoration: none;
    padding: var(--size-6) 0;
    transition: color 0.15s;
}

.megamenu-column ul li a:hover {
    color: var(--c-teal-dark-900, #113644);
}

.menu-item-description {
    display: block;
    font-size: var(--size-12);
    color: var(--c-grey-400, #9ca3af);
    margin-top: var(--size-2);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   Sticky Header
   ═══════════════════════════════════════════════════════════════ */
section.header-default.is-sticky {
    position: fixed;
    top: 0;
    padding: var(--size-12) 0;
    animation: headerSlideDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

section.header-default.is-sticky .header-default__bar {
    box-shadow: 0 var(--size-4) var(--size-30) rgba(17, 54, 68, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--c-white);
}

@keyframes headerSlideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Responsive – Smaller Desktops
   ═══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 1199px) {
    .header-default__bar {
        padding: var(--size-10) var(--size-28);
    }

    .header-default__menu {
        gap: var(--size-20);
    }

    .header-default__menu > li > a {
        font-size: var(--size-14);
    }

    .header-default__menu > li.nav-cta > a {
        font-size: var(--size-16);
    }
}

/* ═══════════════════════════════════════════════════════════════
   Mobile Header
   ═══════════════════════════════════════════════════════════════ */
section.header-mobile {
    display: none;
    padding: 12px 0;
    background: transparent;
    color: #000;
    position: relative;
    z-index: 9999;
}

/* ─── Floating Bar (mirrors desktop) ─── */
.mobile-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-white);
    border-radius: var(--size-8);
    padding: 10px 20px;
    box-shadow: 0 2px 19px 0 rgba(17, 54, 68, 0.16);
    position: relative;
    z-index: 9999;
}

.mobile-header-bar__logo {
    flex-shrink: 0;
}

.mobile-header-bar__logo a {
    display: flex;
    align-items: center;
}

.mobile-header-bar__logo img {
    display: block;
    height: var(--size-55) !important;
    width: auto;
}

.mobile-header-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── Mobile CTA ─── */
section.header-mobile .mobile-cta {
    display: inline-flex;
    align-items: center;
    background: var(--c-yellow-acid);
    color: var(--c-teal-dark-900);
    font-size: 13px;
    padding: 14px 25px;
    line-height: 1;
    border-radius: 10em;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.header-mobile .mobile-cta:hover {
    opacity: 0.9;
}

/* ─── Menu Toggle (text label + small icon) ─── */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.mobile-menu-toggle__icon svg {
    transform: scale(1.45);
}

/* Swap between hamburger and X SVGs */
.mobile-menu-toggle__icon .burger-close {
    display: none;
}

body.menu-active .mobile-menu-toggle__icon .burger-open {
    display: none;
}

body.menu-active .mobile-menu-toggle__icon .burger-close {
    display: block;
}


/* ─── Mobile Sticky ─── */
section.header-mobile.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    animation: mobileHeaderSlideDown 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    padding-top: var(--size-15) !important;
}

@keyframes mobileHeaderSlideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Mobile Breakpoint ─── */
@media screen and (max-width: 991px) {
    section.header-default {
        display: none;
    }

    section.header-mobile {
        display: block;
        position: absolute;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Mobile Menu Overlay
   ═══════════════════════════════════════════════════════════════ */
body.menu-active {
    overflow: hidden;
}

body.menu-active section.header-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

/* Backdrop */
.mobile-navigation {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0.4s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.menu-active .mobile-navigation {
    opacity: 1;
    visibility: visible;
}

/* Panel — drops below the floating bar */
.mobile-navigation__panel {
    padding: 0 12px;
}

.mobile-navigation__nav {
    list-style: none;
    margin: 0;
    background: var(--c-white);
    border-radius: .75rem;
    padding: 4px 20px 28px;
    margin-top: 60px;
    transform: translateY(-16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.menu-active .mobile-navigation__nav {
    transform: translateY(30px);
    opacity: 1 !important;
}

/* ─── Menu Items ─── */
.mobile-navigation__nav > li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-navigation__nav > li:last-child {
    border-bottom: none;
}

.mobile-navigation__nav > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    color: var(--c-teal-dark-900, #113644);
    padding: 15px 0;
    text-decoration: none;
    cursor: pointer;
}

.mobile-navigation__nav a:hover {
    text-decoration: none;
}

/* ─── Chevron for parent items ─── */
.mobile-navigation__nav .mobile-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-navigation__nav .mobile-chevron svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: var(--c-teal-dark-900, #113644);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-navigation__nav > li.submenu-open > a .mobile-chevron {
    transform: rotate(180deg);
}

/* ─── Submenus (accordion) ─── */
.mobile-navigation__nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
}

.mobile-navigation__nav > li.submenu-open > .sub-menu {
    max-height: 600px;
    opacity: 1;
    padding-bottom: 10px;
}

.mobile-navigation__nav .sub-menu li {
    margin: 0;
}

.mobile-navigation__nav .sub-menu > li > a {
    display: block;
    font-weight: 400;
    font-size: 15px;
    color: var(--c-grey-600, #6b7280);
    padding: 10px 0 10px 16px;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mobile-navigation__nav .sub-menu > li > a:hover {
    color: var(--c-teal-dark-900, #113644);
    border-left-color: var(--c-teal-dark-900, #113644);
}

/* Third-level items */
.mobile-navigation__nav .sub-menu .sub-menu {
    padding-left: 16px;
}

.mobile-navigation__nav .sub-menu .sub-menu > li > a {
    font-size: 14px;
    color: var(--c-grey-500, #9ca3af);
    padding: 8px 0 8px 16px;
}

/* ─── CTA item in mobile menu ─── */
.mobile-navigation__nav .make-request a {
    display: block;
    width: 100%;
    padding: 14px 20px;
    margin-top: 16px;
    background: #E1E61E;
    border: none;
    border-radius: 10px;
    text-align: center;
    color: var(--c-teal-dark-900, #003a49);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}

/* ─── Hide CTA li inside mobile nav (already in header bar) ─── */
.mobile-navigation__nav > li.nav-cta {
    display: none;
}

/* ─── Hide old arrow/back elements (replaced by chevron) ─── */
.mobile-navigation__nav .menu-arrow,
.mobile-navigation__nav .menu-arrow-down,
.mobile-navigation__nav .hide-submenu {
    display: none !important;
}
