:root {
  --box-shadow: 0 12px 32px rgba(38, 49, 60, 0.1);
  --global-radius: 3px;
}

* {
    transition: all 0.3s ease-in-out;
}

/* Sticky Header Bug Fix */
header:has(>.is-position-sticky) {
	position: sticky;
	top: calc( 0px + var( --wp-admin--admin-bar--height, 0px ) );
	z-index: 100;
}

@media (max-width: 600px) {
	header:has(>.is-position-sticky) {
		top: 0;
	}
}

/* Header Styles */
.header-navigation li {
    &.current-menu-item > a {
        color: var(--wp--preset--color--custom-harbor-blue) !important;
    }

    > a:hover, > a:focus {
        color: var(--wp--preset--color--custom-harbor-blue) !important;
    }
}

/* Stats CTA */
.stats-cta {
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        left: 10px;
        top: 10px;
        width: calc(100% - 20px);
        height: calc(100% - 20px);
        border: 1px solid #c9b7af;
    }
    &::after {
        content: '';
        position: absolute;
        left: 20px;
        top: 20px;
        width: calc(100% - 40px);
        height: calc(100% - 40px);
        border: 1px solid #c9b7af;
    }

    .wp-block-column {
        position: relative;

        p {
            position: relative;
            z-index: 1;
        }

        &::before {
            content: '';
            position: absolute;
            background-color: #c9b7af;
        }

        @media (max-width: 781px) {
            &:not(:last-child) {
                &::before {
                    bottom: -10px;
                    left: 0;
                    right: 0;
                    width: 50%;
                    height: 1px;
                    margin: 0 auto;
                }
            }
        }
        @media (min-width: 781px) {
            &:not(:last-child) {
                &::before {
                    right: -10px;
                    top: 0;
                    bottom: 0;
                    width: 1px;
                    height: 80%;
                    margin: auto 0;
                }
            }
        }
    }
}

/* CTA Blocks */
.cta-block {
    &.vertical, &.horizontal {
        box-shadow: var(--box-shadow);
        border-radius: var(--global-radius);
        overflow: hidden;
    }
}

/* Medium Width Content */
.width-medium {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 645px) {
    /* Header Navigation */
    ul.header-navigation > li {
        > a {
            position: relative;

            &::before {
                content: '';
                position: absolute;
                bottom: 0;
                left: 50%;
                width: 0;
                height: 2px;
                transform: translate(-50%, 0);
                background-color: var(--wp--preset--color--custom-harbor-blue);
                transition: 0.3s ease-out;
            }

            &:hover::before, &:focus::before {
                width: calc(100% - 35px);
                margin: 0 auto;
            }
        }

        &.current-menu-ancestor > a {
            color: var(--wp--preset--color--custom-harbor-blue) !important;
        }

        &.current-menu-ancestor > a::before, 
        &.current-menu-item > a::before {
            width: calc(100% - 35px);
            margin: 0 auto;
        }
    }

    /* Header Navigation Submenu */
    .wp-block-navigation__submenu-container {
        box-shadow: var(--box-shadow);
        border-radius: var(--global-radius);
        overflow: hidden !important;

        > li {
            a {
                background-color: var(--wp--preset--color--custom-lace);
                color: var(--wp--preset--color--custom-harbor-blue) !important;
            }
            &.current-menu-item > a {
                color: var(--wp--preset--color--custom-lace) !important;
                background-color: var(--wp--preset--color--custom-slate-ink);
            }
            > a {
                &:hover, &:focus {
                    color: var(--wp--preset--color--custom-lace) !important;
                    background-color: var(--wp--preset--color--custom-slate-ink);
                }
            }
        }
    }
}

@media (max-width: 780px) {
    footer .wp-block-navigation__container {
        justify-content: left;
    }
}

/* Mobile overlay up to 644px (WordPress stops at 599px) */
@media (min-width: 600px) and (max-width: 644px) {
	.wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}