/* Keep the viewport width stable while navigating between pages.
 * Without a reserved scrollbar gutter, the fixed header briefly shifts
 * when the destination page gains or loses the vertical scrollbar. */
html {
    scrollbar-gutter: stable;
}

header a {
    color: #333;
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-weight: 550;
    font-size: 1.1rem;
}

header a:hover {
    background-color: #f6f7f8;
}

header.container {
    position: fixed;
    width: 100%;

    font-size: 1.1rem;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: transparent;
    transition: background-color 0.3s ease;

    padding: 0.5rem 1rem;
    z-index: 1000;
}

header .container-content {
    width: 100%;
    max-width: 95rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

header.container.scrolled {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header .left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

header .right {
    display: flex;
    align-items: center;
    gap: 3rem;
}

header .hidden-left {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

header .hidden-right {
    display: flex;
    align-items: center;
    gap: 3rem;
}

header a.header-logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: bold;
    gap: 1rem;
}

header a.premium {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

header .left img {
    height: 1.9rem;
    width: auto;
    margin-bottom: 0.75rem;
}

header .premium-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
    object-fit: contain;
    transform-origin: 50% 80%;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.22s ease;
}

header a.premium:hover .premium-icon {
    transform: translateY(-1px) rotate(-2deg) scale(1.055);
    filter:
        drop-shadow(0 0 2px rgba(252, 85, 24, 0.42))
        drop-shadow(0 0 7px rgba(252, 85, 24, 0.16));
}

@media (prefers-reduced-motion: reduce) {
    header .premium-icon {
        transition: none;
    }

    header a.premium:hover .premium-icon {
        transform: none;
    }
}

header .right .burger {
    display: none;
}

/* =========================
   ACCOUNT MENU
   ========================= */

.header-account {
    position: relative;
    display: flex;
    align-items: center;
}

.header-account-toggle {
    width: 2.55rem;
    height: 2.55rem;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;

    cursor: pointer;
}

.header-account-toggle:focus-visible {
    outline: 2px solid #cfd4da;
    outline-offset: 3px;
}

header .right .header-account-avatar {
    width: 2.55rem;
    height: 2.55rem;

    display: block;
    object-fit: cover;

    border-radius: 50%;
}

.header-account-menu {
    position: absolute;
    top: calc(100% + 0.85rem);
    right: 0;

    width: 12.65rem;

    padding: 0.55rem;

    background: #ffffff;
    border: 2px solid #eef0f2;
    border-radius: 14px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);

    transition:
        opacity 0.16s ease,
        visibility 0.16s ease,
        transform 0.16s ease;

    z-index: 1200;
}

.header-account-menu[hidden] {
    display: block;
}

.header-account.is-open .header-account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header .header-account-item {
    width: 100%;
    min-height: 2.55rem;

    display: flex;
    align-items: center;
    gap: 0.7rem;

    padding: 0.55rem 0.75rem;

    border: none;
    border-radius: 9px;

    background: transparent;
    color: #333333;

    font: inherit;
    font-size: 0.96rem;
    font-weight: 550;
    line-height: 1.2;
    text-align: left;

    text-decoration: none;
    cursor: pointer;

    transition: background-color 0.16s ease;
}


.header-account-item-icon {
    flex: 0 0 1.15rem;
    width: 1.15rem;
    height: 1.15rem;

    display: block;
    background-color: currentColor;

    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.header-account-item-icon--profile {
    -webkit-mask-image: url('/images/icons/profile-menu-user.svg');
    mask-image: url('/images/icons/profile-menu-user.svg');
    transform: scale(1.2);
}

.header-account-item-icon--certificates {
    -webkit-mask-image: url('/images/icons/profile-menu-certificates.svg');
    mask-image: url('/images/icons/profile-menu-certificates.svg');
    transform: scale(1.1);
}

.header-account-item-icon--gift {
    -webkit-mask-image: url('/images/icons/profile-menu-gift.svg');
    mask-image: url('/images/icons/profile-menu-gift.svg');
    transform: translateY(-1px) scale(1.1);
}

.header-account-item-icon--settings {
    -webkit-mask-image: url('/images/icons/profile-menu-settings.svg');
    mask-image: url('/images/icons/profile-menu-settings.svg');
    transform: scale(1.05);
}

.header-account-item-icon--logout {
    -webkit-mask-image: url('/images/icons/profile-menu-logout.svg');
    mask-image: url('/images/icons/profile-menu-logout.svg');
    transform: scale(1.1);
}

header .header-account-item:hover,
header .header-account-item:focus-visible {
    background: #f6f7f8;
    outline: none;
}

.header-account-logout {
    width: 100%;
    margin: 0;
}

.header-account-item--button {
    appearance: none;
}

/* старые кнопки на самой странице профиля больше не нужны */
.profile-actions {
    display: none !important;
}

/* =========================
   MOBILE MENU
   ========================= */

.mobile-menu {
    position: fixed;
    top: 7rem;

    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: .3s;
    width: 100%;

    z-index: 1000;
}

.mobile-menu a {
    font-family: 'Onest', Arial, sans-serif;
    font-size: 1.2rem;
    color: #333;
    text-decoration: none;
    left: 10vw;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-account-menu {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mobile-account-logout {
    margin: 0;
}

.mobile-account-logout button {
    border: none;
    background: transparent;
    padding: 0;

    font-family: 'Onest', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 550;
    color: #333333;

    cursor: pointer;
}

@media (max-width: 850px) {
    header .left img {
        height: 1.85rem;
        width: auto;
    }

    header.container {
        padding: 1rem;
    }

    .mobile-menu {
        position: fixed;
        top: 5.5rem;
    }

    header .right .burger {
        display: block;
        flex: 0 0 auto;

        position: relative;
        width: 1.875rem;
        height: 1.5625rem;

        margin-right: 1.5rem;
        padding: 0;

        background: none;
        border: none;
        outline: none;
        cursor: pointer;
    }

    .burger::before,
    .burger::after,
    .burger span {
        position: absolute;
        left: 0;

        width: 100%;
        height: 0.125rem;

        border-radius: 999px;
        background-color: #333333;

        transform-origin: center;
        transition:
            top 0.2s ease,
            bottom 0.2s ease,
            transform 0.2s ease,
            opacity 0.15s ease;
    }

    .burger::before,
    .burger::after {
        content: "";
    }

    .burger::before {
        top: 0;
    }

    .burger span {
        top: 50%;
        transform: translateY(-50%);
    }

    .burger::after {
        bottom: 0;
    }

    .burger.active::before {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .burger.active span {
        opacity: 0;
        transform: translateY(-50%) scaleX(0.35);
    }

    .burger.active::after {
        top: 50%;
        bottom: auto;
        transform: translateY(-50%) rotate(-45deg);
    }

    header .left .hidden-left {
        display: none;
    }

    header .right .hidden-right {
        display: none;
    }
}

/* =========================
   THEME BUTTON
   ========================= */

.theme-form {
    display: flex;
    align-items: center;
    margin: 0;
    padding-right: 0.5rem;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
}

.theme-svg {
    width: 28px;
    height: 28px;
    overflow: visible;
    transition: transform 0.35s ease;
}

.sun-core {
    fill: #6b7280;
    transform-origin: center;
    transition:
        transform 0.35s ease,
        opacity 0.25s ease;
}

.sun-rays {
    stroke: #6b7280;
    stroke-width: 2.2;
    stroke-linecap: round;

    transform-origin: center;
    transition:
        transform 0.55s ease,
        opacity 0.45s ease;
}

.moon {
    fill: #ffffff;
    opacity: 0;
    transform-origin: center;
    transform: scale(0.5) rotate(35deg);
    transition:
        transform 0.55s ease,
        opacity 0.45s ease;
}

.theme-toggle.active .sun-core {
    opacity: 0;
    transform: scale(0.4);
}

.theme-toggle.active .sun-rays {
    opacity: 0;
    transform: scale(0.3) rotate(45deg);
}

.theme-toggle.active .moon {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateX(1px);
}

.theme-toggle:hover .theme-svg {
    transform: none;
}

/* =========================
   DARK THEME
   ========================= */

body.dark-theme .header-account-menu {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

body.dark-theme header .header-account-item {
    color: #f3f4f6;
}

body.dark-theme header .header-account-item:hover,
body.dark-theme header .header-account-item:focus-visible {
    background: #2b3544;
}

/* ===== RESPONSIVE PASS: page-safe mobile spacing ===== */
@media (max-width: 520px) {
    header.container {
        padding: 0.9rem 1.5rem;
    }

    header .container-content,
    header .left,
    header .right {
        min-width: 0;
    }

    header .left,
    header .right {
        gap: 1rem;
    }

    header .left img {
        height: 1.75rem;
        max-width: 8rem;
    }

    header .right .burger {
        margin-right: 0.25rem;
    }

    .mobile-menu {
        top: 5rem;
        padding: 1.25rem;
        gap: 1rem;
    }

    .mobile-menu a,
    .mobile-account-logout button {
        font-size: 1.05rem;
    }
}


/* =========================
   MODERN HEADER LAYOUT
   ========================= */

header.container {
    padding: 0.7rem 1.35rem;
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        backdrop-filter 0.22s ease;
}

header .container-content {
    position: relative;
    min-height: 3rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.header-left-group {
    min-width: 0;
    flex: 1 1 auto;

    display: flex;
    align-items: center;
    gap: 1.45rem;
}

header a.header-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    align-self: center;
    padding: 0.25rem 0.4rem;
    margin-left: -0.4rem;
    background: transparent !important;
}

header .header-logo img {
    display: block;
    width: auto;
    height: 1.9rem;
    margin: 0;
    transform: translateY(-6px);
}

.header-primary-nav {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.header-primary-nav a {
    height: 2.62rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 0.68rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;

    font-size: 1.04rem;
    font-weight: 550;
    line-height: 1;
    white-space: nowrap;

    transition:
        color 0.16s ease,
        transform 0.16s ease,
        opacity 0.16s ease;
}

.header-primary-nav a:hover {
    background: #f6f7f8;
    border-color: #dde1e5;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

.header-primary-nav a.is-active {
    background: transparent;
    border-color: transparent;
    color: inherit;
    box-shadow: none;
}

.header-primary-nav a.is-active:hover {
    background: #f6f7f8;
    border-color: #dde1e5;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

header .right {
    margin-left: auto;
    gap: 0.6rem;
}

header .hidden-right {
    gap: 0.55rem;
}

header.container.scrolled {
    background: rgba(255, 255, 255, 0.86) !important;
    border-bottom-color: rgba(17, 24, 39, 0.07);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.055);
    -webkit-backdrop-filter: blur(16px) saturate(155%);
    backdrop-filter: blur(16px) saturate(155%);
}

.header-search-trigger {
    min-width: 8.8rem;
    height: 2.62rem;

    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.58rem;

    padding: 0 0.55rem 0 0.75rem;

    border: 1px solid #e6e9ed;
    border-radius: 12px;
    background: transparent;
    color: #2f3338;

    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.045);

    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.header-search-trigger:hover {
    border-color: #dde1e5;
    background: #f6f7f8;
    color: #202124;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

.header-search-trigger:active {
    transform: translateY(0);
}

.header-search-trigger:focus-visible,
.mobile-search-trigger:focus-visible {
    outline: 2px solid #8ab4f8;
    outline-offset: 2px;
}

.header-search-trigger__icon,
.mobile-search-trigger svg {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.header-search-trigger__label {
    flex: 1 1 auto;
    text-align: left;
}

.header-search-trigger kbd,
.mobile-search-trigger kbd {
    min-width: 1.85rem;
    height: 1.7rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 0.45rem;
    border: 1px solid #dde1e6;
    border-radius: 7px;
    background: #f4f5f7;
    color: #59616d;

    font-family: 'Onest', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1;
    box-shadow: inset 0 -1px 0 rgba(17, 24, 39, 0.035);
}

.theme-form {
    padding-right: 0;
}

.theme-toggle {
    width: 2.62rem;
    height: 2.62rem;
    border: 1px solid #e6e9ed;
    border-radius: 12px;
    background: transparent;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.045);
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.theme-toggle:hover {
    background: #f6f7f8;
    border-color: #dde1e5;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

.theme-toggle:focus-visible {
    outline: 2px solid #c7d2fe;
    outline-offset: 2px;
}

.theme-svg {
    width: 1.47rem;
    height: 1.47rem;
}

header a.premium {
    height: 2.62rem;

    display: inline-flex;
    align-items: center;
    gap: 0.42rem;

    padding: 0 0.82rem;
    border: 1px solid #e6e9ed;
    border-radius: 12px;
    background: transparent;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.045);

    font-size: 0.98rem;
    white-space: nowrap;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

header a.premium:hover {
    background: rgba(255, 255, 255, 0.68);
    border-color: rgba(252, 85, 24, 0.24);
    transform: translateY(-1px);
    box-shadow:
        0 5px 14px rgba(17, 24, 39, 0.07),
        0 0 0 1px rgba(252, 85, 24, 0.025);
}

header .premium-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.header-account-toggle {
    width: 2.62rem;
    height: 2.62rem;
    border: 1px solid #e6e9ed;
    background: rgba(255, 255, 255, 0.50);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.045);
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.header-account-toggle:hover {
    background: #f6f7f8;
    border-color: #dde1e5;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

header .right .header-account-avatar {
    width: 2.35rem;
    height: 2.35rem;
}

header a.login {
    height: 2.62rem;
    display: inline-flex;
    align-items: center;
    padding: 0 0.82rem;
    border: 1px solid #e6e9ed;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.50);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.045);
    white-space: nowrap;
}

.mobile-search-trigger {
    width: 100%;
    min-height: 3rem;

    display: flex;
    align-items: center;
    gap: 0.7rem;

    padding: 0.65rem 0.75rem;
    border: 1px solid #e6e9ed;
    border-radius: 10px;
    background: #f7f8fa;
    color: #2f3338;

    font-family: 'Onest', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.mobile-search-trigger span {
    flex: 1 1 auto;
}

/* =========================
   GLOBAL SEARCH
   ========================= */

body.global-search-open {
    overflow: hidden;
}

.site-search[hidden] {
    display: none !important;
}

.site-search {
    position: fixed;
    inset: 0;
    z-index: 3000;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    /* Keep the search window at a stable, symmetrical distance from the viewport. */
    padding: 2.5rem 1rem;
}

.site-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.28);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: site-search-backdrop-in 0.16s ease both;
}

.site-search__panel {
    position: relative;
    z-index: 1;

    width: min(47rem, calc(100vw - 2rem));
    height: calc(100dvh - 5rem);
    max-height: none;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid rgba(17, 24, 39, 0.09);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 30px 80px rgba(17, 24, 39, 0.19),
        0 8px 24px rgba(17, 24, 39, 0.08);

    animation: site-search-panel-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes site-search-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes site-search-panel-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.site-search__input-wrap {
    position: relative;
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    margin: 1rem 1rem 0;

    border: 1px solid #d9dee5;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(17, 24, 39, 0.02);

    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.site-search__input-wrap:focus-within {
    border-color: #9dbcf1;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.site-search__input-icon {
    position: absolute;
    left: 1rem;

    width: 1.28rem;
    height: 1.28rem;

    fill: none;
    stroke: #687386;
    stroke-width: 1.85;
    stroke-linecap: round;

    pointer-events: none;
}

.site-search__input {
    width: 100%;
    height: 3.55rem;

    padding: 0 3.6rem 0 3rem;

    border: 0;
    outline: 0;
    background: transparent;
    color: #202124;

    font-family: 'Onest', Arial, sans-serif;
    font-size: 1.02rem;
    font-weight: 500;
}

.site-search__input::placeholder {
    color: #9098a7;
    opacity: 1;
}

.site-search__input::-webkit-search-cancel-button {
    display: none;
}

.site-search__shortcut {
    position: absolute;
    right: 0.7rem;

    min-width: 2rem;
    height: 1.85rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e3e6ea;
    border-radius: 7px;
    background: #f7f8fa;
    color: #687386;

    font-family: 'Onest', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 650;
}

.site-search__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem 0.75rem 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: #cfd4da transparent;
}

.site-search__body > [hidden] {
    display: none !important;
}

.site-search__empty-state,
.site-search__status {
    min-height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;

    padding: 2rem;
    text-align: center;
}

.site-search__empty-state strong {
    color: #2b3038;
    font-size: 1rem;
    font-weight: 650;
}

.site-search__empty-state > span:last-child,
.site-search__status {
    color: #858d9b;
    font-size: 0.92rem;
    line-height: 1.45;
}

.site-search__empty-icon {
    width: 2.7rem;
    height: 2.7rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 0.35rem;

    border: 1px solid #e6e9ed;
    border-radius: 12px;
    background: #f7f8fa;
    color: #768195;
}

.site-search__empty-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.site-search__results {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.site-search__group + .site-search__group {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eceff2;
}

.site-search__group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.2rem 0.45rem 0.45rem;

    color: #596274;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.site-search__group-count {
    color: #a0a7b2;
    font-variant-numeric: tabular-nums;
}

.site-search__result {
    min-height: 3.55rem;

    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto 1rem;
    align-items: center;
    column-gap: 0.7rem;

    padding: 0.48rem 0.55rem;

    border-radius: 11px;
    color: #252a31;
    text-decoration: none;

    transition:
        background-color 0.12s ease,
        transform 0.12s ease;
}

.site-search__result:hover,
.site-search__result.is-selected {
    background: #eef5ff !important;
}

.site-search__result:focus-visible {
    outline: 2px solid #a8c7fa;
    outline-offset: -2px;
}

.site-search__result-icon {
    width: 2.25rem;
    height: 2.25rem;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e8ebef;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.site-search__result-icon img {
    width: 1.45rem;
    height: 1.45rem;
    object-fit: contain;
}

.site-search__result-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.site-search__result-title {
    overflow: hidden;
    color: #252a31;
    font-size: 0.94rem;
    font-weight: 590;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-search__result-meta {
    color: #9199a6;
    font-size: 0.75rem;
    line-height: 1.2;
}

.site-search__result-kind {
    padding: 0.3rem 0.48rem;
    border-radius: 7px;
    background: #f6f7f9;
    color: #7f8794;

    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.site-search__result-arrow {
    color: #929aa6;
    font-size: 1.1rem;
    line-height: 1;
}

.site-search__footer {
    flex: 0 0 auto;

    min-height: 3.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;

    padding: 0.7rem 1rem;

    border-top: 1px solid #e8ebef;
    background: #fbfbfc;
}

.site-search__hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    color: #858d9b;
    font-size: 0.78rem;
    white-space: nowrap;
}

.site-search__hint kbd,
.site-search__arrows kbd {
    min-width: 1.85rem;
    height: 1.7rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 0.42rem;

    border: 1px solid #dfe3e8;
    border-radius: 6px;
    background: #ffffff;
    color: #616b7c;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);

    font-family: 'Onest', Arial, sans-serif;
    font-size: 0.73rem;
    font-weight: 650;
}

.site-search__hint--navigation {
    margin-left: auto;
}

.site-search__key-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.site-search__key-group kbd {
    min-width: auto;
    padding: 0 0.42rem;
}

.site-search__arrows {
    display: inline-flex;
    gap: 0.2rem;
}

.site-search__arrows kbd {
    min-width: 1.7rem;
    padding: 0;
}

/* =========================
   MODERN HEADER / SEARCH DARK THEME
   ========================= */

body.dark-theme header.container.scrolled {
    background: rgba(17, 24, 39, 0.84) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
}

body.dark-theme .header-primary-nav a {
    border-color: transparent;
    background: transparent;
    color: #e5e7eb;
    box-shadow: none;
}

body.dark-theme .header-primary-nav a:hover {
    border-color: #4b5563;
    background: #263244;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

body.dark-theme .header-primary-nav a.is-active {
    border-color: transparent;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

body.dark-theme .header-primary-nav a.is-active:hover {
    border-color: #4b5563;
    background: #263244;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

body.dark-theme .header-search-trigger {
    border-color: #374151;
    background: transparent;
    color: #f3f4f6;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

body.dark-theme .header-search-trigger:hover {
    border-color: #4b5563;
    background: #263244;
    color: #ffffff;
}

body.dark-theme .header-search-trigger kbd,
body.dark-theme .mobile-search-trigger kbd {
    border-color: #465163;
    background: #111827;
    color: #c3cad4;
    box-shadow: none;
}

body.dark-theme .mobile-search-trigger {
    border-color: #374151;
    background: transparent;
    color: #f3f4f6;
}

body.dark-theme .theme-toggle,
body.dark-theme header a.premium,
body.dark-theme header a.login,
body.dark-theme .header-account-toggle {
    border-color: #374151;
    background: rgba(31, 41, 55, 0.52);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

body.dark-theme .theme-toggle,
body.dark-theme header a.premium {
    background: transparent;
}

body.dark-theme .theme-toggle:hover,
body.dark-theme header a.premium:hover,
body.dark-theme header a.login:hover,
body.dark-theme .header-account-toggle:hover {
    border-color: #4b5563;
    background: #263244;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

body.dark-theme header a.premium:hover {
    border-color: rgba(252, 85, 24, 0.34);
    background: rgba(38, 50, 68, 0.92);
    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(252, 85, 24, 0.035);
}

body.dark-theme .site-search__backdrop {
    background: rgba(2, 6, 12, 0.56);
}

body.dark-theme .site-search__panel {
    border-color: #374151;
    background: rgba(31, 41, 55, 0.98);
    box-shadow:
        0 30px 85px rgba(0, 0, 0, 0.42),
        0 8px 26px rgba(0, 0, 0, 0.25);
}

body.dark-theme .site-search__input-wrap {
    border-color: #4b5563;
    background: #111827;
}

body.dark-theme .site-search__input-wrap:focus-within {
    border-color: #6f9fe8;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

body.dark-theme .site-search__input,
body.dark-theme .site-search__empty-state strong,
body.dark-theme .site-search__result-title,
body.dark-theme .site-search__result {
    color: #f3f4f6;
}

body.dark-theme .site-search__input::placeholder,
body.dark-theme .site-search__status,
body.dark-theme .site-search__empty-state > span:last-child,
body.dark-theme .site-search__result-meta,
body.dark-theme .site-search__group-title,
body.dark-theme .site-search__hint {
    color: #9ca3af;
}

body.dark-theme .site-search__input-icon {
    stroke: #9ca3af;
}

body.dark-theme .site-search__shortcut,
body.dark-theme .site-search__result-kind,
body.dark-theme .site-search__empty-icon {
    border-color: #374151;
    background: #263244;
    color: #aeb7c6;
}

body.dark-theme .site-search__group + .site-search__group,
body.dark-theme .site-search__footer {
    border-color: #374151;
}

body.dark-theme .site-search__result:hover,
body.dark-theme .site-search__result.is-selected {
    background: #263a57 !important;
}

body.dark-theme .site-search__result-icon {
    border-color: #3a4658;
    background: #111827;
}

body.dark-theme .site-search__footer {
    background: #192231;
}

body.dark-theme .site-search__hint kbd,
body.dark-theme .site-search__arrows kbd {
    border-color: #465163;
    background: #111827;
    color: #c3cad4;
    box-shadow: none;
}

/* =========================
   MODERN HEADER RESPONSIVE
   ========================= */

@media (max-width: 1280px) {
    .header-left-group {
        gap: 1.1rem;
    }

    .header-primary-nav {
        gap: 0.4rem;
    }

    .header-primary-nav a {
        padding-inline: 0.72rem;
    }

    .header-search-trigger {
        min-width: 2.62rem;
        width: 2.62rem;
        padding: 0;
        justify-content: center;
    }

    .header-search-trigger__label,
    .header-search-trigger kbd {
        display: none;
    }
}

@media (max-width: 1180px) {
    .header-primary-nav {
        gap: 0.32rem;
    }

    .header-primary-nav a {
        padding-inline: 0.58rem;
        font-size: 0.99rem;
    }
}

@media (max-width: 1050px) {
    .header-primary-nav,
    header .right .hidden-right {
        display: none;
    }

    header .right .burger {
        display: block;
    }

    header.container {
        padding: 0.9rem 1.35rem;
    }

    .mobile-menu {
        top: 4.9rem;
    }
}

@media (max-width: 640px) {
    .site-search {
        padding: 0.75rem;
        align-items: stretch;
    }

    .site-search__panel {
        width: 100%;
        height: calc(100dvh - 1.5rem);
        max-height: none;
        border-radius: 16px;
    }

    .site-search__input-wrap {
        margin: 0.75rem 0.75rem 0;
    }

    .site-search__input {
        height: 3.35rem;
        font-size: 0.95rem;
    }

    .site-search__body {
        padding-inline: 0.55rem;
    }

    .site-search__result {
        grid-template-columns: 2.15rem minmax(0, 1fr) 0.9rem;
    }

    .site-search__result-kind {
        display: none;
    }

    .site-search__footer {
        gap: 0.55rem;
        flex-wrap: wrap;
    }

    .site-search__hint--navigation {
        width: 100%;
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-search__backdrop,
    .site-search__panel {
        animation: none;
    }

    .header-search-trigger,
    .header-primary-nav a,
    .theme-toggle,
    header a.premium,
    .header-account-toggle {
        transition: none;
    }
}


/* ===== HEADER HOVER SYNC: primary nav matches Search ===== */
.header-primary-nav a:hover,
.header-primary-nav a.is-active:hover {
    border-color: #dde1e5;
    background: #f6f7f8;
    color: #202124;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

/* The Java Hub logo stays completely static on hover. */
header a.header-logo:hover,
body.dark-theme header a.header-logo:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: inherit;
    transform: none !important;
    box-shadow: none !important;
}

body.dark-theme .header-primary-nav a:hover,
body.dark-theme .header-primary-nav a.is-active:hover {
    border-color: #4b5563;
    background: #263244;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}


/* ===== LOGIN: same lightweight treatment as primary navigation ===== */
header a.login {
    height: 2.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.68rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    font-size: 1.04rem;
    font-weight: 550;
    line-height: 1;
    white-space: nowrap;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

header a.login:hover {
    border-color: #dde1e5;
    background: #f6f7f8;
    color: #202124;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07);
}

body.dark-theme header a.login {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body.dark-theme header a.login:hover {
    border-color: #4b5563;
    background: #263244;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}
