﻿/* ==============================================================
   MAIN NAVIGATION
   Umbraco 18
   ============================================================== */


/* ==============================================================
   RESET
   ============================================================== */

.main-navigation,
.main-navigation * {
    box-sizing: border-box;
}

.main-navigation {
    /*position: relative;*/
    z-index: 1000;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.nav-links li ul {
    list-style: none;
    margin: 0;
    padding: 0;
}


/* ==============================================================
   CSS-ONLY CHECKBOXES
   ============================================================== */

/*
    Hide the checkboxes visually but keep them available
    to the label controls.

    Do NOT use display:none here.

    Keeping the checkbox in the document is important for
    the CSS sibling selectors used by the mobile menu.
*/

.menu-toggle-checkbox,
.mega-toggle-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}


/* ==============================================================
   DESKTOP
   ============================================================== */


/* --------------------------------------------------------------
   Main navigation row
   -------------------------------------------------------------- */

.nav-links {
    display: flex;
    align-items: center;
}


/* Main first-level items */

ul.nav-links > li {
    padding: 25px 0 25px 50px;
}


/*
    Mega menu children must NOT establish their own
    positioning context.

    .main-navigation is the positioning context for
    the full-width mega menu.
*/

.has-mega-menu {
    position: static;
}


/*
    Normal dropdown DOES need its root item as
    positioning context.
*/

.has-normal-dropdown {
    position: relative;
}


/* --------------------------------------------------------------
   Main navigation links
   -------------------------------------------------------------- */

.nav-links > li > a,
.menu-drop-link .main-link {
    display: block;
    padding: 0 7px 0 0;
    font-family: "alwyn-new-web", sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 26px;
    color: #0A183E;
    text-decoration: none;
}

/* TAG-BUTTON */

.nav-links > li > a.tag-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    background: linear-gradient( to right, #17778e 0%, #59b6b6 100% );
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 26px;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 0px;
}



/* --------------------------------------------------------------
   Main link + arrow
   -------------------------------------------------------------- */

.menu-drop-link {
    display: flex;
    align-items: center;
}

.arrow-trigger {
    display: flex;
    align-items: center;
    padding: 0 0 3px 0;
    cursor: pointer;
}


/* --------------------------------------------------------------
   Hover appearance
   -------------------------------------------------------------- */

.nav-links > li:hover > a,
.nav-links > li:hover .menu-drop-link {
    color: #000;
    text-decoration: underline;
}

.nav-links > li:hover .main-link {
    color: #000;
    text-decoration: underline;
}

.nav-links > li.qp-last-menu-item:hover > a,
.nav-links > li > a.tag-button:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(23, 119, 142, 0.25);
    text-decoration: none;
}

/* ==============================================================
   ACCORDION / DROPDOWN ARROW
   ============================================================== */

.accordion-arrow {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    border-left: 0.1rem solid #0A183E;
    border-bottom: 0.1rem solid #0A183E;
    transform: rotate(-45deg);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


/*
    Desktop arrow points upwards while menu is open.
*/

.has-mega-menu:hover .accordion-arrow,
.has-normal-dropdown:hover .accordion-arrow {
    transform: rotate(135deg);
}


.has-mega-menu:hover .arrow-trigger,
.has-normal-dropdown:hover .arrow-trigger {
    padding: 5px 0 0 0;
}


/* ==============================================================
   NORMAL DESKTOP DROPDOWN
   ============================================================== */

.normal-dropdown {
    position: absolute;
    /*top: calc(100% - 10px);*/
    top: calc(100% - 0px);
    left: 50px;
    width: 220px;
    background-color: #F3F9F9;
    border-top: 1px solid #F3F9F9;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}


ul.normal-dropdown li {
    padding: 0;
}


.normal-dropdown li a {
    display: block;
    padding: 12px 20px 12px 18px;
    font-family: "aptos", sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 26px;
    color: #0A183E;
    text-decoration: none;
    transition: padding-left 0.2s ease, background-color 0.2s ease;
}


    .normal-dropdown li a:hover,
    .normal-dropdown li a:focus-visible {
        background-color: #f5f5f5;
        color: #0A183E;
        padding-left: 25px;
    }


/* Desktop dropdown visibility */

.has-normal-dropdown:hover .normal-dropdown,
.has-normal-dropdown:focus-within .normal-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ==============================================================
   DESKTOP MEGA MENU
   ============================================================== */

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    /*width: 100%;*/
    background-color: #F3F9F9;
    border-top: 1px solid #F3F9F9;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
    --section-margin: 16px;
    --section-radius: 10px;
    width: calc(100% - (var(--section-margin) * 2));
    margin-inline: var(--section-margin);
    border-radius: var(--section-radius);
}


/*
    Desktop mega menu is opened through hover
    or keyboard focus.
*/

.has-mega-menu:hover .mega-menu,
.has-mega-menu:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* --------------------------------------------------------------
   Mega menu content container
   -------------------------------------------------------------- */

.mega-menu-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}


/* --------------------------------------------------------------
   Mega menu columns
   -------------------------------------------------------------- */

.mega-column {
    flex: 1;
    min-width: 0;
}


.mega-column h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 5px;
    /*border-bottom: 2px solid #0A183E;*/
    font-family: "aptos", sans-serif;
    font-size: 23px;
    line-height: 26px;
    font-weight: 700;
    color: #000;
}


.mega-column h3 a {
    color: inherit;
    text-decoration: none;
}


.mega-column h3 a:hover,
.mega-column h3 a:focus-visible {
    text-decoration: underline;
}


/* --------------------------------------------------------------
   Mega menu column images
   -------------------------------------------------------------- */

.mega-column-image {
    width: 100%;
    margin: 0 0 18px 0;
    overflow: hidden;
}


    .mega-column-image a {
        display: block;
    }


    .mega-column-image img {
        display: block;
        width: 100%;
        height: 140px;
        object-fit: cover;
    }


/* --------------------------------------------------------------
   Mega menu links
   -------------------------------------------------------------- */

.mega-column ul li {
    padding: 0 0 8px;
}


.mega-column ul li a {
    display: block;
    /*padding: 0 0 8px*/;
    padding: 0;
    color: #000;
    font-family: "aptos", sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 26px;
    text-decoration: none;
    transition: padding-left 0.2s ease;
}


.mega-column ul li a:hover,
.mega-column ul li a:focus-visible {
    color: #0A183E;
    padding-left: 5px;
}


/* --------------------------------------------------------------
   Mega menu link bullet
   -------------------------------------------------------------- */

.sci-mega-link-container {
    display: flex;
    flex-direction: row;
    align-items: start;
}


.sci-mega-link-bullet {
    flex: 0 0 auto;
    padding: 4px 10px 0 0;
    color: #0A183E;
    font-size: 18px;
    line-height: 1;
}


.sci-mega-link {
    padding: 0;
}


/* ==============================================================
   OPTIONAL FEATURED / NEWSLETTER MODULE
   ============================================================== */

/*
    These styles remain so you can later add an Umbraco
    newsletter partial in the mega menu.

    All HubSpot-specific hsfc selectors have been removed.
*/

.featured-module {
    flex: 1.2;
    min-width: 0;
    background-color: #F3F9F9;
    overflow: hidden;
}


.featured-module h3,
h3.sci-newsletter-signup-header {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 5px;
    /*border-bottom: 2px solid #0A183E;*/
    color: #000;
    font-family: "aptos", sans-serif;
    font-weight: 700;
    font-size: 23px;
    line-height: 26px;
}


.featured-module p {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    color: #0A183E;
    font-family: "aptos", sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 20px;
}


/* ==============================================================
   MEGA MENU THIRD LEVEL
   ============================================================== */

.mega-third-level {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega-column .mega-third-level li {
    margin: 0;
    padding: 0;
}

.mega-column .mega-third-level-link {
    display: block;
    /*
        0.4rem arrow width + 10px right padding
        from .sci-mega-link-bullet.

        This makes the third-level text start at approximately
        the same position as the parent link text.
    */
    padding: 5px 0 5px calc(0.4rem + 20px);
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    line-height: 21px;
    font-weight: 400;
    color: #0A183E;
    text-decoration: none;
}

    .mega-column .mega-third-level-link:hover,
    .mega-column .mega-third-level-link:focus-visible {
        text-decoration: underline;
        /*
        Override the generic mega-column hover rule so these
        links do not move horizontally.
    */
        padding-left: calc(0.4rem + 30px);
    }


/* ==============================================================
   DROPDOWN / MEGA MENU INDICATOR TRIANGLE
   ============================================================== */

/*
    Small triangle between root link and the opened menu.
*/

.has-normal-dropdown:hover::after,
.has-mega-menu:hover::after {
    content: "";
    position: absolute;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #F3F9F9;
    z-index: 1001;
}


/*
    Normal dropdown triangle can be positioned relative
    to its parent.
*/

.has-normal-dropdown:hover::after {
    left: 50px;
    bottom: 0;
}


/*
    Mega menu root itself is position:static, so the triangle
    is less reliable to position against that element.

    We therefore hide the decorative triangle on the mega
    menu and let the border of the panel provide separation.
*/

.has-mega-menu:hover::after {
    display: none;
}


/* ==============================================================
   HAMBURGER
   Hidden on desktop
   ============================================================== */

.hamburger-btn {
    display: none;
}


/* ==============================================================
   MOBILE
   ============================================================== */

@media (max-width: 768px) {


    /* ----------------------------------------------------------
       Navigation container
       ---------------------------------------------------------- */

    .main-navigation {
        position: relative;
        width: 100%;
    }


    /* ----------------------------------------------------------
       Hamburger button
       ---------------------------------------------------------- */

    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 20px;
        margin-left: auto;
        cursor: pointer;
        position: relative;
        z-index: 1002;
    }


        .hamburger-btn .bar {
            display: block;
            width: 100%;
            height: 3px;
            background-color: #333333;
            border-radius: 3px;
            transform-origin: center;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
        }


    /* ----------------------------------------------------------
       Hamburger -> X animation
       ---------------------------------------------------------- */

    .menu-toggle-checkbox:checked ~ .hamburger-btn
    .top-bar {
        transform: translateY(8.5px) rotate(45deg);
    }


    .menu-toggle-checkbox:checked ~ .hamburger-btn
    .mid-bar {
        opacity: 0;
        transform: scaleX(0);
    }


    .menu-toggle-checkbox:checked ~ .hamburger-btn
    .bot-bar {
        transform: translateY(-8.5px) rotate(-45deg);
    }


    /* ----------------------------------------------------------
       Mobile main drawer
       ---------------------------------------------------------- */

    .nav-links {
        position: absolute;
        top: calc(100% + 15px);
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background-color: #ffffff;
        border-top: 1px solid #eeeeee;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }


    /*
        Hamburger checkbox opens main drawer.
    */

    .menu-toggle-checkbox:checked ~ .nav-links {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }


    /* ----------------------------------------------------------
       Root mobile menu items
       ---------------------------------------------------------- */

    ul.nav-links > li {
        width: 100%;
        padding: 0;
        position: relative;
    }


    .nav-links > li > a {
        display: block;
        width: 100%;
        padding: 18px 20px;
        border-bottom: 1px solid #f5f5f5;
    }


    /* ----------------------------------------------------------
       Mobile dropdown root link
       ---------------------------------------------------------- */

    .menu-drop-link {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
    }


        .menu-drop-link .main-link {
            display: flex;
            align-items: center;
            flex-grow: 1;
            padding: 18px 20px;
        }


    /* ----------------------------------------------------------
       Mobile arrow touch target
       ---------------------------------------------------------- */

    .arrow-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px 25px;
        border-left: 1px solid #f5f5f5;
        background-color: #fafafa;
        cursor: pointer;
    }


    .has-mega-menu:hover .arrow-trigger,
    .has-normal-dropdown:hover .arrow-trigger {
        padding: 18px 25px;
    }


    /* ----------------------------------------------------------
       Disable desktop hover arrow behaviour
       ---------------------------------------------------------- */

    .has-mega-menu:hover .accordion-arrow,
    .has-normal-dropdown:hover .accordion-arrow {
        transform: rotate(-45deg);
    }


    /*
        Remove decorative desktop dropdown triangles.
    */

    .has-normal-dropdown:hover::after,
    .has-mega-menu:hover::after {
        display: none;
    }


    /* ==========================================================
       MOBILE ACCORDIONS
       ========================================================== */

    .mega-menu,
    .normal-dropdown {
        position: static;
        width: 100%;
        background-color: #fcfcfc;
        border: none;
        box-shadow: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }


    /*
        Checkbox opens both mega menus and normal dropdowns.
    */

    .mega-toggle-checkbox:checked ~ .mega-menu,
    .mega-toggle-checkbox:checked ~ .normal-dropdown {
        max-height: 2000px;
    }


    /*
        Arrow default state.
    */

    .nav-links > li > .menu-drop-link
    .accordion-arrow {
        transform: rotate(-45deg);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }


    /*
        Arrow opened state.
    */

    .mega-toggle-checkbox:checked ~ .menu-drop-link
    .arrow-trigger
    .accordion-arrow {
        transform: rotate(135deg);
    }


    /* ==========================================================
       MOBILE NORMAL DROPDOWN
       ========================================================== */

    .mega-toggle-checkbox:checked ~ .normal-dropdown {
        padding: 10px 0;
    }


    .normal-dropdown li {
        padding: 0;
    }


        .normal-dropdown li a {
            display: block;
            padding: 12px 35px;
            border-bottom: none;
        }


            .normal-dropdown li a:hover,
            .normal-dropdown li a:focus-visible {
                padding-left: 40px;
            }


    /* ==========================================================
       MOBILE MEGA MENU
       ========================================================== */

    .mega-menu-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 20px;
        gap: 25px;
    }


    .mega-column {
        width: 100%;
    }


        .mega-column h3 {
            margin-top: 0;
            margin-bottom: 8px;
            font-family: "Source Sans 3", sans-serif;
            font-size: 24px;
            line-height: 30px;
            font-weight: 700;
        }


    .mega-column-image img {
        height: 160px;
    }


    /*
        No horizontal link movement on small screens.
    */

    .mega-column ul li a:hover,
    .mega-column ul li a:focus-visible {
        padding-left: 0;
    }


    /* ----------------------------------------------------------
       Optional newsletter module
       ---------------------------------------------------------- */

    .featured-module {
        display: flex;
        flex-direction: column;
        width: 100%;
        background-color: #fcfcfc;
    }


    /* ==========================================================
       MOBILE MAIN MENU ANIMATION
       ========================================================== */

    .nav-links > li {
        opacity: 0;
        transform: translateY(15px);
    }


    .menu-toggle-checkbox:checked ~ .nav-links > li {
        animation: linkFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }


    .nav-links > .nav-item-1 {
        animation-delay: 0.08s;
    }

    .nav-links > .nav-item-2 {
        animation-delay: 0.14s;
    }

    .nav-links > .nav-item-3 {
        animation-delay: 0.20s;
    }

    .nav-links > .nav-item-4 {
        animation-delay: 0.26s;
    }

    .nav-links > .nav-item-5 {
        animation-delay: 0.32s;
    }

    .nav-links > .nav-item-6 {
        animation-delay: 0.38s;
    }

    .nav-links > .nav-item-7 {
        animation-delay: 0.44s;
    }


    @keyframes linkFadeIn {

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}


/* ==============================================================
   SMALL MOBILE
   ============================================================== */

@media (max-width: 480px) {

    .mega-menu-content {
        padding: 18px 15px;
    }


    .mega-column h3 {
        font-size: 22px;
        line-height: 28px;
    }


    .mega-column-image img {
        height: 130px;
    }


    .nav-links > li > a,
    .menu-drop-link .main-link {
        font-size: 18px;
        line-height: 26px;
    }
}


/* ==============================================================
   ACCESSIBILITY
   ============================================================== */

.main-navigation a:focus-visible,
.main-navigation label:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}


/*
    Respect users who have disabled/reduced motion.
*/

@media (prefers-reduced-motion: reduce) {

    .main-navigation *,
    .main-navigation *::before,
    .main-navigation *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
