/* Style dla galerii - nowa wersja */
@import url('colors.css');

.gallery-section {
  padding: 5rem 0;
  background-color: var(--color-background);
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 0 auto;
  max-width: 1200px;
}

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

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-5px);
}

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

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

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(46, 49, 146, 0.8), transparent);
  color: white;
  padding: 15px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

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

.gallery-item-title {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.gallery-item-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.lightbox-prev,
.lightbox-next {
  background-color: rgba(241, 161, 158, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: background-color 0.3s;
  border: none;
  outline: none;
}

.lightbox-prev {
  margin-left: -70px;
}

.lightbox-next {
  margin-right: -70px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: var(--color-primary);
}

/* Responsywność */
@media (max-width: 991.98px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
  }
  
  .lightbox-prev {
    margin-left: -20px;
  }
  
  .lightbox-next {
    margin-right: -20px;
  }
}

@media (max-width: 767.98px) {
  .gallery-section {
    padding: 4rem 0;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  
  .gallery-item-caption {
    padding: 10px;
  }
  
  .gallery-item-title {
    font-size: 0.9rem;
  }
  
  .gallery-item-subtitle {
    font-size: 0.8rem;
  }
}

@media (max-width: 575.98px) {
  .gallery-section {
    padding: 3rem 0;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
