/* Event Card */
.epg-event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Hover effect */
.epg-event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.15);
}

/* Card Grid */
.epg-events {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    padding: 25px;
    align-items: start;
}

/* Image styling */
.epg-event-card img {
    width: 100%;
    height: 340px !important;
    object-fit: cover; /* fills card better */
    display: block;
    border-bottom: 3px solid #f0f0f0;
}

/* Event name at bottom */
.epg-event-info {
    background: #fafafa;
    padding: 12px;
    font-weight: 600;
    font-size: 1rem;
    color: #222;
    text-align: center;
    margin-top: auto;
    letter-spacing: 0.5px;
    border-top: 1px solid #eee;
}

/* Subtle animation when appearing */
.epg-event-card {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Modal */
#epg-modal{
    display:none; /* hide modal initially */
    position:fixed;
    z-index:2000;
    left:0; top:0; width:100%; height:100%;
    background:rgba(0,0,0,0.85);
    padding-top:80px !important;
    overflow:auto; /* scroll if very tall content */
    justify-content:center;  /* horizontal center */
    align-items:center;      /* vertical center */
    /* DO NOT put display:flex here */
    padding-top: 20px;
}

/* Use flex on inner wrapper */
#epg-modal .epg-modal-content{
    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    max-width:95%;
    max-height:90vh;
    margin:0 auto;
}

/* Media (image/video) scaling */
#epg-modal .epg-modal-content img,
#epg-modal .epg-modal-content video{
    max-width:100%;
    max-height:90vh;
    width:auto;
    height:auto;
    display:block;
    margin:0 auto;
    object-fit:contain;
}

/* Close button */
#epg-modal .epg-close{
    position:fixed;
    margin-top: 30px;
    padding-top: 2px;
    padding-left: 13px;
    top:20px;
    right:20px;
    background:rgba(255,68,68,0.9);
    color:white;
    font-size:24px;
    border:none;
    border-radius:50%;
    width:40px;
    height:40px;
    cursor:pointer;
    z-index:2100;
}

/* Navigation arrows */
#epg-modal .epg-prev,
#epg-modal .epg-next{
    position:fixed;
    top:50%;
    transform:translateY(-50%);
    background:rgba(255,255,255,0.7);
    color:black;
    border:none;
    font-size:30px;
    padding:10px;
    cursor:pointer;
    border-radius:50%;
    z-index:2100;
}
#epg-modal .epg-prev{left:10px;}
#epg-modal .epg-next{right:10px;}

/* Responsive adjustments */
@media(max-width:1024px){
    #epg-modal .epg-modal-content img,
    #epg-modal .epg-modal-content video{
        max-height:70vh;
        max-width:90%;
    }
}

@media(max-width:570px){
    #epg-modal .epg-modal-content img,
    #epg-modal .epg-modal-content video{
        max-height:60vh;
        max-width:95%;
    }
}