/*
 * =======================================================
 * EKANTAM RESORT - GALLERY PAGE MINIMAL STYLES
 * File: css/gallery.css
 * Concept: Full-Width Image, Bottom Overlay Caption, Stable Horizontal Scroll
 * =======================================================
 */

/* ---------------------------------------------------- */
/* 1. CORE VIEWPORT & TRACK DIMENSIONS (CRITICAL) */
/* ---------------------------------------------------- */

#gallery-page-container {
    /* Guarantees full screen space for the gallery */
    width: 100vw;
    height: 100vh;
    overflow: hidden; 
    position: relative;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.gallery-viewport {
    width: 100%;
    height: 100%;
    /* KEY: Enables horizontal scrolling */
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory; 
    /* Hide the scrollbar itself for a cleaner look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.gallery-viewport::-webkit-scrollbar {
    display: none;
}

.film-strip-track {
    /* Total width for 8 slides */
    width: 800vw; 
    height: 100%;
    display: flex; /* Makes slides line up horizontally */
}

/* ---------------------------------------------------- */
/* 2. SLIDE DIMENSIONS AND LAYOUT */
/* ---------------------------------------------------- */

.strip-slide {
    /* Guarantees each slide takes exactly one viewport width */
    flex: 0 0 100vw; 
    height: 100vh;
    display: block; 
    padding: 0; 
    position: relative;
    overflow: hidden; 
    scroll-snap-align: start; 
}

/* ---------------------------------------------------- */
/* 3. IMAGE STYLING (THE FIX FOR SHRINKING) */
/* ---------------------------------------------------- */

.strip-slide .image-wrapper {
    /* Must cover the entire slide area */
    width: 100%;
    height: 100%; 
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    /* Optional: Ensure image wrapper can handle background color if images fail to load */
    background-color: #333; 
}

/* * CRITICAL FIX: The .parallax-img is now a stable background-image 
 * The background-attachment: fixed gives a subtle parallax feel 
 * without complex JS, but the image size is now stable (100% cover).
 */
.parallax-img {
    /* Revert to 100% size for stability */
    width: 100%; 
    height: 100%; 
    position: absolute;
    top: 0; 
    left: 0;
    
    /* Make the image always fill its container */
    background-size: cover !important;
    background-position: center center !important;
    
    /* REMOVE ALL PARALLAX JS REFERENCES/PROPERTIES */
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
}

/* ---------------------------------------------------- */
/* 4. CAPTION OVERLAY STYLES (Visibility guaranteed) */
/* ---------------------------------------------------- */

.strip-slide .slide-caption {
    position: absolute;
    bottom: 0; 
    left: 0;
    
    /* Full width, padding included */
    width: 100%; 
    box-sizing: border-box; 
    
    /* Visual styling */
    background: rgba(0, 0, 0, 0.75); /* Slightly darker for better text contrast */
    color: #ffffff; 
    padding: 40px 80px; 
    z-index: 50; /* Ensure text is on top */
}

.strip-slide .slide-caption h2 {
    font-size: 3.2em;
    margin-top: 0;
    text-transform: uppercase;
}
/* ... (Rest of the caption styles remain the same) ... */

/* ---------------------------------------------------- */
/* 5. SLIDE OPENER */
/* ---------------------------------------------------- */

.slide-opener {
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
}
/* ... (Rest of the slide opener and media queries remain the same) ... *//* * =======================================================
 * GALLERY GRID AND MODAL STYLES
 * File: css/gallery-modal.css (Highly Recommended separate file)
 * =======================================================
 */

/* ---------------------------------------------------- */
/* 1. GALLERY GRID CONTAINER (B) */
/* ---------------------------------------------------- */

#gallery-grid-page {
    /* Set padding to account for a fixed header if necessary */
    padding-top: 40px; 
    background-color: #f7f7f7;
}

.gallery-grid-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Category Filters */
.category-filters {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    background: none;
    border: 1px solid #ccc;
    color: #555;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #A37F5D; /* Resort Primary Color */
    color: white;
    border-color: #A37F5D;
}

/* Photo Grid Layout (using CSS Grid for simplicity) */
.photo-grid {
    display: grid;
    /* Responsive columns: starts at 1, expands to 3 or 4 */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.02);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the container without distortion */
    display: block;
    transition: opacity 0.3s;
}

.caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    font-size: 0.9em;
    opacity: 1;
    transition: opacity 0.3s;
}

.grid-item:hover .caption-overlay {
    opacity: 1;
}


/* ---------------------------------------------------- */
/* 2. MODAL VIEWER (C) */
/* ---------------------------------------------------- */

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Dark, high-contrast background */
    z-index: 9999; /* Ensure it's on top of everything */
    display: none; /* Hidden by default, shown by JS */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Class added by JavaScript to display the modal */
.gallery-modal.is-active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content-area {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    position: relative;
}

#modal-image {
    max-width: 100%;
    max-height: 80vh; /* Adjust max height to leave room for caption */
    object-fit: contain; /* CRITICAL: Prevents cropping in the modal */
    display: block;
}

.modal-caption-text {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 15px 20px;
    text-align: center;
    max-width: 100%;
}

/* Modal Controls */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}