/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  color: #333;
}

/* ================= HEADER ================= */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #28a745;
  padding: 15px 30px;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header .logo { display: flex; align-items: center; }
header .logo img { width: 60px; margin-right: 15px; }
header .judul h1 { font-size: 18px; }
header .judul h2 { font-size: 16px; }
header .judul p { font-size: 12px; }

/* ================= MENU TOGGLE ================= */
.menu-toggle {
  display: none; /* default hidden for desktop */
  font-size: 26px;
  cursor: pointer;
  background: none;
  border: none;
  color: white;
}

/* ================= NAVBAR ================= */
nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

nav ul li {
  position: relative;
  margin: 0 10px;
}

nav ul li a {
  text-decoration: none;
  color: white;
  font-weight: bold;
  padding: 8px 12px;
  display: block;
}

nav ul li a:hover {
  background: #1f8027;
  border-radius: 5px;
}

/* ================= DROPDOWN ================= */
nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #28a745;
  border-radius: 5px;
  min-width: 200px;
  z-index: 1000;
}

nav ul li:hover > ul {
  display: block;
}

nav ul li ul li ul {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: #28a745;
  border-radius: 5px;
  min-width: 200px;
}

nav ul li ul li:hover > ul {
  display: block;
}

/* ================= MAIN ================= */
main { flex: 1; padding-top: 90px; }

/* ================= HERO ================= */
.hero {
  background: url("masjid-bg.jpg") center/cover no-repeat;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  background: rgba(40,167,69,0.8);
  padding: 30px;
  text-align: center;
  border-radius: 12px;
  animation: fadeIn 1.2s ease-in-out;
}

.hero-overlay h2 { font-size: 32px; color: #fff; margin-bottom: 10px; }
.hero-overlay p  { font-size: 16px; color: #f1f1f1; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= STRUKTUR ORGANISASI ================= */
.struktur {
  width: 100%;
  background: linear-gradient(to bottom, #eafaf1, #d5f5e3);
  padding: 60px 20px;
}

.struktur h2 {
  text-align: center;
  color: #28a745;
  margin-bottom: 40px;
  font-size: 28px;
  position: relative;
}

.struktur h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: #28a745;
  margin: 10px auto 0;
  border-radius: 2px;
}

.struktur-content {
  max-width: 1200px;
  margin: 0 auto 40px;
  background: #ffffff;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.struktur-content .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  justify-content: center;
}

.card {
  text-align: center;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

.card img {
  width: 120px; height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ================= JABATAN FUNGSIONAL ================= */
.struktur-content.kepala .card .card-header {
  text-align: left;
  font-weight: bold;
  margin-bottom: 10px;
}

/* ================= FOOTER ================= */
footer {
  text-align: center;
  background:#28a745;
  color: #f1f1f1;
  padding: 20px;
  margin-top: auto;
  font-size: 14px;
}
footer p { margin: 0; }

/* ================= DROPDOWN FORM NIKAH ================= */
.dropdown-content li.dropdown:hover > .dropdown-subcontent {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
}

.dropdown-subcontent {
  background: #28a745;
  padding: 5px 0;
  min-width: 200px;
  border-radius: 5px;
}

.dropdown-subcontent li a {
  padding: 10px 15px;
  display: block;
  color: #fff;
  text-decoration: none;
}

.dropdown-subcontent li a:hover {
  background: #1f8027;
}

/* ================= RESPONSIVE ================= */
/* Tablet & Hamburger */
@media (max-width: 992px) {
  .menu-toggle { display: block; }

  nav {
    display: none;
    width: 100%;
    background: #28a745;
  }

  nav.active { display: block; }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a { width: 100%; padding: 10px 20px; }

  nav ul li ul,
  nav ul li ul li ul {
    position: static;
  }

  /* Dropdown klik di mobile */
  nav ul li:hover > ul {
    display: none;
  }
  nav ul li ul.show { display: block; }

  header { padding: 10px 15px; }
  header .logo img { width: 45px; }
  .hero-overlay h2 { font-size: 24px; }
  .hero-overlay p  { font-size: 14px; }
  .struktur-content { padding: 20px; }
}

/* HP */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
  }
  nav ul {
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }
  .hero { height: 180px; padding: 15px; }
  .hero-overlay { padding: 15px; }
  .hero-overlay h2 { font-size: 20px; }
  .hero-overlay p  { font-size: 12px; }
  .struktur { padding: 20px 10px; }
  .struktur-content { padding: 15px; }
  .struktur-content .grid { grid-template-columns: 1fr; }
  .card img { width: 100px; height: 120px; }
  .struktur-content.kepala .card .card-header {
    font-size: 14px;
    margin-bottom: 8px;
  }
}
