/* =============================================================
   bloc-actualites.css — Sainte-Marie de Chavagnes
   Cartes actualités avec couleur par catégorie
   ============================================================= */

/* ── Grid des cards ── */
.actu-query .wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ── Wrapper de la carte (li) ── */
.actu-query .wp-block-post {
    display: flex;
    flex-direction: column;
}

/* ── Card : conteneur principal ── */
.card-actu {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    height: 100%;
    box-shadow: 0 2px 16px rgba(0, 36, 66, 0.08);
    padding: 0 !important;
}

/* ── Image featured en haut ── */
.card-actu .wp-block-post-featured-image {
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0;
    line-height: 0;
    font-size: 0;
}
.card-actu .wp-block-post-featured-image img,
.card-actu .wp-block-post-featured-image a {
    display: block;
    width: 100%;
    margin: 0;
}
.card-actu .wp-block-post-featured-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
}

/* ── Corps de la carte — fond par défaut (violet) ── */
.card-actu__body {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 !important;
    padding: 24px !important;
    background-color: #7F96FF !important;
    color: #ffffff !important;
}

/* ═══════════════════════════════════════
   COULEURS PAR CATÉGORIE — background-color !important
   pour overrider le style inline Gutenberg
   ═══════════════════════════════════════ */

/* Collège → Violet */
.category-college .card-actu__body {
    background-color: #7F96FF !important;
    color: #ffffff !important;
}

/* École → Jasmin/Jaune */
.category-ecole .card-actu__body {
    background-color: #FFEE88 !important;
    color: #002442 !important;
}

/* Lycée → Sable */
.category-lycee .card-actu__body {
    background-color: #EAE0D8 !important;
    color: #002442 !important;
}

/* IST → Corail */
.category-ist .card-actu__body {
    background-color: #FF715B !important;
    color: #ffffff !important;
}

/* Uncategorized → Violet (fallback) */
.category-uncategorized .card-actu__body {
    background-color: #7F96FF !important;
    color: #ffffff !important;
}

/* ── Texte : Collège + uncategorized (fond violet → blanc) ── */
.category-college .card-actu__body *,
.category-uncategorized .card-actu__body * {
    color: #ffffff !important;
}

/* ── Texte : École (fond jaune → navy) ── */
.category-ecole .card-actu__body * {
    color: #002442 !important;
}
.category-ecole .card-actu__body .wp-block-read-more {
    color: #FF715B !important;
}

/* ── Texte : Lycée (fond sable → navy) ── */
.category-lycee .card-actu__body * {
    color: #002442 !important;
}
.category-lycee .card-actu__body .wp-block-read-more {
    color: #FF715B !important;
}

/* ── Texte : IST (fond corail → blanc) ── */
.category-ist .card-actu__body * {
    color: #ffffff !important;
}

/* ── Date + auteur ── */
/* ── Ligne date + auteur : tout sur une ligne ── */
.card-actu__body .wp-block-group.is-nowrap {
    align-items: center !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
}

.card-actu__body .wp-block-post-date {
    display: inline !important;
}
.card-actu__body .wp-block-post-date time {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* "— par" visible + inline */
.card-actu__body .wp-block-post-author__byline {
    display: inline !important;
    font-size: 13px;
    font-weight: 400;
    margin: 0 !important;
    padding: 0 !important;
}

.card-actu__body .wp-block-post-author {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    margin-left: 4px !important;
}
.card-actu__body .wp-block-post-author__content {
    display: inline !important;
    padding: 0 !important;
    margin: 0 !important;
}
.card-actu__body .wp-block-post-author__name {
    display: inline !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    margin: 0 !important;
    padding: 0 !important;
}
.card-actu__body .wp-block-post-author__name a {
    text-decoration: underline;
    font-size: 13px;
}

/* ── Titre ── */
.card-actu__body .wp-block-post-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}
.card-actu__body .wp-block-post-title a {
    text-decoration: none;
}

/* ── Extrait ── */
.card-actu__body .wp-block-post-excerpt {
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}
.card-actu__body .wp-block-post-excerpt__excerpt {
    margin: 0;
}

/* ── Lire la suite ── */
.card-actu__body .wp-block-read-more {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.card-actu__body .screen-reader-text {
    display: none !important;
}

/* ── Boutons filtres ── */
.filtres-actu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.filtre-btn a {
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.filtre-btn:not(.filtre-actif) a {
    opacity: 0.75;
}
.filtre-btn.filtre-actif a {
    opacity: 1;
    outline: 2px solid rgba(0, 0, 0, 0.15);
    outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .actu-query .wp-block-post-template {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 900px) {
    .actu-query .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .actu-query .wp-block-post-template {
        grid-template-columns: 1fr;
    }
    .filtres-actu {
        justify-content: flex-start;
    }
}
