/*! gallery.css v3.0.1 | Safis Spa Gallery Page | MIT License */
/* Gallery Page Styles */
.page-header {
    background: linear-gradient(135deg, var(--jade) 0%, var(--gold) 100%);
    color: var(--heavenwhite);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,100 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.page-header h1 {
    font-family: 'mistrully', cursive;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
    position: relative;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    position: relative;
}

/* Gallery Content */
.gallery-content {
    background: var(--ivory);
    min-height: 60vh;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 20px;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--dark);
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold);
    transition: var(--transition);
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    left: 0;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--heavenwhite);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Gallery Grid - Masonry Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 1px;
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    grid-row: span 12; /* Default span, will be adjusted by image height */
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    background: var(--heavenwhite);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.gallery-media {
    width: 100%;    
    height: 100%;
    display: block;
    transition: var(--transition);
    object-fit: cover;
}
.gallery-video-preview {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--dark);
}

.gallery-video-preview video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.5rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.gallery-item:hover .video-play-button {
    background: var(--gold);
    color: var(--heavenwhite);
    transform: translate(-50%, -50%) scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: var(--heavenwhite);
}

.gallery-info h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--gold);
}

.gallery-info p {
    color: var(--heavenwhite);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.media-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: var(--heavenwhite);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--incense);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--lavender);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gallery-loading p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
}

/* Lightbox-specific styles that extend the base modal */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gold);
    color: var(--heavenwhite);
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: var(--jade);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

.lightbox-media-container {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    border-radius: 10px;
    overflow: hidden
}

.lightbox-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.lightbox-video {
    width: 100%;
    max-height: 70vh;
    display: block;
    background: #000;
}

.lightbox-info {
    padding: 30px;
    background: var(--lightdark) !important;
    color: var(--heavenwhite);
    max-height: fit-content;
    border-top: 1px solid var(--lavender);
}

.lightbox-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--heavenwhite);
}

.lightbox-description {
    color: var(--incense);
    line-height: 1.6;
    margin-bottom: 15px;
}

.lightbox-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--incense);
}

.media-type,
.media-category {
    background: var(--gold);
    padding: 4px 12px;
    border-radius: 12px;
    color: var(--heavenwhite);
    font-weight: 500;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--incense);
}

.gallery-empty i {
    font-size: 3rem;
    color: var(--lavender);
    margin-bottom: 20px;
}

.gallery-empty h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--dark);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 100px 0 60px;
    }
    
    .gallery-filters {
        gap: 10px;
        margin-bottom: 40px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .gallery-overlay {
        padding: 20px;
    }
    
    .gallery-info h3 {
        font-size: 1.3rem;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-info {
        padding: 20px;
    }
    
    .lightbox-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        margin-bottom: 30px;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .lightbox-info {
        padding: 15px;
    }
    
    .lightbox-title {
        font-size: 1.3rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .filter-btn,
    .lightbox-nav {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Focus styles for accessibility */
.filter-btn:focus,
.lightbox-nav:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.gallery-item:focus {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}