/* ============================================
   GWS NAVIGATION - DESKTOP
   ============================================ */

#gws-navigation {
    z-index: 10000;
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    border-radius: 1.5rem;
    background-color: #fff;
    height: 6rem;
    max-width: 90rem;
    width: 94%;
    box-sizing: border-box;
    transition: top 0.3s, border-radius 0.3s, width 0.3s, max-width 0.3s, background-color 0.3s;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

body.scroll #gws-navigation {
    top: 0;
    border-radius: 0;
    max-width: 100%;
    width: 100%;
}

.gws-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: auto;
    max-width: 90rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0 2rem;
    gap: 1.5rem;
}

/* Logo */
.gws-logo {
    display: flex;
    align-items: center;
    margin: 0 auto 0 0;
    height: 3rem;
    max-width: 12rem;
    width: auto;
    text-decoration: none;
}

.gws-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* ============================================
   NAV MENU
   ============================================ */

.gws-ul-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    height: 100%;
}

.gws-ul-wrapper > ul {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    height: 100%;
    width: 100%;
    padding: 0;
    list-style: none;
    gap: 16px;
}

.gws-ul-wrapper > ul > li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
    list-style: none;
}

.gws-ul-wrapper > ul > li.menu-item-has-children {
    align-items: center;
}

.gws-ul-wrapper > ul > li > a {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    transition: color 0.3s;
    white-space: nowrap;
}

.gws-ul-wrapper > ul > li > a:hover {
    color: #2ecc71;
}

/* Active page highlight */
.gws-ul-wrapper > ul > li.current-menu-item > a,
.gws-ul-wrapper > ul > li.current-menu-ancestor > a {
    color: #2ecc71;
}

/* ============================================
   DROPDOWN MENUS - DESKTOP
   ============================================ */

.gws-ul-wrapper > ul > li > ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 16rem;
    padding: 0;
    margin: 0;
    list-style: none;
    border-bottom: 3px solid #2ecc71;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    z-index: 9999;
}

.gws-ul-wrapper > ul > li:hover > ul.sub-menu {
    display: block;
}

.gws-ul-wrapper > ul > li > ul.sub-menu > li {
    display: block;
    width: 100%;
    height: auto;
    background-color: #ffffff;
    padding: 0;
    margin: 0;
    list-style: none;
}

.gws-ul-wrapper > ul > li > ul.sub-menu > li > a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background-color: #ffffff;
    transition: color 0.3s, background-color 0.3s;
}

.gws-ul-wrapper > ul > li > ul.sub-menu > li > a:hover {
    background-color: #f7f7f7;
    color: #2ecc71;
}

/* ============================================
   RIGHT SIDE GROUP
   ============================================ */

.gws-contact-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex: none;
}

/* Dark Mode Toggle - Desktop */
#gws-dark-mode-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    height: 3rem;
    width: 3rem;
    cursor: pointer;
    padding: 0;
    flex: none;
}

#gws-dark-mode-toggle img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 1.25rem;
    width: 1.25rem;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.gws-sun {
    opacity: 0;
}

/* Mobile controls - hidden on desktop */
.gws-mobile-controls {
    display: none;
}

/* Hamburger - hidden on desktop */
.gws-toggle {
    display: none;
}

/* Mobile nav panel - hidden on desktop */
#gws-mobile-nav {
    display: none;
}

/* ============================================
   DARK MODE - DESKTOP
   ============================================ */

body.dark-mode #gws-navigation {
    background-color: #030f18;
}

body.dark-mode .gws-ul-wrapper > ul > li > a {
    color: #ffffff;
}

body.dark-mode .gws-ul-wrapper > ul > li.current-menu-item > a,
body.dark-mode .gws-ul-wrapper > ul > li.current-menu-ancestor > a {
    color: #2ecc71;
}

body.dark-mode .gws-ul-wrapper > ul > li.menu-item-has-children > a::after {
    filter: invert(1);
}

body.dark-mode #gws-navigation .gws-btn-about {
    background-color: #ffffff;
    color: #0A1F0F;
}

body.dark-mode #gws-navigation .gws-btn-about:hover {
    color: #0A1F0F;
}

body.dark-mode .gws-ul-wrapper > ul > li > ul.sub-menu {
    background-color: #2c394b;
}

body.dark-mode .gws-ul-wrapper > ul > li > ul.sub-menu > li {
    background-color: #2c394b;
}

body.dark-mode .gws-ul-wrapper > ul > li > ul.sub-menu > li > a {
    color: #ffffff;
    background-color: #2c394b;
}

body.dark-mode .gws-ul-wrapper > ul > li > ul.sub-menu > li > a:hover {
    background-color: #030f18;
    color: #2ecc71;
}

body.dark-mode #gws-dark-mode-toggle .gws-moon {
    opacity: 0;
    transform: translate(-50%, -150%);
}

body.dark-mode #gws-dark-mode-toggle .gws-sun {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* ============================================
   MOBILE - max-width 1023px
   ============================================ */

@media only screen and (max-width: 1023px) {

    /* Pill stays fixed height always */
    #gws-navigation {
        top: 1rem;
        height: 5rem;
        min-height: 5rem;
        padding: 0 1rem;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: 94%;
        max-width: 90rem;
        border-radius: 1.5rem;
        flex-wrap: nowrap;
        align-items: center;
        box-sizing: border-box;
        overflow: visible;
    }

    body.scroll #gws-navigation {
        top: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Pill goes square at bottom when menu open */
    #gws-navigation.gws-active {
        border-radius: 1.5rem 1.5rem 0 0;
    }

    body.scroll #gws-navigation.gws-active {
        border-radius: 0;
    }

    .gws-container {
        padding: 0;
        flex-wrap: nowrap;
        height: 5rem;
        align-items: center;
        width: 100%;
        position: relative;
    }

    /* Hide desktop nav and CTA */
    .gws-ul-wrapper {
        display: none;
    }

    .gws-contact-group {
        display: none;
    }

    /* Mobile controls row */
    .gws-mobile-controls {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: none;
        margin-left: auto;
    }

    /* Mobile dark mode toggle */
    #gws-dark-mode-toggle-mobile {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        outline: none;
        box-shadow: none;
        background: transparent;
        height: 3rem;
        width: 3rem;
        cursor: pointer;
        padding: 0;
        flex: none;
    }

    #gws-dark-mode-toggle-mobile img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 1.25rem;
        width: 1.25rem;
        pointer-events: none;
        transition: opacity 0.3s, transform 0.3s;
    }

    #gws-dark-mode-toggle-mobile .gws-sun {
        opacity: 0;
    }

    body.dark-mode #gws-dark-mode-toggle-mobile .gws-moon {
        opacity: 0;
        transform: translate(-50%, -150%);
    }

    body.dark-mode #gws-dark-mode-toggle-mobile .gws-sun {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    /* Hamburger button */
    .gws-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        border: none;
        border-radius: 0.5rem;
        background-color: #1a1a1a;
        height: 3rem;
        width: 3rem;
        cursor: pointer;
        flex: none;
        transition: transform 0.4s ease;
    }

    /* Hamburger flip animation */
    #gws-navigation.gws-active .gws-toggle {
        transform: rotate(180deg);
    }

    .gws-box {
        position: relative;
        height: 1rem;
        width: 1.5rem;
    }

    .gws-line {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 2px;
        background-color: #fff;
        height: 2px;
        width: 100%;
        transition: transform 0.4s, top 0.3s, opacity 0.3s;
    }

    .gws-line1 { top: 0; }
    .gws-line2 { top: 50%; transform: translateX(-50%) translateY(-50%); }
    .gws-line3 { bottom: 0; }

    /* Hamburger to X */
    #gws-navigation.gws-active .gws-line1 {
        top: 50%;
        transform: translateX(-50%) rotate(45deg);
    }

    #gws-navigation.gws-active .gws-line2 {
        opacity: 0;
    }

    #gws-navigation.gws-active .gws-line3 {
        bottom: auto;
        top: 50%;
        transform: translateX(-50%) rotate(-45deg);
    }

    /* ============================================
       MOBILE NAV PANEL - drops from bottom of pill
       ============================================ */

    #gws-mobile-nav {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        transform: scaleY(0);
        transform-origin: top;
        width: 100%;
        background-color: #ffffff;
        border-radius: 0 0 1.5rem 1.5rem;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
        z-index: 9998;
        box-sizing: border-box;
        overflow: hidden;
        padding: 1.5rem 1rem 2rem 1rem;
        transition: transform 0.4s ease;
        max-height: 95vh;
        height: auto;
    }

    #gws-mobile-nav.gws-active {
        transform: scaleY(1);
    }

    body.dark-mode #gws-mobile-nav {
        background-color: #030f18;
    }

    /* Mobile nav list */
    #gws-mobile-nav .gws-mobile-ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #gws-mobile-nav .gws-mobile-ul > li {
        display: block;
        width: 100%;
        text-align: center;
        list-style: none;
    }

    #gws-mobile-nav .gws-mobile-ul > li > a {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
        text-decoration: none;
        text-transform: uppercase;
        font-family: 'Oswald', Arial, sans-serif;
        font-size: 1.1rem;
        font-weight: 600;
        color: #1a1a1a;
        transition: color 0.3s;
    }

    #gws-mobile-nav .gws-mobile-ul > li > a:hover {
        color: #2ecc71;
    }

    #gws-mobile-nav .gws-mobile-ul > li.current-menu-item > a,
    #gws-mobile-nav .gws-mobile-ul > li.current-menu-ancestor > a {
        color: #2ecc71;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li > a {
        color: #ffffff;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li > a:hover {
        color: #2ecc71;
    }

    /* Chevron on mobile dropdown parents */
    #gws-mobile-nav .gws-mobile-ul > li.menu-item-has-children > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #gws-mobile-nav .gws-mobile-ul > li.menu-item-has-children > a::after {
        content: "" !important;
        display: inline-flex !important;
        flex-shrink: 0 !important;
        background-image: url('/wp-content/themes/newspaper-child/images/down.svg') !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        height: 1rem !important;
        width: 1rem !important;
        margin-left: 0.35rem !important;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li.menu-item-has-children > a::after {
        filter: invert(1) !important;
    }

    /* Mobile sub-menus */
    #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        visibility: hidden;
        opacity: 0;
        height: 0;
        overflow: hidden;
        width: 90%;
        margin: 0 auto;
        border-top: 2px solid #2ecc71;
        border-radius: 0.5rem;
        background-color: #f0f0f0;
        padding: 0;
        list-style: none;
        transition: opacity 0.3s, height 0.3s, visibility 0.3s, padding 0.3s;
        gap: 0.25rem;
        text-align: center;
    }

    #gws-mobile-nav .gws-mobile-ul > li.gws-dropdown-active > ul.sub-menu {
        visibility: visible;
        opacity: 1;
        height: auto;
        padding: 0.75rem 0;
        margin: 0.5rem auto 0;
    }

    #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu > li {
        display: block;
        width: 100%;
        background-color: transparent;
        list-style: none;
        text-align: center;
    }

    #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu > li > a {
        display: block;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        color: #1a1a1a;
        background-color: transparent;
        text-decoration: none;
        text-transform: uppercase;
        font-family: 'Oswald', Arial, sans-serif;
        font-weight: 600;
        width: 100%;
        box-sizing: border-box;
        transition: color 0.3s;
    }

    #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu > li > a:hover {
        color: #2ecc71;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu {
        background-color: #2c394b;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu > li > a {
        color: #ffffff;
    }

    body.dark-mode #gws-mobile-nav .gws-mobile-ul > li > ul.sub-menu > li > a:hover {
        color: #2ecc71;
    }
}