/*
Theme Name: AGeReB Delta-Mono
Author: Marc-Olivier
Description: Thème sur mesure du projet AGeReB / Delta-Mono (UICN).
Version: 1.0.0
*/

/* ===== Polices auto-hébergées =====
   Nunito (titres + corps) : sans-serif rond, cohérent avec le wordmark du logo AGeReB.
   Variable font : un seul fichier normal + un seul fichier italique couvrent toutes les graisses.
   IBM Plex Mono (chiffres, légendes) : trois graisses statiques, conservé pour les données. */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url('fonts/nunito-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: italic;
    font-weight: 200 1000;
    font-display: swap;
    src: url('fonts/nunito-variable-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-mono-600.woff2') format('woff2');
}

:root {
    --font-heading: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* Bleu extrait du logo AGeReB (pixels du héron / wordmark) — accent froid rare,
       pas encore appliqué : usages proposés en attente de validation. */
    --bleu-logo: #06478D;
}

body {
    background: #F5EFE2;
    font-family: var(--font-body);
    color: #122320;
    margin: 0;
    line-height: 1.65;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.1;
}

/* Conteneur qui recentre le contenu à l'intérieur des sections */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
}

/* En-tête / navigation */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0A3D3A;
    padding: 18px 40px;
}
.site-header a {
    color: #F5EFE2;
    text-decoration: none;
}
.site-nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}
.site-nav a {
    color: #cfe3db;
    font-weight: 500;
}
.site-nav a:hover {
    color: #E4A03C;
}

/* Bannière (hero) — aplat teinté (pas de dégradé décoratif) pour la lisibilité du texte sur la photo */
.hero {
    background:
        linear-gradient(rgba(10,45,42,0.72), rgba(10,45,42,0.72)),
        url('/wp-content/uploads/2026/08/vedette-2.jpg') center/cover no-repeat;
    color: #EAF4EF;
    padding: 90px 0 110px;
}
.hero h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    margin: 20px 0 24px;
    color: #ffffff;
}
.hero h1 .em {
    color: #E4A03C;
    font-style: italic;
}
.hero .official {
    max-width: 620px;
    color: #bfdad0;
    border-left: 2px solid #E4A03C;
    padding-left: 18px;
    font-size: 1.05rem;
}
.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 36px;
}

/* Boutons : rectangles pleins, coins nets — pas de pill */
.btn {
    display: inline-block;
    padding: 13px 28px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 0;
    border: 2px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.btn--solid {
    background: #E4A03C;
    color: #0A3D3A;
    border-color: #E4A03C;
}
.btn--solid:hover {
    background: #f0b158;
    border-color: #f0b158;
}
.btn--outline {
    background: transparent;
    color: #EAF4EF;
    border-color: rgba(234,244,239,0.55);
}
.btn--outline:hover {
    border-color: #EAF4EF;
    background: rgba(234,244,239,0.08);
}

/* Bandeau partenaires */
.funders {
    background: #ffffff;
    border-bottom: 1px solid rgba(18,97,90,0.12);
    padding: 26px 0;
}
.funders-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.funders-label {
    color: #bcd6cc;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.funders-strip {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Section Le projet */
.projet {
    background: #ffffff;
    padding: 88px 0;
}
.projet h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin: 0 0 40px;
    color: #0A3D3A;
    max-width: 640px;
}
.projet-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 56px;
    align-items: start;
}
.projet-texte p {
    margin: 0 0 16px;
    color: #33433f;
    font-family: var(--font-body);
    font-size: 1.28rem;
}
/* "Objectif" : note éditoriale en marge, pas une carte — filet, pas de fond ni de radius */
.projet-objectif {
    border-left: 1px solid rgba(10,61,58,0.25);
    padding-left: 28px;
}
.projet-objectif-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5a56;
    margin: 0 0 10px;
}
.projet-objectif h3 {
    color: #0A3D3A;
    font-size: 1.25rem;
    margin: 0 0 12px;
}
.projet-objectif p {
    color: #33433f;
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.22rem;
}

/* Respiration photographique plein cadre entre deux sections de texte */
.respiration {
    background: #0A3D3A;
}
.respiration figure {
    margin: 0;
}
.respiration img {
    width: 100%;
    height: clamp(320px, 50vw, 560px);
    object-fit: cover;
    display: block;
}

/* Section Chiffres clés — page de rapport, pas des cards.
   Colonne asymétrique : les deux chiffres d'impact (grands) à gauche,
   les deux faits de contexte (petits) à droite, séparés par un filet. */
.chiffres {
    background: #EBE2CC;
    padding: 64px 0 72px;
}
.chiffres h2 {
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    margin: 0 0 44px;
    color: #0A3D3A;
    max-width: 460px;
}
.chiffres-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    column-gap: 56px;
}
.chiffres-impact {
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.chiffres-contexte {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    border-left: 1px solid rgba(10,61,58,0.22);
    padding-left: 32px;
}
.chiffre {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chiffre-num {
    font-family: var(--font-mono);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    /* espace insécable fine entre milliers : en monospace, un espace normal
       a la même largeur qu'un chiffre et fait lire deux nombres distincts */
    word-spacing: -0.32em;
    font-variant-numeric: tabular-nums;
    color: #12615A;
}
.chiffres-impact .chiffre-num {
    font-size: clamp(2.5rem, 5.2vw, 3.8rem);
}
.chiffres-contexte .chiffre-num {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    /* accent froid rare — reprend le bleu du logo pour distinguer les faits
       de contexte des chiffres d'impact (restés en vert) */
    color: var(--bleu-logo);
}
.chiffre-label {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.92rem;
    color: #4a5a56;
    letter-spacing: 0.01em;
}
.chiffres-contexte .chiffre-label {
    font-size: 0.86rem;
}

/* Section Zone d'intervention */
.zone {
    background: #ffffff;
    padding: 88px 0;
}
.zone h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin: 0 0 16px;
    color: #0A3D3A;
    max-width: 680px;
}
.zone-intro {
    max-width: 680px;
    color: #4a5a56;
    margin: 0 0 40px;
    font-family: var(--font-body);
    font-size: 1.15rem;
}
/* Liste éditoriale — plus de cards : filets, photo d'un côté qui alterne, texte de l'autre */
.zone-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(10,61,58,0.18);
}
.zone-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 48px 0;
    border-bottom: 1px solid rgba(10,61,58,0.18);
}
/* Une entrée sur deux : la photo passe à droite */
.zone-item--reverse .zone-photo {
    order: 2;
}
.zone-item--reverse .zone-content {
    order: 1;
}
/* Pas de photo disponible : le texte reprend toute la largeur, rien ne casse */
.zone-item--no-photo {
    grid-template-columns: 1fr;
}
.zone-photo {
    margin: 0;
}
.zone-photo img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.zone-num {
    display: block;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.95rem;
    color: #4E9D6C;
    margin: 0 0 10px;
}
/* La ligne "Aire Marine Protégée" : seule occurrence où l'ocre marque une exception ponctuelle */
.zone-num--amp {
    color: #E4A03C;
    letter-spacing: 0.03em;
}
.zone-content h3 {
    font-size: 1.25rem;
    margin: 0 0 10px;
    color: #0A3D3A;
}
.zone-content p {
    font-size: 1.1rem;
    color: #4a5a56;
    margin: 0;
    max-width: 480px;
    font-family: var(--font-body);
}

/* Pied de page */
.site-footer {
    background: #0A3D3A;
    color: #bcd6cc;
    padding: 70px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 46px;
}
.site-footer h3 { color: #fff; font-size: 1.3rem; margin: 0 0 14px; }
.site-footer h4 {
    color: #E4A03C; font-size: 0.78rem; letter-spacing: 0.12em;
    text-transform: uppercase; margin: 0 0 14px;
}
.site-footer p { color: #bcd6cc; font-size: 1rem; margin: 0; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 22px;
    display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    font-size: 0.9rem; color: #8fb3a8;
}

/* ===== Responsive : écrans étroits (mobile / tablette) ===== */
@media (max-width: 860px) {

    /* Barre du haut : logo et menu empilés et centrés */
    .site-header {
        flex-direction: column;
        gap: 14px;
        padding: 18px 24px;
        text-align: center;
    }
    .site-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    /* "Le projet" : les 2 colonnes passent l'une sous l'autre */
    .projet-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Chiffres : la colonne de contexte passe sous la colonne d'impact */
    .chiffres-grid {
        grid-template-columns: 1fr;
        row-gap: 32px;
    }
    .chiffres-contexte {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(10,61,58,0.22);
        padding-top: 28px;
        flex-direction: row;
        gap: 40px;
    }

    /* Zone d'intervention : photo au-dessus du texte, l'alternance ne s'applique plus */
    .zone-item {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 36px 0;
    }
    .zone-item--reverse .zone-photo,
    .zone-item--reverse .zone-content {
        order: initial;
    }

    /* Footer : les 3 colonnes s'empilent */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    /* Un peu moins d'espace vertical sur mobile */
    .hero {
        padding: 60px 0 70px;
    }
}

/* ===== Très petits écrans (téléphones) ===== */
@media (max-width: 520px) {

    .chiffres-contexte {
        flex-direction: column;
        gap: 24px;
    }

    /* La ligne du bas du footer se centre */
    .footer-bottom {
        justify-content: center;
        text-align: center;
    }
}

/* Logo dans la barre du haut */
.site-logo {
    height: 100px;
    width: auto;
    display: block;
}

/* ===== Galerie ===== */
/* Traitement documentaire : images pleines, pas d'effet "portfolio" (radius/ombre/zoom) */

/* Espacement entre les images */
.wp-block-gallery.has-nested-images {
    gap: 18px !important;
}

/* Chaque image de la galerie */
.wp-block-gallery.has-nested-images figure.wp-block-image {
    overflow: hidden;
}

/* L'image elle-même : hauteur régulière */
.wp-block-gallery.has-nested-images figure.wp-block-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

/* Un peu d'air autour de la galerie */
.page-content .wp-block-gallery {
    margin-top: 30px;
}

/* ===== Formulaire de contact (Fluent Forms) ===== */

/* Le bouton Envoyer aux couleurs du site */
.fluentform .ff-btn-submit,
.fluentform button[type="submit"] {
    background: #0A3D3A !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 13px 34px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: background 0.25s ease !important;
}
.fluentform .ff-btn-submit:hover,
.fluentform button[type="submit"]:hover {
    background: #E4A03C !important;
    color: #0A3D3A !important;
}

/* Les champs : anneau de focus net, en bleu (couleur du logo) — état d'interaction, pas de décor */
.fluentform input:focus,
.fluentform textarea:focus,
.fluentform select:focus {
    border-color: var(--bleu-logo) !important;
    outline: 2px solid var(--bleu-logo) !important;
    outline-offset: 1px;
}

/* Un peu d'air sous le formulaire */
.fluentform {
    margin-top: 10px;
}

/* ===== En-tête des pages internes ===== */
.page-hero {
    background: #0A3D3A;
    color: #EAF4EF;
    padding: 72px 0 60px;
}
.page-hero h1 {
    color: #ffffff;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    margin: 16px 0 0;
}
.page-hero-sub {
    color: #bfdad0;
    font-size: 1.1rem;
    max-width: 640px;
    margin: 20px 0 0;
    border-left: 2px solid #E4A03C;
    padding-left: 18px;
}

/* Corps de page */
.page-content {
    background: #ffffff;
    padding: 60px 0 80px;
}
.page-content h1 {
    color: #0A3D3A;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    margin: 0 0 24px;
}
.page-body {
    max-width: 760px;
    color: #33433f;
    font-size: 1.05rem;
}
.page-body p { margin: 0 0 18px; }
/* Liens du corps de texte : bleu du logo — usage fonctionnel (affordance de lien), pas décoratif */
.page-body a {
    color: var(--bleu-logo);
    text-underline-offset: 2px;
}
.page-body a:hover {
    color: #0A3D3A;
}

/* ===== Textes de la page Contact, plus soignés ===== */

/* Le paragraphe d'intro (le premier) en plus grand, façon "chapô" */
.page-contact .fluent_form_ffform_wrapper,
.page-template-default.page .page-body > p:first-of-type {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #1c332e;
}

/* On cible spécifiquement la page Contact via son body class */
body.page-id-8 .page-body {
    max-width: 700px;
}

/* Le paragraphe d'intro : plus grand, façon "chapô" élégant */
body.page-id-8 .page-body > p:last-of-type {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #1c332e;
    margin: 0 0 14px;
}

/* L'adresse : discrète, en petit, gris-vert */
body.page-id-8 .page-body > p:first-of-type {
    font-size: 0.95rem;
    color: #6a7a74;
    line-height: 1.6;
    margin: 0 0 28px;
}

/* ===== Animations : arrivée en douceur ===== */

/* La bannière/en-tête glisse depuis le haut */
.hero,
.page-hero {
    animation: agFadeDown 0.8s ease both;
}

/* Le contenu visible sans défiler (juste sous le hero) monte en fondu au chargement.
   .projet / .chiffres / .zone ne sont PAS ici : elles utilisent .reveal (révélation
   au défilement, plus bas) — les deux animations combinées sur un même élément se
   neutralisaient (l'animation de chargement figeait opacity:1 après ~1s, donc plus
   rien à "révéler" quand l'IntersectionObserver ajoutait .is-visible ensuite). */
.funders,
.page-content {
    animation: agFadeUp 0.9s ease 0.15s both;
}

@keyframes agFadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: none; }
}
@keyframes agFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

/* Respect des préférences d'accessibilité (mouvement réduit) */
@media (prefers-reduced-motion: reduce) {
    .hero, .page-hero, .funders, .page-content {
        animation: none;
    }
}

/* ===== Révélation au défilement ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Ajustements responsive (ajoutés) ===== */
@media (max-width: 860px) {
    /* Logo plus compact sur mobile : on gagne de la hauteur, moins de scroll */
    .site-logo {
        height: 64px;
    }
}

@media (max-width: 520px) {
    /* Marges latérales réduites sur petit écran : le contenu respire un peu plus large */
    .container {
        padding: 0 18px;
    }
}

/* ===== Menu hamburger (mobile) ===== */

/* La case à cocher qui mémorise l'état ouvert/fermé du menu : toujours invisible.
   "Checkbox hack" : pas de JavaScript — c'est le CSS qui réagit à l'état coché
   de cette case pour afficher ou masquer le menu. */
.nav-toggle {
    display: none;
}

/* Le bouton hamburger : masqué sur grand écran (là, le menu s'affiche normalement) */
.nav-toggle-btn {
    display: none;
    cursor: pointer;
    padding: 8px;
    line-height: 0;
}
/* Les trois barres du hamburger */
.nav-toggle-btn span {
    display: block;
    width: 26px;
    height: 2px;
    background: #F5EFE2;
    margin: 6px 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 860px) {
    /* Barre du haut : logo à gauche, hamburger à droite, sur une même ligne */
    .site-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    /* On affiche le bouton hamburger */
    .nav-toggle-btn {
        display: block;
    }

    /* Le menu occupe toute la largeur, passe sous la barre, et se replie par défaut */
    .site-nav {
        flex-basis: 100%;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }
    .site-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 10px 0;
    }
    .site-nav a {
        display: block;
        padding: 10px;
        font-size: 1.05rem;
    }

    /* Case cochée (hamburger tapé) : le menu se déploie */
    .nav-toggle:checked ~ .site-nav {
        max-height: 360px;
    }

    /* Le hamburger se transforme en croix quand le menu est ouvert */
    .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* ===== Page Communiqués de presse (bloc natif "Fichier" de WordPress) ===== */

.page-body .wp-block-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(10,61,58,0.15);
}

/* Titre du communiqué (premier lien du bloc) */
.page-body .wp-block-file > a:first-child {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0A3D3A;
    text-decoration: none;
}
.page-body .wp-block-file > a:first-child:hover {
    color: var(--bleu-logo);
    text-decoration: underline;
}

/* Bouton Télécharger, dans le style .btn du site (ocre, rectangulaire) */
.page-body .wp-block-file__button {
    background: #E4A03C !important;
    color: #0A3D3A !important;
    border-radius: 0 !important;
    padding: 10px 24px !important;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease;
    margin-left: 0 !important;
}
.page-body .wp-block-file__button:hover {
    background: #f0b158 !important;
}

/* Mobile : bouton sous le titre */
@media (max-width: 600px) {
    .page-body .wp-block-file {
        flex-direction: column;
        align-items: flex-start;
    }
}