/**
 * -----------------------------------------------------------------------------
 * STANDARISATION U-CHILD THEME - Version Stable
 * -----------------------------------------------------------------------------
 * 1. Imports & Variables (:root)
 * 2. Styles de Base & Reset
 * 3. Layout & Conteneurs (Règles !important conservées)
 * 4. Espacement Typographique (Règles calc() conservées)
 * 5. Composants ACF (Timeline / Key Numbers)
 * 6. Articles de Blog & Animations
 * 7. Composants UI (Onglets, Tableaux, Accordéon)
 * 8. Navigation (Header, Menu)
 * 9. Galerie & LightGallery
 * 10. Pied de Page
 * 11. Responsive (Global)
 * -----------------------------------------------------------------------------
 */

/* ==========================================================================
   1. IMPORTS & VARIABLES
   ========================================================================== */
/* Open Sans — police variable locale (normal + italic) */
@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-style: italic;
    font-display: swap;
}


/* Variables globales */
:root {
    /* === COULEURS === */
    --color-primary: #dc132d;
    --color-secondary: #5a5555;
    --color-text: #0B1215;
    --color-background: #ffffff;
    --color-footer: #5a5555;
    
    /* === TYPOGRAPHIE === */
    --font-family: 'Open Sans', sans-serif;
    --font-size: 16px;
    --font-weight: 400;
    --line-height: 1.6;
    
    /* === ESPACEMENT === */
    --space-xs: 5px;
    --space-sm: 10px;
    --space-md: 15px;
    --space-lg: 20px;
    --space-xl: 25px;
    --space-2xl: 30px;
    --space-3xl: 40px;
    --space-4xl: 60px;
    
    /* === MISE EN PAGE === */
    --container-max-width: 1440px;
    --container-padding-desktop: 50px;
    --container-padding-mobile: 25px;
    --grid-gutter: 30px;
    --logo-width: 150px;
    
    /* === COMPOSANTS === */
    --border-radius: 4px;
    --transition: all 0.3s ease;
    --box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 12px;
    --focus-ring: 1px solid rgba(0, 0, 0, 0.3); /* Nouvelle variable pour le focus */
    --focus-offset: 1px;
}

/* ==========================================================================
   2. STYLES DE BASE & RESET
   ========================================================================== */
/* AMÉLIORATION: Ajout de box-sizing pour des mises en page fiables */
*, *::before, *::after {
    box-sizing: border-box;
}

body,
html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight);
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
}

.no-scroll {
    overflow-y: hidden;
}

html.no-scroll {
    overflow: hidden;
}

body:not(.home) .main-content {
    padding-top: 80px;
}

/* Accessibilité: Focus Global — :focus-visible uniquement (ne s'applique pas au clic souris) */
*:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.btn:focus-visible,
.wp-block-button .wp-block-button__link:focus-visible,
.primary-menu a:focus-visible,
.mobile-menu a:focus-visible,
.accordion-header:focus-visible,
.tabs-nav ul li:focus-visible,
.gallery-item:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    text-decoration: underline;
}

.wp-block-separator {
    border: none;
    border-top: 2px solid;
    opacity: 0.1;
    margin: var(--space-3xl) 0;
}

h2.wp-block-heading {
    font-size: 48px;
    color: var(--color-primary);
    font-weight: 300;
}

body:not(.home) h2.wp-block-heading {
    font-size: 24px;
    color: var(--color-primary);
    font-weight: 700;
}

body:not(.home) h3.wp-block-heading {
    font-size: 24px;
    font-weight: 700;
}

body:not(.home) h1.wp-block-heading,
.single-post h1.wp-block-heading {
    font-size: 48px;
    color: var(--color-primary);
}

.single-post h2.wp-block-heading {
    font-size: 32px;
    color: var(--color-primary);
}

.wp-block-paragraph a,
.wp-block-list a,
.accordion-content a,
.tab a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

.wp-block-paragraph a:hover,
.wp-block-list a:hover,
.accordion-content a:hover,
.tab a:hover {
    color: var(--color-secondary);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

.wp-block-image {
    margin-top: 0;
    margin-bottom: var(--space-lg);
}

/* Ajouter la marge haute uniquement si un bloc précède */
* + .wp-block-image {
    margin-top: var(--space-lg);
}

.aligncenter,
.wp-block-image.aligncenter {
    text-align: center;
    margin: 0 auto;
}

/* ==========================================================================
   3. LAYOUT & CONTENEURS
   ========================================================================== */

/* Conteneur principal (Conservation du !important pour la compatibilité) */
.container {
    max-width: var(--container-max-width) !important;
    padding-left: var(--container-padding-desktop) !important;
    padding-right: var(--container-padding-desktop) !important;
    width: auto !important;
}

.is-style-section {
    padding: 80px 0;
}

/* Colonnes Gutenberg */
.wp-block-columns {
    margin-top: 0;
    margin-bottom: var(--space-3xl);
    gap: var(--grid-gutter);
}

/* Ajouter la marge haute uniquement si un bloc précède */
* + .wp-block-columns {
    margin-top: var(--space-xl);
}

.wp-block-column {
    padding: 0;
}

/* Système de grille de base (Row) */
.row {
    margin-right: calc(-0.5 * var(--grid-gutter));
    margin-left: calc(-0.5 * var(--grid-gutter));
}

.row > * {
    padding-right: calc(var(--grid-gutter) * 0.5);
    padding-left: calc(var(--grid-gutter) * 0.5);
}

/* Gestion du Full Width pour Gutenberg (alignfull) */
.main-content .wp-block-group.alignfull.has-background {
    position: relative;
    width: 100vw;
    left: calc(0px - ((100vw - 100%) / 2));
    padding-left: var(--container-padding-desktop);
    padding-right: var(--container-padding-desktop);
}

.main-content .wp-block-group.alignfull.has-background > * {
    max-width: var(--container-max-width) !important;
    padding-left: var(--container-padding-desktop) !important;
    padding-right: var(--container-padding-desktop) !important;
    width: auto !important;
}

.wp-block-group.alignfull.has-background > *:last-child {
    padding: 0;
    margin-bottom: 0;
}


/* ==========================================================================
   4. ESPACEMENT TYPOGRAPHIQUE
   ========================================================================== */

/* Marges de base des titres et paragraphes */
h1, .h1 { margin-bottom: 30px; margin-top: 0; }
h2, .h2 { margin-bottom: 25px; margin-top: 0; }
h3, .h3 { margin-bottom: 20px; margin-top: 0; }
h4, .h4 { margin-bottom: 15px; margin-top: 0; }
h5, .h5 { margin-bottom: 10px; margin-top: 0; }
h6, .h6 { margin-bottom: 5px; margin-top: 0; }
p { margin-bottom: 20px; margin-top: 0; }

/* Blocs de texte avec espacement après eux */
p, ul:not([class]), ol:not([class]) {
    margin-bottom: 20px;
    margin-top: 0;
}

/* Quand un titre est suivi d'un paragraphe, ne pas ajouter d'espace supplémentaire */
h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p,
.h1 + p, .h2 + p, .h3 + p, .h4 + p, .h5 + p, .h6 + p {
    margin-top: 0;
}

/* Quand un paragraphe suit un autre paragraphe, ajouter un peu d'espace */
p + p {
    margin-top: 20px;
}

/* Quand un élément non-titre est suivi d'un titre, ajouter un espacement approprié */
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + h2,
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + .h2 {
    margin-top: calc(20px + 25px);
}

:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + h3,
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + .h3 {
    margin-top: calc(20px + 20px);
}

:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + h4,
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + .h4 {
    margin-top: calc(20px + 15px);
}

:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + h5,
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + .h5 {
    margin-top: calc(20px + 10px);
}

:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + h6,
:not(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + .h6 {
    margin-top: calc(20px + 5px);
}

/* Gestion des marges dans les conteneurs */
p:last-child, ul:not([class]):last-child, ol:not([class]):last-child {
    margin-bottom: 0;
}

.wp-block-group > :last-child,
.wp-block-column > :last-child,
.accordion-content > :last-child {
    margin-bottom: 0;
}

.wp-block-group > :first-child,
.wp-block-column > :first-child,
.accordion-content > :first-child {
    margin-top: 0;
}

blockquote {
    font-style: italic;
    border-left: 4px solid var(--color-primary);
    padding-left: 16px;
    margin: 1em 0;
}

/* ==========================================================================
   5. COMPOSANTS ACF
   ========================================================================== */

/* ===== BLOCS ACF TIMELINE (Conservation de la logique float originale) ===== */
.timeline-list {
    padding: 0;
    margin: 0 auto;
    width: 75%;
    list-style-type: none;
    position: relative;
}

.timeline-list > li {
    padding: 0 0 var(--space-lg) 0;
    clear: both;
    display: block;
    text-shadow: none!important;
    position: relative;
    width: calc(50% - 50px);
    box-sizing: border-box;
    font-size: var(--font-size);
    line-height: var(--line-height);
    float: right;
    text-align: left;
    margin-bottom: var(--space-sm);
}

.timeline-list > li h2 {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    margin-top: 0;
}

.timeline-list > li:after {
    content: "";
    display: block;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: var(--color-primary);
    position: absolute;
    top: 20px;
    left: -50px;
    margin-left: -10px;
}

.timeline-list > li:nth-child(2n) {
    float: left;
    text-align: right;
}

.timeline-list > li:nth-child(2n):after {
    left: auto;
    margin-left: 0;
    right: -50px;
    margin-right: -10px;
}

.timeline-list:before {
    content: "";
    display: block;
    height: calc(100% - 20px);
    width: 0;
    position: absolute;
    left: 50%;
    margin-left: -1.5px;
    top: 20px;
    border-left: 1px dashed var(--color-secondary);
}

.timeline-list:after {
    content: "";
    clear: both;
    display: block;
}

/* Responsive pour timeline */
@media screen and (max-width: 992px) {
    .timeline-list {
        width: 85%;
    }
    
    .timeline-list > li h2 {
        font-size: 28px;
    }
}

@media screen and (max-width: 768px) {
    .timeline-list {
        width: 100%;
    }
    
    .timeline-list > li {
        clear: both;
        float: left!important;
        width: calc(100% - 50px);
        margin-bottom: var(--space-sm);
        padding: var(--space-md);
        text-align: right!important;
        font-size: 16px;
    }
    
    .timeline-list > li h2 {
        font-size: 24px;
    }
    
    .timeline-list > li:after {
        right: -30px!important;
        left: auto!important;
        margin: 0!important;
        top: 18px;
    }
    
    .timeline-list:before {
        height: 100%;
        left: auto;
        right: 30px;
    }
}

@media screen and (max-width: 576px) {
    .timeline-list > li {
        padding: var(--space-lg);
        font-size: 15px;
    }
    
    .timeline-list > li h2 {
        font-size: 20px;
        margin-bottom: var(--space-xs);
    }
}

/* ===== BLOCS ACF KEY-NUMBER (Conservation) ===== */
.key-number-wrap {
    height: 100%;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.key-number {
    padding: var(--space-2xl);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.key-number .number {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    line-height: 1;
}

.key-number .title {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.key-number .description {
    font-size: 16px;
    color: var(--color-secondary);
    line-height: var(--line-height);
    margin-bottom: 0;
}

/* Conteneur ACF key-number avec Bootstrap */
.acf-key-number {
    margin: var(--space-3xl) 0;
}

.acf-key-number .container {
    padding-left: 0;
    padding-right: 0;
}

/* Responsive pour les blocs key-number */
@media screen and (max-width: 768px) {
    .key-number .number {
        font-size: 40px;
    }
    
    .key-number .title {
        font-size: 18px;
    }
    
    .key-number .description {
        font-size: 15px;
    }
}

@media screen and (max-width: 576px) {
    .key-number {
        padding: var(--space-lg);
    }
    
    .key-number .number {
        font-size: 36px;
    }
    
    .key-number .title {
        font-size: 16px;
    }
    
    .key-number .description {
        font-size: 14px;
    }
}


/* ==========================================================================
   6. ARTICLES DE BLOG & ANIMATIONS
   ========================================================================== */
.blog-cat,
.events-by-category {
    margin-bottom: var(--space-3xl);
}

.blog-cat-list,
.events-by-category-list {
    row-gap: var(--grid-gutter);
}

.blog-item {
    text-decoration: none;
}

.card {
    height: 100%;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--color-text);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

.card .img-wrap {
    height: 300px;
}

.card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card .blog-content {
    padding: var(--space-2xl);
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
}

.card h3 {
    margin-bottom: var(--space-lg);
    padding: 0;
    color: var(--color-primary);
}

.card .card-info {
    font-size: 15px;
    display: inline-flex;
}

.card .card-info i {
    position: relative;
    width: 25px;
    min-width: 25px;
    top: 1px;
}

.card .category {
    font-size: 14px;
    background-color: var(--color-primary);
    margin-top: var(--space-lg);
    padding: var(--space-xs) var(--space-sm);
    color: #fff;
    border-radius: var(--border-radius);
    display: inline-block;
}

.blog-item.animation {
    animation: fadeIn 0.5s;
}

/* Animations de chargement et d'attente (IAS - Infinite Scroll / Load More) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0px);
    }
}

.ias-blog,
.load-more-blog {
    text-align: center;
}

.ias-blog .loader {
    width: 50px;
    height: 50px;
    border-radius: 100%;
    position: relative;
    margin: 0 auto;
}

.ias-blog .loader:before,
.ias-blog .loader:after {
    content: "";
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    border: 5px solid transparent;
    border-top-color: var(--color-secondary);
}

.ias-blog .loader:before {
    z-index: 100;
    animation: spin 1s infinite;
}

.ias-blog .loader:after {
    border: 5px solid #eeeeee;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.load-more-blog .btn {
    position: relative;
}

.load-more-blog .btn .text {
    transition: 0.3s;
}

.load-more-blog .btn svg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: 0.3s;
    opacity: 0;
    visibility: hidden;
}

.load-more-blog .btn.loading svg {
    opacity: 1;
    visibility: visible;
}

.load-more-blog .btn.loading .text {
    opacity: 0;
    visibility: hidden;
}

/* Styles d'article individuel */
.entry-header {
    margin: 0 auto;
    margin-bottom: var(--space-3xl);
}

.entry-header h1 {
    font-weight: bold;
    font-size: 42px;
    margin-bottom: var(--space-lg);
}

.single-post .meta-text {
    font-size: 16px;
}

.entry-thumbnail {
    margin-bottom: var(--space-3xl);
}

.entry-thumbnail img {
    width: 100%;
    max-height: 800px;
    object-fit: cover;
}

.entry-content {
    margin: 0 auto;
}

.entry-categories {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.entry-categories .badge {
    background-color: var(--color-primary);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: 14px;
    display: inline-block;
}

/* ==========================================================================
   7. COMPOSANTS UI (ONGLETS, TABLEAUX, ACCORDÉON)
   ========================================================================== */

/* --- Boutons de base --- */
.btn {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--color-secondary);
    color: #ffffff;
}

.wp-block-button .wp-block-button__link {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    border-radius: 0;
}

.wp-block-button .wp-block-button__link:hover {
    background-color: var(--color-secondary);
    color: #ffffff;
}

.wp-block-buttons {
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-3xl);
    gap: var(--space-sm);
}

.wp-block-button {
    margin-bottom: var(--space-sm);
}

/* --- Onglets (Tabs) --- */
.tabs {
    margin-bottom: var(--space-3xl);
}

.tabs .tabs-nav {
    margin-bottom: var(--space-lg);
}

.tabs-nav ul {
    padding: 0px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.tabs-nav ul li {
    display: inline-block;
    list-style-type: none;
    padding: var(--space-sm) 15px;
    border-radius: var(--border-radius);
    background: #eee;
    transition: var(--transition);
    cursor: pointer;
}
.tabs-nav ul li:hover,
.tabs-nav ul li.active {
    background: var(--color-secondary);
    color: #fff;
}
.tabs-content .tab {
    display: none;
}

.tabs-content .tab.active {
    display: block;
}

/* --- Tableau --- */
table {
    width: 100%;
    border: 0;
}

table tbody tr {
    background: #fafafa;
    border-bottom: 0;
}

table tbody tr:nth-child(even) {
    background: transparent;
}

table tr td,
.wp-block-table td,
.wp-block-table th {
    border: 0;
    padding: var(--space-lg) var(--space-xl);
}

table tr td a:hover {
    color: var(--color-secondary);
    text-decoration: none;
}

table p {
    margin-bottom: 0px;
}

.wp-block-table {
    overflow-x: auto;
}

.wp-block-table::-webkit-scrollbar {
    height: 4px;
    width: 4px;
    background: #e0e0e0;
}

.wp-block-table::-webkit-scrollbar-corner {
    background: #e0e0e0;
}

.wp-block-table::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 0;
}

/* --- Accordéon --- */
.accordions {
    margin-bottom: var(--space-3xl);
}

.accordion-item {
    background: #eee;
    transition: all 0.3s ease;
    margin-bottom: var(--space-xs);
}

.accordion-item .accordion-header h1,
.accordion-item .accordion-header h2,
.accordion-item .accordion-header h3,
.accordion-item .accordion-header h4,
.accordion-item .accordion-header h5,
.accordion-item .accordion-header h6 {
    font-size: 20px;
    font-weight: 500;
    margin: 0px;
    padding: 0px;
}

.accordion-item .accordion-header {
    padding: 35px 90px 35px 35px;
    display: block;
    position: relative;
    transition: 0.3s;
    cursor: pointer;
}

/* Icône Plus/Moins */
.accordion-item .accordion-header:after {
    content: "";
    position: absolute;
    top: 50%;
    right: 35px;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    transform: translateY(-50%);
    transition: 0.3s;
}

.accordion-item .accordion-header:before {
    content: "";
    position: absolute;
    top: 50%;
    right: 45px;
    width: 2px;
    height: 22px;
    background: var(--color-text);
    transform: translateY(-50%);
    transition: 0.3s;
}

.accordion-item .accordion-header.active:before {
    transform: translateY(-50%);
    height: 0px;
}

.accordion-item.active {
    background: #e5e5e5;
}

.accordion-item .accordion-content {
    padding: var(--space-sm) 35px var(--space-xl) 35px;
    display: none;
}

/* Fix pour les marges du dernier enfant dans l'accordéon */
.accordion-item .accordion-content p:last-child {
    margin-bottom: 0px !important;
}

/* Listes dans les composants */
ul.editor-list,
.tab ul,
.accordion-content ul {
    margin-bottom: 20px;
    margin-left: 14px;
    list-style: none;
    padding: 0;
}

.accordion-content ul ul {
    margin-bottom: 16px;
    margin-top: 12px;
}

.accordion-content ul > li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 16px;
}

.accordion-content ul > li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    background: currentColor;
    border-radius: 100%;
}

.accordion-content ul ul > li:before {
    background: transparent;
    border: 1px solid currentColor;
}


/* ==========================================================================
   8. NAVIGATION (HEADER)
   ========================================================================== */
/* --- En-tête --- */
#site-header {
    padding: 0;
    background: transparent;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 99;
    transition: var(--transition);
    transform: translateY(0);
}

/* Comportement sticky désactivé — le header reste toujours visible */

/* Sur les pages secondaires, le header est dans le flux normal (fond visible) */
body:not(.home) #site-header {
    position: relative;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* --- Icônes extra (LinkedIn, Email, Site parent) --- */
.header-extra {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-extra li a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.header-extra li a img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: var(--transition);
}

.header-extra li a:hover img {
    opacity: 0.7;
    transform: translateY(-2px);
}

.site-logo {
    width: var(--logo-width);
    height: var(--logo-width);
}

.site-logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.site-logo img {
    width: 100%;
    height: 100%;
}

/* --- Navigation Principale --- */
.main-nav {
    display: block;
}

.primary-menu {
    display: flex;
    padding: 0;
    margin: 0;
    gap: var(--space-3xl);
    list-style: none;
}

.primary-menu li {
    position: relative;
}

.primary-menu li a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    transition: var(--transition);
    display: block;
}

.primary-menu li a:hover {
    color: var(--color-primary);
}

.primary-menu li.current-menu-item a {
    color: var(--color-primary);
}

/* Styles des Sous-menus */
.primary-menu li .sub-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    background-color: rgba(11, 18, 21, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    padding: var(--space-xs) 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    min-width: 230px;
}

/* Caret en diamant (carré rotationé) pour correspondre au glassmorphism */
.primary-menu li .sub-menu::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 24px;
    width: 10px;
    height: 10px;
    background-color: rgba(11, 18, 21, 0.82);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

.primary-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu li .sub-menu li {
    margin: 0;
    position: relative;
}

.primary-menu li .sub-menu li a {
    padding: 10px var(--space-lg) 10px calc(var(--space-lg) + 3px);
    color: rgba(255, 255, 255, 0.82);
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.01em;
    text-transform: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-left-color 0.2s ease, padding-left 0.2s ease;
}

.primary-menu li .sub-menu li:last-child a {
    border-bottom: none;
}

.primary-menu li .sub-menu li a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.07);
    border-left-color: var(--color-primary);
    padding-left: calc(var(--space-lg) + 8px);
}

/* Sous-menu de troisième niveau */
.primary-menu li .sub-menu li .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 4px;
}

/* Pas de caret sur les sous-sous-menus */
.primary-menu li .sub-menu li .sub-menu::before {
    display: none;
}

.primary-menu li .sub-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Indicateur de flèche déroulante (SVG style Font Awesome chevron-down) */
.primary-menu li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23ffffff' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.3s ease;
    position: relative;
    top: -1px;
}

.primary-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* Flèche droite pour les éléments de sous-menu avec enfants */
.primary-menu li .sub-menu li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: auto;
    float: right;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23ffffff' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transform: rotate(-90deg);
    position: relative;
    top: 6px;
}

.primary-menu li .sub-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(-90deg);
}

/* --- Navigation Mobile --- */
.menu-toggle {
    display: none;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    z-index: 100;
}

.menu-toggle span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--color-text);
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: var(--transition);
}

.menu-toggle span:nth-child(1) { top: 0px; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

.menu-toggle.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

.mobile-nav-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 98;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding-top: var(--space-4xl);
}

.mobile-nav-container.open { right: 0; }

.mobile-nav-inner {
    padding: 0 var(--space-xl) var(--space-2xl);
}

.mobile-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu li {
    margin: 0;
    padding: 0;
    position: relative;
}

.mobile-menu li a {
    display: block;
    position: relative;
    padding: 12px 0;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.mobile-menu li a:hover {
    color: var(--color-primary);
}

.mobile-menu .sub-menu {
    display: none;
    margin: 0;
    list-style: none;
    margin-top: var(--space-sm);
    padding-left: var(--space-lg);
}

.mobile-menu .submenu-open > .sub-menu {
    display: block;
}

.mobile-menu .sub-menu li a {
    padding: 8px 0;
    font-size: 16px;
    color: var(--color-secondary);
}

.mobile-menu .sub-menu li a:hover {
    color: var(--color-primary);
}

.mobile-menu .menu-item-has-children > a::after {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%230B1215' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.mobile-menu .submenu-open > a::after {
    transform: translateY(-50%) rotate(180deg);
}


/* ==========================================================================
   9. GALERIE & SLIDERS
   ========================================================================== */
/* --- Fond slider commun dans le header (pages hors accueil) --- */
.header-bg-slider {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.common-header-swiper {
    width: 100%;
    height: 100%;
}

.common-header-swiper .swiper-slide {
    position: relative;
    overflow: hidden;
}

.common-header-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.common-header-swiper .swiper-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

/* --- Sliders --- */
.main-swiper {
    width: 100%;
    height: 450px;
    position: relative;
}

.main-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-swiper .swiper-slide .slide-caption {
    position: absolute;
    width: 100%;
}

.main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-swiper .swiper-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.main-swiper .swiper-slide .slide-caption {
    z-index: 2;
}

.testimonials-swiper {
    width: 100%;
    position: relative;
    margin-bottom: var(--space-3xl);
}

.testimonials-swiper .swiper-wrapper {
    display: flex;
    align-items: center;
}

.testimonials-swiper .swiper-slide {
    transition: var(--transition);
}

.testimonials-swiper .swiper-pagination {
    position: relative;
    margin-top: var(--space-3xl);
}

.testimonials-swiper .swiper-slide:not(.swiper-slide-active) .testimonial-card {
    opacity: 0;
    transform: scale(0.9);
}

.testimonials-swiper .testimonial-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0px 100px;
}

.testimonials-swiper .testimonial-content {
    font-style: italic;
    margin-bottom: var(--space-lg);
    font-size: 20px;
}

.testimonials-swiper h4 {
    font-weight: 600;
    margin-bottom: 0px;
}

/* --- Grille de Logos --- */
.logo-grid {
    margin: var(--space-3xl) 0;
}

.logo-item {
    background-color: #fafafa;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.logo-item a {
    display: flex;
    padding: var(--space-3xl);
    align-items: center;
    width: 100%;
    height: 100%;
}

.logo-item img {
    width: 100%;
    height: auto;
    max-height: 125px;
    object-fit: contain;
    /* filter: grayscale(1); */
    transition: var(--transition);
}

.logo-item:hover img {
    /* filter: grayscale(0); */ 
    transform: translateY(-5px);
}

/* --- Galerie --- */
.acf-gallery {
    margin: var(--space-3xl) 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.gallery-grid .gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-grid .gallery-item:hover {
    transform: translateY(-5px);
}

/* Masonry */
.gallery-masonry {
    column-count: 4;
    column-gap: var(--space-lg);
    width: 100%;
}

.gallery-masonry .gallery-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 var(--space-lg);
    break-inside: avoid;
    -moz-column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    transform: translateZ(0);
    border-radius: 0;
}

.gallery-masonry .gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.gallery-masonry .gallery-item:hover {
    transform: none;
}

/* Éléments de Galerie */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    border-radius: var(--border-radius);
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    inset: auto 0 0 0;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: var(--space-sm);
    font-size: 14px;
}

/* Styles LightGallery */
.lg-backdrop {
    background-color: rgba(0,0,0,0.85);
}

.lg-toolbar .lg-icon,
.lg-actions .lg-next, 
.lg-actions .lg-prev {
    background-color: rgba(90, 85, 85, 0.45);
    color: #fff;
}

.lg-toolbar .lg-icon:hover,
.lg-actions .lg-next:hover, 
.lg-actions .lg-prev:hover {
    background-color: var(--color-primary);
}


/* ==========================================================================
   10. PIED DE PAGE
   ========================================================================== */
footer .footer-content {
    padding: 60px 0;
    background-color: var(--color-footer);
}

footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer p,
footer a {
    color: #ffffff!important;
}

footer a {
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--color-primary)!important;
}

footer hr.wp-block-separator {
    border: none;
    border-top: 1px solid;
    opacity: 1;
    margin: var(--space-xl) 0;
    color: #fff;
}

footer .copyright-container {
    padding: var(--space-sm) 0;
    background-color: var(--color-primary);
    font-size: 16px;
    color: #ffffff;
}

/* ==========================================================================
   11. RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */

/* --- 1200px — Tablette paysage / petit desktop --- */
@media screen and (max-width: 1200px) {
    .gallery-masonry { column-count: 3; }

    .header-left {
        gap: 40px;
    }

    .primary-menu {
        gap: var(--space-2xl);
    }

    .main-swiper {
        height: 380px;
    }
}

/* --- 1050px — Basculement menu mobile --- */
@media screen and (max-width: 1050px) {
    /* Logo réduit sur mobile — la relation logo/menu ne s'applique plus ici */
    :root {
        --logo-width: 80px;
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    /* Décale le contenu du menu mobile sous le header (hauteur logo + marge) */
    .mobile-nav-container {
        padding-top: 95px;
    }

    /* Burger toujours blanc — le header est toujours sur un slider sombre */
    .menu-toggle span {
        background: #fff;
    }

    /* Quand le menu est ouvert, le fond du nav (blanc) est visible
       derrière le header transparent — le X redevient sombre */
    .menu-toggle.active span {
        background: var(--color-text);
    }
}

/* --- 992px — Tablette portrait --- */
@media screen and (max-width: 992px) {
    .gallery-masonry { column-count: 2; }

    /* Typographie */
    h2.wp-block-heading {
        font-size: 36px;
    }

    body:not(.home) h1.wp-block-heading,
    .single-post h1.wp-block-heading {
        font-size: 36px;
    }

    .entry-header h1 {
        font-size: 34px;
    }

    /* Section */
    .is-style-section {
        padding: 50px 0;
    }

    /* Testimonials */
    .testimonials-swiper .testimonial-card {
        padding: 0 50px;
    }

    .testimonials-swiper .testimonial-content {
        font-size: 18px;
    }

    /* Slider */
    .main-swiper {
        height: 320px;
    }

    /* Grille de logos */
    .logo-item a {
        padding: var(--space-xl);
    }
}

/* --- 768px — Mobile large --- */
@media screen and (max-width: 768px) {
    /* Conteneur */
    .container,
    .main-content .wp-block-group.alignfull.has-background {
        padding-left: var(--container-padding-mobile)!important;
        padding-right: var(--container-padding-mobile)!important;
    }

    /* Typographie */
    h2.wp-block-heading {
        font-size: 28px;
    }

    body:not(.home) h2.wp-block-heading {
        font-size: 20px;
    }

    body:not(.home) h1.wp-block-heading,
    .single-post h1.wp-block-heading {
        font-size: 28px;
    }

    .entry-header h1 {
        font-size: 26px;
    }

    body:not(.home) .main-content {
        padding-top: 40px;
    }

    /* Sections */
    .is-style-section {
        padding: 40px 0;
    }

    /* Accordéon */
    .accordion-item .accordion-header {
        padding: var(--space-xl) 60px var(--space-xl) var(--space-xl);
    }

    .accordion-item .accordion-header:after {
        right: var(--space-xl);
    }

    .accordion-item .accordion-header:before {
        right: calc(var(--space-xl) + 10px);
    }

    .accordion-item .accordion-content {
        padding: var(--space-sm) var(--space-xl) var(--space-xl);
    }

    /* Testimonials */
    .testimonials-swiper .testimonial-card {
        padding: 0 var(--space-lg);
    }

    .testimonials-swiper .testimonial-content {
        font-size: 16px;
    }

    /* Slider */
    .main-swiper {
        height: 260px;
    }

    /* Footer */
    footer .footer-content {
        padding: 40px 0;
    }

    /* Espacement blocs */
    .wp-block-columns {
        margin-bottom: var(--space-xl);
    }

    .wp-block-buttons {
        margin-top: var(--space-xl);
        margin-bottom: var(--space-xl);
    }
}

/* --- 576px — Mobile standard --- */
@media screen and (max-width: 576px) {
    :root {
        --logo-width: 60px;
    }

    /* Ajuster le décalage du nav mobile au logo réduit */
    .mobile-nav-container {
        padding-top: 75px;
    }

    .gallery-masonry { column-count: 1; }

    /* Typographie */
    h2.wp-block-heading {
        font-size: 24px;
    }

    body:not(.home) h1.wp-block-heading,
    .single-post h1.wp-block-heading {
        font-size: 24px;
    }

    .single-post h2.wp-block-heading {
        font-size: 20px;
    }

    .entry-header h1 {
        font-size: 22px;
    }

    /* Section */
    .is-style-section {
        padding: 30px 0;
    }

    /* Testimonials */
    .testimonials-swiper .testimonial-card {
        padding: 0;
    }

    /* Slider */
    .main-swiper {
        height: 220px;
    }

    /* Cards */
    .card .img-wrap {
        height: 220px;
    }
}