/*
 * Règles propres au nouveau thème, absentes de legacy.css :
 * - header/nav maison (remplace les surcharges Bootstrap de l'ancien site)
 * - sticky header (.fixed) — le menu n'a volontairement pas de fond coloré aléatoire
 *   (contrairement au footer, cf. legacy.css), sur demande explicite
 * - toggle du sous-menu mobile (.subMenu / .menuOver)
 * - slider maison de la home (remplace le carousel Bootstrap)
 * - modale "à propos"
 */

/* ============================================================
   Header / nav
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    padding: 10px 30px;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(27,52,93,0.1);
    transition: box-shadow 0.25s ease, padding 0.25s ease;
}

.site-header.fixed {
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.site-header .site-logo {
    display: block;
    line-height: 0;
    flex-shrink: 0;
}

.site-header .site-logo img {
    height: 50px;
    width: auto;
    transition: height 0.25s ease;
}

.site-header.fixed .site-logo img {
    height: 40px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2em;
}

.site-nav > ul.menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.7em;
    margin: 0;
    padding: 0;
}

.site-nav a {
    font-family: 'Stencil std', calibri;
    font-size: 0.95em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1b345d;
    text-decoration: none;
    padding: 0.3em 0;
    position: relative;
}

.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: #f8b912;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus {
    color: #f8b912;
}

.site-nav a:hover::after,
.site-nav a:focus::after {
    transform: scaleX(1);
}

.site-nav .dropdown {
    position: relative;
}

.site-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 14em;
    background-color: #fff;
    border-top: 2px solid #f8b912;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 30;
}

.site-nav .dropdown:hover .sub-menu,
.site-nav .dropdown:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
}

.site-nav .sub-menu li {
    display: block;
}

.site-nav .sub-menu a {
    display: block;
    padding: 0.4em 1.2em;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
}

.site-nav .sub-menu a::after {
    display: none;
}

.site-nav .sub-menu a:hover {
    background-color: #f5f5f5;
}

.facebook-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    padding: 0;
    border-radius: 50%;
    color: #1b345d;
}

.facebook-link::after {
    display: none;
}

.facebook-link:hover,
.facebook-link:focus {
    background-color: #1b345d;
    color: #fff;
}

/* Utilisé aussi par le label du champ de recherche (searchform.php) : visible pour les lecteurs
   d'écran, masqué visuellement — pattern WP standard, absent du thème jusqu'ici. */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.menuOver {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.menuOver .icon-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #1b345d;
    margin: 5px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.subMenu {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1.5em;
}

body.menu-is-open {
    overflow: hidden;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    height: 2.4em;
    padding: 0;
    background: none;
    border: 1px solid #1b345d;
    border-radius: 50%;
    color: #1b345d;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-toggle:hover,
.search-toggle:focus {
    background-color: #1b345d;
    color: #fff;
}

.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2200;
    background-color: rgba(27,52,93,0.92);
    padding: 3em 1em;
}

.search-overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: m60-fade-in 0.2s ease;
}

.search-overlay-content {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-overlay-close {
    position: absolute;
    top: -3em;
    right: 0;
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    border: none;
    background-color: rgba(255,255,255,0.9);
    color: #1b345d;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-overlay-close:hover {
    background-color: #fff;
}

.search-overlay .search-form {
    display: flex;
    align-items: center;
}

.search-overlay .search-form input[type="search"] {
    flex: 1;
    padding: 0.9em 1.2em;
    border: none;
    border-radius: 999px 0 0 999px;
    font-family: 'Courier New', Courier, Arial;
    font-size: 1.2em;
    outline: none;
}

.search-overlay .search-form button {
    border: none;
    background-color: #f8b912;
    color: #1b345d;
    border-radius: 0 999px 999px 0;
    padding: 0.9em 1.6em;
    cursor: pointer;
    font-family: 'Stencil std', calibri;
    font-size: 1em;
    letter-spacing: 0.03em;
    transition: background-color 0.2s ease;
}

.search-overlay .search-form button:hover {
    background-color: #fff;
}

@media (max-width: 1012px) {
    .menuOver {
        display: block;
        position: relative;
        z-index: 1600;
    }

    /* Le burger se change en croix quand le panneau est ouvert. */
    .menuOver.is-open .icon-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menuOver.is-open .icon-bar:nth-child(2) {
        opacity: 0;
    }

    .menuOver.is-open .icon-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Panneau slide-in depuis la droite, plutôt qu'un simple dépliement inline. */
    .subMenu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 82%;
        max-width: 320px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 1.8em;
        background-color: #fff;
        padding: 5em 1.8em 2em;
        box-shadow: -6px 0 24px rgba(0,0,0,0.25);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 1550;
    }

    .subMenu.is-open {
        transform: translateX(0);
    }

    .site-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .site-nav > ul.menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9em;
        width: 100%;
    }

    .site-nav .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        border-top: none;
        border-left: 2px solid #f8b912;
        margin-top: 0.5em;
        padding-left: 0.8em;
    }

    .site-nav .dropdown.is-open .sub-menu {
        display: block;
    }

    .search-toggle {
        align-self: flex-start;
    }

    .menu-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 1540;
    }

    .menu-backdrop.is-open {
        display: block;
    }
}


/* ============================================================
   Slider maison (page d'accueil)
   ============================================================ */

.slider {
    position: relative;
    height: 500px;
    margin-bottom: 10px;
    overflow: hidden;
}

.slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

.slider .slide.is-active {
    opacity: 1;
    visibility: visible;
}

.slider .slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider .slide-banner {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1b345d;
}

.slider .slide-caption {
    position: absolute;
    z-index: 10;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5em 2em;
    background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0) 100%);
    box-sizing: border-box;
}

.slider .slide-caption h1 {
    color: #fff;
    font-size: 2.5em;
    margin: 0 0 0.3em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.slider .slide-caption a {
    color: #fff;
}

.slider .slide-caption .apropos-button {
    display: inline-block;
    margin-top: 0.5em;
    padding: 0.5em 1.2em;
    background-color: #085196;
    border-radius: 4px;
    text-decoration: none;
}

.slider .slide-caption .apropos-button:hover {
    background-color: #063c70;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255,255,255,0.6);
    border: none;
    font-size: 2em;
    line-height: 1;
    padding: 0.2em 0.5em;
    cursor: pointer;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}


/* ============================================================
   Modale "à propos"
   ============================================================ */

.apropos-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0,0,0,0.7);
    padding: 3em 1em;
    overflow-y: auto;
    animation: m60-fade-in 0.2s ease;
}

.apropos-modal.is-open {
    display: block;
}

.apropos-modal-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2.5em;
    border-radius: 6px;
    border-top: 4px solid #f8b912;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.apropos-modal-content h1 {
    color: #1b345d;
    margin-top: 0;
}

.apropos-modal-close {
    position: absolute;
    top: 0.6em;
    right: 0.6em;
    width: 2em;
    height: 2em;
    line-height: 2em;
    text-align: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: #1b345d;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.apropos-modal-close:hover {
    background-color: #f5f5f5;
}

@keyframes m60-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ============================================================
   Lightbox maison (vignette single publication)
   ============================================================ */

.m60-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background-color: rgba(0,0,0,0.88);
    padding: 3em 1em;
    text-align: center;
    cursor: zoom-out;
}

.m60-lightbox.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: m60-fade-in 0.2s ease;
}

.m60-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    cursor: default;
}

.m60-lightbox-close {
    position: absolute;
    top: 1em;
    right: 1em;
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    border: none;
    background-color: rgba(255,255,255,0.9);
    color: #1b345d;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.m60-lightbox-close:hover {
    background-color: #fff;
}


/* ============================================================
   Lightbox PDF (single publication, PDF d'une seule page)
   ============================================================ */

.m60-pdf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background-color: rgba(0,0,0,0.88);
    padding: 3em 1em;
}

.m60-pdf-lightbox.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: m60-fade-in 0.2s ease;
}

.m60-pdf-lightbox-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100%;
}

.m60-pdf-lightbox iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.m60-pdf-lightbox-close {
    position: absolute;
    top: -1em;
    right: -1em;
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    border: none;
    background-color: rgba(255,255,255,0.9);
    color: #1b345d;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.m60-pdf-lightbox-close:hover {
    background-color: #fff;
}

@media (max-width: 1012px) {
    .m60-pdf-lightbox {
        padding: 3em 0.5em;
    }

    .m60-pdf-lightbox-close {
        top: -2.6em;
        right: 0;
    }
}


/* ============================================================
   Fade simple au scroll
   ============================================================ */

.m60-fade-target {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.m60-fade-target.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .m60-fade-target {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* ============================================================
   Page contact
   ============================================================ */

.contact-form {
    max-width: 600px;
    margin: 0 0 2em;
}

.contact-form .m60-hp {
    position: absolute;
    left: -9999px;
}

.contact-form .form-group {
    margin-bottom: 1.3em;
}

.contact-form label {
    display: block;
    margin-bottom: 0.4em;
    color: #1b345d;
    font-weight: bold;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.7em 1em;
    border: 1px solid #dde1e7;
    border-radius: 4px;
    font-family: 'Courier New', Courier, Arial;
    font-size: 1em;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: #1b345d;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .has-error input,
.contact-form .has-error textarea {
    border-color: #c0392b;
}

.contact-form .field-error {
    display: block;
    margin-top: 0.4em;
    color: #c0392b;
    font-size: 0.9em;
}

.contact-form button[type="submit"] {
    padding: 0.7em 2em;
    background-color: #1b345d;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: 'Stencil std', calibri;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 2px 2px 10px gray;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.contact-form button[type="submit"]:hover {
    background-color: #f8b912;
    color: #1b345d;
}

.form-message {
    max-width: 600px;
    margin-bottom: 1.5em;
    padding: 1em 1.3em;
    border-radius: 4px;
    font-weight: bold;
}

.form-message.form-success {
    background-color: #e3f6e5;
    color: #1e7a2e;
}

.form-message.form-error {
    background-color: #fbe4e1;
    color: #c0392b;
}

.contact-info {
    max-width: 600px;
    padding-top: 1.5em;
    border-top: 1px solid #dde1e7;
}

.contact-info p {
    font-size: 1.1em;
}

.contact-info a {
    color: #1b7fbb;
}


/* ============================================================
   Bouton "charger plus" (pages catégorie)
   ============================================================ */

.load-more-wrap {
    width: 100%;
    text-align: center;
    margin: 1.5em 0;
}

.load-more {
    padding: 0.7em 1.8em;
    background-color: #1b345d;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: 'Stencil std', calibri;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 2px 2px 10px gray;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.load-more:hover:not(:disabled) {
    background-color: #f8b912;
    color: #1b345d;
}

.load-more:disabled {
    cursor: default;
    opacity: 0.6;
}

.load-more.is-loading {
    opacity: 0.6;
}


/* ============================================================
   Page 404
   ============================================================ */

/* Le sélecteur d'origine ciblait #404.container : un identifiant CSS ne peut pas commencer par
   un chiffre, donc #404 est invalide et ces règles n'étaient jamais appliquées — d'où la page
   non centrée. On cible .container tout court, scopé à .main. */
.main .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 700px;
    margin: 4em auto;
    padding: 0 1em;
}

.main .container img {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 2px 2px 10px gray;
    margin-bottom: 1.5em;
}

.main .container h3 {
    color: #1b345d;
    font-weight: normal;
    line-height: 1.6;
}
