/* ============================================ */
/* DESKTOP/TABLET SINGLE ROW GALLERY */
/* ============================================ */

.tile-single-row-carousel-widget .photo-gallery {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 1400px;
    margin: 20px auto;
}

.tile-single-row-carousel-widget .photo-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #e9ecef;
    border-radius: 12px;
    aspect-ratio: 3/2;
}

.tile-single-row-carousel-widget .photo-item:nth-child(1) { grid-column: 1 / 2; }
.tile-single-row-carousel-widget .photo-item:nth-child(2) { grid-column: 2 / 3; }
.tile-single-row-carousel-widget .photo-item:nth-child(3) { grid-column: 3 / 4; }
.tile-single-row-carousel-widget .photo-item:nth-child(4) { grid-column: 4 / 5; }
.tile-single-row-carousel-widget .photo-item:nth-child(5) { grid-column: 5 / 6; }
.tile-single-row-carousel-widget .photo-gallery .photo-item:nth-child(n+6) {
    display: none;
}

.tile-single-row-carousel-widget .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.tile-single-row-carousel-widget .photo-item:hover img {
    transform: scale(1.05);
}

.tile-single-row-carousel-widget .view-all-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}

.tile-single-row-carousel-widget .view-all-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tile-single-row-carousel-widget .view-all-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}


/* ============================================ */
/* MODAL STYLES */
/* ============================================ */

.tile-single-row-carousel-widget .modal-xl {
    max-width: 1400px;
}

.tile-single-row-carousel-widget .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #dee2e6;
}

.tile-single-row-carousel-widget .modal-header .modal-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.tile-single-row-carousel-widget .modal-header .close {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
    padding: 0;
    margin: 0;
    line-height: 1.5;
}

.tile-single-row-carousel-widget .modal-header .close:hover {
    opacity: 1;
}

.tile-single-row-carousel-widget .modal-header .close-text {
    font-size: 16px;
    font-weight: 500;
}

.tile-single-row-carousel-widget .modal-header .close-icon {
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

.tile-single-row-carousel-widget .modal-body {
    padding: 30px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.tile-single-row-carousel-widget .modal-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tile-single-row-carousel-widget .modal-photo-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background-color: #e9ecef;
}

.tile-single-row-carousel-widget .modal-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tile-single-row-carousel-widget .modal-photo-item:hover img {
    transform: scale(1.05);
}

/* ============================================ */
/* LIGHTBOX STYLES */
/* ============================================ */

.tile-single-row-carousel-widget .lightbox-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 9999;
}

.tile-single-row-carousel-widget .lightbox-viewer.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-single-row-carousel-widget .lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.tile-single-row-carousel-widget .lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.tile-single-row-carousel-widget .lightbox-close,
.tile-single-row-carousel-widget .lightbox-nav {
    position: absolute;
    background-color: rgba(255,255,255,0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10000;
}

.tile-single-row-carousel-widget .lightbox-close {
    top: 20px;
    right: 20px;
}

.tile-single-row-carousel-widget .lightbox-close:hover,
.tile-single-row-carousel-widget .lightbox-nav:hover {
    background-color: white;
    transform: scale(1.1);
}

.tile-single-row-carousel-widget .lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.tile-single-row-carousel-widget .lightbox-nav:hover {
    transform: translateY(-50%) scale(1.1);
}

.tile-single-row-carousel-widget .lightbox-prev {
    left: 20px;
    z-index: 10001;
}

.tile-single-row-carousel-widget .lightbox-next {
    right: 20px;
    z-index: 10001;
}

.tile-single-row-carousel-widget .lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================ */
/* RESPONSIVE BREAKPOINTS */
/* ============================================ */

/* Tablet: 1024px */
@media (max-width: 1024px) {
    .tile-single-row-carousel-widget .photo-gallery {
        grid-template-columns: repeat(4, 1fr);
        margin: 20px;
    }

    .tile-single-row-carousel-widget .photo-item:nth-child(5) {
        display: none;
    }

    .tile-single-row-carousel-widget .view-all-btn {
        bottom: 12px;
        right: 12px;
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Mobile: 768px - GALLERY GRID */
@media (max-width: 768px) {
    .tile-single-row-carousel-widget .photo-gallery {
        display: grid !important;
        /* 2 i.p.v. 3 tegels: breder = hoger, beter zichtbaar op mobiel.
           Links/rechts geen extra marge zodat de galerij uitlijnt met de
           titel en de overige content (alleen verticale marge). */
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 20px 0;
    }

    .tile-single-row-carousel-widget .photo-item {
        border-radius: 0;
        aspect-ratio: 3/2;
    }

    .tile-single-row-carousel-widget .photo-item:nth-child(1) { grid-column: 1 / 2; border-radius: 12px 0 0 12px; }
    .tile-single-row-carousel-widget .photo-item:nth-child(2) { grid-column: 2 / 3; border-radius: 0 12px 12px 0; }
    .tile-single-row-carousel-widget .photo-gallery .photo-item:nth-child(n+3) {
        display: none;
    }

    .tile-single-row-carousel-widget .view-all-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        gap: 0;
    }

    .tile-single-row-carousel-widget .view-all-btn svg {
        width: 20px;
        height: 20px;
    }

    .tile-single-row-carousel-widget .view-all-text {
        display: none;
    }

    .tile-single-row-carousel-widget .modal-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 576px) {
    .tile-single-row-carousel-widget .photo-gallery {
        margin: 15px 0;
        gap: 6px;
    }

    .tile-single-row-carousel-widget .view-all-btn {
        bottom: 8px;
        right: 8px;
        padding: 6px;
        width: 32px;
        height: 32px;
    }

    .tile-single-row-carousel-widget .view-all-btn svg {
        width: 18px;
        height: 18px;
    }

    .tile-single-row-carousel-widget .modal-body {
        padding: 15px;
    }

    .tile-single-row-carousel-widget .modal-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}
