/* ========= Photo Gallery Styles ========= */

.gallery-page {
    max-width: 900px;
}

.gallery-description {
    font-size: 1.1rem;
    color: var(--fg2);
    margin-top: 1rem;
    text-align: center;
}

.photo-gallery {
    margin-top: 3rem;
}

.gallery-date-section {
    margin-bottom: 5rem;
}

.gallery-date {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--fg1);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg_code);
    font-family: var(--font-serif);
    text-align: center;
}

/* ========= Carousel Container ========= */

.photo-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-track-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 0.5rem;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}

/* ========= Photo Item ========= */

.photo-item {
    width: 100%;
    background-color: var(--bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.photo-link {
    display: block;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

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

.photo-caption {
    font-size: 1rem;
    color: var(--fg2);
    padding: 1.5rem;
    margin: 0;
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    line-height: 1.6;
    min-height: 4rem;
}

/* ========= Carousel Navigation Buttons (Overlay Style) ========= */

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2.5rem;
    color: white;
    z-index: 10;
    opacity: 0.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn span {
    line-height: 1;
    user-select: none;
    display: block;
    margin-top: -4px;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Hide single-photo carousel buttons */
.photo-carousel[data-single-photo="true"] .carousel-btn {
    display: none;
}

/* Gallery page text below photos */
.gallery-page-text {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg_code);
    border-radius: 0.5rem;
    line-height: 1.8;
    color: var(--fg2);
}

.gallery-page-text p {
    margin-bottom: 1rem;
}

.gallery-page-text p:last-child {
    margin-bottom: 0;
}

.no-photos {
    text-align: center;
    color: var(--fg4);
    font-size: 1.1rem;
    padding: 3rem;
}

/* ========= Lightbox Styles ========= */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-family: var(--font-sans);
    font-size: 1rem;
}

/* ========= Responsive Gallery ========= */

@media (max-width: 968px) {
    .photo-img {
        height: 400px;
    }
    
    .carousel-btn {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .carousel-prev {
        left: 15px;
    }
    
    .carousel-next {
        right: 15px;
    }
}

@media (max-width: 768px) {
    .photo-img {
        height: 350px;
    }
    
    .gallery-date {
        font-size: 1.3rem;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .photo-caption {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    .lightbox {
        padding: 20px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
}

@media (max-width: 480px) {
    .photo-img {
        height: 300px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
}

