/* ============================================
   GALLERY PREMIUM STYLES - TWO-STEP FLOW
   ============================================ */

/* --- Step 1: Album Card Grid --- */
.gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-3xl);
}

.gallery-album-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-premium);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    /* Base for overlay */
}

.gallery-album-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary);
}

.album-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* More proportional for full look */
    overflow: hidden;
    background: var(--gray-200);
}

.carousel-track-horizontal {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
}

.carousel-track-horizontal::-webkit-scrollbar {
    display: none;
}

.carousel-slide-horizontal {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    height: 100%;
}

.carousel-slide-horizontal img,
.carousel-slide-horizontal video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform var(--transition-slow);
}

/* Specific fix for Crew to avoid face cutting */
.category-our-crew .carousel-slide-horizontal img,
.category-crew .carousel-slide-horizontal img {
    object-position: center 15%;
}

.carousel-slide-horizontal:hover img,
.carousel-slide-horizontal:hover video {
    transform: scale(1.05);
}

.album-card-info {
    position: absolute;
    top: 0 !important;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    color: var(--white);
    z-index: 2;
    border-bottom: none;
}

.album-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.album-title-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.album-title-row i {
    font-size: 1.1rem;
    color: var(--secondary);
    /* Premium gold/accent color */
}

.album-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.photo-count {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.album-grid-view {
    position: fixed;
    inset: 0;
    background: #f8fafc;
    z-index: 9998;
    /* Below Lightbox (2000 in original CSS, let's normalize) */
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-grid-view.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.album-grid-header {
    background: var(--white);
    padding: 1rem var(--spacing-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    z-index: 10;
}

.album-back-btn {
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.album-back-btn:hover {
    background: var(--gray-100);
}

.album-grid-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-serif);
    color: var(--primary);
    flex: 1;
    text-align: center;
    padding-right: 100px;
    /* Balance back button */
}

.album-grid-view .container {
    flex: 1;
    overflow-y: auto;
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-3xl);
}

.album-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.album-grid-item {
    position: relative;
    cursor: pointer;
    background: var(--gray-200);
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 1;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.album-grid-item:hover {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.album-grid-item img,
.album-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.album-grid-item:hover img,
.album-grid-item:hover video {
    transform: scale(1.1);
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 2px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
    pointer-events: none;
}

/* --- Lightbox Override for High Z-Index --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    /* Higher than album grid overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: var(--spacing-lg);
    text-align: center;
    color: var(--white);
    max-width: 800px;
}

.lightbox-caption h4 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.lightbox-caption p {
    font-size: 1rem;
    opacity: 0.8;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--secondary);
    color: var(--primary);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .gallery-album-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .album-grid-header h3 {
        padding-right: 60px;
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .gallery-album-grid {
        grid-template-columns: 1fr;
    }

    .album-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}