﻿/* ==========================================================================
   Life — header
   Slim white bar that spans the content area, to the right of the sidebar.
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--lf-sidebar-w);
    height: var(--lf-header-h);
    z-index: 1030;
    display: flex;
    align-items: center;
    background-color: var(--lf-surface);
    border-bottom: 1px solid var(--lf-border);
    box-shadow: var(--lf-shadow-xs);
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

    /* A little more separation once the page has scrolled */
    .header.header-scrolled {
        box-shadow: var(--lf-shadow-md);
    }

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    padding: 0 1.75rem;
}

/* --------------------------------------------------------------------------
   Sidebar toggle — mobile only, the rail is always open on desktop
   -------------------------------------------------------------------------- */
.header .toggle-sidebar-btn {
    display: none;
    font-size: 1.375rem;
    line-height: 1;
    color: var(--lf-ink);
    background: none;
    border: none;
    padding: 0.375rem;
    margin-left: -0.375rem;
    border-radius: var(--lf-radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .header .toggle-sidebar-btn:hover {
        background-color: var(--lf-surface-alt);
        color: var(--lf-navy-800);
    }

@media (max-width: 1199.98px) {
    .header {
        left: 0;
    }

        .header .toggle-sidebar-btn {
            display: block;
        }
}

/* --------------------------------------------------------------------------
   Page date
   -------------------------------------------------------------------------- */
.header-date {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--lf-ink-muted);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .header-date {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Account menu
   -------------------------------------------------------------------------- */
.header-account {
    margin-left: auto;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.3125rem 0.625rem 0.3125rem 0.3125rem;
    border: 1px solid transparent;
    background: none;
    border-radius: var(--lf-radius-pill);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .user-chip:hover,
    .user-chip:focus {
        background-color: var(--lf-surface-alt);
        border-color: var(--lf-border);
        color: inherit;
    }

    .user-chip .user-avatar {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        border-radius: 50%;
        background: linear-gradient( 140deg, var(--lf-navy-700), var(--lf-navy-900) );
        color: #fff;
        font-size: 0.8125rem;
        font-weight: 600;
        line-height: 34px;
        text-align: center;
        letter-spacing: 0.02em;
    }

    .user-chip .user-meta {
        display: flex;
        flex-direction: column;
        line-height: 1.25;
        text-align: left;
    }

    .user-chip .user-name {
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--lf-ink);
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-chip .user-chevron {
        font-size: 0.75rem;
        color: var(--lf-ink-subtle);
    }

@media (max-width: 575.98px) {
    .user-chip .user-meta,
    .user-chip .user-chevron {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Off-canvas backdrop
   -------------------------------------------------------------------------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background-color: rgba(6, 23, 39, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.toggle-sidebar .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1200px) {
    .sidebar-overlay {
        display: none;
    }
}
