/* Gallery Section - Infinite Auto-Scroll Collage */
.gallery {
  padding: 3rem 0;
  background: var(--white);
  color: var(--black);
  overflow: hidden;
}

.gallery .section-title {
  color: var(--black);
}

.gallery-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  overflow: hidden;
}

.gallery-row {
  display: flex;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.gallery-track {
  display: flex;
  gap: 1rem;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

/* Scroll right animation */
.gallery-row[data-direction="right"] .gallery-track {
  animation-name: scrollRight;
  animation-duration: 40s;
}

/* Scroll left animation */
.gallery-row[data-direction="left"] .gallery-track {
  animation-name: scrollLeft;
  animation-duration: 35s;
}

@keyframes scrollRight {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes scrollLeft {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Pause on hover */
.gallery-row:hover .gallery-track {
  animation-play-state: paused;
}

.gallery-item {
  flex-shrink: 0;
  height: 400px;
  position: relative;
  z-index: 1;
}

.gallery-item:hover {
  z-index: 10;
}

.gallery-item img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  border: 5px solid var(--black);
  background: var(--white);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover img {
  box-shadow: 6px 6px 0 var(--yellow);
  transform: scale(1.02);
}

.gallery-overlay {
  display: none;
}

.gallery-number {
  display: none;
}

/* Gallery Modal */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.gallery-modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gallery-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border: none;
  box-shadow: none;
  background: transparent;
  display: block;
}

.gallery-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: var(--red);
  color: var(--white);
  border: 4px solid var(--black);
  width: 50px;
  height: 50px;
  font-size: 2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
}

.gallery-modal-close:hover {
  background: var(--yellow);
  color: var(--black);
  transform: rotate(90deg);
}

/* Mobile Responsive */
@media (max-width: 1200px) {
  .gallery-item {
    height: 350px;
  }
  
  .gallery-wrapper {
    gap: 1.5rem;
  }
}

@media (max-width: 992px) {
  .gallery-item {
    height: 300px;
  }
  
  .gallery-track {
    gap: 0.8rem;
  }
  
  .gallery-wrapper {
    gap: 0.8rem;
  }
  
  .gallery-modal-content img {
    border: none;
    box-shadow: none;
  }
  
  .gallery-modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: -45px;
  }
}

@media (max-width: 768px) {
  .gallery {
    padding: 1.5rem 0;
  }
  
  .gallery-item {
    height: 250px;
  }
  
  .gallery-item img {
    border-width: 3px;
  }
  
  .gallery-track {
    gap: 0.8rem;
  }
  
  .gallery-wrapper {
    gap: 0.8rem;
  }
  
  .gallery-modal {
    padding: 1rem;
  }
  
  .gallery-modal-content img {
    border: none;
    box-shadow: none;
  }
  
  .gallery-modal-close {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
    top: -40px;
  }
  
  /* Faster animation on mobile */
  .gallery-row[data-direction="right"] .gallery-track {
    animation-duration: 30s;
  }
  
  .gallery-row[data-direction="left"] .gallery-track {
    animation-duration: 25s;
  }
}

@media (max-width: 480px) {
  .gallery-item {
    height: 200px;
  }
  
  .gallery-item img {
    border-width: 3px;
  }
  
  .gallery-track {
    gap: 0.8rem;
  }
  
  .gallery-wrapper {
    gap: 0.8rem;
  }
}
