/* Canonical Smallnm header. Matches the homepage navigation across all pages. */
*, *::before, *::after {
    box-sizing: border-box;
}

body > .site-header,
body > #masthead,
body > .main-header-bar-wrap,
body > .ast-mobile-header-wrap,
body > #mobile-nav-drawer,
body > .mobile-nav-drawer,
.site-header,
#masthead,
#mobile-nav-drawer,
.mobile-nav-drawer {
    display: none !important;
}

.snm-header + #page > header,
#page > header:not(.snm-header) {
    display: none !important;
}

.snm-header ~ .snm-header {
    display: none !important;
}

.snm-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.snm-header .ac,
.snm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.snm-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.snm-logo {
    flex-shrink: 0;
    color: #1d4ed8;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.snm-logo:hover,
.snm-logo:focus {
    color: #1e3a8a;
}

.snm-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.snm-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 6px;
    color: #374151;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

.snm-nav-link:hover,
.snm-nav-link:focus {
    color: #1d4ed8;
    background: #f9fafb;
}

.snm-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.snm-search-toggle,
.snm-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    background: none;
    border: 0;
    color: #4b5563;
    cursor: pointer;
}

.snm-search-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: color .15s ease, background-color .15s ease;
}

.snm-search-toggle:hover,
.snm-search-toggle:focus {
    color: #1d4ed8;
    background: #f9fafb;
}

.snm-search-form {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    width: 0;
    overflow: hidden;
    padding: 0;
    background: #f9fafb;
    border: 1px solid transparent;
    border-radius: 8px;
    transform: translateY(-50%);
    transition: width .25s ease, border-color .25s ease, padding .25s ease;
}

.snm-search-open .snm-search-form {
    width: 300px;
    padding: 0 8px 0 14px;
    border-color: #e5e7eb;
}

.snm-search-input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1f2937;
    font-size: .875rem;
}

.snm-search-input::placeholder {
    color: #4b5563;
}

.snm-search-submit {
    width: 32px;
    height: 40px;
    color: #1d4ed8;
}

.snm-search-submit:hover,
.snm-search-submit:focus {
    color: #1e3a8a;
}

.snm-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
}

.snm-mobile-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #374151;
    border-radius: 1px;
    transition: transform .25s ease, opacity .25s ease;
}

.snm-mobile-toggle[aria-expanded="true"] .snm-mobile-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.snm-mobile-toggle[aria-expanded="true"] .snm-mobile-bar:nth-child(2) {
    opacity: 0;
}

.snm-mobile-toggle[aria-expanded="true"] .snm-mobile-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .snm-header-inner {
        gap: 12px;
        padding: 0 18px;
    }

    .snm-nav {
        position: fixed;
        top: 64px;
        right: 0;
        left: 0;
        z-index: 999;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - 64px);
        margin-left: 0;
        overflow-y: auto;
        padding: 8px 0;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-100%);
        transition: transform .25s ease, opacity .25s ease;
    }

    .snm-nav.snm-nav-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .snm-nav-link {
        width: 100%;
        min-height: 48px;
        padding: 14px 24px;
        border-bottom: 1px solid #f3f4f6;
        border-radius: 0;
    }

    .snm-search {
        position: static;
        margin: 0;
        padding: 8px 24px;
    }

    .snm-search-toggle {
        display: none;
    }

    .snm-search-form,
    .snm-search-open .snm-search-form {
        position: static;
        width: 100%;
        padding: 0 8px 0 14px;
        border-color: #e5e7eb;
        transform: none;
    }

    .snm-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 420px) {
    .snm-logo {
        font-size: 1.2rem;
    }

    .snm-header-inner {
        padding: 0 14px;
    }
}
