/* Forest Vacation Theme - San Sebastián del Oeste */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Gallery Section Styles */
.gallery-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/><circle cx="50" cy="10" r="1" fill="%23000" opacity="0.02"/><circle cx="10" cy="90" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 15px;
    margin-top: 2rem;
}



/* Gallery Items */
.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    animation-delay: 0.1s;
}

.gallery-item:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-card {
    height: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
}

.image-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
    border-radius: 15px;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(106, 170, 145, 0.7),  /* light filtered green - mint forest glow */
        rgba(106, 170, 145, 0.7)   
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.25s ease;
    border-radius: 15px;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.gallery-item:hover .overlay-content {
    transform: translateY(0);
}

.image-title {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.image-title.medium {
    font-size: 12px;
}

.image-title.small {
    font-size: 10px;
}

.overlay-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
}



/* Loading Animation */
.gallery-image {
    opacity: 0;
    animation: fadeInImage 0.8s ease forwards;
}


/* Kaleidoscope Effect */
.gallery-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #e74c3c, #f39c12, #f1c40f, #2ecc71, 
        #3498db, #9b59b6, #e74c3c);
    background-size: 400% 400%;
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    animation: gradientShift 3s ease infinite;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::before {
    opacity: 0.7;
}



.modal-backdrop.show {
  opacity: 0.85 !important;
  pointer-events: auto !important;
}

.modal {
  pointer-events: auto;
}

#galleryModal {
  pointer-events: auto;
}

#galleryModal .modal-dialog {
  pointer-events: auto;
}

#galleryModal .modal-content {
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.85); /* Make this layer catch events */
}

#galleryModal .modal-body {
  pointer-events: auto;
}

body.modal-open {
  pointer-events: none; /* Disable background clicks */
}

body.modal-open .modal,
body.modal-open .modal * {
  pointer-events: auto; /* Re-enable pointer events only inside the modal */
}

.swiper-modal {
    width: 1700px !important;
    max-width: 100% !important;
    height: 100vh;
}

#galleryModal .swiper-pagination-bullet {
  width: 15px;
  height: 15px;
  margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 9px) !important;
  background: rgba(255, 255, 255, 1);
}

#galleryModal .swiper-pagination-bullet-active {
  background: #fff;
}

#galleryModal .swiper-button-prev, #galleryModal .swiper-rtl .swiper-button-next,
#galleryModal .swiper-button-next:after, #galleryModal .swiper-rtl .swiper-button-prev:after {
    color: #f8f5f0;
    background-color: rgba(0, 0, 0, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(-50%);
    display: flex
    ;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

#galleryModal .swiper-button-prev:after, #galleryModal .swiper-rtl .swiper-button-next:after {
  color: #f8f5f0;
    background-color: rgba(0, 0, 0, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* Arrow for the "previous" button */
#galleryModal .swiper-button-prev::after {
    content: '←'; 
    font-size: 22px;
}

/* Arrow for the "next" button */
#galleryModal .swiper-button-next::after {
    content: '→'; 
    font-size: 22px;
}

.modal-gallery-image {
    max-height: calc(100vh - 185px) !important;
}

#galleryModal .swiper-pagination-modal {
    position: relative;
    top: -50px !important;
}

#galleryModal .swiper-slide-modal {
    max-width: 2000px !important;
}

.swiper-button-next-modal {
    right: var(--swiper-navigation-sides-offset, 30px);
    left: auto;
}

.swiper-button-prev-modal {
    left: var(--swiper-navigation-sides-offset, 20px);
    right: auto;
}

/* ========================================
   KEYFRAMES ANIMATIONS
   ======================================== */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Tablet and up */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 180px;
        gap: 20px;
    }
}

/* Desktop and up */
@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: 160px;
        gap: 25px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 10px;
    }
    
    .gallery-item {
        grid-row: span 1 !important;
        grid-column: span 1 !important;
    }
    
    .image-title {
        font-size: 1.1rem;
    }
}