/* Photo Gallery Styles */
.photo-gallery-wrapper {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding: 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #333;
}

.gallery-description {
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.gallery-container {
    width: 100%;
}

.gallery-grid {
    display: grid;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 3/2;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.image-title {
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.gallery-item:hover .image-title {
    opacity: 1;
}

.no-images-message {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    padding: 40px;
    grid-column: 1 / -1;
}

.photo-gallery-shortcode {
    margin: 20px 0;
}

/* Lightbox Styles */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
    display: block;
    opacity: 1;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 600px;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
    z-index: 90;
}

.nav-btn {
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: 25px 20px 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    z-index: 80;
}

.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    z-index: 1;
}

/* Responsive */
@media (max-width: 850px) {
    .lightbox-content {
        width: 95vw;
        height: calc(95vw * 0.75);
        max-width: 800px;
        max-height: 600px;
    }
    
    .gallery-grid {
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .gallery-title {
        font-size: 2em;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .lightbox-content {
        width: 98vw;
        height: calc(98vw * 0.75);
        border-radius: 8px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lightbox-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
        top: 10px;
        right: 10px;
    }

    .lightbox-navigation {
        padding: 0 10px;
    }

    .lightbox-caption {
        padding: 20px 15px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .photo-gallery-wrapper {
        padding: 15px;
    }
    
    .gallery-title {
        font-size: 1.8em;
    }
}

@media (max-height: 650px) {
    .lightbox-content {
        height: 90vh;
        width: calc(90vh * 1.333);
        max-width: 800px;
        max-height: 600px;
    }

    .lightbox-caption {
        padding: 15px 20px 10px;
        font-size: 14px;
    }
}