/* ===================================
   Variables et Reset
   =================================== */
:root {
    --eg-red: #DD183B;
    --eg-beige: #FFEDE6;
    --eg-white: #FFFFFF;
    --eg-dark: #231417;
    --eg-transition: all 0.3s ease;
}

/* ===================================
   Section Événements
   =================================== */
.eg-events-section {
    padding: 50px 20px;
    background-color: var(--eg-dark);
    font-family: 'Poppins', sans-serif;
}

.eg-section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--eg-white);
    margin-bottom: 35px;
    position: relative;
    animation: fadeInDown 0.8s ease;
}

.eg-section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--eg-red);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ===================================
   Grille des Événements
   =================================== */
.eg-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================================
   Carte Événement
   =================================== */
.eg-event-card {
    background: var(--eg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: var(--eg-transition);
    cursor: pointer;
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
}

.eg-event-card:nth-child(1) { animation-delay: 0.05s; }
.eg-event-card:nth-child(2) { animation-delay: 0.1s; }
.eg-event-card:nth-child(3) { animation-delay: 0.15s; }
.eg-event-card:nth-child(4) { animation-delay: 0.2s; }
.eg-event-card:nth-child(5) { animation-delay: 0.25s; }
.eg-event-card:nth-child(6) { animation-delay: 0.3s; }
.eg-event-card:nth-child(7) { animation-delay: 0.35s; }
.eg-event-card:nth-child(8) { animation-delay: 0.4s; }

.eg-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(221, 24, 59, 0.2);
}

/* ===================================
   Image Événement
   =================================== */
.eg-event-image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--eg-beige);
}

.eg-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--eg-transition);
}

.eg-event-card:hover .eg-event-image img {
    transform: scale(1.1);
}

.eg-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--eg-beige), #ffd4c4);
    color: var(--eg-red);
    font-weight: 600;
}

/* ===================================
   Contenu Événement
   =================================== */
.eg-event-content {
    padding: 15px;
}

.eg-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--eg-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-event-description {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================
   Bouton Galerie
   =================================== */
.eg-view-gallery {
    background: var(--eg-red);
    color: var(--eg-white);
    border: none;
    padding: 8px 20px;
    border-radius: 18px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--eg-transition);
    width: 100%;
}

.eg-view-gallery:hover {
    background: #b61430;
    transform: scale(1.02);
}

/* ===================================
   Modal Galerie
   =================================== */
.eg-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(35, 20, 23, 0.95);
    animation: fadeIn 0.3s ease;
}

.eg-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.eg-modal-content {
    background-color: var(--eg-white);
    margin: 20px;
    padding: 0;
    border-radius: 15px;
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.eg-modal-close {
    position: absolute;
    right: 25px;
    top: 15px;
    color: var(--eg-white);
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100000;
    transition: var(--eg-transition);
    line-height: 1;
}

.eg-modal-close:hover {
    color: var(--eg-red);
    transform: rotate(90deg);
}

.eg-modal-body {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* ===================================
   Visionneuse Galerie
   =================================== */
.eg-gallery-viewer h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--eg-dark);
    margin-bottom: 30px;
    text-align: center;
}

.eg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.eg-gallery-item-viewer {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--eg-transition);
    cursor: pointer;
}

.eg-gallery-item-viewer:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(221, 24, 59, 0.2);
}

.eg-gallery-item-viewer img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.eg-gallery-caption {
    padding: 15px;
    background: var(--eg-beige);
    color: var(--eg-dark);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* ===================================
   Lightbox pour les images
   =================================== */
.eg-lightbox {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.eg-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.eg-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.eg-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.eg-lightbox-close {
    position: absolute;
    right: -50px;
    top: 0;
    color: var(--eg-white);
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--eg-transition);
}

.eg-lightbox-close:hover {
    color: var(--eg-red);
}

/* ===================================
   Message vide
   =================================== */
.eg-no-events {
    text-align: center;
    padding: 60px 20px;
    color: var(--eg-white);
    font-size: 1.2rem;
    background: var(--eg-dark);
    border-radius: 10px;
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Responsive - Tablette
   =================================== */
@media (max-width: 1024px) {
    .eg-events-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
    
    .eg-section-title {
        font-size: 1.6rem;
    }
    
    .eg-modal-body {
        padding: 30px;
    }
    
    .eg-event-image {
        height: 130px;
    }
}

/* ===================================
   Responsive - Mobile
   =================================== */
@media (max-width: 768px) {
    .eg-events-section {
        padding: 35px 15px;
    }
    
    .eg-events-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .eg-section-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .eg-event-image {
        height: 120px;
    }
    
    .eg-event-content {
        padding: 12px;
    }
    
    .eg-event-title {
        font-size: 0.95rem;
    }
    
    .eg-event-description {
        font-size: 0.75rem;
    }
    
    .eg-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .eg-modal-body {
        padding: 20px;
    }
    
    .eg-modal-close {
        right: 10px;
        top: 10px;
        font-size: 35px;
    }
    
    .eg-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .eg-gallery-viewer h2 {
        font-size: 1.5rem;
    }
    
    .eg-lightbox-close {
        right: 10px;
        top: -50px;
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .eg-events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .eg-section-title {
        font-size: 1.3rem;
    }
    
    .eg-event-title {
        font-size: 0.95rem;
    }
    
    .eg-event-content {
        padding: 12px;
    }
    
    .eg-event-image {
        height: 140px;
    }
}