/* ========================================= */
/* SERENE PATH GALLERY STYLES (Stitch Inspired) */
/* ========================================= */

/* Root Colors from Stitch Design System */
:root {
    --sp-surface: #f7f9fb;
    --sp-surface-container: #eceef0;
    --sp-surface-low: #f2f4f6;
    --sp-primary: #0061a4;
    --sp-primary-container: #e8f0ff;
    --sp-on-surface: #191c1e;
    --sp-on-surface-variant: #43474a;
    --sp-orange: #f28c1b;
}

/* Base Body Adjust for Gallery wrapper if needed */
.gallery-wrapper {
    background-color: var(--sp-surface);
    padding-top: 4rem;
    padding-bottom: 5rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Typography Scale */
.gallery-wrapper .section-title {
    text-align: center !important;
    font-size: 3rem;
    font-weight: 800;
    color: var(--sp-on-surface);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    position: relative;
}

/* Minimalist separator */
.gallery-wrapper .section-title::after {
    display: none; /* Removed the harsh underline in favor of whitespace and soft shifts */
}

.gallery-wrapper .section-desc {
    text-align: center !important;
    color: var(--sp-on-surface-variant);
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto 40px auto;
}

/* Hero Section */
.page-header {
    position: relative;
    background: url('../../images/banners/banner-gallery.png') no-repeat center center/cover;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
    margin-bottom: 20px;
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(0, 97, 164, 0.5) 0%, rgba(13, 27, 42, 0.8) 100%);
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.page-breadcrumb {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.9;
}

.page-breadcrumb a {
    color: #a0c2e6; /* Softer blue link */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-breadcrumb a:hover {
    color: white;
}

/* Filters - Soft Pills */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--sp-surface-low);
    border: none;
    color: var(--sp-on-surface-variant);
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03); /* Ghost feeling */
}

.filter-btn:hover {
    background: var(--sp-surface-container);
    color: var(--sp-on-surface);
}

.filter-btn.active {
    background: var(--sp-primary);
    color: white;
    box-shadow: 0 8px 16px rgba(0, 97, 164, 0.2); /* Deep blue tinted ambient shadow */
}

/* Flat Grid - No Masonry */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.gallery-item {
    height: 320px;
    border-radius: 24px; /* Soft, friendly corners "ROUND_EIGHT" style */
    overflow: hidden;
    position: relative;
    background: var(--sp-surface-low);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    will-change: transform, opacity;
}

.gallery-item:hover {
    box-shadow: 0 24px 48px rgba(0, 97, 164, 0.08); /* Primary color tinted elevate */
    transform: translateY(-8px);
}

.gallery-inner {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: var(--sp-surface-container); /* Fallback */
}

.gallery-inner img, 
.gallery-inner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.06);
}

/* Glassmorphism Overlays for Photos */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 97, 164, 0.15); /* Primary color wash */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.overlay span {
    color: white;
    font-size: 3.5rem;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0px 4px 16px rgba(0,0,0,0.2);
}

.gallery-item.photos:hover .overlay {
    opacity: 1;
}

.gallery-item.photos:hover .overlay span {
    transform: translateY(0) scale(1);
}

/* Glassmorphism Indicators for Videos - Center Floating Component */
.video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-icon span {
    color: var(--sp-primary);
    font-size: 2.2rem;
    margin-left: 3px;
    transition: color 0.3s ease;
}

.gallery-item.videos:hover .video-icon {
    background: var(--sp-primary);
    box-shadow: 0 16px 40px rgba(0, 97, 164, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
}

.gallery-item.videos:hover .video-icon span {
    color: white;
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .page-header { 
        height: 280px; 
        border-radius: 0 0 24px 24px; 
    }
    .page-title { 
        font-size: 2.5rem; 
    }
    .gallery-wrapper .section-title { 
        font-size: 2.2rem; 
    }
    .gallery-wrapper .section-desc { 
        font-size: 1.05rem; 
        padding: 0 15px; 
    }
    .gallery-grid { 
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
        gap: 20px; 
    }
    .gallery-item { 
        height: 260px; 
        border-radius: 16px; 
    }
}

/* Lightbox Styles - Elegant Glass */
.gallery-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(13, 27, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(10px);
}

.gallery-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.gallery-lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--sp-primary);
    transform: rotate(90deg);
}

/* Name Only Placeholder Styles */
.gallery-item.name-only {
    cursor: default !important;
}

.gallery-item.name-only:hover {
    transform: none; /* Disable lift effect if no image */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sp-surface-low) 0%, var(--sp-surface-container) 100%);
    padding: 2rem;
    text-align: center;
}

.media-placeholder .material-symbols-outlined {
    font-size: 3rem;
    color: var(--sp-primary);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.media-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sp-on-surface);
    line-height: 1.4;
}

.gallery-item.name-only .gallery-inner:hover {
    background: var(--sp-primary-container);
    transition: background 0.3s ease;
}
