/* Gallery Mosaic Styles */
.gallery-section {
  margin: 2rem 0;
}

.gallery-section h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--surface);
  aspect-ratio: 1;
}

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

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

/* Special layouts for specific numbers of images */
.gallery-mosaic[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-mosaic[data-count="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-mosaic[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-mosaic[data-count="5"] .gallery-item:first-child {
  grid-column: 1 / 3;
}

.gallery-mosaic[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  z-index: 10001;
}

.lightbox-close:hover {
  background: var(--accent-color);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  z-index: 10001;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary-color);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Thumbnail navigation */
.lightbox-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  overflow-x: auto;
  padding: 0.5rem;
}

.lightbox-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  object-fit: cover;
}

.lightbox-thumbnail:hover {
  opacity: 0.8;
}

.lightbox-thumbnail.active {
  opacity: 1;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery-mosaic {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.25rem;
  }

  .gallery-mosaic[data-count="2"],
  .gallery-mosaic[data-count="3"],
  .gallery-mosaic[data-count="4"],
  .gallery-mosaic[data-count="6"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-mosaic[data-count="5"] .gallery-item:first-child {
    grid-column: 1 / 3;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-thumbnails {
    bottom: -70px;
  }

  .lightbox-thumbnail {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .gallery-mosaic {
    grid-template-columns: 1fr;
  }

  .gallery-mosaic[data-count="5"] .gallery-item:first-child {
    grid-column: 1;
  }
}
