/* assets/css/galeri.css */

:root {
    --gallery-bg: #0f172a;
    --text-light: #f1f5f9;
    --accent: #15406a;
}

body {
    background-color: var(--gallery-bg);
    color: var(--text-light);
    overflow-x: hidden;
}

.gallery-hero {
    position: relative;
    padding-top: 3rem;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* The Canvas where WebGL renders */
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind content but visible */
}

.gallery-content {
    position: relative;
    z-index: 10; /* Above canvas */
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas if needed, but buttons need pointer-events auto */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5vw;
}

.gallery-title {
    position: absolute;
    bottom: 1.5rem;
    left: 3vw;
    font-size: 5vw;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.555);
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: overlay;
}

/* Allow clicking on the slider area to open modal */
.gallery-slider {
    position: relative;
    width: 80vw;
    /* aspect-ratio: 16/9; */
    height: 60vh;
    margin: 0 auto;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks */
    z-index: 15; /* Ensure it's above canvas but below controls if they overlap, though controls are separate */
}

/* Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none; /* Hidden by default, toggled by JS/GSAP */
    justify-content: center;
    align-items: center;
}

.modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6); /* Dark semi-transparent */
    backdrop-filter: blur(15px); /* Strong blur effect */
    -webkit-backdrop-filter: blur(15px);
}

.modal-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.95);
}

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: 0px;
    right: -50px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}

.close-modal:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; /* Or whatever layout */
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hide DOM elements, show WebGL only */
}

/* But we DO want the images to load for the texture. */
.gallery-slide img {
    display: none; /* Curtains loads via new Image(), but referencing existing <img> tag is common using plane.loadImages */
    /* Actually better: keep them in DOM but hidden opacity */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* To ensure Curtains picks up correct dimensions, the container must have size */
/* .gallery-slide.active state is managed by JS logic */

/* Captions overlay */
.slide-caption {
    position: absolute;
    bottom: -10vh; /* Adjust based on design */
    left: 0;
    pointer-events: auto;
    color: var(--text-light);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    max-width: 50%;
}

.slide-caption h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slide-caption p {
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

/* Controls */
.gallery-controls {
    position: absolute;
    bottom: 5vh;
    right: 5vw;
    display: flex;
    align-items: center;
    gap: 2rem;
    pointer-events: auto;
    z-index: 20;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
}

.nav-btn:hover {
    background: var(--text-light);
    color: var(--gallery-bg);
}

.pagination {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

.pagination .current {
    font-size: 1.5rem;
}

.pagination .divider {
    opacity: 0.5;
    margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-title {
        top: 6.5rem;
        left: 10%;
        color: rgba(255, 255, 255, 0.555);
    -webkit-text-stroke: 0.2px rgba(255, 255, 255, 0.555);
    }
    
    .gallery-slider {
        width: 90vw;
        height: 50vh;
    }

    .slide-caption {
        max-width: 100%;
        bottom: -15vh;
    }

    .slide-caption h2 {
        font-size: 2rem;
    }
}
