/**
 * ==========================================================================
 * StabilityTest Theme - Header Styles
 * ==========================================================================
 *
 * Styles for the global site header.
 *
 * Responsibilities:
 *
 * - Header layout
 * - Site branding
 * - Logo styling
 * - Navigation styling
 * - Header spacing
 * - Header visual effects
 *
 * Keep all header-related styles isolated within this file.
 *
 * @package StabilityTest_Theme
 * @since 1.0.0
 * ==========================================================================
 */

.site-header,
.site-header * {
    box-sizing: border-box;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    width: 100%;
    overflow: visible;

    border-bottom: 1px solid var(--stabilitytest-border-light);

    background: rgba(9, 9, 15, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-header__inner {
    max-width: var(--stabilitytest-container-width);
    margin: 0 auto;
    padding: 22px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Branding */

.site-header__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-header__logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-header__logo {
    display: block;
    width: auto;
    height: 32px;
}

.site-header__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--stabilitytest-color-text);
    text-decoration: none;
}

/* Navigation */

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-header__nav ul {
    margin: 0;
    padding: 0;

    list-style: none;

    display: flex;
    align-items: center;
    gap: 22px;
}

.site-header__nav a {
    font-size: 0.95rem;
    color: var(--stabilitytest-color-text);
    text-decoration: none;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.site-header__nav a:hover {
    color: var(--stabilitytest-color-primary);
}

.site-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 16px;

    border: 1px solid var(--stabilitytest-border-medium);
    border-radius: var(--stabilitytest-radius-md);

    color: var(--stabilitytest-color-text);
    font-weight: 700;
}

.site-header__cta:hover {
    border-color: var(--stabilitytest-color-primary);
    color: var(--stabilitytest-color-primary);
}

/* Mobile Toggle */

.site-header__toggle {
    display: none;
}

.site-header__toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header__toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.site-header__toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Responsive */

@media (max-width: 768px) {

    .site-header__inner {
        position: relative;

        display: block;

        width: 100%;
        max-width: 100%;

        padding: 12px 20px;
    }

    .site-header__bar {
        width: 100%;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .site-header__logo {
        width: auto;
        height: 24px;
        max-width: 230px;
    }

    .site-header__toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;

        flex: 0 0 38px;

        width: 38px;
        height: 38px;

        padding: 0;
        margin: 0 0 0 auto;

        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .site-header__toggle span {
        display: block;

        width: 22px;
        height: 2px;

        border-radius: 999px;

        background: var(--stabilitytest-color-text);

        transition:
            transform 0.25s ease,
            opacity 0.2s ease;
    }

    .site-header__nav {
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        z-index: 1001;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;

        overflow: hidden;

        max-height: 0;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;

        padding: 0 20px;

        border: 1px solid var(--stabilitytest-border-light);
        border-radius: 0;

        background: rgba(9, 9, 15, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        transition:
            max-height 0.35s ease,
            opacity 0.25s ease 0.05s,
            visibility 0s linear 0.35s;
    }

    .site-header__nav.is-open {
        max-height: calc(100vh - 62px);
        height: calc(100vh - 62px);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        padding-top: 20px;
        padding-bottom: 20px;

        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            visibility 0s linear 0s;
    }

    .site-header__nav ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;

        padding: 0;

        opacity: 0;
        transition: opacity 0.2s ease 0.15s;
    }

    .site-header__nav.is-open ul,
    .site-header__nav.is-open .site-header__cta {
        opacity: 1;
    }

    .site-header__nav a {
        font-size: 1rem;
        font-weight: 500;
    }

    .site-header__cta {
        width: 100%;
        margin-top: 4px;
        opacity: 0;
    }
}