﻿: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.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Page Layout */
.gallery-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: 60vh;
}

/* Header Section */
.gallery-header-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1.5rem;
}

.header-title .subtitle {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.header-title h1 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    margin: 0;
    color: var(--color-dark);
}

/* Session Select Styling */
.session-select {
    padding: 0.8rem 2.5rem 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    background-color: var(--color-white);
    border: 2px solid #e9ecef;
    border-radius: 50px; /* Pill shape */
    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 1rem center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

    .session-select:hover, .session-select:focus {
        border-color: var(--color-primary);
        outline: none;
        box-shadow: 0 4px 15px rgba(0,95,115,0.15);
    }

/* --- MASONRY ALBUM GRID --- */
.albums-masonry {
    column-count: 3; /* 3 Columns on desktop */
    column-gap: 2rem;
}

.album-card {
    break-inside: avoid; /* Prevents card from being cut in half */
    margin-bottom: 2rem;
    background: var(--color-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.02);
}

    .album-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    }

/* Card Image Area */
.card-image {
    position: relative;
    overflow: hidden;
    width: 100%;
}

    .card-image img {
        width: 100%;
        height: auto;
        display: block;
        transition: transform 0.8s ease;
    }

.album-card:hover .card-image img {
    transform: scale(1.05);
}

/* Hover Overlay on Image */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 95, 115, 0.4); /* Primary color tint */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .card-overlay span {
        color: white;
        background: rgba(255,255,255,0.2);
        backdrop-filter: blur(5px);
        padding: 0.8rem 1.5rem;
        border-radius: 30px;
        font-weight: 600;
        transform: translateY(20px);
        transition: transform 0.3s ease;
    }

.album-card:hover .card-overlay {
    opacity: 1;
}

    .album-card:hover .card-overlay span {
        transform: translateY(0);
    }

/* Card Text Content */
.card-details {
    padding: 1.5rem;
    background: #fff;
}

.card-title {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-dark);
    line-height: 1.4;
}

.card-meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #868e96;
    font-weight: 500;
}

/* --- Empty State --- */
.no-albums {
    text-align: center;
    padding: 4rem;
    background: #f8f9fa;
    border-radius: 12px;
    color: #6c757d;
    font-size: 1.1rem;
    width: 100%;
}

/* --- Responsive Breakpoints --- */

/* Tablet */
@media (max-width: 1024px) {
    .albums-masonry {
        column-count: 2;
        column-gap: 1.5rem;
    }

    .gallery-page-container {
        padding: 3rem 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .gallery-header-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .header-title h1 {
        font-size: 2rem;
    }

    .select-wrapper {
        width: 100%;
    }

    .session-select {
        width: 100%;
    }

    .albums-masonry {
        column-count: 1; /* Single column on mobile */
    }

    .album-card {
        margin-bottom: 1.5rem;
    }
}

/* --- 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;
    }
}
