/*
Theme Name: CleanEB Child
Theme URI: https://cleaneb.fr/
Description: Thème enfant CleanEB basé sur Hello Elementor.
Author: CleanEB
Author URI: https://cleaneb.fr/
Template: hello-elementor
Version: 1.0.0
Text Domain: cleaneb-child
*/

/* =========================================================
   VARIABLES CLEANEB
========================================================= */

:root {
    --cleaneb-green: #84A392;
    --cleaneb-green-dark: #6F9180;
    --cleaneb-text: #17201B;
    --cleaneb-muted: #66736B;
    --cleaneb-background: #FFFFFF;
    --cleaneb-soft-background: #F2F7F4;
    --cleaneb-border: rgba(23, 32, 27, 0.10);
    --cleaneb-shadow: 0 15px 40px rgba(23, 32, 27, 0.12);
}

/* =========================================================
   BASE
   Règles limitées afin de ne pas perturber Elementor
========================================================= */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--cleaneb-text);
    background: var(--cleaneb-background);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================================
   HEADER CLEANEB
========================================================= */

.cleaneb-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid var(--cleaneb-border);
}

.cleaneb-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
    width: min(calc(100% - 40px), 1280px);
    min-height: 125px;
    margin: 0 auto;
}

/* Logo */

.cleaneb-header__logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.cleaneb-header__logo img {
    display: block;
    width: auto;
    max-width: 300px;
    max-height: 105px;
    object-fit: contain;
}

/* Navigation */

.cleaneb-header__navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
}

.cleaneb-header__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cleaneb-header__menu li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cleaneb-header__menu > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 90px;
    color: var(--cleaneb-text);
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cleaneb-header__menu > li > a:hover,
.cleaneb-header__menu > li.current-menu-item > a,
.cleaneb-header__menu > li.current-menu-ancestor > a {
    color: var(--cleaneb-green);
}

/* Trait animé sous les liens */

.cleaneb-header__menu > li > a::after {
    position: absolute;
    right: 0;
    bottom: 24px;
    left: 0;
    height: 2px;
    background: var(--cleaneb-green);
    content: "";
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.cleaneb-header__menu > li > a:hover::after,
.cleaneb-header__menu > li.current-menu-item > a::after,
.cleaneb-header__menu > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* Sous-menu WordPress */

.cleaneb-header__menu .sub-menu {
    position: absolute;
    top: calc(100% - 12px);
    left: 0;
    z-index: 20;
    min-width: 240px;
    margin: 0;
    padding: 10px;
    visibility: hidden;
    list-style: none;
    background: #FFFFFF;
    border: 1px solid var(--cleaneb-border);
    border-radius: 12px;
    box-shadow: var(--cleaneb-shadow);
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.cleaneb-header__menu li:hover > .sub-menu,
.cleaneb-header__menu li:focus-within > .sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.cleaneb-header__menu .sub-menu a {
    display: block;
    padding: 11px 14px;
    color: var(--cleaneb-text);
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.cleaneb-header__menu .sub-menu a:hover,
.cleaneb-header__menu .sub-menu .current-menu-item > a {
    color: var(--cleaneb-green-dark);
    background: var(--cleaneb-soft-background);
}

/* =========================================================
   CTA DU HEADER
========================================================= */

body .cleaneb-header a.cleaneb-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 165px;
    min-height: 48px;
    padding: 0 22px;
    color: #FFFFFF !important;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background-color: #84A392 !important;
    border: 2px solid #84A392;
    border-radius: 11px;
    box-shadow: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

/* Aucune flèche sur le CTA */

body .cleaneb-header a.cleaneb-header__cta::after {
    display: none;
    content: none;
}

/* Survol du CTA */

body .cleaneb-header a.cleaneb-header__cta:hover,
body .cleaneb-header a.cleaneb-header__cta:focus-visible {
    color: #FFFFFF !important;
    background-color: #6F9180 !important;
    border-color: #6F9180;
    box-shadow: 0 8px 18px rgba(132, 163, 146, 0.28);
    transform: translateY(-2px);
}

/* Le CTA mobile est masqué sur ordinateur */

body .cleaneb-header a.cleaneb-header__cta--mobile {
    display: none;
}

/* =========================================================
   MENU BURGER
========================================================= */

.cleaneb-header__toggle,
.cleaneb-header__burger {
    display: none;
}

/* =========================================================
   TEMPLATE ARTICLE CLEANEB
========================================================= */

/* Contenu centré après suppression de la colonne latérale */

.cleaneb-article__main {
    display: block;
    width: min(calc(100% - 40px), 900px);
    margin: 0 auto;
}

.cleaneb-article__body {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.cleaneb-article__content {
    width: 100%;
}

/* Lisibilité du contenu éditorial */

.cleaneb-article__content p,
.cleaneb-article__content ul,
.cleaneb-article__content ol,
.cleaneb-article__content blockquote {
    margin-top: 0;
    margin-bottom: 1.4em;
}

.cleaneb-article__content h2,
.cleaneb-article__content h3,
.cleaneb-article__content h4 {
    scroll-margin-top: 120px;
}

.cleaneb-article__content img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Image de l’auteur */

.cleaneb-article__author-avatar {
    flex: 0 0 auto;
}

.cleaneb-article__author-avatar img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
}

/* =========================================================
   EAEL POST GRID
   Cartes de même hauteur et boutons alignés
========================================================= */

.eael-post-grid-container .eael-post-grid {
    align-items: stretch !important;
}

.eael-post-grid-container .eael-grid-post {
    display: flex !important;
    height: auto !important;
}

.eael-post-grid-container .eael-grid-post-holder,
.eael-post-grid-container .eael-grid-post-holder-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
}

.eael-post-grid-container .eael-entry-wrapper,
.eael-post-grid-container .eael-entry-content,
.eael-post-grid-container .eael-grid-post-excerpt {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
}

.eael-post-grid-container .eael-post-elements-readmore-btn {
    align-self: flex-start !important;
    margin-top: auto !important;
}

/*
Décommente ce bloc pour imposer la même hauteur aux images :

.eael-post-grid-container .eael-entry-media,
.eael-post-grid-container .eael-entry-thumbnail {
    height: 240px !important;
    overflow: hidden !important;
}

.eael-post-grid-container .eael-entry-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
*/

/* =========================================================
   RESPONSIVE TABLETTE ET MOBILE
========================================================= */

@media screen and (max-width: 1024px) {

    .cleaneb-header__container {
        min-height: 78px;
    }

    .cleaneb-header__logo img {
        max-width: 160px;
        max-height: 60px;
    }

    /* Burger */

    .cleaneb-header__burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        margin-left: auto;
        cursor: pointer;
    }

    .cleaneb-header__burger span {
        display: block;
        width: 27px;
        height: 2px;
        margin: 0 auto;
        background: var(--cleaneb-text);
        border-radius: 4px;
        transition:
            opacity 0.25s ease,
            transform 0.25s ease;
    }

    /* Navigation mobile fermée */

    .cleaneb-header__navigation {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        padding: 0 20px;
        overflow: hidden;
        visibility: hidden;
        background: #FFFFFF;
        border-top: 1px solid var(--cleaneb-border);
        box-shadow: 0 18px 30px rgba(23, 32, 27, 0.08);
        opacity: 0;
        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            padding 0.35s ease,
            visibility 0.35s ease;
    }

    .cleaneb-header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .cleaneb-header__menu > li {
        width: 100%;
        border-bottom: 1px solid var(--cleaneb-border);
    }

    .cleaneb-header__menu > li > a {
        width: 100%;
        min-height: auto;
        padding: 15px 0;
    }

    .cleaneb-header__menu > li > a::after {
        display: none;
    }

    /* Sous-menus visibles dans le menu mobile */

    .cleaneb-header__menu .sub-menu {
        position: static;
        min-width: 0;
        padding: 0 0 10px 15px;
        visibility: visible;
        border: 0;
        box-shadow: none;
        opacity: 1;
        transform: none;
    }

    .cleaneb-header__menu .sub-menu a {
        padding: 9px 12px;
    }

    /* CTA */

    body .cleaneb-header a.cleaneb-header__cta--desktop {
        display: none;
    }

    body .cleaneb-header a.cleaneb-header__cta--mobile {
        display: inline-flex;
        align-self: flex-start;
        margin: 20px 0 5px;
    }

    /* Ouverture du menu */

    .cleaneb-header__toggle:checked
    ~ .cleaneb-header__navigation {
        max-height: 900px;
        padding-top: 15px;
        padding-bottom: 25px;
        visibility: visible;
        opacity: 1;
    }

    /* Animation du burger */

    .cleaneb-header__toggle:checked
    + .cleaneb-header__burger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .cleaneb-header__toggle:checked
    + .cleaneb-header__burger span:nth-child(2) {
        opacity: 0;
    }

    .cleaneb-header__toggle:checked
    + .cleaneb-header__burger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

@media screen and (max-width: 600px) {

    .cleaneb-header__container {
        width: min(calc(100% - 30px), 1280px);
    }

    .cleaneb-header__logo img {
        max-width: 145px;
    }

    body .cleaneb-header a.cleaneb-header__cta--mobile {
        width: 100%;
        min-width: 0;
    }

    .cleaneb-article__main {
        width: min(calc(100% - 30px), 900px);
    }

    .cleaneb-article__author-avatar img {
        width: 90px;
        height: 90px;
    }
}

@media screen and (max-width: 600px) {
    /* Masque le dernier élément du fil d’Ariane */
    .cleaneb-article__breadcrumb > *:last-child {
        display: none !important;
    }

    /* Masque aussi le séparateur placé juste avant */
    .cleaneb-article__breadcrumb > *:nth-last-child(2) {
        display: none !important;
    }
}

@media screen and (max-width: 600px) {
    .eael-current {
        display: none !important;
    }

    .eael-breadcrumb-separator:has(+ .eael-current) {
        display: none !important;
    }
}