/* =====================================================================
   PROJETFOOT V2 — HEADER COMMUN
   ===================================================================== */

.pf-header{
    /* Couleurs : modifie --pf-accent pour changer la couleur d'accent */
    --pf-ink:#0a0d0c;
    --pf-ink-2:#1e2624;
    --pf-muted:#5b6360;
    --pf-faint:#9aa19e;
    --pf-line:#e6e8e6;
    --pf-soft:#f2f3f2;
    --pf-accent:#f26a1b;
    --pf-danger:#c0362c;
    --pf-h:68px;

    position:sticky;
    top:0;
    z-index:1000;

    font-family:"Geist","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;

    background:rgba(255,255,255,.85);
    -webkit-backdrop-filter:saturate(180%) blur(16px);
    backdrop-filter:saturate(180%) blur(16px);

    border-bottom:1px solid var(--pf-line);

    transition:box-shadow .2s ease, background-color .2s ease;
}

.pf-header.is-scrolled{
    background:rgba(255,255,255,.94);
    box-shadow:0 8px 24px -14px rgba(10,13,12,.25);
}

.pf-header *,
.pf-header *::before,
.pf-header *::after{
    box-sizing:border-box;
}

.pf-header a{
    text-decoration:none;
}

.pf-header button{
    font:inherit;
}

.pf-header :focus-visible{
    outline:2px solid var(--pf-accent);
    outline-offset:2px;
}


/* =====================================================================
   STRUCTURE
   ===================================================================== */

.pf-header-wrap{
    width:100%;
    max-width:1240px;
    height:var(--pf-h);

    margin:0 auto;
    padding:0 24px;

    display:flex;
    align-items:center;
    gap:28px;
}

.pf-header-right{
    margin-left:auto;

    display:flex;
    align-items:center;
    gap:10px;
}

.pf-header-divider{
    width:1px;
    height:22px;

    background:var(--pf-line);
}


/* =====================================================================
   LOGO
   ===================================================================== */

.pf-header-logo-link{
    display:flex;
    align-items:center;
    flex:0 0 auto;

    border-radius:6px;
}

.pf-header-logo{
    display:block;
    width:140px;
    height:auto;

    transition:opacity .15s ease;
}

.pf-header-logo-link:hover .pf-header-logo{
    opacity:.8;
}


/* =====================================================================
   NAVIGATION
   ===================================================================== */

.pf-header-nav{
    display:flex;
    align-items:center;
    gap:4px;
}

.pf-nav-link{
    position:relative;

    height:38px;
    padding:0 14px;

    display:inline-flex;
    align-items:center;

    color:var(--pf-muted) !important;

    font-size:14.5px;
    font-weight:500;
    white-space:nowrap;

    border-radius:9px;

    transition:color .15s ease, background-color .15s ease;
}

.pf-nav-link:hover{
    color:var(--pf-ink) !important;
    background:var(--pf-soft);
}

.pf-nav-link.is-active{
    color:var(--pf-ink) !important;
    font-weight:600;
}

/* Petit trait d'accent collé au bas du header */
.pf-nav-link.is-active::after{
    content:"";

    position:absolute;
    left:14px;
    right:14px;
    bottom:calc((var(--pf-h) - 38px) / -2);

    height:2px;

    background:var(--pf-accent);
    border-radius:2px 2px 0 0;
}


/* =====================================================================
   ICÔNES
   ===================================================================== */

.pf-header-icon{
    width:20px;
    height:20px;

    display:block;
    flex-shrink:0;

    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}


/* =====================================================================
   LANGUE (PC)
   ===================================================================== */

.pf-language{
    position:relative;
}

.pf-language-current{
    height:36px;
    padding:0 10px 0 11px;

    display:inline-flex;
    align-items:center;
    gap:6px;

    color:var(--pf-muted);
    background:transparent;

    border:1px solid var(--pf-line);
    border-radius:999px;

    font-size:13px;
    font-weight:600;
    letter-spacing:.02em;

    cursor:pointer;
    white-space:nowrap;

    transition:color .15s ease, background-color .15s ease, border-color .15s ease;
}

.pf-language-current:hover,
.pf-language-current[aria-expanded="true"]{
    color:var(--pf-ink);
    background:var(--pf-soft);
    border-color:#dcdfdc;
}

.pf-language-current .pf-header-icon{
    width:16px;
    height:16px;
}

.pf-language-chevron{
    width:14px;
    height:14px;

    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;

    transition:transform .2s ease;
}

.pf-language-current[aria-expanded="true"] .pf-language-chevron{
    transform:rotate(180deg);
}

.pf-language-menu{
    position:absolute;
    z-index:2000;
    top:calc(100% + 10px);
    right:0;

    min-width:196px;
    padding:6px;

    background:#fff;

    border:1px solid var(--pf-line);
    border-radius:14px;

    box-shadow:
        0 16px 40px -10px rgba(10,13,12,.22),
        0 2px 6px rgba(10,13,12,.06);

    opacity:0;
    visibility:hidden;
    transform:translateY(-6px) scale(.98);
    transform-origin:top right;

    transition:
        opacity .16s ease,
        transform .16s ease,
        visibility 0s linear .16s;
}

.pf-language-menu.is-open{
    opacity:1;
    visibility:visible;
    transform:none;

    transition:
        opacity .16s ease,
        transform .16s ease,
        visibility 0s;
}

.pf-language-option{
    display:flex;
    align-items:center;
    gap:10px;

    padding:8px 10px;

    color:var(--pf-muted) !important;

    font-size:13.5px;
    font-weight:500;

    border-radius:9px;

    transition:background-color .12s ease, color .12s ease;
}

.pf-language-option:hover{
    color:var(--pf-ink) !important;
    background:var(--pf-soft);
}

.pf-language-code{
    width:30px;
    height:22px;

    display:inline-grid;
    place-items:center;

    color:var(--pf-ink);
    background:var(--pf-soft);

    font-size:11px;
    font-weight:700;
    letter-spacing:.03em;

    border-radius:6px;
}

.pf-language-check{
    width:16px;
    height:16px;
    margin-left:auto;

    fill:none;
    stroke:var(--pf-accent);
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;

    opacity:0;
}

.pf-language-option.is-active{
    color:var(--pf-ink) !important;
    font-weight:600;
}

.pf-language-option.is-active .pf-language-code{
    color:#fff;
    background:var(--pf-ink);
}

.pf-language-option.is-active .pf-language-check{
    opacity:1;
}


/* =====================================================================
   ACTIONS
   ===================================================================== */

.pf-header-actions{
    display:flex;
    align-items:center;
    gap:4px;
}

.pf-header-logout{
    margin:0;
    padding:0;

    display:flex;
}


/* ---------- Boutons icône (compte, favoris, déconnexion) ---------- */

.pf-icon-btn{
    position:relative;

    width:40px;
    height:40px;

    display:inline-grid;
    place-items:center;

    color:var(--pf-muted) !important;
    background:transparent;

    border:0;
    border-radius:10px;

    cursor:pointer;

    transition:color .15s ease, background-color .15s ease;
}

.pf-icon-btn:hover,
.pf-icon-btn.is-active{
    color:var(--pf-ink) !important;
    background:var(--pf-soft);
}

/* Infobulle */
.pf-icon-btn[data-tooltip]::after{
    content:attr(data-tooltip);

    position:absolute;
    top:calc(100% + 8px);
    left:50%;

    padding:5px 9px;

    color:#fff;
    background:var(--pf-ink);

    font-size:12px;
    font-weight:500;
    white-space:nowrap;

    border-radius:7px;

    opacity:0;
    pointer-events:none;
    transform:translate(-50%,-4px);

    transition:opacity .15s ease, transform .15s ease;
}

.pf-icon-btn[data-tooltip]:hover::after,
.pf-icon-btn[data-tooltip]:focus-visible::after{
    opacity:1;
    transform:translate(-50%,0);
    transition-delay:.25s;
}


/* ---------- Boutons texte ---------- */

.pf-btn{
    height:40px;
    padding:0 16px;

    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;

    font-size:14px;
    font-weight:600;
    line-height:1;
    white-space:nowrap;

    border:1px solid transparent;
    border-radius:10px;

    cursor:pointer;

    transition:
        background-color .15s ease,
        color .15s ease,
        border-color .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}

.pf-btn .pf-header-icon{
    width:18px;
    height:18px;
    stroke-width:2;
}

.pf-btn-dark{
    color:#fff !important;
    background:var(--pf-ink);
    border-color:var(--pf-ink);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 6px 14px -8px rgba(10,13,12,.55);
}

.pf-btn-dark:hover,
.pf-btn-dark.is-active{
    background:var(--pf-ink-2);
    border-color:var(--pf-ink-2);

    transform:translateY(-1px);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 10px 18px -10px rgba(10,13,12,.6);
}

.pf-btn-dark:active{
    transform:none;
}

.pf-btn-ghost{
    color:var(--pf-muted) !important;
    background:transparent;
}

.pf-btn-ghost:hover{
    color:var(--pf-ink) !important;
    background:var(--pf-soft);
}

.pf-btn-outline{
    color:var(--pf-ink) !important;
    background:#fff;
    border-color:var(--pf-line);
}

.pf-btn-outline:hover{
    background:var(--pf-soft);
}

.pf-header-actions .pf-header-publish{
    margin-left:6px;
}


/* =====================================================================
   BURGER (caché sur PC)
   ===================================================================== */

.pf-burger{
    width:40px;
    height:40px;

    display:none;
    place-items:center;

    color:var(--pf-ink);
    background:#fff;

    border:1px solid var(--pf-line);
    border-radius:10px;

    cursor:pointer;

    transition:background-color .15s ease;
}

.pf-burger:hover{
    background:var(--pf-soft);
}

.pf-burger-box{
    position:relative;

    width:18px;
    height:12px;

    display:block;
}

.pf-burger-box span{
    position:absolute;
    left:0;

    width:100%;
    height:2px;

    background:currentColor;
    border-radius:2px;

    transition:top .2s ease, transform .25s ease, opacity .15s ease;
}

.pf-burger-box span:nth-child(1){ top:0; }
.pf-burger-box span:nth-child(2){ top:5px; }
.pf-burger-box span:nth-child(3){ top:10px; }

.pf-header.is-menu-open .pf-burger-box span:nth-child(1){
    top:5px;
    transform:rotate(45deg);
}

.pf-header.is-menu-open .pf-burger-box span:nth-child(2){
    opacity:0;
}

.pf-header.is-menu-open .pf-burger-box span:nth-child(3){
    top:5px;
    transform:rotate(-45deg);
}


/* =====================================================================
   MENU MOBILE (caché sur PC)
   ===================================================================== */

.pf-drawer,
.pf-drawer-backdrop{
    display:none;
}


/* =====================================================================
   PC ÉTROIT
   ===================================================================== */

@media (max-width:1024px){

    .pf-header-wrap{
        padding:0 18px;
        gap:18px;
    }

    .pf-header-logo{
        width:126px;
    }
}


/* =====================================================================
   MOBILE / TABLETTE
   ===================================================================== */

@media (max-width:860px){

    .pf-header{
        --pf-h:60px;
    }

    .pf-header-wrap{
        padding:0 14px;
        gap:12px;
    }

    .pf-header-logo{
        width:112px;
    }

    .pf-header-right{
        gap:8px;
    }

    /* Tout passe dans le menu burger */
    .pf-header-nav,
    .pf-language,
    .pf-header-divider,
    .pf-header-actions .pf-icon-btn,
    .pf-header-logout,
    .pf-header-login{
        display:none !important;
    }

    /* On garde l'action principale visible */
    .pf-header-actions .pf-header-publish{
        width:40px;
        padding:0;
        margin-left:0;
    }

    .pf-publish-label{
        display:none;
    }

    .pf-header-register{
        height:40px;
        padding:0 14px;

        font-size:13.5px;
    }

    .pf-burger{
        display:inline-grid;
    }


    /* ---------- Fond assombri ---------- */

    .pf-drawer-backdrop{
        display:block;

        position:absolute;
        top:100%;
        left:0;
        right:0;

        height:100vh;

        background:rgba(10,13,12,.32);

        opacity:0;
        visibility:hidden;

        transition:opacity .2s ease, visibility 0s linear .2s;
    }

    .pf-header.is-menu-open .pf-drawer-backdrop{
        opacity:1;
        visibility:visible;

        transition:opacity .2s ease, visibility 0s;
    }


    /* ---------- Panneau ---------- */

    .pf-drawer{
        display:block;

        position:absolute;
        top:100%;
        left:0;
        right:0;

        max-height:calc(100vh - var(--pf-h));
        max-height:calc(100dvh - var(--pf-h));
        overflow-y:auto;
        overscroll-behavior:contain;

        background:#fff;

        border-bottom:1px solid var(--pf-line);
        border-radius:0 0 20px 20px;

        box-shadow:0 24px 40px -20px rgba(10,13,12,.35);

        opacity:0;
        visibility:hidden;
        transform:translateY(-8px);

        transition:
            opacity .2s ease,
            transform .22s ease,
            visibility 0s linear .22s;
    }

    .pf-header.is-menu-open .pf-drawer{
        opacity:1;
        visibility:visible;
        transform:none;

        transition:
            opacity .2s ease,
            transform .22s ease,
            visibility 0s;
    }

    .pf-drawer-inner{
        padding:10px 14px 20px;
    }


    /* ---------- Liens ---------- */

    .pf-drawer-nav{
        display:grid;
        gap:2px;
    }

    .pf-drawer-link,
    .pf-drawer-logout{
        width:100%;

        display:flex;
        align-items:center;
        gap:12px;

        padding:10px;

        color:var(--pf-ink) !important;
        background:transparent;

        border:0;
        border-radius:12px;

        font-size:15.5px;
        font-weight:500;
        text-align:left;

        cursor:pointer;

        transition:background-color .15s ease;
    }

    .pf-drawer-link:hover,
    .pf-drawer-link.is-active{
        background:var(--pf-soft);
    }

    .pf-drawer-link.is-active{
        font-weight:600;
    }

    .pf-drawer-link-icon{
        width:38px;
        height:38px;

        display:grid;
        place-items:center;
        flex-shrink:0;

        color:var(--pf-ink);
        background:var(--pf-soft);

        border-radius:10px;
    }

    .pf-drawer-link-icon .pf-header-icon{
        width:19px;
        height:19px;
    }

    .pf-drawer-link.is-active .pf-drawer-link-icon{
        color:#fff;
        background:var(--pf-ink);
    }

    .pf-drawer-chevron{
        width:18px;
        height:18px;
        margin-left:auto;

        fill:none;
        stroke:var(--pf-faint);
        stroke-width:2;
        stroke-linecap:round;
        stroke-linejoin:round;
    }


    /* ---------- Boutons ---------- */

    .pf-drawer-actions{
        margin-top:12px;

        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }

    .pf-drawer-actions.is-single{
        grid-template-columns:1fr;
    }

    .pf-drawer-actions .pf-btn{
        width:100%;
        height:48px;

        font-size:15px;
        border-radius:12px;
    }


    /* ---------- Sections ---------- */

    .pf-drawer-section{
        margin:16px 0 0;
        padding:16px 0 0;

        border-top:1px solid var(--pf-line);
    }

    .pf-drawer-label{
        display:block;

        margin:0 4px 10px;

        color:var(--pf-faint);

        font-size:11.5px;
        font-weight:600;
        letter-spacing:.08em;
        text-transform:uppercase;
    }


    /* ---------- Sélecteur de langue ---------- */

    .pf-lang-switch{
        display:grid;
        grid-template-columns:repeat(3,1fr);
        gap:4px;

        padding:4px;

        background:var(--pf-soft);
        border-radius:12px;
    }

    .pf-lang-switch a{
        padding:8px 4px;

        display:flex;
        flex-direction:column;
        align-items:center;
        gap:2px;

        color:var(--pf-muted) !important;

        border-radius:9px;

        transition:background-color .15s ease, color .15s ease;
    }

    .pf-lang-switch strong{
        font-size:14px;
        font-weight:700;
    }

    .pf-lang-switch small{
        font-size:11px;
        font-weight:500;
    }

    .pf-lang-switch a.is-active{
        color:var(--pf-ink) !important;
        background:#fff;

        box-shadow:0 1px 3px rgba(10,13,12,.12);
    }


    /* ---------- Déconnexion ---------- */

    .pf-drawer-logout-form{
        margin-top:14px;
        padding-top:10px;
    }

    .pf-drawer-logout{
        color:var(--pf-danger) !important;
    }

    .pf-drawer-logout:hover{
        background:#fdf1f0;
    }

    .pf-drawer-logout .pf-drawer-link-icon{
        color:var(--pf-danger);
        background:#fdf1f0;
    }


    /* Bloque le scroll de la page quand le menu est ouvert */
    body.pf-menu-open{
        overflow:hidden;
    }
}


/* =====================================================================
   PETITS MOBILES
   ===================================================================== */

@media (max-width:380px){

    .pf-header-wrap{
        padding:0 10px;
        gap:8px;
    }

    .pf-header-logo{
        width:96px;
    }

    .pf-header-register{
        padding:0 11px;
        font-size:13px;
    }

    .pf-drawer-actions{
        grid-template-columns:1fr;
    }
}


/* =====================================================================
   ANIMATIONS RÉDUITES
   ===================================================================== */

@media (prefers-reduced-motion:reduce){

    .pf-header *,
    .pf-header *::before,
    .pf-header *::after{
        transition:none !important;
    }
}


/* =====================================================================
   PROTECTION BOUTONS NOIRS (contre le CSS global du site)
   ===================================================================== */

.pf-header .pf-btn-dark,
.pf-header .pf-btn-dark:link,
.pf-header .pf-btn-dark:visited,
.pf-header .pf-btn-dark:hover,
.pf-header .pf-btn-dark:active,
.pf-header .pf-btn-dark *{
    color:#fff !important;
    -webkit-text-fill-color:#fff !important;
}

.pf-header .pf-btn-dark svg,
.pf-header .pf-btn-dark svg *{
    stroke:#fff !important;
}


/* ---------------------------------------------------------------------
   LIEN ADMIN (visible seulement pour les admins)
   --------------------------------------------------------------------- */

.pf-admin-btn{
    color:#b07d1c;
}

.pf-admin-btn:hover{
    color:#8a5f10;
    background:#fdf4e1;
}

.pf-admin-link .pf-drawer-link-icon{
    color:#b07d1c;
    background:#fdf4e1;
}



/* ---------------------------------------------------------------------
   MESSAGERIE : pastille des messages non lus
   --------------------------------------------------------------------- */

.pf-msg-btn{
    position:relative;
}

.pf-msg-count{
    position:absolute;
    top:3px;
    right:2px;
    min-width:17px;
    height:17px;
    padding:0 4px;

    display:grid;
    place-items:center;

    color:#fff;
    background:#d92d20;
    border-radius:999px;
    box-shadow:0 0 0 2px #fff;

    font-size:10.5px;
    font-weight:700;
    line-height:1;
}

.pf-msg-count-inline{
    position:static;
    margin-left:auto;
    box-shadow:none;
}

.pf-msg-count-inline + .pf-drawer-chevron{
    margin-left:8px;
}