:root {
    --background-color: #FFFCFA;
    --primary-color: #3DCC3D;
    --primary-dark: #2a6e2a;
    --ink-color: #1c1c1a;
    --text-color: #373435;
    --header-bg: #f8f8f8;
    --header-border: #ddd;
    --secondary-bg: #e9ecef;
    --font-main: 'Space Grotesk', sans-serif;
    --font-heading: 'Concert One', sans-serif;
}

body.dark-mode {
    --background-color: #111827;
    --primary-color: #3DCC3D;
    --ink-color: #f4f4f2;
    --text-color: #FFFCFA;
    --header-bg: #1f2937;
    --header-border: #4b5563;
    --secondary-bg: #1f2937;
}

body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Focus visible cohérent sur toute la page, pour l'accessibilité clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════
   HERO — trame de points façon impression offset
══════════════════════════════════════════════ */
.hero-actu {
    position: relative;
    background:
        radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px),
        linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    background-size: 16px 16px, 100% 100%;
    padding: 90px 20px 100px;
    text-align: center;
    margin-top: 20px;
    overflow: hidden;
}

.hero-actu::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 40px;
    background: var(--background-color);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: scaleX(1.2);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: var(--font-main);
    font-weight: 400;
    letter-spacing: 0.5px;
    font-size: 3.2rem;
    color: white;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.hero-content p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.92);
    max-width: 600px;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════
   FILTRES
══════════════════════════════════════════════ */
.filter-actu-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -35px auto 30px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.filter-actu-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    background-color: var(--background-color);
    padding: 10px;
    border-radius: 60px;
    border: 1px solid var(--header-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.filter-actu-btn {
    background: transparent;
    border: none;
    padding: 10px 22px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-actu-btn i {
    font-size: 0.9rem;
}

.filter-actu-btn:hover {
    background: rgba(61, 204, 61, 0.1);
    color: var(--primary-color);
}

.filter-actu-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 6px 16px rgba(61, 204, 61, 0.35);
}

.filter-actu-btn:active {
    transform: scale(0.96);
}

/* ══════════════════════════════════════════════
   GRILLE & CARTES — esprit "fiche de calage"
══════════════════════════════════════════════ */
.container-actu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.actu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.actu-card {
    background: var(--background-color);
    border: 1px solid var(--header-border);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Petit repère de calage dans le coin — clin d'œil à l'impression flexo */
.actu-card::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 16px;
    height: 16px;
    z-index: 2;
    background:
        linear-gradient(var(--primary-color), var(--primary-color)) center / 100% 1.5px no-repeat,
        linear-gradient(var(--primary-color), var(--primary-color)) center / 1.5px 100% no-repeat;
    border: 1.5px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.55;
    pointer-events: none;
}

.actu-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(61, 204, 61, 0.16);
    border-color: var(--primary-color);
}

.actu-image {
    width: 100%;
    height: 210px;
    overflow: hidden;
    position: relative;
    background: var(--secondary-bg);
}

.actu-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%);
    pointer-events: none;
}

.actu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.actu-card:hover .actu-image img {
    transform: scale(1.06);
}

.actu-category {
    position: absolute;
    top: 15px;
    left: 34px;
    background: var(--primary-color);
    color: white;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.actu-date {
    position: absolute;
    bottom: 12px;
    right: 15px;
    color: white;
    padding: 4px 10px;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.actu-content {
    padding: 22px 20px;
}

.actu-content h3 {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    line-height: 1.35;
}

.actu-excerpt {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.55;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.actu-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: gap 0.3s ease;
}

.actu-readmore:hover {
    gap: 12px;
}

/* ══════════════════════════════════════════════
   MODAL / POP-UP DÉTAIL
══════════════════════════════════════════════ */
.modal {
    visibility: visible !important; /* prioritaire sur la règle du loader (body > *:not(#site-loader)) */
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 18, 0.72);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--background-color);
    border-radius: 22px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    animation: modalSlideIn 0.35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: sticky;
    top: 15px;
    right: 15px;
    float: right;
    background: var(--background-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.08) rotate(90deg);
}

.modal-image-wrap {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.modal-image-wrap::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background:
        linear-gradient(white, white) center / 100% 1.5px no-repeat,
        linear-gradient(white, white) center / 1.5px 100% no-repeat;
    z-index: 2;
    opacity: 0.85;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-body {
    padding: 30px 34px 34px;
    clear: both;
}

.modal-body h2 {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px 0;
}

.modal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--secondary-bg);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-color);
}

.modal-meta i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.modal-body p {
    line-height: 1.75;
    margin-bottom: 15px;
    opacity: 0.9;
}

/* ══════════════════════════════════════════════
   NEWSLETTER
══════════════════════════════════════════════ */
.newsletter-section {
    background: var(--background-color);
    padding: 60px 20px;
    margin-top: 60px;
}

.newsletter-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: var(--secondary-bg);
    padding: 45px 40px;
    border-radius: 28px;
    border: 1px solid var(--header-border);
}

.newsletter-icon {
    width: 68px;
    height: 68px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 24px rgba(61, 204, 61, 0.3);
}

.newsletter-icon i {
    font-size: 1.8rem;
    color: white;
}

.newsletter-card h3 {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.newsletter-card p {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 25px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    height: 48px;
    border: 1px solid var(--header-border);
    border-radius: 50px;
    background: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-main);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(61, 204, 61, 0.15);
}

.newsletter-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    height: 48px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    white-space: nowrap;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(61, 204, 61, 0.35);
}

.newsletter-form button:active {
    transform: translateY(0);
}

.newsletter-status {
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.newsletter-status.success {
    color: var(--primary-color);
}

.newsletter-status.error {
    color: #dc3545;
}

/* ══════════════════════════════════════════════
   ÉTATS VIDES / CHARGEMENT
══════════════════════════════════════════════ */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 1.05rem;
}

.no-results i {
    font-size: 2.6rem;
    margin-bottom: 15px;
    display: block;
    color: var(--primary-color);
    opacity: 0.6;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-actu {
        padding: 70px 20px 90px;
    }

    .hero-content h1 {
        font-size: 2.1rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .filter-actu-group {
        padding: 8px;
        border-radius: 30px;
    }

    .filter-actu-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .actu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .newsletter-card {
        padding: 30px 24px;
        margin: 0 15px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    .modal-body {
        padding: 22px;
    }

    .modal-image-wrap {
        height: 200px;
    }
}

/* Respect des préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}