/* === MISE EN PAGE DES MÉCÉNATS === */

/* Augmenter la largeur du contenu pour les pages de mécénats */
body.post-type-archive-mecenat {
    --wp--style--global--content-size: 1400px !important;
}

/* Styling des métadonnées de mécénat */
.conference-meta {
    background-color: #f9f9f9;
    border-left: 4px solid var(--wp--preset--color--contrast, #121212);
    padding: 0.4rem 0.8rem;
    margin-bottom: 0.6rem;
}
.conference-meta p {
    margin: 0.2rem 0 !important;
    font-size: 0.85rem;
}
.conference-meta strong {
    color: var(--wp--preset--color--contrast, #121212);
}

/* Conteneur de la liste des mécénats : grille 3 colonnes */
body.post-type-archive-mecenat .wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

/* Tous les éléments : même taille */
body.post-type-archive-mecenat .wp-block-post-template > li {
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Groupe interne : padding réduit */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-group {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 0.8rem !important;
    margin-bottom: 0 !important;
}

/* Images de même hauteur pour tous les mécénats */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-featured-image img {
    height: 160px !important;
    object-fit: cover !important;
    width: 100% !important;
}

/* Titres plus petits pour tous les mécénats */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.4rem !important;
    line-height: 1.3 !important;
}

/* Contenu tronqué à 100px */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content {
    position: relative !important;
    max-height: 100px !important;
    overflow: hidden !important;
    flex-grow: 1 !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
}

/* Réduire aussi la taille des textes à l'intérieur */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content p,
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content li,
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content span {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
}

/* Forcer les blocs internes au contenu à s'afficher en colonne normale */
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content .wp-block-group,
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content .wp-block-columns,
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content [class*="is-layout-grid"],
body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content [class*="is-layout-flex"] {
    display: block !important;
    grid-template-columns: none !important;
    flex-direction: column !important;
}

body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
}

body.post-type-archive-mecenat .wp-block-post-template > li .wp-block-post-content::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 40px !important;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)) !important;
    pointer-events: none !important;
}

/* Bouton Voir plus (lien vers la page individuelle) */
.mecenat-read-more {
    display: inline-block !important;
    margin-top: 0.6rem !important;
    padding: 0.4rem 0.8rem !important;
    background-color: var(--wp--preset--color--contrast, #121212) !important;
    color: var(--wp--preset--color--base, #ffffff) !important;
    border: none !important;
    border-radius: 0.33rem !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    font-family: Georgia, serif !important;
    transition: background-color 0.2s ease !important;
    text-decoration: none !important;
    align-self: flex-start !important;
}

.mecenat-read-more:hover {
    background-color: #333 !important;
    color: #ffffff !important;
}

body.post-type-archive-conference .mecenat-read-more {
    display: none !important;
}
body.post-type-archive-lettre_annuelle .mecenat-read-more {
    display: none !important;
}
body.post-type-archive-voyage .mecenat-read-more {
    display: none !important;
}

/* Responsive : sur tablette, 2 colonnes */
@media (max-width: 1024px) {
    body.post-type-archive-mecenat .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Responsive : sur mobile, colonne unique */
@media (max-width: 600px) {
    body.post-type-archive-mecenat .wp-block-post-template {
        grid-template-columns: 1fr !important;
    }
}