/*
 Theme Name:   Coppet Avocats
 Theme URI:    https://www.kokmoka.com
 Description:  Thème enfant pour Divi pour Coppet Avocats
 Author:       Kokmoka
 Template:     Divi
 Version:      1.0.0
*/

/* ==========================================================================
   HARMONISATION GLOBALE DES TITRES (1/4_1/2_1/4 et 1/4_1/4_1/2)
   ========================================================================== */

@media screen and (min-width: 981px) {
    
    /* 1. Conteneur Flexbox unifié */
    .et_pb_row_1-4_1-2_1-4,
	.et_pb_row_1-4_1-4_1-4,
    .et_pb_row_1-4_1-4_1-2,
	.titre_articles_auteurs{
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 1080px !important;
        box-sizing: border-box !important;
    }

    /* 2. Neutralisation des colonnes et des effets de décalage */
    .et_pb_row_1-4_1-2_1-4 > .et_pb_column,
	.et_pb_row_1-4_1-4_1-4 > .et_pb_column,
    .et_pb_row_1-4_1-4_1-2 > .et_pb_column,
	.titre_articles_auteurs > .et_pb_column{
        margin-right: 0 !important;
        margin-left: 0 !important;
        float: none !important;
        box-sizing: border-box !important;
        transform: none !important;
        transition: none !important;
    }

    /* 3. Séparateur de GAUCHE (Toujours la 1ère colonne) */
    .et_pb_row_1-4_1-2_1-4 > .et_pb_column:first-child,
	.et_pb_row_1-4_1-4_1-4 > .et_pb_column:first-child,
    .et_pb_row_1-4_1-4_1-2 > .et_pb_column:first-child,
	.titre_articles_auteurs > .et_pb_column:first-child	{
        width: 50px !important;
        flex: 0 0 50px !important; /* Taille fixe stricte de 50px */
        overflow: hidden !important;
        display: block !important;
    }

    /* 4. Colonne centrale du TITRE (La 2ème colonne) */
    .et_pb_row_1-4_1-2_1-4 > .et_pb_column:nth-child(2),
	.et_pb_row_1-4_1-4_1-4 > .et_pb_column:nth-child(2),
    .et_pb_row_1-4_1-4_1-2 > .et_pb_column:nth-child(2),
	.titre_articles_auteurs > .et_pb_column:nth-child(2){
        width: auto !important; 
        flex: 0 1 auto !important; /* Ne s'étire pas si le titre est court */
        
        /* PROTECTION DU VIDE : On limite à 100% - 70px (juste pour laisser la place au filet gauche) */
        max-width: calc(100% - 70px) !important; 
        
        padding: 0 20px !important;
        text-align: left !important; 
    }

    /* 5. Séparateur de DROITE (La 3ème colonne, uniquement si NON vide) */
    .et_pb_row_1-4_1-2_1-4 > .et_pb_column:nth-child(3):not(.et_pb_column_empty),
	.et_pb_row_1-4_1-4_1-4 > .et_pb_column:nth-child(3):not(.et_pb_column_empty),
    .et_pb_row_1-4_1-4_1-2 > .et_pb_column:nth-child(3):not(.et_pb_column_empty),
	.titre_articles_auteurs > .et_pb_column:nth-child(3):not(.et_pb_column_empty){
        width: auto !important;
        
        /* 
           La magie du Flexbox sans :has() : 
           Puisque cette colonne exige au minimum 80px de large, elle va d'elle-même
           forcer le titre à rétrécir quand elle est présente, sans qu'on ait besoin 
           de changer le max-width du titre !
        */
        flex: 1 0 auto !important; 
        min-width: 80px !important; 
        
        overflow: hidden !important;
        display: block !important;
    }

    /* 5b. Masquage strict si la 3ème colonne est vide */
    .et_pb_row_1-4_1-2_1-4 > .et_pb_column_empty,
	.et_pb_row_1-4_1-4_1-4 > .et_pb_column_empty,
    .et_pb_row_1-4_1-4_1-2 > .et_pb_column_empty,
	.titre_articles_auteurs	> .et_pb_column_empty{
        display: none !important; /* Complètement retirée du calcul Flexbox */
        width: 0 !important;
        flex: 0 0 0 !important;
    }

    /* 6. Écrasement des largeurs folles de Divi sur les modules textes */
    .et_pb_row_1-4_1-2_1-4 .et_pb_text,
	.et_pb_row_1-4_1-4_1-4 .et_pb_text,
    .et_pb_row_1-4_1-4_1-2 .et_pb_text,
	.titre_articles_auteurs	.et_pb_text{
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* 7. Alignement des modules de séparation */
    .et_pb_row_1-4_1-2_1-4 .et_pb_divider,
	.et_pb_row_1-4_1-4_1-4 .et_pb_divider,
    .et_pb_row_1-4_1-4_1-2 .et_pb_divider,
	.titre_articles_auteurs	.et_pb_divider{
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    .et_pb_row_1-4_1-2_1-4 .et_pb_divider_internal,
	.et_pb_row_1-4_1-4_1-4 .et_pb_divider_internal,
    .et_pb_row_1-4_1-4_1-2 .et_pb_divider_internal,
	.titre_articles_auteurs	.et_pb_divider_internal{
        width: 100% !important;
    }
}


/*** Meta auteurs/date ***/
.post-meta {
    display: flex !important;
    flex-direction: column !important;
    font-size: 0 !important; /* Cache le pipe "|" et le "par" natif */
}

.post-meta .published {
    order: 1;
    font-size: 12px !important;
	display:block;
	line-height:18px;
}
.post-meta .author {
	display:block;
    order: 2;
    font-size: 12px !important;
	line-height:18px;
	
}
.et-blog-css-grid .post-meta .author {
	padding:0 15px;
}
.post-meta .author::before {
    content: "Par ";
    font-size: 12px !important;
    color: inherit; 
}

/*** Pagination ***/
.et-blog-css-grid > div > div:has(.wp-pagenavi),
.et-blog-css-grid .wp-pagenavi {
  grid-column: 1 / -1;
  width: 100%;
}

/*** Page Auteur ***/
.titre-auteur-h1 h1{
	text-transform:uppercase;
	font-size:46px;
}
.titre-auteur-h1 .lowercase-letter {
    text-transform: lowercase !important;
    font-size: 0.85em;
}
.grille-auteur-custom {
    display: grid;
    grid-template-columns: 3fr 3fr 1fr 1fr;
    gap: 20px;
    align-items: center;
    width: 100%;
	margin-top:20px;
}

.grille-auteur-custom .bloc-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grille-auteur-custom .bloc-email,
.grille-auteur-custom .bloc-telephone {
    justify-content: flex-start;
    word-break: break-word;
	font-weight:bold;
}

.grille-auteur-custom .bloc-item a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.grille-auteur-custom .bloc-item a:hover {
    opacity: 0.8;
}

.grille-auteur-custom .bloc-linkedin i {
    font-size: 24px;
	color:#126c99;
}

.grille-auteur-custom .bloc-logo img {
    max-width: 100%;
    height: auto;
    display: block;
	max-height:32px;
	width:32px;
}

/* Adaptation responsive */
@media (max-width: 768px) {
    .grille-auteur-custom {
        grid-template-columns: 1fr 1fr;
    }
    
    .grille-auteur-custom .bloc-email,
    .grille-auteur-custom .bloc-telephone {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .grille-auteur-custom {
        grid-template-columns: 1fr;
    }

    .grille-auteur-custom .bloc-email,
    .grille-auteur-custom .bloc-telephone {
        grid-column: span 1;
    }
}