

.gallery-container-section {
    position: relative;
    padding: 100px 0;
    background: var(--bg-deep);
    perspective: 2000px;
    overflow: visible;
}

.gallery-instruction {
    text-align: center;
    color: #888;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* Restored Grid Layout */
.unfold-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    position: relative;
}

.unfold-item {
    position: relative;
    width: 320px;
    height: 200px;
    margin: 40px auto;
    perspective-origin: center center;
    transform-style: preserve-3d;
    transform: none;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s;
    list-style: none;
    padding: 0;
    cursor: pointer;
    z-index: 1;
}

/* no staggered tilts */

/* --- NO HOVER EXPANSION --- */
.unfold-item:hover {
    z-index: 10;
}

/* Image Slices Base Styles */
.unfold-item li {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s, border 0.3s;
    background: var(--bg-void);
    background-image: var(--bg-img);
    background-size: 300% 300%;
    filter: grayscale(0.6) brightness(0.6);
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
}

/* Slices Initial Folded Positions */
.unfold-item li:nth-of-type(1) { transform: none; z-index: 10; background-position: center center; }
.unfold-item li:nth-of-type(2) { left: 100%; transform-origin: left center; transform: rotateY(180deg); background-position: right center; }
.unfold-item li:nth-of-type(3) { top: 100%; transform-origin: center top; transform: rotateX(-180deg); background-position: center bottom; }
.unfold-item li:nth-of-type(4) { left: -100%; transform-origin: right center; transform: rotateY(-180deg); background-position: left center; }
.unfold-item li:nth-of-type(5) { top: -100%; transform-origin: center bottom; transform: rotateX(180deg); background-position: center top; }
.unfold-item li:nth-of-type(6) { top: 100%; left: 100%; transform-origin: center top; transform: rotateX(-180deg); background-position: right bottom; }
.unfold-item li:nth-of-type(7) { top: 100%; left: -100%; transform-origin: right center; transform: rotateY(-180deg); background-position: left bottom; }
.unfold-item li:nth-of-type(8) { top: -100%; left: -100%; transform-origin: center bottom; transform: rotateX(180deg); background-position: left top; }
.unfold-item li:nth-of-type(9) { top: -100%; left: 100%; transform-origin: left center; transform: rotateY(180deg); background-position: right top; }

/* --- CLICK EXPANSION ANIMATION --- */
.unfold-item.expanding-to-center {
    z-index: 99999;
    pointer-events: none;
    /* Use the calculated variables to move from current position to center */
    /* scale(1.8) ensures it's not "too big" as requested */
    transform: translate(var(--move-x), var(--move-y)) scale(0.9) rotateX(0deg) rotateY(0deg) !important;
    transition: all 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.unfold-item.expanding-to-center li {
    filter: grayscale(0) brightness(1);
    border: 1px solid var(--neon-cyan);
    /* Force unfolding during the flight */
    transform: rotateX(0) rotateY(0) !important;
}

.unfold-item li:nth-of-type(1) { background-position: center center; }
.unfold-item li:nth-of-type(2) { background-position: 100% 50%; }
.unfold-item li:nth-of-type(3) { background-position: 50% 100%; }
.unfold-item li:nth-of-type(4) { background-position: 0% 50%; }
.unfold-item li:nth-of-type(5) { background-position: 50% 0%; }
.unfold-item li:nth-of-type(6) { background-position: 100% 100%; }
.unfold-item li:nth-of-type(7) { background-position: 0% 100%; }
.unfold-item li:nth-of-type(8) { background-position: 0% 0%; }
.unfold-item li:nth-of-type(9) { background-position: 100% 0%; }
/* --- GALLERY MODAL OVERLAY --- */
.gallery-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 100000;
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.gallery-overlay.active { display: flex; }

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border: 1px solid rgba(255,255,255,0.1);
    background: #000;
    position: relative;
}

#modalImg {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    animation: imageFadeIn 0.5s ease;
}

@keyframes imageFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    position: absolute;
    top: 30px; right: 30px;
    background: none; border: none;
    color: white; font-size: 2rem;
    cursor: pointer; transition: 0.3s;
}

.close-modal:hover { color: var(--neon-cyan); transform: scale(1.2); }

.nav-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 60px; height: 60px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}

.nav-btn:hover { background: var(--neon-cyan); color: black; }
.nav-btn.prev { left: 40px; }
.nav-btn.next { right: 40px; }

.modal-info {
    margin-top: 20px;
    color: var(--neon-cyan);
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 2px;
}

/* ── ASYMMETRIC GRID ── */

/* ── 2-COLUMN CIRCULAR GRID ─────────────────────────────────────────── */
.unfold-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, 280px) !important;
    grid-template-rows: auto !important;
    gap: 50px !important;
    max-width: 660px !important;
    margin: 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
}

.unfold-item {
    width: 280px !important;
    height: 280px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    grid-column: auto !important;
    grid-row: auto !important;
    transform: none !important;
    box-shadow: 0 6px 28px rgba(0,0,0,0.12), 0 0 0 2px rgba(0,151,167,0.12);
}

/* Hover: glow ring */
.unfold-item:hover {
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 0 0 5px rgba(0,151,167,0.4), 0 8px 40px rgba(0,151,167,0.2) !important;
}

/* View icon on hover */
.unfold-item::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem; color: rgba(255,255,255,0.95);
    z-index: 21; pointer-events: none;
    border-radius: 12px;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    opacity: 0; text-shadow: 0 0 20px rgba(0,151,167,0.9);
}
.unfold-item:hover::before { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* No label overlay */
.unfold-item::after { display: none !important; }

@media (max-width: 640px) {
    .unfold-gallery {
        grid-template-columns: repeat(2, 200px) !important;
        gap: 30px !important;
        max-width: 460px !important;
    }
    .unfold-item { width: 200px !important; height: 200px !important; }
}
@media (max-width: 440px) {
    .unfold-gallery {
        grid-template-columns: repeat(2, 150px) !important;
        gap: 20px !important;
        max-width: 340px !important;
    }
    .unfold-item { width: 150px !important; height: 150px !important; }
}


/* ── LIGHT OVERRIDES ── */

/* ── LIGHT THEME OVERRIDES ─────────────────────────────────────────── */


.gallery-container-section { background:#f4f7fa !important; }
.gallery-instruction { color:#6b7fa3 !important; }
.gallery-instruction h1 { color:#1a2332 !important; font-family:'Syncopate',sans-serif; font-size:clamp(1.3rem,3vw,2rem); letter-spacing:0.1em; }
.gallery-instruction h1 span { color:#0097a7 !important; }

/* Cards: grayscale by default, colour on hover */
.unfold-item li { filter: grayscale(1) brightness(0.85) !important; border: 1px solid rgba(0,0,0,0.08) !important; }
.unfold-item:hover li { filter: grayscale(0) brightness(1.04) !important; }
.unfold-item.expanding-to-center li { filter: grayscale(0) brightness(1) !important; border: 1px solid #0097a7 !important; }

.gallery-overlay { display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 25, 40, 0.95) !important;
    z-index: 100000; /* Base level */
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    flex-direction: column; }
.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border: 1px solid rgba(0, 151, 167, 0.2) !important;
    background: #fff !important;
    position: relative;
    z-index: 100050; /* Lower than buttons */
    border-radius: 12px;
    overflow: hidden;
}
.close-modal { color:#1a2332 !important; background:rgba(255,255,255,0.9) !important; border-radius:50% !important;
    width:44px !important; height:44px !important; display:flex !important; align-items:center !important;
    justify-content:center !important; font-size:1rem !important; border:1px solid #dde6ef !important; top:24px !important; right:24px !important; }
.close-modal:hover { color:#fff !important; background:#e53935 !important; border-color:#e53935 !important; transform:rotate(90deg) scale(1.1) !important; }
.nav-btn { color:#fff !important; background:rgba(255,255,255,0.08) !important; border:1px solid rgba(255,255,255,0.15) !important; }
.nav-btn:hover { background:#0097a7 !important; box-shadow:0 0 20px rgba(0,151,167,0.4) !important; }
.modal-info { color:#b2ebf2 !important; }

.recognition { background:#fff !important; border-top:1px solid #dde6ef; border-bottom:1px solid #dde6ef; }
.recognition-title { color:#6b7fa3 !important; }
footer { background:#1a2332 !important; }
.copyright { color:#8899bb !important; border-top:1px solid rgba(255,255,255,0.07) !important; }
.nav-btn {
    position: absolute;
    top: 50%; 
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    width: 60px; height: 60px;
    border-radius: 50%; 
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
    /* This ensures they stay ON TOP of the image */
    z-index: 100100 !important; 
}

.nav-btn.prev { 
    left: 40px; 
}

.nav-btn.next { 
    right: 40px; 
}

/* Mobile Adjustments to keep buttons on screen */
@media (max-width: 768px) {
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
    }
    .nav-btn.prev { left: 10px; }
    .nav-btn.next { right: 10px; }
}

