/* ep-gallery: thumbnail grid. Phones 2 columns, tablets up to 3, desktops as set in the plugin. */
.epg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .epg-grid {
        grid-template-columns: repeat(var(--epg-cols-md, 3), minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .epg-grid {
        grid-template-columns: repeat(var(--epg-cols, 4), minmax(0, 1fr));
    }
}

.epg-item {
    margin: 0;
}

.epg-link {
    display: block;
    overflow: hidden;
    border-radius: 0;
}

.epg-thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: var(--epg-ratio, 3 / 2);
    object-fit: cover;
    transition: transform .2s ease;
}

.epg-link:hover .epg-thumb,
.epg-link:focus-visible .epg-thumb {
    transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
    .epg-thumb {
        transition: none;
    }
}

/* Large photo dialog (Bootstrap 5 modal from the Joomla core), lightbox style:
   the whole screen is dark and slightly see-through, the photo stays in the middle.
   Together with the Bootstrap backdrop (50%) this gives about 85% darkness. */
.epg-modal {
    background-color: rgba(0, 0, 0, .7);
}

.epg-modal .modal-content {
    border: 0;
    border-radius: 0;
    background-color: transparent;
    color: #fff;
}

.epg-modal .modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: .75rem 1rem;
    border: 0;
}

.epg-modal .btn-close {
    margin-left: auto;
}

.epg-modal .modal-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
    touch-action: pan-y;
}

.epg-full {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    width: auto;
    height: auto;
    box-shadow: 0 0 2rem rgba(0, 0, 0, .6);
}

.epg-nav {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .5);
    color: #fff;
    transform: translateY(-50%);
}

.epg-nav:hover,
.epg-nav:focus-visible {
    background-color: rgba(0, 0, 0, .8);
}

.epg-prev {
    left: .5rem;
}

.epg-next {
    right: .5rem;
}
