/* ================================================================
   PAGE ACTUALITES — Styles spécifiques à la page liste et aux
   articles individuels (single-edb_actualite.php).
   Les styles de base des cartes (.news-grid, .news-card, etc.)
   sont dans main.css (lignes 1153–1231) et partagés avec l'accueil.
   ================================================================ */

/* ==================== PAGE TITLE QUOTES ==================== */

.page-title-quotes {
    position: relative;
    display: inline-block;
}

.page-title-quotes::before {
    content: '\275D';
    position: absolute;
    top: -0.4em;
    left: -0.6em;
    font-size: 1.3em;
    color: #6BBFB5;
    opacity: 0.8;
    line-height: 1;
}

.page-title-quotes::after {
    content: '\275E';
    position: absolute;
    bottom: -0.5em;
    right: -0.6em;
    font-size: 1.3em;
    color: #6BBFB5;
    opacity: 0.8;
    line-height: 1;
}

/* ==================== FILTERS WRAPPER ==================== */

.filters-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

/* ==================== CATEGORY FILTERS BAR ==================== */

.filters-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.filter-btn {
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    border: 2px solid var(--border-light);
    background: white;
    color: var(--text-medium);
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.filter-btn[data-filter="tous"].active {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
}

.filter-btn[data-filter="primaire"].active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.3);
}

.filter-btn[data-filter="maternelle"].active {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

.filter-btn[data-filter="commun"].active {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.3);
}

.filter-btn i {
    font-size: 0.85rem;
}

.filter-btn[data-filter="primaire"] i {
    color: #8B5CF6;
}

.filter-btn[data-filter="primaire"].active i {
    color: white;
}

.filter-btn[data-filter="commun"] i {
    color: #EC4899;
}

.filter-btn[data-filter="commun"].active i {
    color: white;
}

/* Icon toggle for maternelle (image-based icons) */
.filter-btn .filter-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.filter-btn .filter-icon-active {
    display: none;
}

.filter-btn.active .filter-icon-default {
    display: none;
}

.filter-btn.active .filter-icon-active {
    display: inline;
}

/* ==================== YEAR FILTER ==================== */

.year-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.year-filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.03em;
    margin-right: 0.1rem;
}

.year-btn {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1.5px solid var(--border-light);
    background: white;
    color: var(--text-light);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.year-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-ultra-light);
}

.year-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.25);
}

.year-btn i {
    font-size: 0.7rem;
}

/* ==================== FILTER RESULTS COUNT ==================== */

.filter-results-count {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    min-height: 1.2em;
    transition: opacity 0.2s ease;
}

.filter-results-count span {
    font-weight: 700;
    color: var(--primary);
}

/* ==================== NEWS CARD IMG WRAPPER ==================== */

.news-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-card-img-wrapper {
    overflow: hidden;
    position: relative;
}

.news-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    color: var(--text-light);
    font-size: 2.5rem;
    opacity: 0.4;
}

/* ==================== CATEGORY BADGES ==================== */

.news-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.news-category-badge.primaire {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.news-category-badge.maternelle {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.news-category-badge.commun {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
}

/* ==================== FILTER ANIMATIONS ==================== */

.news-card.hidden {
    display: none;
}

.news-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.news-card.fade-in {
    animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== EMPTY STATE ==================== */

.news-empty {
    text-align: center;
    padding: 4rem 1rem;
    display: none;
}

.news-empty.visible {
    display: block;
}

.news-empty-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.news-empty-text {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ==================== RESPONSIVE — LIST PAGE ==================== */

@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .filters-bar {
        gap: 1rem;
    }

    .filter-btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.95rem;
    }
}

/* ================================================================
   SINGLE ARTICLE PAGE (single-edb_actualite.php)
   ================================================================ */

/* ==================== ARTICLE LAYOUT ==================== */

.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2DB8A4;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    transition: gap 0.3s ease;
    text-decoration: none;
}

.back-link:hover {
    gap: 0.75rem;
    color: #249688;
}

.article-date {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(45, 184, 164, 0.1);
    color: #2DB8A4;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark, #1e293b);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 2rem;
    }
}

/* ==================== ARTICLE BODY CONTENT ==================== */

.article-content p {
    color: var(--text-medium, #64748b);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.article-content ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

.article-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-medium, #64748b);
    font-size: 1.05rem;
    line-height: 1.7;
}

.article-content ul li::before {
    content: '\2013';
    position: absolute;
    left: 0;
    color: #2DB8A4;
    font-weight: 700;
}

.article-content ul li strong {
    color: var(--dark, #1e293b);
}

/* ==================== SECTION SUBTITLE ==================== */

.section-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2DB8A4;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2DB8A4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

/* ==================== HERO IMAGE ==================== */

.article-hero {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==================== WORDPRESS GALLERY BLOCK IN ARTICLES ==================== */

/* Style WP gallery blocks inside article content to match the static HTML design.
   WordPress adds .is-layout-flex with its own flexbox — we override to grid. */
.article-body .wp-block-gallery,
.article-body .wp-block-gallery.is-layout-flex,
.article-body .wp-block-gallery.wp-block-gallery-is-layout-flex {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
    margin-top: 1rem;
    margin-bottom: 2rem;
    flex-wrap: unset !important;
}

.article-body .wp-block-gallery .wp-block-image,
.article-body .wp-block-gallery .wp-block-image figure {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: unset !important;
    flex-grow: unset !important;
}

.article-body .wp-block-gallery .wp-block-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(45, 184, 164, 0.25);
}

.article-body .wp-block-gallery .wp-block-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.article-body .wp-block-gallery .wp-block-image:hover img {
    transform: scale(1.05);
}

/* Auto-inserted section titles for galleries and videos */
.article-body .auto-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2DB8A4;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #2DB8A4;
}

/* Also style standalone images in articles */
.article-body .wp-block-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.article-body .wp-block-image img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

/* YouTube / video embeds */
.article-body .wp-block-embed {
    margin: 2rem 0;
}

.article-body .wp-block-embed .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.article-body .wp-block-embed .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive gallery — 2 cols on small screens */
@media (max-width: 480px) {
    .article-body .wp-block-gallery,
    .article-body .wp-block-gallery.is-layout-flex {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* ==================== VIDEO SECTION ==================== */

.video-section {
    margin-top: 2.5rem;
}

.video-section video {
    width: 100%;
    max-width: 500px;
    max-height: 320px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block;
}

/* ==================== LIGHTBOX ==================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
    line-height: 1;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}
