﻿:root {
    --color-primary: #005f73;
    --color-secondary: #0a9396;
    --color-dark: #1a1a1a;
    --color-light: #f1f3f5;
    --color-white: #ffffff;
    --font-primary: 'Poppins', sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-container {
    width: 100%;
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    box-sizing: border-box;
    position: relative;
}

/* --- Header & Controls --- */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 10;
}

.header-title {
    text-align: left;
}

    .header-title .subtitle {
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--color-secondary);
    }

    .header-title h1 {
        font-family: var(--font-primary);
        font-size: 2rem;
        margin: 0.25rem 0 0 0;
    }

.session-select {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--color-white);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231a1a1a' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

/* --- Main Content Slider --- */
.album-slider {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1300px;
    height: 400px;
}

.album-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

    .album-slide.active {
        opacity: 1;
        visibility: visible;
    }

.album-image-wrapper {
    width: 400px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

    .album-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1);
        transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

.album-slide.active .album-image-wrapper img {
    transform: scale(1.05);
}

.album-title {
    font-family: var(--font-primary);
    font-size: 5rem;
    line-height: 1.1;
    overflow: hidden;
}

    .album-title .char {
        display: inline-block;
        transform: translateY(100%);
        transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

.album-slide.active .album-title .char {
    transform: translateY(0);
}

/* --- Footer & Navigation --- */
.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 10;
}

.album-counter {
    font-size: 1.2rem;
    font-weight: 600;
}

.slider-nav button {
    width: 50px;
    height: 50px;
    border: 1px solid var(--color-dark);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
}

    .slider-nav button:hover {
        background: var(--color-dark);
        color: var(--color-white);
    }

.slider-nav svg {
    width: 20px;
}

.loader, .no-albums {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--color-grey);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .gallery-container {
        height: auto;
        min-height: 100vh;
        padding: 2rem 1.5rem;
    }

    .gallery-header {
        flex-direction: column;
        gap: 1rem;
    }

    .album-slider {
        position: relative;
        transform: none;
        top: auto;
        left: auto;
        height: auto;
        margin: 3rem 0;
    }

    .album-slide {
        position: relative;
        flex-direction: column;
        text-align: center;
        display: none; /* JS will handle visibility */
    }

        .album-slide.active {
            display: flex;
        }

    .album-image-wrapper {
        width: 100%;
        height: 350px;
        margin-bottom: 2rem;
    }

    .album-title {
        font-size: 2.5rem;
    }

    .gallery-footer {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.gallery-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

    .gallery-header h1 {
        font-family: var(--font-primary);
        font-size: 3.5rem;
        margin: 0;
    }

    .gallery-header p {
        font-size: 1.1rem;
        color: #6c757d;
        max-width: 600px;
        margin: 1rem auto 0;
    }

.back-link {
    position: absolute;
    top: 90%;
    left: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: background-color 0.3s;
}

    .back-link:hover {
        background-color: #e9ecef;
    }

    .back-link svg {
        margin-right: 0.5rem;
    }

/* Masonry Grid */
.photo-grid {
    column-count: 4;
    column-gap: 12px;
    padding: 0 8px;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .grid-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    .grid-item img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 16px;
    }

    .grid-item .overlay {
        position: absolute;
        top: 8px;
        right: 8px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        padding: 8px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .grid-item:hover .overlay {
        opacity: 1;
    }

.overlay svg {
    width: 24px;
    height: 24px;
    color: #333;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

    .lightbox.active {
        opacity: 1;
        visibility: visible;
    }

.lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

    .lightbox-btn:hover {
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.lightbox-close {
    top: 16px;
    right: 16px;
    transform: none;
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-btn svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.loader {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    padding: 3rem 0;
}

@media (max-width: 1024px) {
    .photo-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-page-container {
        padding: 2rem 1rem;
    }

    .gallery-header h1 {
        font-size: 2.5rem;
    }

    .back-link {
        display: none;
    }

    .photo-grid {
        column-count: 2;
        column-gap: 8px;
    }

    .grid-item {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        column-count: 1;
    }

    .lightbox-img {
        max-width: 90vw;
        max-height: 75vh;
    }
}