.main-header {
    width: 100vw;
    min-width: 100%;
    max-width: none;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(253, 216, 53, 0.18), transparent 55%),
        linear-gradient(90deg, #000 0%, var(--myred) 50%, #000 100%);
    color: #fff;
    margin: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 0.45rem clamp(0.75rem, 2vw, 1.25rem);
}

@supports (width: 100dvw) {
    .main-header {
        width: 100dvw;
        margin-left: calc(50% - 50dvw);
        margin-right: calc(50% - 50dvw);
    }
}

.main-nav {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    gap: 0.4rem;
    text-align: left;
    font-size: clamp(0.95rem, 1vw, 1.05rem);
}

.brand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 460px) minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
}

.brand-start {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    justify-self: start;
    min-width: 0;
    overflow: hidden;
}

.brand-featured-links {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem 0.45rem;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.brand-featured-links .nav-link {
    font-size: 0.95em;
}

.brand-featured-links .nav-link:not(:last-child)::after {
    content: "|";
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.45rem;
}

.site-title {
    color: var(--myyellow);
    text-decoration: none;
    font-size: clamp(1rem, 1.6vw, 1.45rem);
    line-height: 1.1;
    white-space: nowrap;
    display: inline-block;
}

.site-title:hover {
    text-decoration: none;
}

.site-title-short {
    display: none;
}

.site-title-full {
    display: inline;
}

.nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    padding: 8px 7px;
    flex-direction: column;
    justify-content: space-between;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-content {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: clamp(0.6rem, 1.4vw, 1.1rem);
}

.main-header .nav-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-header .nav-link:hover {
    color: var(--myyellow);
}

.main-header .nav-link[aria-current="page"] {
    color: var(--myyellow);
}

.site-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
}

.other-links {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem 0.5rem;
    flex-wrap: wrap;
}

.other-links {
    min-width: 0;
}

.mobile-featured-links {
    display: none;
}

.site-menu .nav-link {
    white-space: nowrap;
}

.site-menu .nav-link:not(:last-child)::after {
    content: "|";
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.55rem;
}

.search-form form {
    display: flex;
    align-items: center;
    gap: 0;
}

.search-input-shell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 0.3rem 0.3rem 0.3rem 0.45rem;
    background: rgba(255, 255, 255, 0.95);
}

.search-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: rgba(128, 0, 0, 0.08);
    color: #3a0000;
    padding: 0.18rem 0.3rem 0.18rem 0.5rem;
    white-space: nowrap;
}

.search-scope-chip-label {
    font-size: 0.84rem;
    line-height: 1;
    font-weight: 600;
}

.search-scope-chip-clear {
    width: 1.1rem;
    height: 1.1rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: #2a0000;
    font-size: 0.92rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-scope-chip-clear:hover {
    background: rgba(0, 0, 0, 0.16);
}

.search-scope-chip.is-hidden {
    display: none;
}

.top-search {
    justify-self: center;
    width: 100%;
}

.search-form input[type="text"] {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    padding: 0.18rem 0.12rem;
    background: transparent;
}

.search-form input[type="text"]:focus {
    outline: none;
}

.search-form .button {
    display: none;
}

.search-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #555;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.search-submit:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 48px;
    justify-self: end;
}

.login-link {
    white-space: nowrap;
}

.profile-menu {
    position: relative;
}

.profile-toggle {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 210px;
    padding: 0.45rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 15;
}

.profile-dropdown.is-open {
    display: grid;
    gap: 0.2rem;
}

.profile-username {
    color: #555;
    font-size: 0.86rem;
    padding: 0.28rem 0.5rem;
}

.profile-link {
    color: #1f1f1f;
    text-decoration: none;
    border-radius: 7px;
    padding: 0.42rem 0.5rem;
}

.profile-link:hover {
    background: rgba(128, 0, 0, 0.1);
    text-decoration: none;
}

.profile-link-button {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.main-header a:focus-visible,
.main-header button:focus-visible,
.main-header input:focus-visible {
    outline: 2px solid var(--myyellow);
    outline-offset: 2px;
}

@media (max-width: 1024px) {
    .brand-row {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 320px) minmax(0, 1fr);
    }

    .nav-content {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .header-actions {
        justify-self: end;
    }
}

@media (max-width: 900px) {
    .brand-featured-links {
        display: none;
    }

    .brand-row {
        grid-template-columns: minmax(0, auto) minmax(160px, 1fr) minmax(0, auto);
    }
}

@media (max-width: 900px) {
    .main-header {
        padding: 0.38rem 0.75rem;
    }

    .brand-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
    }

    .top-search {
        flex: 1 1 0;
        min-width: 0;
        order: 2;
    }

    .top-search form {
        width: 100%;
    }

    .top-search input[type="text"] {
        flex: 1;
        min-width: 0;
    }

    .search-input-shell {
        min-width: 0;
    }

    .header-actions {
        order: 3;
        flex-shrink: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-content {
        display: none;
        margin-top: 0.1rem;
    }

    .nav-content.is-open {
        display: grid;
    }

    .site-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .mobile-featured-links {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem 0.5rem;
        width: 100%;
        white-space: nowrap;
    }

    .mobile-featured-links .nav-link:not(:last-child)::after {
        content: "|";
        color: rgba(255, 255, 255, 0.6);
        margin-left: 0.45rem;
    }

    .other-links {
        width: 100%;
    }

    .site-menu .nav-link::after {
        content: "";
        margin-left: 0;
    }

    .profile-dropdown {
        right: 0;
    }

    .site-title-full {
        display: none;
    }

    .site-title-short {
        display: inline;
        font-size: 1.25rem;
        font-weight: 700;
    }
}

@media (min-width: 901px) {
    .nav-content {
        display: grid !important;
    }
}