/* ==========================================================================
   GLORAVE PUBLIC HEADER V2 — автономный матовый стиль
   Стиль внутри файла, не зависит от общего CSS сайта.
   ========================================================================== */

.grh-header,
.grh-header *,
.grh-header *::before,
.grh-header *::after {
    box-sizing: border-box !important;
}

.grh-header {
    --grh-bg: #08090b;
    --grh-bg-2: #101114;
    --grh-card: #15161a;
    --grh-card-hover: #1b1d22;
    --grh-text: #f3f4f6;
    --grh-muted: rgba(243, 244, 246, 0.62);
    --grh-border: rgba(255, 255, 255, 0.09);
    --grh-border-strong: rgba(79, 195, 247, 0.34);
    --grh-blue: #4fc3f7;
    --grh-blue-2: #2f8fbd;
    --grh-danger: #ef4444;
    --grh-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);

    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--grh-text) !important;
    background: linear-gradient(180deg, var(--grh-bg-2), var(--grh-bg)) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--grh-border) !important;
    box-shadow: var(--grh-shadow) !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.grh-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.58), transparent);
    opacity: 0.75;
}

[data-theme="light"] .grh-header {
    --grh-bg: #f7f8fa;
    --grh-bg-2: #ffffff;
    --grh-card: #ffffff;
    --grh-card-hover: #edf3f7;
    --grh-text: #17212b;
    --grh-muted: rgba(23, 33, 43, 0.62);
    --grh-border: rgba(47, 81, 97, 0.14);
    --grh-border-strong: rgba(3, 155, 229, 0.35);
    --grh-blue: #039be5;
    --grh-blue-2: #2f5161;
    --grh-shadow: 0 8px 22px rgba(47, 81, 97, 0.12);
}

.grh-shell {
    position: relative !important;
    z-index: 1 !important;
    width: min(100% - 32px, 1620px) !important;
    min-height: 58px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 18px !important;
}

.grh-header a,
.grh-header button {
    font: inherit !important;
}

.grh-logo {
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: var(--grh-text) !important;
    text-decoration: none !important;
    border: 0 !important;
    background: transparent !important;
}

.grh-logo:hover {
    text-decoration: none !important;
}

.grh-logo-mark {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    background: linear-gradient(180deg, #1c8dc0, #17617c) !important;
    border: 1px solid rgba(79, 195, 247, 0.38) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 16px rgba(79, 195, 247, 0.20) !important;
}

.grh-logo-mark i {
    color: #ffffff !important;
    font-size: 1.06rem !important;
    line-height: 1 !important;
}

.grh-logo-copy {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    line-height: 1 !important;
}

.grh-logo-name {
    max-width: 190px !important;
    color: var(--grh-text) !important;
    font-size: 1.02rem !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: -0.035em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.grh-logo-sub {
    margin-top: 4px !important;
    color: var(--grh-blue) !important;
    font-size: 0.62rem !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 0.13em !important;
    text-transform: uppercase !important;
}

.grh-nav {
    min-width: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
}

.grh-link,
.grh-icon,
.grh-menu {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    color: var(--grh-muted) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.88rem !important;
    line-height: 1 !important;
    font-weight: 760 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease !important;
}

.grh-link:link,
.grh-link:visited,
.grh-link:hover,
.grh-link:active,
.grh-logo:link,
.grh-logo:visited,
.grh-logo:hover,
.grh-logo:active {
    text-decoration: none !important;
}

.grh-header.grh-header--lang-locked .grh-lang,
.grh-header[data-language-switcher-enabled="0"] .grh-lang {
    display: none !important;
}

.grh-lang {
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 3px !important;
    border-radius: 10px !important;
    color: var(--grh-muted) !important;
    background: var(--grh-card) !important;
    border: 1px solid var(--grh-border) !important;
}

.grh-lang__link {
    height: 28px !important;
    min-width: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    color: var(--grh-muted) !important;
    text-decoration: none !important;
    font-size: .74rem !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: .06em !important;
    border: 1px solid transparent !important;
    background: transparent !important;
}

.grh-lang__link:hover {
    color: var(--grh-text) !important;
    background: var(--grh-card-hover) !important;
    text-decoration: none !important;
}

.grh-lang__link.is-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--grh-blue), var(--grh-blue-2)) !important;
    border-color: var(--grh-border-strong) !important;
}

@media (max-width: 520px) {
    .grh-lang {
        height: 34px !important;
        padding: 2px !important;
    }
    .grh-lang__link {
        height: 28px !important;
        min-width: 29px !important;
        padding: 0 6px !important;
        font-size: .68rem !important;
    }
}

.grh-icon,
.grh-menu {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    color: var(--grh-muted) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.88rem !important;
    line-height: 1 !important;
    font-weight: 760 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease !important;
}

.grh-link i,
.grh-icon i,
.grh-menu i {
    color: currentColor !important;
    font-size: 0.96rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.grh-link:hover,
.grh-icon:hover,
.grh-menu:hover {
    color: var(--grh-text) !important;
    text-decoration: none !important;
    background: var(--grh-card-hover) !important;
    border-color: var(--grh-border) !important;
    transform: translateY(-1px) !important;
}

.grh-link.is-active {
    color: #ffffff !important;
    background: #1d5f78 !important;
    border-color: var(--grh-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 16px rgba(79,195,247,0.16) !important;
}

[data-theme="light"] .grh-link.is-active {
    color: #ffffff !important;
    background: #2f8fbd !important;
}

.grh-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
}

.grh-icon,
.grh-menu {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    color: var(--grh-text) !important;
    background: var(--grh-card) !important;
    border: 1px solid var(--grh-border) !important;
}

.grh-icon:hover,
.grh-menu:hover {
    color: var(--grh-blue) !important;
    border-color: var(--grh-border-strong) !important;
}

.grh-icon--admin {
    color: #ffffff !important;
    border-color: rgba(255, 209, 102, 0.42) !important;
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.18) !important;
}

.grh-icon--admin:hover {
    color: #ffd166 !important;
    border-color: rgba(255, 209, 102, 0.68) !important;
}

/* Light theme fix: keep the admin gear visible on the pale header. */
[data-theme="light"] .grh-icon--admin {
    color: #8a5a00 !important;
    background: rgba(255, 209, 102, 0.22) !important;
    border-color: rgba(168, 117, 12, 0.38) !important;
    box-shadow: 0 0 14px rgba(168, 117, 12, 0.12) !important;
}

[data-theme="light"] .grh-icon--admin:hover {
    color: #6f4700 !important;
    background: rgba(255, 209, 102, 0.34) !important;
    border-color: rgba(168, 117, 12, 0.58) !important;
}

.grh-theme.theme-toggle {
    appearance: none !important;
    color: var(--grh-text) !important;
    background: var(--grh-card) !important;
    border: 1px solid var(--grh-border) !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
    padding: 0 !important;
}

.grh-theme.theme-toggle:hover {
    color: var(--grh-blue) !important;
    background: var(--grh-card-hover) !important;
    border-color: var(--grh-border-strong) !important;
}

.grh-menu {
    display: none !important;
}

@media (max-width: 1280px) {
    .grh-shell {
        grid-template-columns: auto auto auto !important;
        justify-content: space-between !important;
    }

    .grh-menu {
        display: inline-flex !important;
        order: 2 !important;
    }

    .grh-nav {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: calc(100% + 8px) !important;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 10px !important;
        border-radius: 14px !important;
        background: var(--grh-bg-2) !important;
        border: 1px solid var(--grh-border) !important;
        box-shadow: 0 22px 55px rgba(0,0,0,0.44) !important;
    }

    .grh-header.is-open .grh-nav {
        display: flex !important;
    }

    .grh-link {
        width: 100% !important;
        justify-content: flex-start !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        padding: 0 13px !important;
        border-radius: 10px !important;
    }

    .grh-actions {
        order: 3 !important;
    }
}

@media (max-width: 767px) {
    .grh-shell {
        width: min(100% - 20px, 1620px) !important;
        min-height: 54px !important;
        gap: 9px !important;
    }

    .grh-logo-mark,
    .grh-icon,
    .grh-menu,
    .grh-theme.theme-toggle {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        border-radius: 9px !important;
    }

    .grh-logo-name {
        max-width: 140px !important;
        font-size: 0.94rem !important;
    }

    .grh-logo-sub {
        font-size: 0.58rem !important;
    }
}

@media (max-width: 480px) {
    .grh-logo-copy {
        display: none !important;
    }

    .grh-actions {
        gap: 6px !important;
    }
}

/* v4 mobile fix: menu collapses earlier because Timeline and Universe were added */
@media (max-width: 1280px) {
    .grh-shell {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        justify-content: stretch !important;
    }

    .grh-logo {
        grid-column: 1 !important;
        justify-self: start !important;
    }

    .grh-actions {
        grid-column: 3 !important;
        justify-self: end !important;
        order: initial !important;
    }

    .grh-menu {
        display: inline-flex !important;
        order: initial !important;
    }

    .grh-nav {
        left: 0 !important;
        right: 0 !important;
        top: calc(100% + 8px) !important;
    }
}

@media (max-width: 767px) {
    .grh-shell {
        min-height: 54px !important;
        grid-template-columns: auto minmax(8px, 1fr) auto !important;
    }

    .grh-logo {
        gap: 8px !important;
    }

    .grh-logo-copy {
        display: flex !important;
    }

    .grh-logo-name {
        max-width: 118px !important;
        font-size: 0.88rem !important;
    }

    .grh-logo-sub {
        font-size: 0.54rem !important;
        margin-top: 3px !important;
    }

    .grh-actions {
        gap: 6px !important;
    }
}

@media (max-width: 420px) {
    .grh-shell {
        width: min(100% - 14px, 1620px) !important;
        gap: 6px !important;
    }

    .grh-logo-copy {
        display: none !important;
    }

    .grh-actions {
        gap: 5px !important;
    }
}


/* Final guard: never allow browser/default theme underline on header navigation. */
.grh-header .grh-link,
.grh-header .grh-link *,
.grh-header .grh-logo,
.grh-header .grh-lang__link {
    text-decoration: none !important;
}

/* HARD FIX: убрать любые подчеркивания в верхнем меню, даже если глобальный CSS грузится позже. */
.grh-header a,
.grh-header a:link,
.grh-header a:visited,
.grh-header a:hover,
.grh-header a:active,
.grh-header a:focus,
.grh-header a *,
.grh-header .grh-link,
.grh-header .grh-link:link,
.grh-header .grh-link:visited,
.grh-header .grh-link:hover,
.grh-header .grh-link:active,
.grh-header .grh-link:focus,
.grh-header .grh-link span,
.grh-header .grh-logo,
.grh-header .grh-logo *,
.grh-header .grh-lang__link,
.grh-header .grh-lang__link * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    border-bottom: 0 !important;
}


/* EMERGENCY FIX: окончательно убираем браузерные/глобальные подчеркивания в меню. */
html body .grh-header nav.grh-nav a.grh-link,
html body .grh-header nav.grh-nav a.grh-link:link,
html body .grh-header nav.grh-nav a.grh-link:visited,
html body .grh-header nav.grh-nav a.grh-link:hover,
html body .grh-header nav.grh-nav a.grh-link:active,
html body .grh-header nav.grh-nav a.grh-link:focus,
html body .grh-header nav.grh-nav a.grh-link span,
html body .grh-header .grh-logo,
html body .grh-header .grh-logo *,
html body .grh-header .grh-lang a,
html body .grh-header .grh-lang a * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: solid !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none;
}