/* Shared site header — Jay Bharat Memories */
.site-header {
    --sh-bg: rgba(255, 255, 255, 0.98);
    --sh-border: rgba(15, 23, 42, 0.1);
    --sh-text: #0f172a;
    --sh-muted: #64748b;
    --sh-accent: #4f46e5;
    --sh-accent-hover: #4338ca;
    --sh-pill: #f1f5f9;
    --sh-pill-active: #eef2ff;
    --sh-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--sh-bg);
    border-bottom: 1px solid var(--sh-border);
    box-shadow: var(--sh-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.site-header--dark {
    --sh-bg: rgba(15, 23, 42, 0.92);
    --sh-border: rgba(255, 255, 255, 0.1);
    --sh-text: #f8fafc;
    --sh-muted: rgba(248, 250, 252, 0.72);
    --sh-accent: #a5b4fc;
    --sh-accent-hover: #c7d2fe;
    --sh-pill: rgba(255, 255, 255, 0.08);
    --sh-pill-active: rgba(255, 255, 255, 0.16);
    --sh-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.28);
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0.85rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    min-height: 52px;
}

.site-header-start {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--sh-text);
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    min-width: 0;
}

.site-brand i {
    color: var(--sh-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

.site-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--sh-muted);
    text-decoration: none;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.site-home-link:hover {
    background: var(--sh-pill);
    color: var(--sh-accent);
}

.header-quick-rail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
}

.header-quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 32px;
    height: 32px;
    padding: 0 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--sh-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.header-quick-action i {
    font-size: 0.82rem;
    color: var(--sh-accent);
}

.header-quick-label {
    display: none;
}

.header-quick-action:hover,
.header-quick-action:focus-visible {
    background: var(--sh-pill);
    color: var(--sh-text);
    border-color: var(--sh-border);
    outline: none;
}

.header-quick-action.is-toggled {
    background: var(--sh-pill-active);
    color: var(--sh-accent);
    border-color: rgba(79, 70, 229, 0.25);
}

.site-header-end {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-self: end;
}

.site-header-session {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-header-session-label {
    display: none;
}

.site-header-auth {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    white-space: nowrap;
    transition: filter 0.15s, transform 0.15s;
}

.site-header-auth:hover {
    filter: brightness(1.06);
}

.site-header-auth--out {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--sh-border);
}

.site-header-auth--out:hover {
    background: #e2e8f0;
    filter: none;
}

.site-header--dark .site-header-auth--out {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.site-nav-toggle {
    display: none;
    border: 1px solid var(--sh-border);
    background: var(--sh-pill);
    color: var(--sh-text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.site-nav {
    display: none;
}

.site-nav-group {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.site-nav-divider {
    width: 1px;
    height: 20px;
    background: var(--sh-border);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

.site-nav a,
.site-nav details > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sh-muted);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s, color 0.15s;
}

.site-nav details > summary::-webkit-details-marker { display: none; }

.site-nav a:hover,
.site-nav details > summary:hover {
    background: var(--sh-pill);
    color: var(--sh-text);
}

.site-nav a.is-active,
.site-nav details.is-active > summary {
    background: var(--sh-pill-active);
    color: var(--sh-accent);
}

.site-nav-dropdown {
    position: relative;
}

.site-nav-dropdown > summary::after {
    content: '';
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-left: 2px;
    opacity: 0.6;
}

.site-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: var(--sh-bg);
    border: 1px solid var(--sh-border);
    border-radius: 12px;
    box-shadow: var(--sh-shadow);
    padding: 0.35rem;
    z-index: 1100;
}

.site-nav-dropdown-menu a {
    display: flex;
    width: 100%;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
}

.site-header-spacer {
    height: 52px;
    flex-shrink: 0;
}

@media (min-width: 720px) {
    .header-quick-label {
        display: inline;
    }

    .header-quick-action {
        padding: 0 0.55rem;
    }

    .site-header-session-label {
        display: inline;
    }
}

@media (min-width: 960px) {
    .site-nav {
        display: flex;
        align-items: center;
        gap: 0.15rem;
        position: absolute;
        top: calc(100% + 1px);
        right: 0.85rem;
        min-width: 280px;
        padding: 0.45rem;
        background: var(--sh-bg);
        border: 1px solid var(--sh-border);
        border-radius: 12px;
        box-shadow: var(--sh-shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
        pointer-events: none;
    }

    .site-header.is-open .site-nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

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

    .site-header-end {
        position: relative;
    }
}

@media (max-width: 959px) {
    .site-nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 0.65rem 0.85rem 0.85rem;
        background: var(--sh-bg);
        border-bottom: 1px solid var(--sh-border);
        box-shadow: var(--sh-shadow);
        max-height: calc(100vh - 52px);
        overflow-y: auto;
    }

    .site-header.is-open .site-nav {
        display: flex;
    }

    .site-header-inner {
        position: relative;
    }

    .site-nav-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .site-nav-divider {
        width: 100%;
        height: 1px;
        margin: 0.25rem 0;
    }

    .site-nav a,
    .site-nav details > summary {
        width: 100%;
        border-radius: 8px;
        padding: 0.6rem 0.75rem;
        font-size: 0.86rem;
    }

    .site-nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 0.5rem;
        margin-top: 0.2rem;
    }

    .site-header-auth span {
        display: none;
    }

    .site-brand-text {
        max-width: 9rem;
    }
}

@media (max-width: 420px) {
    .header-quick-label {
        display: none;
    }

    .header-quick-action {
        min-width: 30px;
        padding: 0;
    }
}
