/*
 Theme Name:   Divi Child YoD
 Theme URI:    https://yod-communication.fr
 Description:  Thème enfant Divi — base propre et légère (CSS/JS + optimisations).
 Author:       Yoann Dennequin-Leemans
 Author URI:   https://yod-communication.fr
 Template:     Divi
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 Text Domain:  divi-child-yod
*/

/* Bouton dans le header : item "Devis & Contact" uniquement */
.et-l--header .et-menu li.btn-contact-header > a {
    background: #f29b3b;
    color: #ffffff !important;
    padding: 8px 40px;
    border-radius: 999px;
    line-height: 1;
    display: inline-flex
;
    align-items: center;
    justify-content: center;
    height: 50px;
    margin-top: 11px;
}


.et_pb_menu_0_tb_header.et_pb_menu ul li.btn-contact-header.current_page_item > a {
  color: #ffffff !important;
  background: #f29b3b;
}

/* Hover-up sur le bouton "Devis & Contact" */
.et_pb_menu_0_tb_header.et_pb_menu ul li.btn-contact-header > a {
  transition: all 0.25s ease;
}

.et_pb_menu_0_tb_header.et_pb_menu ul li.btn-contact-header > a:hover {
  transform: translateY(-3px);
  background: #000000; /* option : met ta couleur souhaitée */
  color: #ffffff !important;
}


/* optionnel : virer un peu de marge à droite si besoin */
.et-l--header .et-menu li.btn-contact-header {
  padding-right: 0;
}

/* Hover */
.et-l--header .et-menu li.btn-contact-header > a:hover {
  background: #222222;
  color: #ffffff !important;
  transform: translateY(-1px);
}


.hover-up {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform: translateY(0);
}

.hover-up:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}


/* La section du header Divi */
.et_pb_section_0_tb_header {
    position: relative;
    overflow: visible;
}

/* Pseudo-élément qui crée le dégradé blanc */
.et_pb_section_0_tb_header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0; /* invisible en haut de page */
    transition: opacity 0.25s ease;
    
    /* Dégradé blanc → transparent */
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.85) 0%,   /* opaque en haut */
        rgba(255,255,255,0.50) 45%,  /* intermédiaire */
        rgba(255,255,255,0.00) 100%  /* totalement transparent en bas */
    );
}

/* Quand on scrolle : on affiche le dégradé */
.et_pb_section_0_tb_header.header-gradient-active::before {
    opacity: 1;
}


.lwp-hide-mobile-menu.et_pb_menu .et_pb_menu__menu,.lwp-hide-mobile-menu.et_pb_fullwidth_menu .et_pb_menu__menu {
    display: flex!important;
}
 
.lwp-hide-mobile-menu .et_mobile_nav_menu {
    display: none;
}

@media (min-width: 768px) and (max-width: 980px) {
    .lwp-hide-mobile-menu.et_pb_menu .et_pb_menu__menu,.lwp-hide-mobile-menu.et_pb_fullwidth_menu .et_pb_menu__menu {
        display: flex!important;
    }
 
    .lwp-hide-mobile-menu .et_mobile_nav_menu {
        display: none;
    }
}

lwp-hide-mobile-menu .et_pb_menu__menu > nav > ul > li {
    width:100%
}

@media (max-width: 767px) {
    .lwp-hide-mobile-menu .et_pb_menu__menu > nav > ul > li {
        width:100%
    }
}

/* Forcer toutes les colonnes Divi à 100% sur mobile */
@media (max-width: 980px) {

    /* 1. On casse le flex qui fige à 50% */
    .et_pb_row {
        display: block !important;
    }

    /* 2. Toutes les colonnes prennent toute la largeur */
    .et_pb_row .et_pb_column {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Footer : forcer le menu réseaux à prendre 100% de largeur sur mobile */
@media (max-width: 980px) {

    footer .et_pb_menu__wrap,
    footer .et_pb_menu__menu,
    footer .et-menu-nav,
    footer .et-menu-nav ul {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
    }

    /* On enlève les limites de largeur résiduelles */
    footer .et_pb_menu__wrap {
        flex: none !important;
        margin: 0 !important;
    }

    /* Liste propre bien alignée à gauche */
    footer .et-menu-nav ul {
        padding-left: 0;
    }
}

/******************************
  Grille "Derniers projets"
  1 grand à gauche + 4 à droite
*******************************/

.yod-masonry {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr; /* gauche / droite */
    gap: 20px;
    align-items: stretch;
}

/* Bloc commun */
.yod-item {
    position: relative;
    overflow: hidden;
}

/* Grand bloc à gauche */
.yod-item--large {
    height: 100%;
}

/* Colonne de droite contenant les 4 petits */
.yod-grid-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    height: 100%;
}

/* Petits blocs carrés */
.yod-item--small {
    position: relative;
}

/* Image de fond (grand + petits) */
.yod-item__image {
    width: 100%;
    height: 100%;
    min-height: 100%;
    aspect-ratio: 1 / 1;         /* carré sur les petits, le grand prend la hauteur de la colonne */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

/* Lien overlay */
.yod-item__link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Overlay noir */
.yod-item__link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
    z-index: 2;
}

/* Titre au centre */
.yod-item__title {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 40%);
    margin: 0;
    padding: 0 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}

/* Hover : zoom + overlay + titre visible */
.yod-item__link:hover .yod-item__image {
    transform: scale(1.05);
}

.yod-item__link:hover::before {
    background: rgba(0,0,0,0.6);
}

.yod-item__link:hover .yod-item__title {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/********************
  Responsive
********************/

/* Tablette : 2 colonnes symétriques */
@media (max-width: 980px) {
    .yod-masonry {
        grid-template-columns: 1fr;
    }

    .yod-grid-right {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile : 1 colonne */
@media (max-width: 767px) {
    .yod-masonry {
        grid-template-columns: 1fr;
    }

    .yod-grid-right {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .yod-item__title {
        font-size: 18px;
    }
}

