/* ==========================================================
   NAVIGATION
   Ebbeløkke Strand
   Version: 1.1.0
========================================================== */


/* ==========================================================
   MAIN HEADER
========================================================== */

.c-header {
    position: relative;
    z-index: 100;

    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #e5e5e5;

    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
}


/* ==========================================================
   NAVIGATION CONTAINER
========================================================== */

.c-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 88px;

    padding: 10px 0;
}


/* ==========================================================
   LOGO
========================================================== */

.c-nav__brand {
    display: flex;
    align-items: center;

    flex: 0 0 auto;

    min-height: 68px;
}

.c-nav__brand a {
    display: flex;
    align-items: center;

    text-decoration: none;
}

.site-logo-mark {
    display: block;

    width: 72px;
    height: 72px;

    max-width: 72px;
    max-height: 72px;

    object-fit: contain;
}


/* ==========================================================
   PRIMARY NAVIGATION — DESKTOP
========================================================== */

.c-nav__menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex: 1;

    margin-left: 50px;
}


/* WordPress menu list */

.c-nav__list {
    display: flex;
    align-items: center;

    margin: 0;
    padding: 0;

    list-style: none;
}


/* Individual menu item */

.c-nav__list > li {
    position: relative;

    margin: 0;
    padding: 0;
}


/* Divider between menu items */

.c-nav__list > li + li {
    border-left: 1px solid #d7dde2;
}


/* Actual WordPress menu links */

.c-nav__list > li > a {
    display: flex;
    align-items: center;

    min-height: 42px;

    padding: 0 14px;

    color: #173b5c;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 14px;
    font-weight: 500;

    line-height: 1.2;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}


/* Hover */

.c-nav__list > li > a:hover {
    color: #0b6fa4;

    background-color: #f5f7f8;
}


/* Active menu item */

.c-nav__list > li.current-menu-item > a,
.c-nav__list > li.current-menu-ancestor > a {
    color: #0b6fa4;

    background-color: #f5f7f8;
}


/* ==========================================================
   DESKTOP DROPDOWN
========================================================== */

.c-nav__list .sub-menu {
    position: absolute;

    top: 100%;
    left: 0;

    z-index: 1000;

    min-width: 210px;

    margin: 0;
    padding: 8px 0;

    background: #ffffff;

    border: 1px solid #e4e4e4;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);

    list-style: none;

    opacity: 0;
    visibility: hidden;

    transform: translateY(5px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}


.c-nav__list .menu-item-has-children:hover > .sub-menu,
.c-nav__list .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


.c-nav__list .sub-menu a {
    display: block;

    padding: 11px 18px;

    color: #173b5c;

    font-size: 13px;

    line-height: 1.4;

    text-decoration: none;
}


.c-nav__list .sub-menu a:hover {
    background: #f5f7f8;

    color: #0b6fa4;
}


/* ==========================================================
   MOBILE MENU TOGGLE
   Hidden on desktop/tablet.
========================================================== */

.c-mobile-menu-toggle {
    display: none;

    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #173b5c;

    cursor: pointer;

    flex: 0 0 auto;
}


/* Hamburger icon */

.c-mobile-menu-toggle__icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    width: 24px;
    height: 24px;
}


.c-mobile-menu-toggle__icon span {
    display: block;

    width: 24px;
    height: 2px;

    background: currentColor;

    border-radius: 1px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* Hamburger → X when menu is open */

.c-mobile-menu-open .c-mobile-menu-toggle__icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.c-mobile-menu-open .c-mobile-menu-toggle__icon span:nth-child(2) {
    opacity: 0;
}

.c-mobile-menu-open .c-mobile-menu-toggle__icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* Keyboard focus */

.c-mobile-menu-toggle:focus-visible {
    outline: 2px solid #0b6fa4;

    outline-offset: 3px;
}


/* ==========================================================
   MOBILE MENU
   Hidden by default.
========================================================== */

.c-mobile-menu {
    display: none;

    width: 100%;

    background: #ffffff;

    border-top: 1px solid #e5e5e5;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);
}


/* Mobile menu is visible when JS adds the body class */

.c-mobile-menu-open .c-mobile-menu {
    display: block;
}


/* Mobile menu navigation */

.c-mobile-menu__nav {
    width: 100%;
}


/* Mobile menu list */

.c-mobile-menu__list {
    display: block;

    margin: 0;
    padding: 8px 0 16px;

    list-style: none;
}


/* Mobile menu items */

.c-mobile-menu__list li {
    display: block;

    margin: 0;
    padding: 0;

    border: 0;
}


/* Mobile menu links */

.c-mobile-menu__list > li > a {
    display: block;

    padding: 13px 18px;

    color: #173b5c;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 16px;
    font-weight: 500;

    line-height: 1.4;

    text-decoration: none;

    border-bottom: 1px solid #e5e5e5;
}


/* Mobile menu hover/focus */

.c-mobile-menu__list > li > a:hover,
.c-mobile-menu__list > li > a:focus {
    color: #0b6fa4;

    background-color: #f5f7f8;
}


/* Active mobile menu item */

.c-mobile-menu__list > li.current-menu-item > a,
.c-mobile-menu__list > li.current-menu-ancestor > a {
    color: #0b6fa4;

    background-color: #f5f7f8;
}


/* Mobile submenu */

.c-mobile-menu__list .sub-menu {
    display: block;

    margin: 0;
    padding: 0;

    list-style: none;

    background: #fafbfc;
}


/* Mobile submenu links */

.c-mobile-menu__list .sub-menu a {
    display: block;

    padding: 11px 18px 11px 36px;

    color: #173b5c;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 15px;

    line-height: 1.4;

    text-decoration: none;

    border-bottom: 1px solid #e5e5e5;
}


.c-mobile-menu__list .sub-menu a:hover,
.c-mobile-menu__list .sub-menu a:focus {
    color: #0b6fa4;

    background-color: #f5f7f8;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 900px) {

    .c-nav {
        min-height: 78px;
    }

    .site-logo-mark {
        width: 64px;
        height: 64px;

        max-width: 64px;
        max-height: 64px;
    }

    .c-nav__menu {
        margin-left: 25px;
    }

    .c-nav__list > li > a {
        padding: 0 9px;

        font-size: 12px;
    }

}


/* ==========================================================
   MOBILE / SMALL TABLET
========================================================== */

@media (max-width: 700px) {

    .c-nav {
        min-height: 72px;

        padding: 7px 0;
    }


    /* Hide desktop navigation */

    .c-nav__menu {
        display: none;
    }


    /* Show mobile hamburger */

    .c-mobile-menu-toggle {
        display: flex;
    }


    /* Mobile logo */

    .site-logo-mark {
        width: 58px;
        height: 58px;

        max-width: 58px;
        max-height: 58px;
    }


    /* Keep mobile header compact */

    .c-nav__brand {
        min-height: 58px;
    }

}


/* ==========================================================
   ACCESSIBILITY
========================================================== */

.c-nav__list > li > a:focus-visible,
.c-mobile-menu__list a:focus-visible {
    outline: 2px solid #0b6fa4;

    outline-offset: 3px;
}


/* ==========================================================
   PREVENT PAGE SCROLL WHEN MOBILE MENU IS OPEN
========================================================== */

body.c-mobile-menu-open {
    overflow: hidden;
}