/* Tiled Gallery Styles are now handled by justified-gallery.css */
/* We can add custom overrides here if needed */
.tiled-gallery {
    margin: 20px 0;
    /* CSS fallback: simple flexbox layout before JS enhancement */
    display: flex;
    flex-wrap: wrap;
    /* gap: 4px; */
}

.tiled-gallery a {
    display: block;
    flex: 1 1 auto;
    min-width: 120px;
}

.tiled-gallery img {
    width: 100%;
    height: auto;
}

.tiled-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tiled-item:hover {
    transform: scale(1.02);
}

.tiled-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tiled-item:nth-child(3n) {
    grid-row: span 2;
}

.tiled-item:nth-child(5n) {
    grid-column: span 2;
}

/* Square Gallery Styles */
.square-gallery {
    display: grid;
    gap: 4px;
    margin: 20px 0;
}

.square-gallery[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.square-gallery[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.square-gallery[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.square-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    transition: transform 0.3s ease;
}

.square-item:hover {
    transform: scale(1.02);
}

.square-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Carousel Gallery Styles */
.carousel-gallery {
    margin: 20px 0;
    position: relative;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    background: #000;
    /* border-radius: 8px; */
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    /* border-radius: 4px; */
    text-align: center;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0, 0, 0, 0.9);
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Lightbox Styles */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    margin: 5% auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 16px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tiled-gallery {
        gap: 2px;
    }
    
    .tiled-gallery a {
        min-width: 100px;
    }
    
    .square-gallery[data-columns="3"],
    .square-gallery[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .carousel-slides {
        height: 250px;
    }
    
    .carousel-prev,
    .carousel-next {
        padding: 10px 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .tiled-gallery {
        gap: 2px;
    }
    
    .tiled-gallery a {
        min-width: 80px;
    }
    
    .square-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .carousel-slides {
        height: 200px;
    }
    
    .carousel-prev,
    .carousel-next {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
}

.vb-2 {
    padding-bottom: 5rem;
}   