
/* --- Gallery Slider Section --- */
.gallery-section {
    padding: 80px 20px 40px;
    background: linear-gradient(180deg, #111122 0%, #0D2C7C 100%);
    position: relative;
    text-align: center;
    overflow: hidden;
}

.gallery-section h2 {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 15px;
    font-family: var(--font-heading);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

@media (min-width: 768px) {
    .gallery-section h2 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
}

.gallery-section .section-intro {
  max-width: 800px;
  margin: 0 auto 15px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Slider Container */
/* Slider Container */
.gallery-slider-container {
    position: relative;
    max-width: 1200px;
    margin: 30px auto 0;
    overflow: hidden; /* Hides horizontal scrollbar */
    padding: 20px 0 20px; /* Adjusted spacing */
}

@media (min-width: 768px) {
    .gallery-slider-container {
        margin: 50px auto 0;
        padding: 60px 0 20px;
    }
}

/* Slider Track */
.gallery-track {
    display: flex;
    gap: 0; /* Crucial: We use padding on slides for spacing now to ensure math is perfect */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); /* Smoother interaction */
    width: 100%;
    cursor: grab;
}

.gallery-track:active {
    cursor: grabbing;
}

/* Individual Slide */
.gallery-slide {
    flex: 0 0 100%; /* Default mobile: 1 slide per view */
    max-width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 15px; /* Creates the "gap" visually */
    box-sizing: border-box;
}

/* Gallery Item Styling */
.gallery-item {
    background: rgba(34, 34, 68, 0.6);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08); /* Slightly more visible border */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 100%; /* Full width on mobile */
    margin: 0 auto;
}

@media (min-width: 768px) {
    .gallery-item {
        border-radius: 16px; 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        max-width: 400px; 
    }
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 35px rgba(0, 255, 255, 0.2);
    z-index: 2;
}

.gallery-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.6s ease;
    border-radius: 12px; /* Ensure image corners match container */
}

.gallery-item:hover .gallery-img {
    transform: scale(1.02); /* Reduced scale to prevent overflow if contained */
}

.gallery-caption {
    padding: 12px;
    font-family: var(--font-heading);
    color: var(--text-primary);
    background: rgba(17, 17, 34, 0.9);
    backdrop-filter: blur(8px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(8px);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .gallery-caption {
        padding: 15px;
        font-size: 0.95rem;
        letter-spacing: 1px;
    }
}

/* Navigation Buttons - Floating Design */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.slider-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: 5px; }
.next-btn { right: 5px; }

/* Pagination Dots */
.slider-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    position: relative;
    z-index: 10;
}

.dot {
    width: 30px; /* Long pill shape for modern look */
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent-cyan);
    width: 45px; /* Expands when active */
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
    .gallery-slide {
        flex: 0 0 50%; /* 2 slides per view on tablet */
    }
    .slider-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .prev-btn { left: 0px; }
    .next-btn { right: 0px; }
    /* Pull buttons slightly outside if container allows, or flush to edge */
}

@media (min-width: 1024px) {
    .gallery-slide {
        flex: 0 0 100%; /* 1 slide per view on desktop */
        padding: 0 40px; /* Add breathing room on sides */
    }
    
    .gallery-item {
        max-width: 900px; /* Limit width for a cleaner, focused look */
        margin: 0 auto;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5); /* Enhanced shadow for single hero item */
        height: auto; /* Allow height to adapt to content */
    }

    .gallery-img {
        height: auto; /* Remove fixed height */
        max-height: 600px; /* Optional: limit max height just in case */
    }

    /* Keep buttons inside the container to avoid being clipped by overflow:hidden */
    .prev-btn { left: 30px; } 
    .next-btn { right: 30px; }
    
    /* Ensure buttons are large and clearly visible over images */
    .slider-btn {
        width: 60px;
        height: 60px;
        background: rgba(17, 17, 34, 0.7); /* Slightly transparent */
        border: 1px solid rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(5px);
    }
    
    .slider-btn:hover {
        transform: translateY(-50%) scale(1.2);
        background: var(--accent-cyan);
        color: var(--bg-primary);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    }
}

/* Fix for touch devices to avoid hover sticky states */
@media (hover: none) {
    .gallery-item:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}
