/* event-gallery.css */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Cinzel:wght@400;600&family=DM+Sans:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* ── DESIGN TOKENS ──────────────────────────────────────── */
:root {
    --ev-primary:      #062037;
    --ev-primary-dark: #041425;
    --ev-gold:         #C5A054;
    --ev-gold-light:   #DCC07A;
    --ev-cream:        #FAF7F2;
    --ev-white:        #FFFFFF;
    --ev-text:         #062037;
    --ev-text-muted:   #6b7d8e;
    --ev-shadow:       0 10px 30px rgba(6, 32, 55, 0.08);
    --ev-shadow-hover: 0 20px 40px rgba(6, 32, 55, 0.15);
    --ev-radius:       14px;
    --ev-transition:   .35s cubic-bezier(.4,0,.2,1);
}

/* ── PAGE WRAPPER ───────────────────────────────────────── */
.event-page-wrapper {
    padding: 80px 24px;
    background-color: var(--ev-cream);
    min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────────────── */
.event-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gold-text {
    color: var(--ev-gold);
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    font-size: .75rem;
    letter-spacing: .20em;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.event-header h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Fluid responsive typography */
    font-family: 'Playfair Display', serif;
    margin: 0 0 20px;
    color: var(--ev-primary);
    line-height: 1.2;
}

.header-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--ev-gold), var(--ev-gold-light));
    margin: 0 auto;
    border-radius: 4px;
}

/* ── MASONRY GRID ───────────────────────────────────────── */
.masonry-container {
    max-width: 1400px;
    margin: 0 auto;
}

.masonry-grid {
    column-count: 4;
    column-gap: 24px;
}

.masonry-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 24px;
    border-radius: var(--ev-radius);
    overflow: hidden;
    position: relative;
    background: var(--ev-white);
    box-shadow: var(--ev-shadow);
    transition: transform var(--ev-transition), box-shadow var(--ev-transition);
    cursor: pointer;
    will-change: transform;
}

.masonry-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--ev-shadow-hover);
}

/* ── MEDIA WRAPPER ──────────────────────────────────────── */
.media-wrapper {
    position: relative;
    line-height: 0;
}

.media-wrapper img, 
.media-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s ease;
}

.masonry-item:hover .media-wrapper img,
.masonry-item:hover .media-wrapper video {
    transform: scale(1.05);
}

.video-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ev-primary);
    transition: all var(--ev-transition);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,.1);
}

.masonry-item:hover .video-indicator {
    background: var(--ev-primary);
    color: var(--ev-white);
}

/* ── OVERLAY ────────────────────────────────────────────── */
.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(transparent, rgba(6, 32, 55, 0.85));
    color: var(--ev-white);
    opacity: 0;
    transition: opacity var(--ev-transition);
}

.masonry-item:hover .item-overlay {
    opacity: 1;
}

/* ── LIGHTBOX ───────────────────────────────────────────── */
.lightbox-modal {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 20, 37, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility .3s;
    will-change: opacity;
    padding: 20px;
}

.lightbox-modal.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--ev-white);
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: background var(--ev-transition);
    border: none;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(197, 160, 84, 0.3);
    color: var(--ev-gold);
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    transform: scale(0.9);
    transition: transform .4s cubic-bezier(.165, .84, .44, 1);
    will-change: transform;
    text-align: center;
}

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

#lightboxMediaContainer img, 
#lightboxMediaContainer video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--ev-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: inline-block;
}

.lightbox-caption {
    margin-top: 20px;
    color: var(--ev-white);
    text-align: center;
}

.lightbox-caption h3 { 
    color: var(--ev-gold); 
    margin-bottom: 5px; 
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
}

.lightbox-caption p {
    color: rgba(255,255,255,0.7);
    font-size: .9rem;
    margin: 0;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* Laptop */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
        column-gap: 20px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .event-page-wrapper {
        padding: 60px 20px;
    }
    
    .masonry-grid {
        column-count: 2;
        column-gap: 16px;
    }
    
    .masonry-item {
        margin-bottom: 16px;
    }
    
    /* Always show a subtle overlay on touch devices so users know it's tappable */
    .item-overlay {
        opacity: 1;
        background: linear-gradient(transparent 40%, rgba(6, 32, 55, 0.7));
        padding: 20px 14px 14px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .event-page-wrapper {
        padding: 40px 16px;
    }
    
    .masonry-grid {
        column-count: 2;
        column-gap: 10px;
    }
    
    .masonry-item {
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    .event-header h1 {
        font-size: 1.8rem;
    }
    
    .video-indicator {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }
    
    /* Lightbox Mobile Adjustments */
    .lightbox-content {
        max-width: 95%;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    #lightboxMediaContainer img, 
    #lightboxMediaContainer video {
        max-height: 50vh;
        border-radius: 10px;
    }
    
    .lightbox-caption h3 {
        font-size: 1rem;
    }
    
    .lightbox-caption p {
        font-size: .8rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .masonry-item, .media-wrapper img, .media-wrapper video, .lightbox-content, .lightbox-modal {
        transition-duration: 0.01ms !important;
    }
}