/**
 * En-tête de page — titre + sous-titre (composant partagé)
 * Exclu : race.php (bannière course dédiée)
 */

/* ─── Structure de base ──────────────────────────────────────────────────── */

.page-header {
    position: relative;
    margin-bottom: 2rem;
    margin-top: 0;
    padding: 1.5rem 0 1.6rem;

    /* Ligne d'accent en bas : signature visuelle du composant */
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
}

/* Ligne lumineuse dégradée — l'élément signature */
.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 750px;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--accent, #7b93f0) 0%,
        transparent 100%
    );
    border-radius: 0 2px 2px 0;
}

/* ─── Eyebrow (label optionnel au-dessus du titre) ───────────────────────── */

.page-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent, #e8173a);
    margin-bottom: 0.55rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

/* Petite puce décorative avant l'eyebrow */
.page-header__eyebrow::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    flex-shrink: 0;
}

/* ─── Titre h1 ───────────────────────────────────────────────────────────── */

.page-header > h1,
.page-header .page-title-row h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0;

    /* Léger dégradé sur le texte pour le sortir du fond */
    background: linear-gradient(
        135deg,
        var(--text, #f0f0f0) 0%,
        var(--text-muted, rgba(240,240,240,0.65)) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header > h1:only-child {
    margin-bottom: 0.6rem;
}

/* ─── Ligne titre (avec actions à droite) ────────────────────────────────── */

.page-header .page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* ─── Sous-titre ─────────────────────────────────────────────────────────── */

.page-header__subtitle {
    color: var(--text-muted);
    font-size: clamp(0.82rem, 2.5vw, 0.9rem);
    line-height: 1.55;
    letter-spacing: 0.025em;
    margin: 0.45rem 0 0;
    max-width: 62ch;
    opacity: 0.75;
}

.page-header__subtitle a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.page-header__subtitle a:hover {
    color: var(--accent, #e8173a);
    text-decoration-color: currentColor;
}

/* ─── Variante centrée (auth, profil public) ─────────────────────────────── */

.page-header--centered {
    text-align: center;
}

.page-header--centered::after {
    left: 50%;
    transform: translateX(-50%);
    width: 750px;
    /* Symétrique pour les vues centrées */
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--accent, #7b93f0) 50%,
        transparent 100%
    );
}

.page-header--centered .page-header__eyebrow {
    justify-content: center;
}

.page-header--centered .page-header__subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ─── Indicateur « live » (dashboard) ───────────────────────────────────── */

.page-header__subtitle--live {
    display: flex;
    align-items: center;
    justify-content: inherit;
    gap: 0.45rem;
}

.page-header--centered .page-header__subtitle--live {
    justify-content: center;
}

.page-header__subtitle--live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success-soft, #6bc96b);
    box-shadow: 0 0 0 2px rgba(107, 201, 107, 0.2), 0 0 8px var(--color-success-soft, #6bc96b);
    flex-shrink: 0;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 2px rgba(107,201,107,0.2), 0 0 8px #6bc96b; }
    50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(107,201,107,0.1), 0 0 14px #6bc96b; }
}

/* ─── Auth ───────────────────────────────────────────────────────────────── */

.page-auth .page-header {
    margin-bottom: 0;
    width: 100%;
    padding-top: 0.75rem;
    background: none;
}

.page-auth .page-header::after {
    display: none;
}

.page-auth .page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
    /* Pas de gradient text en auth pour rester léger */
    background: none;
    -webkit-text-fill-color: var(--text, #f0f0f0);
    color: var(--text, #f0f0f0);
}

.page-auth .page-header__subtitle {
    margin-bottom: 1.75rem;
    opacity: 1;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .page-header {
        padding: 1.1rem 0 1.3rem;
    }

    .page-header::after {
        width: 120px;
    }

    .page-header .page-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .page-header__subtitle--live::before {
        animation: none;
    }
}