/* Gallery Section Styles */
.gallery-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 20px;
}

.gallery-row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.gallery-item {
  width: calc(25% - 20px);
  margin: 10px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

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

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  padding: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gallery-overlay h4 {
  color: #fff;
  margin: 0;
  font-size: 1em;
  font-family: "Barlow", Helvetica, Arial, sans-serif;
}

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

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

.popup-content {
  position: relative;
  max-width: 80%;
  max-height: 80vh;
}

.popup-content img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  border: 5px solid #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.popup-close {
  position: absolute;
  top: -30px;
  right: -30px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.popup-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.popup-caption {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  color: #fff;
  text-align: center;
  padding: 5px 10px;
  font-family: "Barlow", Helvetica, Arial, sans-serif;
}

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

.popup-prev,
.popup-next {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  margin: 0 20px;
  transition: background-color 0.3s ease;
}

.popup-prev:hover,
.popup-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Responsive layout */
@media only screen and (max-width: 992px) {
  .gallery-item {
    width: calc(33.33% - 20px);
  }
}

@media only screen and (max-width: 768px) {
  .gallery-item {
    width: calc(50% - 20px);
  }
  .popup-content {
    max-width: 95%;
  }
  .popup-close {
    right: 0;
    top: -40px;
  }
}

@media only screen and (max-width: 480px) {
  .gallery-item {
    width: calc(100% - 20px);
  }
}
