/*
 * responsive-fix.css
 * Correctifs responsives pour rencontresdesagricultures.com
 * Ne PAS modifier style.css — tous les correctifs sont ici.
 *
 * Problèmes corrigés :
 *  1. .content-grid absent de style.css (8 pages affectées)
 *  2. .hero-carousel / carousel : display et overflow manquants (CSS inline cassé)
 *  3. .ukraine-banner : display:flex manquant
 *  4. .news-card / .news-card-image : layout de base manquant
 *  5. .page-header : background gradient et couleur de texte manquants
 *  6. .production-table : pas de scroll horizontal sur mobile
 *  7. .carousel-slide img : hauteur fixe écrasée par le CSS inline cassé
 *  8. .options-grid : layout manquant (page inscriptions)
 *  9. .btn : styles de base manquants (pages hors articles)
 * 10. Variables CSS --ukraine-blue / --ukraine-yellow absentes de style.css
 * 11. .category-tag : background absent
 * 12. .btn-outline : border absent
 * 13. .sidebar-card-header.ukraine / .social-btn.facebook/youtube : couleurs absentes
 * 14. Breakpoints @media 768px et 480px pour les classes ci-dessus
 */

/* ============================================================
   0. VARIABLES CSS MANQUANTES
   --ukraine-blue et --ukraine-yellow étaient uniquement dans
   les blocs <style> inline qui ont été supprimés.
   ============================================================ */

:root {
    --ukraine-blue: #0057b7;
    --ukraine-yellow: #ffd700;
}

/* ============================================================
   1. HERO CAROUSEL
   Le bloc <style> inline est cassé (67 { sans fermetures) :
   les propriétés de display/overflow ne s'appliquent pas.
   ============================================================ */

.hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    /* transition: définie dans le CSS inline (0.6s ease) — ne pas redéfinir */
}

.carousel-slide {
    /* min-width:100% définie dans le CSS inline — ne pas redéfinir */
    flex-shrink: 0;
    position: relative;
    width: 100%;
}

/* Rétablir la hauteur correcte : le CSS inline applique EN DERNIER
   height:220px (la valeur "mobile" arrive après la valeur "desktop" dans la même règle cassée),
   donc l'image fait toujours 220px. On restaure 300px par défaut et on adapte sur mobile. */
.carousel-slide img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 71, 42, 0.4) 0%,
        rgba(26, 71, 42, 0.7) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.carousel-content {
    color: #ffffff;
    text-align: center;
}

.carousel-dot.active {
    background: #ffffff;
    transform: scale(1.3);
}

.carousel-arrow {
    position: absolute;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
}

/* ============================================================
   2. LAYOUT PRINCIPAL — .content-grid
   Utilisé dans 8 pages (index, actualites, archives, programme,
   inscriptions, infos-pratiques, partenaires, informations-legales).
   Absent de style.css, règle vide dans le CSS inline cassé.
   ============================================================ */

.main-content {
    padding: 2.5rem 0;
}

.content-grid {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

/* La zone principale de contenu occupe le reste de l'espace */
.content-grid > *:first-child {
    flex: 1 1 0;
    min-width: 0; /* évite le dépassement avec flex */
}

/* La sidebar garde une largeur fixe identique à .article-grid (style.css : 320px) */
.content-grid > .sidebar {
    flex: 0 0 320px;
    width: 320px;
}

/* ============================================================
   3. PAGE HEADER
   Le CSS inline applique le gradient mais pas padding/color.
   ============================================================ */

.page-header {
    position: relative;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ukraine-blue) 0%, var(--green-primary) 100%);
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 50%;
    background: linear-gradient(135deg, transparent 0%, var(--ukraine-yellow) 100%);
    opacity: 0.15;
    pointer-events: none;
}

.page-header h2 {
    color: #ffffff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    margin: 0;
}

/* ============================================================
   4. UKRAINE BANNER
   display:flex manquant — les deux colonnes bleu/jaune ne s'affichent pas côte à côte.
   ============================================================ */

.ukraine-banner {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.ukraine-banner-blue,
.ukraine-banner-yellow {
    flex: 1;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ukraine-banner-blue {
    background: #0057b7;
    color: #ffffff;
}

.ukraine-banner-yellow {
    background: #ffd700;
    color: #0057b7;
}

/* ============================================================
   5. NEWS CARDS
   Styles de base absents — fond, radius, shadow, layout vertical.
   ============================================================ */

.news-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(26, 71, 42, 0.15);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 71, 42, 0.2);
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.news-card-body {
    padding: 1.5rem;
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7c6e;
    margin-bottom: 0.75rem;
}

.news-card h3 {
    font-size: 1.25rem;
    color: #1a472a;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.news-card p {
    color: #3d4a3f;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================================
   6. CATEGORY TAG (news cards)
   A un background mais pas de padding / border-radius / font-size.
   ============================================================ */

.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.category-tag.green {
    background: #2d5a3d;
}

/* ============================================================
   7. BOUTONS DE BASE
   .btn, .btn-primary, .btn-outline absents de style.css pour les pages hors articles.
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #2d5a3d;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1a472a;
}

.btn-outline {
    background: transparent;
    color: #1a472a;
    /* border défini dans le CSS inline */
}

.btn-outline:hover {
    background: #1a472a;
    color: #ffffff;
}

/* ============================================================
   8. SOCIAL BUTTONS (sidebar)
   .social-btn a le padding mais pas display ni border-radius ni couleur.
   ============================================================ */

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: opacity 0.2s ease;
}

.social-btn:hover {
    opacity: 0.85;
}

/* ============================================================
   9. CATEGORIES LIST (sidebar)
   ============================================================ */

.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    border-bottom: 1px solid #e8ede9;
}

.categories-list li:last-child {
    border-bottom: none;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    color: #3d4a3f;
    transition: color 0.2s ease;
}

.categories-list a:hover {
    color: #9abc0e;
}

/* ============================================================
   10. OPTIONS GRID (page inscriptions)
   ============================================================ */

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* ============================================================
   11. TABLEAUX — scroll horizontal sur mobile
   Pas de wrapper overflow-x dans les 29 pages concernées.
   On utilise display:block + overflow-x sur le tableau lui-même.
   ============================================================ */

.production-table,
.pricing-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ============================================================
   12. CATEGORY TAG — background par défaut manquant
   ============================================================ */

.category-tag {
    background: var(--ukraine-blue);
}

/* ============================================================
   13. BOUTON OUTLINE — border manquante
   ============================================================ */

.btn-outline {
    border: 2px solid #1a472a;
}

/* ============================================================
   14. SIDEBAR — couleurs manquantes
   ============================================================ */

.sidebar-card-header.ukraine {
    background: linear-gradient(135deg, var(--ukraine-blue) 0%, #2d5a3d 100%);
}

.social-btn.facebook {
    background: #1877f2;
}

.social-btn.facebook:hover {
    background: #0d65d9;
}

.social-btn.youtube {
    background: #ff0000;
}

.social-btn.youtube:hover {
    background: #cc0000;
}

/* ============================================================
   BREAKPOINT 768px — Mobile
   ============================================================ */

@media (max-width: 768px) {

    /* Carousel : hauteur réduite */
    .carousel-slide img {
        height: 220px;
    }

    /* Empiler content-grid en colonne */
    .content-grid {
        flex-direction: column;
        gap: 1.5rem;
    }

    .content-grid > .sidebar {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Ukraine banner : passer en colonne */
    .ukraine-banner {
        flex-direction: column;
    }

    /* Page header */
    .page-header {
        padding: 1.25rem;
    }

    .page-header h2 {
        font-size: 1.35rem;
    }

    /* News cards : image moins haute */
    .news-card-image {
        height: 160px;
    }

    /* Options grid : 1 colonne */
    .options-grid {
        grid-template-columns: 1fr;
    }

    /* Carousel arrows : plus petits */
    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    /* Main content : moins de padding */
    .main-content {
        padding: 1.5rem 0;
    }
}

/* ============================================================
   BREAKPOINT 480px — Très petit mobile
   ============================================================ */

@media (max-width: 480px) {

    /* Carousel : hauteur minimale */
    .carousel-slide img {
        height: 180px;
    }

    /* Page header encore plus compact */
    .page-header {
        padding: 1rem;
    }

    .page-header h2 {
        font-size: 1.15rem;
    }

    /* News cards */
    .news-card-body {
        padding: 1rem;
    }

    .news-card-image {
        height: 140px;
    }

    /* Boutons en pleine largeur dans les cartes */
    .news-card .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tableaux : taille de fonte réduite */
    .production-table,
    .pricing-table {
        font-size: 0.8rem;
    }

    .production-table th,
    .production-table td,
    .pricing-table th,
    .pricing-table td {
        padding: 0.5rem;
    }

    /* Carousel overlay : moins de padding */
    .carousel-overlay {
        padding: 1rem;
    }
}
