/**
 * Header Styles - Mobile First
 * Breakpoint: 1024px
 */

/* ============================================================================
   VARIABLES & RESET
   ============================================================================ */
:root {
    --header-height: 80px;
    --header-top-height: 40px;
    --header-bg: #ffffff;
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --text-color: #333333;
    --accent-color: #E31029;
    --transition: all 0.3s ease;
}

/* ============================================================================
   TOP HEADER (Optional)
   ============================================================================ */
.header-top {
    background: #f5f5f5;
    font-size: 14px;
    padding: 6px 0;
    height: 48px;
    transition: transform 0.3s ease;
}


.top-header-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.top-header-list a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.top-header-list a:hover {
    color: var(--accent-color);
}

/* Top header positioning */
.header-top.position-absolute {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-top.position-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.header-top.is-hidden,
.header-top.position-fixed.is-hidden {
    transform: translateY(-100%);
}

/* Initial position with absolute top header */
body.has-top-header:not(.has-fixed-top-header) .site-header {
    top: 48px;
    /* Adjust to your top header height */
}

/* Adjust main header when top header is fixed */
body.has-fixed-top-header .site-header {
    top: 40px;
    /* height of top header */
}

.header-top .th-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.th-zone--left,
.th-zone--center,
.th-zone--right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.th-zone--left {
    justify-self: start;
}

.th-zone--center {
    justify-self: center;
}

.th-zone--right {
    justify-self: end;
}

/* Buttons */
.th-btns {
    display: flex;
    gap: 0px;
    flex-wrap: wrap;
}

.th-btn {
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    display: inline-block;
    line-height: 150%;
}

.th-btn--primary {
    background: var(--accent-color);
    color: #fff;
}

.th-btn--secondary {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.th-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.th-btn:active {
    background: rgba(0, 0, 0, 0.10);
    color: #290B7A;
}


/* === SOCIALS === */
.th-socials {
  display:flex;
  gap:4px;
  list-style:none;
  margin:0;
  padding:0;
}

.th-socials__item {
  display:block;
  width:24px;
  height:24px;
  background-color: var(--btn-primary-bg);
  border-radius: 8px;
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
  transition: .1s ease-in-out;
}

.th-socials__item:hover {
    background-color: var(--btn-primary-bg-hover);
}

.th-socials__item a {
    display: flex
;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    justify-content: center;
    align-items: center;
}

.th-socials__icon {
    width:16px;
    /* we gebruiken nu background images via CSS */
}


/* === SEARCH === */
.th-search form {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.th-search input[type="search"] {
    border: none;
    padding: 6px 10px;
    font-size: 14px;
    flex: 1;
}

.th-search input[type="search"]:focus {
    outline: none;
}

.th-search input[type="submit"],
.th-search button {
    border: none;
    background: var(--accent-color);
    color: #fff;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.th-search input[type="submit"]:hover,
.th-search button:hover {
    background: #005a87;
}


/* Contact */
.th-contact {
    text-decoration: none;
    color: var(--text-color);
}

/* Skip link styling */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

/* Screen reader text */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles voor toetsenbordnavigatie */
button:focus,
a:focus {
    /* outline: 2px solid #005fcc; */
    /* outline-offset: 2px; */
}

/* Mobile/Desktop visibility */
@media (max-width: 1023px) {
    .header-top.desktop-only {
        display: none;
    }
}

@media (min-width: 1024px) {
    .header-top.mobile-only {
        display: none;
    }

    .header-top.position-absolute {
        display: flex;
        align-items: center;
    }

    .th-socials__item {
        width: 32px;
        height: 32px;
    }
    .th-socials__icon {
        width: 20px;
    }
}

/* ============================================================================
   MAIN HEADER
   ============================================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    z-index: 1000;
    transition: var(--transition);
}

/* Compensate for fixed header */
.site {
    padding-top: var(--header-height);
}

/* When top header exists */
body.has-top-header .site-header {
    top: 40px;
    /* Adjust based on top header height */
}

body.has-top-header .site {
    padding-top: calc(var(--header-height) + 40px);
}

/* Header inner container */
.site-header .inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* Top header scroll behavior */
.header-top.position-fixed {
    transition: transform 0.3s ease;
}

.header-top.position-fixed.is-hidden {
    transform: translateY(-100%);
}

/* When fixed top header exists, offset the hide animation */
body.has-fixed-top-header .site-header.is-hidden {
    transform: translateY(calc(-100% - 40px));
    /* 40px = top header height */
}


/* ============================================================================
   LOGO
   ============================================================================ */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
    height: 48px;
}

.site-logo svg {
    display: block;
    height: 100%;
    width: auto;
}

.site-logo img {
    height: 50px;
    width: auto;
    display: block;
}

/* ============================================================================
   DESKTOP NAVIGATION (Hidden on mobile)
   ============================================================================ */
.desktop-navigation {
    display: none;
}

.cta-btn {
    display: inline-block;
    padding: 12px 16px;
    background: var(--btn-primary-bg);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    color: var(--font-light);
    font-size: 1rem;
    font-style: normal;
    font-weight: 700;
    line-height: 150%; /* 24px */
    min-height: 48px;
    display: flex;
    align-items: center;
    align-content: center;

}

.cta-btn:hover {
    background: var(--btn-primary-bg-hover);
}

.cta-btn:active {
    background: var(--btn-primary-bg-active);
}

.header-cta-buttons.desktop-only {
    display: none;
}

.cta-btn--secondary {
    background: transparent !important;
    color: var(--accent-color) !important;
    border: 2px solid var(--accent-color);
}

.cta-btn--secondary:hover {
    background: var(--accent-color) !important;
    color: white !important;
}

/* ============================================================================
   MOBILE MENU TOGGLE
   ============================================================================ */
.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1100;
}

.hamburger {
    width: 24px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
    transform-origin: center;
}

/* Hamburger to X animation */
.mobile-menu-toggle.is-active .hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.is-active .hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Screen reader text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================================
   HEADER SCROLL STATES
   ============================================================================ */
.site-header.is-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

/* ============================================================================
   DESKTOP STYLES (1024px and up)
   ============================================================================ */
@media (min-width: 1024px) {

    /* Show desktop navigation */
    .desktop-navigation {
        display: block;
        flex: 1;
        margin: 0 40px;
    }

    /* Desktop menu styles */
    .nav-menu {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
        gap: 30px;
    }

    .nav-menu li {
        position: relative;
    }

    .nav-menu a {
        color: var(--text-color);
        text-decoration: none;
        padding: 10px 0;
        display: inline-block;
        transition: var(--transition);
        position: relative;
    }

    /* Hover effect with underline
    .nav-menu>li>a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--accent-color);
        transition: width 0.3s ease;
    } */

    .nav-menu>li>a:hover::after,
    .nav-menu>li.current-menu-item>a::after {
        width: 100%;
    }

    /* Dropdown indicator */
    


    /* Submenu styles */
    .nav-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        min-width: 220px;
        list-style: none;
        margin: 0;
        padding: 10px 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        border-radius: 4px;
    }

    .nav-menu li:hover>.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .sub-menu li {
        padding: 0;
    }

    .sub-menu a {
        padding: 10px 20px;
        display: block;
        color: var(--text-color);
        transition: var(--transition);
    }

    .sub-menu a:hover {
        background: #f5f5f5;
        color: var(--accent-color);
    }

    /* Third level menu */
    .sub-menu .sub-menu {
        left: 100%;
        top: 0;
        margin-left: 0;
    }

    /* Show CTA button */
    .header-cta-buttons.desktop-only {
        display: flex;
        gap: 15px;
    }

    /* Hide mobile toggle */
    .mobile-menu-toggle {
        display: none;
    }

    /* Mega menu support (optional) */
    .nav-menu .mega-menu {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        max-width: 1200px;
        padding: 30px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
    }

    /* Top header adjustments */
    .top-header-list {
        justify-content: flex-end;
    }
}

/* Navbar buttons styling */
.nav-menu .btn a,
.mobile-nav-menu .btn a {
    background: var(--accent-color);
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 4px;
    margin: 0 5px;
}

.nav-menu .btn a:hover {
    background: #005a87;
}

/* Desktop: buttons rechts uitlijnen */
@media (min-width: 1024px) {
    .nav-menu {
        justify-content: center;
    }

    .nav-menu .btn {
        margin-left: auto;
    }

    .nav-menu .btn+.btn {
        margin-left: 10px;
    }
}

/* Mobile: buttons onderaan */
.mobile-nav-menu .btn {
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
    padding-top: 20px;
}


/* ============================================================================
   DESKTOP NAV + MEGA MENU (één schoon blok)
   ============================================================================ */
@media (min-width:1024px) {

    /* --- Basis desktop menu --- */
    .desktop-navigation {
        display: block;
        flex: 1;
        margin: 0 32px;
    }

    .nav-menu {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
        gap: 32px;
        justify-content: flex-end;
    }

    .nav-menu>li {
        position: relative;
    }

    .nav-menu>li>a {
        text-decoration: none;
        display: inline-block;
        position: relative;
        color: var(--link-primary);
        /* Text/Regular/Bold */
        font-family: Roboto;
        font-size: 1rem;
        font-style: normal;
        font-weight: 700;
        line-height: 150%; /* 24px */
    }

    /* underline effect top-level */
    /* .nav-menu>li>a::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 0;
        height: 2px;
        background: var(--accent-color);
        transition: width .3s ease; */
    }

    .nav-menu>li>a:hover::after,
    .nav-menu>li.current-menu-item>a::after {
        width: 100%;
    }

  

    .nav-menu>li:not(.has-mega).menu-item-has-children:hover>a::before {
        transform: rotateX(180deg);
        top: 9px;
    }

    /* --- NORMALE DROPDOWNS (gescoped, zodat mega niet geraakt wordt) --- */
    .nav-menu>li:not(.has-mega)>.sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        margin: 0;
        padding: 10px 0;
        list-style: none;
        border-radius: 4px;
        background: #fff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all .3s ease;
    }

    .nav-menu>li:not(.has-mega):hover>.sub-menu,
    .nav-menu>li:not(.has-mega):focus-within>.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu>li:not(.has-mega)>.sub-menu li {
        position: relative;
    }

    .nav-menu>li:not(.has-mega)>.sub-menu a {
        display: block;
        padding: 10px 20px;
        color: var(--text-color);
        text-decoration: none;
        transition: var(--transition);
    }

    .nav-menu>li:not(.has-mega)>.sub-menu a:hover {
        background: #f5f5f5;
        color: var(--accent-color);
    }

    .nav-menu>li:not(.has-mega)>.sub-menu .sub-menu {
        position: absolute;
        top: 0;
        left: 100%;
        margin: 0;
        padding: 10px 0;
        min-width: 220px;
        background: #fff;
        border-radius: 4px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all .3s ease;
    }

    .nav-menu>li:not(.has-mega)>.sub-menu li:hover>.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* --- MEGA MENU --- */
    .nav-menu>li.has-mega {
        position: unset;
    }

    /* paneel (gesloten staat) */
    .nav-menu>li.has-mega>.mega-menu__inner {
        position: absolute;
        left: 0;
        top: calc(100% - 14px);
        width: 100%;
        max-width: unset;
        /* kan inline overschreven worden via ACF */
        padding: 24px;
        background: #fff;        
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
        z-index: 1000;
        pointer-events: none;
        /* vang niets als paneel dicht is */
    }

    .nav-menu>li.has-mega>.mega-menu__inner::before{
        content: "";
        width: 200vw;
        background-color: white;
        position: absolute;
        left: -100%;
        box-shadow: 0px 20px 15px rgb(0 0 0 / 10%);
        height: 100%;
        top: 0;
        transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    }

    /* open states */
    .nav-menu>li.has-mega:hover>.mega-menu__inner,
    .nav-menu>li.has-mega.is-hovering>.mega-menu__inner,
    .nav-menu>li.has-mega:focus-within>.mega-menu__inner {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* grid (UL direct in mega-menu__inner) */
    .nav-menu>li.has-mega>.mega-menu__inner>.mega-menu {
        display: grid;
        gap: 24px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mega-menu[data-mega-cols="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mega-menu[data-mega-cols="3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mega-menu[data-mega-cols="4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mega-menu[data-mega-cols="5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    /* kolom header */
    .mega-col__header {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 8px;
    }

    .mega-col__icon {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .mega-col__title {
        font-weight: 700;
        margin: 0 0 6px 0;
    }

    .mega-col__desc {
        font-size: 14px;
        color: #666;
        margin-top: 4px;
    }

    .mega-col__header a {
        text-decoration: none;
        padding: 0;
    }

    /* zorg dat alle submenus binnen mega altijd zichtbaar/statisch zijn */
    .nav-menu>li.has-mega>.mega-menu__inner>.mega-menu,
    .nav-menu>li.has-mega .mega-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        margin: 0;
        padding: 0;
    }

    .nav-menu>li.has-mega .mega-menu .sub-menu>li>a {
        display: block;
        padding: 8px 0;
        color: var(--text-color);
        text-decoration: none;
    }

    .nav-menu>li.has-mega .mega-menu .sub-menu>li>a:hover {
        color: var(--accent-color);
    }

    /* custom content blok in kolom */
    .mega-col__custom :where(p, ul, ol) {
        margin: 0 0 10px 0;
    }

    @media (min-width:1024px) {
        a.mega-col__title {
            font-weight: 700;
            margin: 0 0 6px 0;
            display: inline-block;
            color: var(--text-color);
            text-decoration: none;
        }

        a.mega-col__title:hover {
            color: var(--accent-color);
        }
    }

}