/* --- 1. CORE PAGE LAYOUT --- */
.header-spacer {
    padding-top: 160px; 
    text-align: center;
    margin-bottom: 40px;
}

.header-spacer h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 800;
    text-transform: uppercase;
}

/* --- 2. THE GRIDS --- */
.gallery-grid, .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-top: 80px;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- 3. GLASS CARDS & IMAGE FITTING --- */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--magenta);
}

/* THE "FRAME" FOR IMAGES AND VIDEOS */
.img-placeholder, .video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Creates a uniform box shape */
    background: #111;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* THE "MAGIC" THAT MAKES IMAGES FIT */
.img-placeholder img, .video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Centers and crops to fill the frame */
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.glass-card:hover img {
    transform: scale(1.08); /* Subtle zoom on hover */
}

/* --- 4. TEXT OVERLAYS --- */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px 12px;
    /* Gradient ensures white text is readable on light photos */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    pointer-events: none;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(230, 0, 126, 0.9);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: 0.3s;
}

.glass-card:hover .play-overlay {
    background: var(--magenta);
    transform: translate(-50%, -50%) scale(1.1);
}

/* --- 5. THE MODAL WINDOW (Pop-Out) --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-window {
    background: #fff;
    width: 100%;
    max-width: 1100px;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8);
    border: 1px solid #333;
}

.modal-header {
    background: #000;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
}

.modal-header h2 { 
    color: #fff; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin: 0; 
}

.header-action-btn {
    background: none; 
    border: 1px solid #444; 
    color: #fff;
    padding: 5px 12px; 
    border-radius: 4px; 
    cursor: pointer;
}

.close-btn { 
    color: #fff; 
    font-size: 2.5rem; 
    cursor: pointer; 
    line-height: 1; 
}

.close-btn:hover { color: var(--magenta); }

.modal-body {
    background: #111;
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* VIDEO CONTAINER FIX */
.modal-video-container {
    width: 100%;
    max-width: 950px;
    aspect-ratio: 16 / 9;
}

.modal-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.mySlides img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 5px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* --- 6. NAVIGATION & ANIMATION --- */
.modal-nav {
    position: absolute; 
    width: 100%; 
    display: flex;
    justify-content: space-between; 
    padding: 0 30px; 
    pointer-events: none;
}

.nav-btn {
    background: rgba(230, 0, 126, 0.85);
    border: none; 
    color: #fff;
    width: 60px; 
    height: 60px; 
    border-radius: 50%;
    cursor: pointer; 
    pointer-events: auto;
    transition: 0.3s;
    font-size: 1.2rem;
}

.nav-btn:hover { background: var(--magenta); transform: scale(1.1); }

.animate-pop { animation: popOut 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes popOut {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- 7. MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .gallery-grid, .video-grid { grid-template-columns: 1fr; }
    .modal-window { width: 100%; max-height: 95vh; }
    .modal-body { min-height: 300px; padding: 10px; }
    .nav-btn { width: 45px; height: 45px; }
    .modal-nav { padding: 0 10px; }
}