/* =========================================
   EN-TÊTE & NAVIGATION (site public et privé)
   ========================================= */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(15, 69, 101, 0.15);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-img {
    height: 100px;
    width: auto;
    display: block;
}

.company-name {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
}

.company-sous {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover { color: var(--primary-blue); }

.site-header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(15, 69, 101, 0.15);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.main-nav a:hover,
.main-nav a:focus-visible { text-decoration: underline; }

/* =========================================
   BANDEAU DES PAGES PRIVÉES
   (logo à gauche, menu à droite, une seule ligne)
   ========================================= */
.entete-page {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(15, 69, 101, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    display: block;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-blue);
}

header.entete-page { display: block; }

.entete-haut {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    padding: 0.75rem 2rem;
    width: 100%;
}

/* Titre du document : invisible à l'écran (utilisé pour l'impression
   par le script de remplir.php, qui le clone dans la première feuille) */
.print-titre-doc {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0 1rem;
    font-weight: 700;
    font-size: 1.00rem;
    color: var(--primary-blue);
    line-height: 1.5;
}

.print-sous-titre {
    display: block;
    margin-top: 0em;
    font-size: 0.85rem;
    font-weight: 400;
}

.entete-page .print-titre-doc { display: none; }

/* Navigation : à droite de la ligne, sur fond blanc, comme l'accueil */
.nav-principal { margin-left: auto; }

.nav-principal ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    background: none;
}

.nav-principal li { margin: 0; }

.nav-principal a {
    color: var(--primary-blue);
    text-decoration: none;
    padding: 8px 12px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-principal a:hover,
.nav-principal a:focus-visible {
    background: none;
    color: var(--primary-blue);
    text-decoration: underline;
    outline-offset: 2px;
}

/* Lien de la page courante : repère immédiat dans le menu */
.nav-principal a.actif {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 5px;
    background: var(--light-accent);
    border-radius: 4px;
}

.contenu-page {
    width: 100%;
    flex: 1;
}

/* =========================================
   PIED DE PAGE SITE (écran)
   ========================================= */
footer,
.site-footer {
    background-color: var(--primary-blue);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer p,
.site-footer p { margin: 5px 0; }

footer a,
.site-footer a {
    color: var(--light-accent);
    text-decoration: none;
}

footer a:hover,
.site-footer a:hover { text-decoration: underline; }

.pied-page {
    background-color: var(--primary-blue);
    color: var(--white);
    margin-top: auto;
    padding: 0.6rem 1rem;
    text-align: center;
}

.pied-coordonnees {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo-pied {
    height: 80px;
    width: auto;
    display: block;
}

.pied-texte { text-align: left; }

.pied-texte p { margin: 2px 0; font-size: 0.7rem; }
.pied-ligne-1 { font-weight: 600; }
.pied-ligne-2 { color: var(--light-accent); }

.pied-liens {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--light-accent);
}

.pied-liens a {
    color: var(--light-accent);
    text-decoration: none;
}

.pied-liens a:hover { text-decoration: underline; }

/* =========================================
   MOBILE — bandeau, nav, pied
   ========================================= */
@media (max-width: 768px) {

    header,
    .site-header {
        flex-direction: column;
        gap: 10px;
        padding: 0.75rem 1rem;
        position: static;
    }

    .logo-img { height: 80px; }

    .company-name { font-size: 1.2rem; }
    .company-sous { font-size: 0.65rem; }

    nav ul,
    .main-nav {
        gap: 8px 18px;
        font-size: 0.95rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .entete-haut {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1rem;
    }

    .nav-principal { margin-left: 0; }

    .nav-principal ul {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .coordonnees {
        text-align: left;
        font-size: 0.8rem;
    }
}