.news-source-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    
    display: flex;
    align-items: center;
    gap: 0;                   /* gap animé séparément */
    
    height: 36px;
    padding: 0 10px;
    overflow: hidden;

    max-width: 36px;
    
    background: var(--light-bg);
    color: var(--text-color);
    
    border-radius: 50px;
    box-shadow: var(--badge-shadow, 0 2px 8px rgba(0, 0, 0, 0.15));
    
    text-decoration: none;
    white-space: nowrap;
    
    /* Transition sur les 3 propriétés qui changent */
    transition: max-width 0.45s cubic-bezier(0.23, 1, 0.32, 1),
                gap       0.45s cubic-bezier(0.23, 1, 0.32, 1),
                padding   0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.news-source-badge:hover {
    max-width: 220px;
    gap: 8px;
    padding: 0 14px 0 10px;
}

/* Masquer le texte au repos, l'afficher au survol */
.news-source-badge-text {
    opacity: 0;
    transition: opacity 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.news-source-badge:hover .news-source-badge-text {
    opacity: 1;
}

/* News Hero Grid */
.news-hero-section {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.news-hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0;
    width: 100%;
    height: 50vh;
    min-height: 700px;
    max-height: 700px;
    margin: 0;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.news-hero-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    background: #f5f5f5;
    display: flex;
    align-items: flex-end;
    opacity: 1;
    transform: none;
    will-change: none;
}

/* Hover : zoom image */
.news-hero-item:hover img,
.news-hero-item:focus-within img {
    transform: scale(1.06);
}

/* Hover : apparition du dégradé overlay */
.news-hero-item:hover .news-hero-overlay::before,
.news-hero-item:focus-within .news-hero-overlay::before {
    opacity: 1;
    transform: scaleY(1) translateY(0);
}

.news-hero-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-hero-link:focus {
    outline: 3px solid rgba(61, 137, 46, 0.5);
    outline-offset: -3px;
}

.news-hero-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease-out;
    will-change: transform;
}

.news-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /* Gradient handled by pseudo-element to allow smooth transform/opacity animation */
}

.news-hero-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
    opacity: 0;
    transform-origin: top center;
    transform: scaleY(0.85) translateY(8%);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}


/* Au survol des cases news : renforcement progressif du dégradé noir en bas */

.news-hero-item:active img {
    transform: none;
    transition-duration: 0.05s;
}

.news-hero-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.news-hero-item.medium {
    grid-column: span 2;
    grid-row: span 1;
}

.news-hero-item.small {
    grid-column: span 1;
    grid-row: span 1;
}

.news-hero-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    /* Transparent en haut -> léger dégradé vers noir en bas */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
    background-color: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 1rem 1.2rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: none;
    transform: none;
}

.news-hero-title {
    background-color: var(--third-color);
    font-size: 1.60rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    display: block;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-hero-date {
    text-align: center;
}

/* Media Queries pour News Hero */
@media (max-width: 900px) {
    .news-hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(2, 1fr);
        gap: 0;
        height: 50vh;
        min-height: 350px;
        max-height: 500px;
    }
    
    .news-hero-item.large,
    .news-hero-item.medium,
    .news-hero-item.small {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .news-hero-title {
        font-size: 1.15rem;
    }
    
    .news-hero-date {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .news-hero-section {
        min-height: unset;
        position: relative;
        overflow: hidden;
    }

    .news-hero-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        height: 65vw;
        min-height: 250px;
        max-height: 420px;
        scrollbar-width: none;
        grid-template-columns: unset;
        grid-template-rows: unset;
        gap: 0;
    }

    .news-hero-grid::-webkit-scrollbar {
        display: none;
    }

    .news-hero-item,
    .news-hero-item.large,
    .news-hero-item.medium,
    .news-hero-item.small {
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        grid-column: unset;
        grid-row: unset;
        border-radius: 0;
        scroll-snap-align: start;
    }

    .news-hero-caption {
        padding: 0.8rem 1rem;
    }

    .news-hero-title {
        font-size: 1.05rem;
    }

    .news-hero-date {
        font-size: 0.75rem;
    }

    /* Carousel arrows */
    .carousel-btn {
        display: flex;
    }

    /* Carousel dots */
    .carousel-dots {
        display: flex;
    }
}

/* ── Carousel Controls (hidden on desktop) ── */
.carousel-btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1.4rem;
    transition: background 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.carousel-btn:focus {
    background: rgba(0, 0, 0, 0.7);
    outline: none;
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-dots {
    display: none;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 6px;
    background: #fff;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.carousel-dot.active {
    background: var(--primary-color, #3d892e);
    transform: scale(1.25);
}

.news-hero {
    position: relative;
    overflow: hidden;
    animation: gradientFlow 10s ease infinite;
    background-size: 200% 200%;
}

.news-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.news-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Section Recherche et Filtres */
.search-filter-section {
    padding: 3rem 5%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-filter-container {
    max-width: 1400px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
    border-color: var(--third-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 137, 46, 0.2);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
}

/* Make search button visually match the user-profile button */
/* Moved to styles.css for consistency across all pages */

.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background-color: var(--light-bg);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
    color: var(--dark-text);
}

.filter-tab.active {
    background-color: var(--third-color);
    color: white;
    border-color: var(--third-color);
}

/* Section ActualitÃ©s */
.news-section {
    padding: 4rem 5%;
    background-color: var(--light-bg);
}

.news-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--dark-text);
    margin: 0;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-dropdown label {
    font-weight: 500;
    color: var(--dark-text);
}

.sort-dropdown select {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-dropdown select:focus {
    border-color: var(--third-color);
    outline: none;
}

/* Article en Vedette */
.featured-article {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    transition: var(--transition-fast);
}

.featured-image {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.featured-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #777;
    font-size: 0.9rem;
}

.meta-item i {
    color: var(--third-color);
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(61, 137, 46, 0.1);
    color: var(--third-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.featured-content h3 {
    font-size: 2rem;
    color: var(--dark-text);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-content p {
    color: #666;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--third-color);
    color: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    align-self: flex-start;
}

/* Grille d'ActualitÃ©s */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.news-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--dark-text);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.news-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-content h3 {
    font-size: 1.3rem;
    color: var(--dark-text);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.news-content p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.9rem;
}

.article-link {
    color: var(--third-color);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1.25rem;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
    color: var(--dark-text);
}

.pagination-btn.active {
    background-color: var(--third-color);
    color: white;
    border-color: var(--third-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Newsletter CTA */
.newsletter-cta {
    background: linear-gradient(135deg, var(--third-color), var(--fourth-color));
    color: white;
    padding: 4rem 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 4rem;
}

.newsletter-cta h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.newsletter-form-inline {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form-inline input {
    flex: 1;
    min-width: 250px;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-form-inline button {
    padding: 1rem 2rem;
    background-color: white;
    color: var(--third-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

/* Aucun RÃ©sultat */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background-color: white;
    border-radius: var(--border-radius);
}

.no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-results h3 {
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #666;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
    .featured-article {
        grid-template-columns: 1fr;
    }
    
    .featured-image {
        min-height: 300px;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .news-hero {
        padding: 6rem 5% 3rem;
    }
    
    .news-hero h1 {
        font-size: 2rem;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-input-wrapper {
        min-width: 100%;
    }
    
    .filter-tabs {
        justify-content: flex-start;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-content {
        padding: 2rem;
    }
    
    .featured-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .news-hero h1 {
        font-size: 1.75rem;
    }
    
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .newsletter-form-inline {
        flex-direction: column;
    }
    
    .newsletter-form-inline input {
        min-width: 100%;
    }
}

/* Bouton "Voir plus" - vert et texte centré verticalement */
.btn.voir-plus {
    background-color: #28a745;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 0 !important; /* plus d'arrondi */
    display: flex;
    align-items: center; /* centre verticalement le texte */
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.15s ease, transform 0.08s ease;
    width: auto; /* largeur adaptée au contenu */
    max-width: 220px; /* limite la largeur pour la rendre moins large */
    height: 100%; /* occupe toute la hauteur disponible du conteneur */
    box-sizing: border-box;
    margin: 0 auto;
    align-self: stretch;
}

.btn.voir-plus:hover,
.btn.voir-plus:focus {
    background-color: #218838;
    outline: none;
}

.btn.voir-plus:active {
    transform: translateY(1px);
}
