/* Public pages (app.php): full-width dark bar; inner row matches --layout-max-width */

.site-header {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: var(--site-header-bg, #111827);
    border-bottom: 1px solid var(--site-header-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    position: sticky;
    top: 0;
    z-index: 40;
}

.site-header-inner {
    max-width: var(--layout-max-width, 1400px);
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    min-height: 3.5rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Landing: three-column bar — logo | in-page anchors | account */
.site-header-inner--landing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: center;
    min-height: 3.5rem;
    max-width: var(--layout-max-width, 1400px);
}

.site-header-inner--landing .site-logo {
    justify-self: start;
}

/* Landing: center column = menu (mobile) + in-page nav (desktop) */
.site-header-landing-mid {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    grid-column: 2;
    min-width: 0;
}

.site-header-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.site-header-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

.site-header-menu-toggle-bars,
.site-header-menu-toggle-bars::before,
.site-header-menu-toggle-bars::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.site-header-menu-toggle-bars {
    position: relative;
}

.site-header-menu-toggle-bars::before,
.site-header-menu-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
}

.site-header-menu-toggle-bars::before {
    top: -6px;
}

.site-header-menu-toggle-bars::after {
    top: 6px;
}

.site-header--menu-open .site-header-menu-toggle {
    background: rgba(255, 255, 255, 0.12);
}

.site-header-anchors {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 1.5vw, 1.5rem);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.site-header-anchors a {
    color: rgba(229, 231, 235, 0.72);
    text-decoration: none;
    padding: 0.35rem 0.2rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-header-anchors a:hover {
    color: #f9fafb;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.site-header-anchors-aux {
    display: none;
}

.site-header-anchors-aux__link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.2rem 0.25rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(229, 231, 235, 0.88) !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.site-header-anchors-aux__link:hover {
    color: #fff !important;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.site-header-anchors-aux .nav-logout {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 0.5rem 0.2rem 0.15rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header-anchors-aux__btn {
    text-align: left;
    width: 100%;
    text-decoration: none !important;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    font-weight: 500;
}

.site-header-anchors-aux__btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.site-header-aside {
    display: flex;
    align-items: center;
    gap: 0.6rem 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    justify-self: end;
    grid-column: 3;
}

.site-header-inner:not(.site-header-inner--landing) .site-header-aside {
    margin-left: auto;
}

.site-header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    background: #0891b2;
    color: #f8fafc !important;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    border: none;
    box-shadow: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-header-cta:hover {
    background: #0e7490;
    color: #fff !important;
    text-decoration: none;
}

.site-nav .site-header-cta:hover {
    text-decoration: none;
}

.site-nav-secondary {
    color: rgba(229, 231, 235, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.3rem 0.15rem;
    white-space: nowrap;
}

.site-nav-secondary:hover {
    color: #fff;
    text-decoration: underline;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.45rem;
    margin: -0.35rem -0.45rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--site-header-fg, #e5e7eb);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-logo:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.site-logo-img {
    display: block;
    height: 1.75rem;
    width: auto;
    max-width: 10rem;
    object-fit: contain;
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--site-header-fg, #e5e7eb);
}

.site-nav a {
    color: inherit;
    text-decoration: none;
}

.site-nav a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Primary CTA in nav: no default underline (handled per element) */
.site-nav a.site-header-cta,
.site-nav a.site-header-cta:hover {
    text-decoration: none;
}

.nav-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.nav-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-logout {
    display: inline;
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--site-header-fg, #e5e7eb);
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover {
    color: #fff;
}

.site-main {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0 0 1rem;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Landing mobile: hamburger, compact panel, CTA in bar; Sign in/Sign out in panel only */
@media (max-width: 720px) {
    .page-landing .site-header-account--desktop {
        display: none !important;
    }

    .page-landing .site-header-menu-toggle {
        display: inline-flex;
    }

    .page-landing .site-header-anchors-aux {
        display: flex;
        flex-direction: column;
    }

    /* Panel positions against full header row (not hamburger column) so it fits the viewport. */
    .page-landing .site-header-anchors {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        margin-top: 0.35rem;
        margin-left: 0;
        margin-right: 0;
        transform: none;
        z-index: 50;
        box-sizing: border-box;
        padding: 0.45rem 0.65rem 0.65rem;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.15rem;
        font-size: 0.9rem;
        background: #111827;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    }

    .page-landing .site-header--menu-open .site-header-anchors {
        display: flex;
    }

    .page-landing .site-header--menu-open.site-header {
        z-index: 50;
    }

    .page-landing .site-header-anchors a {
        border-radius: 8px;
        padding: 0.55rem 0.5rem;
        white-space: normal;
    }

    .page-landing .site-header-inner--landing {
        position: relative;
        display: flex;
        justify-content: space-between;
        flex-wrap: nowrap;
        column-gap: 0.75rem;
    }

    .page-landing .site-header-inner--landing .site-header-landing-mid {
        position: static;
        order: 1;
        flex: 0 0 auto;
        justify-content: flex-start;
    }

    .page-landing .site-header-inner--landing .site-logo {
        order: 2;
    }

    .page-landing .site-header-inner--landing .site-header-aside {
        order: 3;
    }
}

@media (max-width: 600px) {
    .site-header-inner {
        padding: 0.7rem 1rem;
    }
}
