/* Navigation styles */
.menu-item {
    font-size: 1.25rem;
}
#site-header .current-menu-item {
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 5px !important;
}
/* WPML switcher styles */
.wpml-ls-statics-shortcode_actions {
    font-size: 1.25rem;
    font-family: 'Founders Grotesk', sans-serif;
    color: var(--wp--preset--color--blue);
}
.wpml-ls-item:not(.wpml-ls-current-language) {
    opacity: 0.5;
}
.wpml-ls-statics-shortcode_actions, 
.wpml-ls-statics-shortcode_actions * {
    padding: 0 !important;
    border: 0 !important;
}
.wpml-ls-statics-shortcode_actions ul {
    display: flex;
    gap: var(--zero-point-five-spacer);
}
.wpml-ls-statics-shortcode_actions ul li a {
    display: flex;
}
.wpml-ls-statics-shortcode_actions .wpml-ls-display {
    display: none;
}
/* —> Mobile solve for WPML switcher */
@media screen and (max-width: 781px) {
    #lang-switcher[data-mobile-visibility="false"] .wpml-ls-item:not(.wpml-ls-current-language) {
        display: none !important;
    }
    #lang-switcher ul {
        pointer-events: none;
        display: flex;
        flex-direction: column;
    }
    #lang-switcher[data-mobile-visibility="true"] ul li {
        pointer-events: all;
    }
}

/* Translate right-col. SVGs to account for Founders line-height offset */
svg#pw-globe,
svg#pw-search,
svg#pw-close {
    transform: translateY(-4px);
}

/* Page/post-specific styles to set gap between header and content — header already has 30px padding */
body.home #site-header {
    padding-bottom: var(--one-spacer);
}
body.page:not(.home) #site-header,
body.archive #site-header {
    padding-bottom: var(--four-spacer);
}
body.single-post #site-header {
    padding-bottom: var(--two-spacer);
}

#site-header #pw-logo-horizontal {
    width: 100%;
    height: fit-content;
}

 /* Color overrides for header when on single issue page */
 body.tax-issue {
    background-color: var(--wp--preset--color--cool-grey);
    #site-header {
        /* Logo */
        #pw-logo-horizontal {
            path {
                fill: var(--wp--preset--color--white) !important;
            }
            rect {
                stroke: var(--wp--preset--color--white) !important;
            }
        }
        /* Nav items */
        nav ul {
            color: var(--wp--preset--color--white) !important;
        }
        /* Search icon */
        #pw-search {
            path {
                fill: var(--wp--preset--color--white) !important;
            }
        }
        /* Globe icon */
        #pw-globe {
            circle, path, line {
                stroke: var(--wp--preset--color--white) !important;
            }
        }
        /* WPML toggle */
        .wpml-ls-statics-shortcode_actions {
            color: var(--wp--preset--color--white) !important;   
        }
        /* Menu button */
        #menu-toggle {
            color: var(--wp--preset--color--white) !important;   
        }
    }
 }

 /* Color overrides for header when on single post tagged with an 'Issue' */
 body:has(header.issue) {
    #site-header {
        /* Logo */
        #pw-logo-horizontal {
            path {
                fill: var(--wp--preset--color--black) !important;
            }
            rect {
                stroke: var(--wp--preset--color--black) !important;
            }
        }
        /* Nav items */
        nav ul {
            color: var(--wp--preset--color--black) !important;
        }
        /* Search icon */
        #pw-search {
            path {
                fill: var(--wp--preset--color--black) !important;
            }
        }
        /* Globe icon */
        #pw-globe {
            circle, path, line {
                stroke: var(--wp--preset--color--black) !important;
            }
        }
        /* WPML toggle */
        .wpml-ls-statics-shortcode_actions {
            color: var(--wp--preset--color--black) !important;   
        }
        /* Menu button */
        #menu-toggle {
            color: var(--wp--preset--color--black) !important;   
        }
    }
}

/* Newsletter colors */
body.tax-newsletter,
body:has(header.newsletter) {
    #site-header {
        background-color: var(--custom-background-color) !important;
        /* Logo */
        #pw-logo-horizontal {
            path {
                fill: var(--custom-text-color) !important;
            }
            rect {
                stroke: var(--custom-text-color) !important;
            }
        }
        /* Nav items */
        nav ul {
            color: var(--custom-text-color) !important;
        }
        /* Search icon */
        #pw-search {
            path {
                fill: var(--custom-text-color) !important;
            }
        }
        /* Globe icon */
        #pw-globe {
            circle, path, line {
                stroke: var(--custom-text-color) !important;
            }
        }
        /* WPML toggle */
        .wpml-ls-statics-shortcode_actions {
            color: var(--custom-text-color) !important;   
        }
        /* Menu button */
        #menu-toggle {
            color: var(--custom-text-color) !important;   
        }
    }
    main {
        background-color: var(--custom-background-color) !important;
        .has-red-color,
        .has-blue-color,
        * {
            color: var(--custom-text-color) !important;
        }
        svg {
            path {
                fill: var(--custom-text-color) !important;
            }
        }
    }
 }

 /* Search interaction */
 #search-container {
    #pw-close {
        display: none;
    }
    form {
        display: none;
    }
    &&.active {
        #pw-search {
            display: none;
        }
        #pw-close {
            display: block;
        }
        form {
            display: flex;
            gap: var(--one-spacer);
            /* Account for nudging of icons to match leading */
            transform: translateY(-2px);
            input[type="search"] {
                border-width: 0 0 1px 0 !important; 
                border-style: solid !important;
                border-color: currentColor !important;
                border-radius: 0 !important;
                padding: 0 !important;
                font-family: 'Founders Grotesk' !important;
                font-size: 1.25rem !important;
                max-width: 100px;
            }
            input[type="submit"] {
                border: 0 !important;
                padding: 0 !important;
                background: none !important;
                font-family: 'Founders Grotesk' !important;
                font-size: 1.25rem !important;
            }
        }
        ~ #lang-switcher {
            display: none !important;
        }
    }
 }