.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background-color: #eee;
  cursor: pointer;
  height: 100%;
}

.gallery-item a {
  display: block;
  height: 100%;
  text-decoration: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.title-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px;
  font-size: 1rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .title-overlay {
  opacity: 1;
}

/* Magnific Popup custom styles */
.mfp-with-zoom .mfp-container,
.mfp-with-zoom.mfp-bg {
  opacity: 0;
  -webkit-backface-visibility: hidden;
  transition: all 0.3s ease-out;
}

.mfp-with-zoom.mfp-ready .mfp-container {
  opacity: 1;
}

.mfp-with-zoom.mfp-ready.mfp-bg {
  opacity: 0.8;
}

.mfp-with-zoom.mfp-removing .mfp-container,
.mfp-with-zoom.mfp-removing.mfp-bg {
  opacity: 0;
}

.mfp-title {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  padding: 10px 0;
}

/* Make popup responsive */
@media (max-width: 768px) {
  .mfp-content {
    max-width: 90%;
  }
  
  .mfp-title {
    font-size: 1rem;
  }
}


.custom-gallery-wrapper {
  overflow: hidden;
  position: relative;
  max-width: 1200px;
  margin: auto;
}

.custom-gallery-carousel {
  display: flex;
  transition: transform 0.5s ease;
}

.custom-gallery-item {
  flex: 0 0 20%;
  padding: 10px;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0.5;
}

.custom-gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.custom-gallery-item.active {
  transform: scale(1.15);
  opacity: 1;
  z-index: 2;
}

.custom-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  display: none;
  z-index: 10;
}

.custom-prev-btn {
  left: 0;
}

.custom-next-btn {
  right: 0;
}

.custom-gallery-wrapper:hover .custom-nav-btn {
  display: block;
}

@media (max-width: 992px) {
  .custom-gallery-item {
    flex: 0 0 33.33%;
  }

  .custom-gallery-item img {
    height: 200px;
  }
}

@media (max-width: 576px) {
  .custom-gallery-item {
    flex: 0 0 100%;
  }

  .custom-gallery-item img {
    height: 180px;
  }
}
.custom-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 28px;
  padding: 10px 14px;
  cursor: pointer;
  z-index: 10; /* Important: above image layer */
  display: none;
  pointer-events: auto;
}

.custom-gallery-wrapper:hover .custom-nav-btn {
  display: block;
}
.custom-gallery-item {
  z-index: 1;
}
.custom-nav-btn {
  backdrop-filter: blur(4px);
  border-radius: 50%;
}


@media (max-width: 767px) {
    /* Keep all items in one row */
    #section-about .row.g-4 .col-4 {
        width: 33.33%;
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* Reduce padding for mobile */
    #section-about .row.g-4 .p-30 {
        padding: 10px !important;
    }
    
    /* Reduce font size for mobile */
    #section-about .row.g-4 .de_count h2 {
        font-size: 1.5rem !important;
    }
    
    #section-about .row.g-4 .de_count div {
        font-size: 0.8rem !important;
    }
}