html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", sans-serif;
}

main {
  flex: 1;
}

footer {
  background-color: #2e7d32;
  color: white;
  text-align: center;
  padding: 1px;
}

/* Header/Navbar */
.navbar {
  background-color: #2e7d32;
  padding: 15px 0;
  color: white;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
}

.nav-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav-links li a.active,
.nav-links li a:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 20px 20px;
  background-color: #e8f5e9;
}

.hero-section h2 {
  margin: 0;
  font-size: 28px;
  color: #2e7d32;
}

/* Logo & Header */
.logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;
  background-color: white;
  padding: 5px;
}

.header-kiri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}

.header-teks {
  color: white;
  margin: 0;
  padding: 0;
  justify-content: left;
  line-height: 1.2; /* NORMAL supaya tidak tumpuk */
}
.header-teks h1,
.header-teks h3,
.header-teks h4,
.header-teks p {
  margin: 0; /* hilangkan margin */
  padding: 2px 0; /* kasih sedikit padding biar ga terlalu nempel */
  line-height: 1.1; /* agak rapat */
}

@media (max-width: 768px) {
  .header-kiri {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 10px;
    flex-wrap: wrap;
  }
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 35px;
  padding: 5px 70px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
}

.gallery-item img {
  width: 120%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: rgba(0, 80, 0, 0.7);
  color: #fff;
  padding: 10px;
  opacity: 0;
  transition: 0.3s;
  font-size: 14px;
  box-sizing: border-box;
  border-radius: 12px;

  /* Kunci utama agar teks turun ke bawah saat panjang */
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  line-height: 1.4;
  max-height: 100%; /* biar tidak terpotong */
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

.gallery-caption h4 {
  margin: 0;
  font-size: 16px;
  padding: 20px 0;
}

.gallery-caption .tanggal {
  font-size: 14px;
  margin-top: 4px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
}

.close {
  position: absolute;
  top: 30px;
  right: 50px;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.pagination {
  text-align: center;
  margin: 20px;
}

.pagination a {
  color: green;
  padding: 8px 16px;
  text-decoration: none;
  border: 1px solid #ccc;
  margin: 0 4px;
  border-radius: 5px;
}

.pagination a.active {
  background-color: green;
  color: white;
}

@media (max-width: 768px) {
  .header-teks h1 {
    font-size: 20px;
  }

  .header-teks h3 {
    font-size: 16px;
  }

  .header-teks h4 {
    font-size: 14px;
  }

  .header-teks p {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .header-teks h1 {
    font-size: 18px;
  }

  .header-teks h3 {
    font-size: 15px;
  }

  .header-teks h4 {
    font-size: 13px;
  }

  .header-teks p {
    font-size: 11px;
  }
}
