/**
 * Gallery Component Styles
 * Image gallery with modal lightbox
 */

/* ========================================
   Desktop Grid Layout
   ======================================== */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Gallery Item Pseudo-classes */
.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.gallery-item:active {
  transform: translateY(-2px);
}

.gallery-item:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
}

/* Gallery Item Image */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ========================================
   Zoom Overlay
   ======================================== */
.zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.zoom-icon {
  color: white;
  font-size: 40px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.gallery-item:hover .zoom-icon {
  transform: scale(1);
}

/* ========================================
   Image Modal
   ======================================== */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 999998;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95%;
  max-height: 95%;
  text-align: center;
  z-index: 999999;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  transition: background 0.3s ease;
  z-index: 1000000;
}

.modal-close:hover {
  background: rgba(0,0,0,0.8);
}

.modal-title {
  color: white;
  margin-top: 15px;
  font-size: 16px;
}

/* ========================================
   Mobile Slider
   ======================================== */
.mobile-slider {
  display: none;
}

/* ========================================
   Media Queries
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .image-gallery {
    display: none;
  }

  .mobile-slider {
    display: block;
    margin: 20px 0;
  }

  .swiper-container {
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
  }

  .swiper-slide {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
  }

  .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .swiper-pagination {
    position: static !important;
    margin-top: 15px;
    text-align: center;
  }

  .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ccc;
    opacity: 1;
    margin: 0 4px;
  }

  .swiper-pagination-bullet-active {
    background: #007aff;
  }
}

/* Force hide mobile slider on desktop */
@media (min-width: 769px) {
  .mobile-slider {
    display: none !important;
  }
}

/* ========================================
   Accessibility - Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-item img,
  .zoom-overlay,
  .zoom-icon,
  .modal-close {
    transition: none;
  }
}
