/* © 2025 Viraup (viraup.com) */
:root {
    --header-bg: #070A14;
    --header-surface: #11172A;
    --header-text: #EDEDF3;
    --header-muted: #9BA0AE;
    --header-primary: #8B5CF6;
    --header-accent: #0A5CFF;
    --header-border: rgba(255, 255, 255, 0.08);
    --header-radius: 16px;
    --header-height: 64px;
    --header-gap: 16px;
    --header-font: 'Vazirmatn', Tahoma, Arial, sans-serif;
    --header-focus: 0 0 0 3px rgba(139, 92, 246, .28);
}

body.has-mobile-nav {
    overflow: hidden;
}

.site-header {
    position: sticky;
    top: 0;
    inset-inline: 0;
    z-index: 90;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    font-family: var(--header-font);
    color: var(--header-text);
}

.site-header__container {
    height: var(--header-height);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: var(--header-gap);
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    min-width: 124px;
    color: inherit;
    text-decoration: none;
}

.site-header__brand img {
    display: block;
    height: 30px;
    object-fit: contain;
}

.site-header__menu-toggle {
    display: none;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--header-border);
    background: var(--header-surface);
    color: var(--header-text);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: border-color .2s ease, background .2s ease;
}

.site-header__menu-toggle:focus-visible {
    outline: none;
    box-shadow: var(--header-focus);
}

.site-header__menu-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.site-header__menu-bar {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.site-header__nav {
    /* Align nav next to brand on RTL; push actions to the far side instead */
    margin-inline-start: 0;
    display: flex;
    align-items: center;
    color: inherit;
}

.site-header__nav-inner {
    display: flex;
    align-items: center;
    height: 100%;
}

.site-header__nav-list {
    display: flex;
    align-items: center;
    gap: var(--header-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-header__nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--header-text);
    text-decoration: none;
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: color .18s ease, background .18s ease;
}

.site-header__nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: currentColor;
}

.site-header__nav-link:hover {
    color: #ffffff;
}

.site-header__nav-link:focus-visible {
    outline: none;
    box-shadow: var(--header-focus);
}

.site-header__nav-link.is-active::after {
    content: '';
    position: absolute;
    inset-inline: 10px;
    bottom: 4px;
    height: 2px;
    background: var(--header-primary);
    border-radius: 999px;
}

.site-header__nav-label {
    line-height: 1.2;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--header-gap);
    justify-content: flex-end;
    min-width: 320px;
    /* Push actions to the opposite side so nav sits on the right in RTL */
    margin-inline-start: auto;
}

.site-header__search {
    position: relative;
    width: 192px;
    flex: 0 0 192px;
}

.site-header__search input {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--header-border);
    background: var(--header-surface);
    color: var(--header-text);
    padding: 0 14px;
    font-family: var(--header-font);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.site-header__search input::placeholder {
    color: var(--header-muted);
}

.site-header__search input:focus-visible {
    outline: none;
    border-color: var(--header-accent);
    box-shadow: var(--header-focus);
}

.site-header__profile {
    position: relative;
    flex-shrink: 0;
}

.site-header__profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--header-border);
    background: var(--header-surface);
    color: var(--header-text);
    font-family: var(--header-font);
    transition: border-color .2s ease, background .2s ease;
}

.site-header__profile-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.site-header__profile-btn:focus-visible {
    outline: none;
    box-shadow: var(--header-focus);
}

.site-header__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--header-primary);
    color: #0b0b0b;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
}

.site-header__avatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.site-header__profile-name {
    max-width: 120px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-header__profile-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 12px);
    min-width: 200px;
    border-radius: 14px;
    border: 1px solid var(--header-border);
    background: var(--header-surface);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
    padding: 8px;
    list-style: none;
    margin: 0;
    display: none;
    z-index: 20;
}

.site-header__profile[data-open="true"] .site-header__profile-menu {
    display: block;
}

/* Fallback: open on focus for keyboard users or if JS fails */
.site-header__profile:focus-within .site-header__profile-menu {
    display: block;
}

.site-header__profile-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
}

.site-header__profile-menu a:hover,
.site-header__profile-menu a:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.site-header__profile-caret {
    flex-shrink: 0;
    color: var(--header-muted);
}

.site-header__cta {
    display: inline-grid;
    place-items: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--header-primary);
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .18s ease, color .18s ease;
    flex: 0 0 188px;
    max-width: 188px;
}

.site-header__cta--placeholder {
    visibility: hidden;
    pointer-events: none;
}

.site-header__cta:hover {
    background: rgba(139, 92, 246, 0.16);
}

.site-header__cta:focus-visible {
    outline: none;
    box-shadow: var(--header-focus);
}

.site-header__overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 22, 0.62);
    backdrop-filter: saturate(160%) blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 80;
}

.site-header__overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1024px) {
    .site-header__container {
        padding-inline: 16px;
    }

    .site-header__menu-toggle {
        display: inline-flex;
    }

    .site-header__nav {
        position: fixed;
        inset: var(--header-height) 0 0 0;
        background: rgba(21, 21, 38, 0.94);
        backdrop-filter: saturate(160%) blur(14px);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease, transform .18s ease;
        justify-content: center;
        padding: 32px 24px 24px;
    }

    .site-header__nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-header__nav-inner {
        width: min(420px, 100%);
        justify-content: center;
    }

    .site-header__nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .site-header__nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.02);
    }

    .site-header__nav-link::after {
        inset-inline: 16px;
        bottom: 8px;
    }

    .site-header__actions {
        min-width: auto;
        gap: 12px;
    }

    .site-header__search {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header__menu-toggle,
    .site-header__nav,
    .site-header__overlay,
    .site-header__cta,
    .site-header__profile-btn,
    .site-header__nav-link {
        transition: none !important;
    }
}
