* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

body {
  background-color: #f8f4e1;
  color: #4e1f00;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background-color: #4e1f00;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.logo-img {
  height: 40px;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  color: #f8f4e1;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #feba17;
}

.burger {
  display: none;
  cursor: pointer;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: #f8f4e1;
  margin: 5px;
  transition: all 0.3s ease;
}

/* Gallery Section */
.gallery {
  padding: 120px 50px 180px;
  text-align: center;
  background: linear-gradient(180deg, #f8f4e1, #74512d);
}

.gallery h1 {
  font-size: 48px;
  color: #feba17;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(78, 31, 0, 0.5);
}

.gallery p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 40px;
  color: #74512d;
}

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

.gallery-card {
  position: relative;
  overflow: visible;
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  z-index: 1; /* Z-index awal untuk kartu */
}

.gallery-card:nth-child(1) {
  animation-delay: 0.1s;
}
.gallery-card:nth-child(2) {
  animation-delay: 0.2s;
}
.gallery-card:nth-child(3) {
  animation-delay: 0.3s;
}

.gallery-card:hover {
  z-index: 10; /* Z-index lebih tinggi saat di-hover agar pop-up tidak tertutupi */
}

.gallery-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
  z-index: 2;
  position: relative;
}

.gallery-card:hover .gallery-img {
  transform: translateY(-10px);
  box-shadow: 0 0 20px rgba(254, 186, 23, 0.7);
}

.gallery-popup {
  position: absolute;
  bottom: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  background-color: #f8f4e1;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(78, 31, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  z-index: 3; /* Z-index pop-up lebih tinggi dari gambar */
  transition: z-index 0s;
}

.gallery-card:hover .gallery-popup {
  opacity: 1;
  visibility: visible;
  z-index: 11; /* Z-index sangat tinggi saat di-hover */
  animation: popupEffect 0.6s ease-out forwards;
}

.gallery-popup h3 {
  font-size: 18px;
  color: #4e1f00;
  margin-bottom: 5px;
}

.gallery-popup p {
  font-size: 14px;
  color: #74512d;
  margin-bottom: 10px;
}

.cta-button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  background-color: #feba17;
  border: none;
  color: #4e1f00;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s;
}

.cta-button:hover {
  background-color: #74512d;
  color: #f8f4e1;
  transform: translateY(-3px);
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #4e1f00;
  color: #f8f4e1;
}

/* Fade-In Animation for Cards */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Popup Animation (Rise and Fall) */
@keyframes popupEffect {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) translateY(-20px);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(20px);
    opacity: 1;
  }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    background-color: #4e1f00;
    padding: 20px;
  }

  .nav-links.active {
    display: flex;
  }

  .burger {
    display: block;
  }

  .gallery {
    padding: 100px 20px 80px;
  }

  .gallery h1 {
    font-size: 36px;
  }

  .gallery-img {
    height: 200px;
  }

  .gallery-card {
    padding-bottom: 100px; /* Tambahan padding untuk memberikan ruang bagi pop-up */
  }

  .gallery-popup {
    bottom: 20px; /* Sesuaikan posisi agar pop-up lebih terlihat */
    width: 90%;
    z-index: 11; /* Pastikan pop-up selalu di depan */
  }

  .gallery-card:hover .gallery-popup {
    z-index: 12; /* Z-index lebih tinggi saat di-hover */
  }
}
