/* Gallery Thumbnails Grid */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

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

.gallery-item-info {
    padding: 15px;
}

.gallery-item-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
}

.gallery-item-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-meta {
    font-size: 12px;
    color: #999;
    margin: 0;
}

.gallery-item-meta span {
    margin-right: 10px;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

.lightbox-caption {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.lightbox-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.lightbox-description {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.lightbox-meta {
    font-size: 14px;
    color: #999;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Photo View Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.photo-gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.photo-gallery-item:hover {
    transform: scale(1.05);
}

.photo-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* Module Gallery Thumbnails */
.module-gallery-thumbnails .gallery-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.module-gallery-thumbnails .gallery-thumbnail-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.module-gallery-thumbnails .gallery-thumbnail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.module-gallery-thumbnails .gallery-thumbnail-item:hover .gallery-thumbnail-image img {
    transform: scale(1.05);
}

.module-gallery-thumbnails .gallery-thumbnail-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.module-gallery-thumbnails .gallery-thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.module-gallery-thumbnails .gallery-image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-gallery-thumbnails .gallery-thumbnail-info {
    padding: 15px;
    background: white;
}

.module-gallery-thumbnails .gallery-thumbnail-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-gallery-thumbnails .gallery-thumbnail-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-gallery-thumbnails .gallery-thumbnail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.module-gallery-thumbnails .gallery-thumbnail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-gallery-thumbnails .gallery-module-header {
    text-align: center;
    margin-bottom: 30px;
}

.module-gallery-thumbnails .gallery-slogan {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.module-gallery-thumbnails .gallery-title {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: bold;
}

.module-gallery-thumbnails .gallery-description {
    color: #666;
    margin-top: 10px;
    font-size: 16px;
}

.module-gallery-thumbnails .gallery-module-footer {
    text-align: center;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-container,
    .module-gallery-thumbnails .gallery-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .module-gallery-thumbnails .gallery-thumbnail-image {
        height: 150px;
    }

    .module-gallery-thumbnails .gallery-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .gallery-container,
    .module-gallery-thumbnails .gallery-thumbnails-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .module-gallery-thumbnails .gallery-thumbnail-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}
