/* ===================== VARIABEL ROOT ===================== */
:root {
  --color-primary: #e4630d;
  --color-secondary: #f4f4f4;
  --color-bg: #fafafa;
  --color-text: #333;
  --color-light: #f4f4f4;
  --radius: 8px;
  --transition: 0.3s ease;
  --section-gap: 2rem;
  --border-style: 2px solid #ccc;
  --shadow: 0 2px 6px rgba(33, 8, 255, 0.664);
}

/* ===================== RESET & DASAR ===================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  padding-top: 85px;
}

/* ===================== LINK ===================== */
a {
  text-decoration: none;
  color: inherit;
}

/* ===================== GAMBAR UMUM ===================== */
img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
  user-select: none;
  pointer-events: none;
}

/* ===================== HEADER ===================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 100;
  border-bottom: 1px solid rgba(228, 99, 13, 0.1);
  transition: all 0.3s ease;
}

header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  min-height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.logo img {
  height: 45px;
  width: 45px;
  border-radius: 0;
}

.logo span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===================== HAMBURGER (MOBILE ONLY) ===================== */
.hamburger {
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 3;
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  color: var(--color-primary);
  display: none;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(228, 99, 13, 0.1);
  border: 2px solid transparent;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger:hover {
  background: rgba(228, 99, 13, 0.2);
  border-color: var(--color-primary);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 5px 15px rgba(228, 99, 13, 0.3);
}

.hamburger:active {
  transform: translateY(-50%) scale(0.95);
}

/* Hamburger Animation */
.hamburger.active {
  background: var(--color-primary);
  color: white;
}

.hamburger.active:hover {
  background: #c4510b;
}

/* ===================== DESKTOP NAVIGATION ===================== */
#desktop-nav {
  display: block;
}

#desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

#desktop-nav li {
  position: relative;
}

#desktop-nav a {
  display: inline-block;
  font-weight: 500;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: transparent;
  border: 2px solid transparent;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
}

#desktop-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  transition: left 0.3s ease;
  z-index: -1;
  border-radius: 6px;
}

#desktop-nav a:hover {
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(228, 99, 13, 0.3);
}

#desktop-nav a:hover::before {
  left: 0;
}

#desktop-nav a:active {
  transform: translateY(0);
}

#desktop-nav a.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(228, 99, 13, 0.4);
}

#desktop-nav a.active::before {
  left: 0;
}

/* ===================== MOBILE NAVIGATION ===================== */
#mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  overflow: hidden;
  max-height: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
  display: none;
  backdrop-filter: blur(10px);
}

#mobile-nav.active {
  max-height: 600px;
  animation: slideInMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  display: block;
}

@keyframes slideInMobile {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
  flex-direction: column;
}

#mobile-nav li {
  border-bottom: 1px solid rgba(228, 99, 13, 0.1);
  margin: 0 1rem;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

#mobile-nav li:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
}

#mobile-nav li:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(228, 99, 13, 0.2);
}

#mobile-nav a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  background: linear-gradient(135deg, transparent 0%, transparent 100%);
  color: var(--color-text);
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#mobile-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  border-radius: 0 4px 4px 0;
}

#mobile-nav a::after {
  content: '→';
  position: absolute;
  right: 1.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: var(--color-primary);
  font-weight: bold;
}

#mobile-nav a:hover {
  background: linear-gradient(135deg, rgba(228, 99, 13, 0.1) 0%, rgba(228, 99, 13, 0.05) 100%);
  color: var(--color-primary);
  padding-left: 2rem;
}

#mobile-nav a:hover::before {
  transform: scaleY(1);
}

#mobile-nav a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

#mobile-nav a:active {
  transform: scale(0.98);
}

#mobile-nav a.active {
  background: linear-gradient(135deg, var(--color-primary), #ff6b35);
  color: white;
  padding-left: 2rem;
}

#mobile-nav a.active::before {
  transform: scaleY(1);
  background: white;
}

#mobile-nav a.active::after {
  opacity: 1;
  transform: translateX(0);
  color: white;
}

.hidden {
  display: none;
}

/* ===================== HERO ===================== */
.hero-container {
  position: relative;
  width: 100vw;
  height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #e6dedece;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.hero-slider {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 2s ease-in-out;
}

.slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide img,
.hero-img {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  display: block;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 1rem 1.5rem;
  font-size: 2rem;
  border-radius: var(--radius);
  z-index: 10;
  text-align: center;
  pointer-events: none;
}

/* ===================== UTAMA ===================== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  gap: var(--section-gap);
}

section {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

section h2 {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

section h3 {
  margin-top: 2rem;
  color: var(--color-primary);
}

.paragraph-center {
  text-align: center;
  margin-bottom: 2rem;
}

.history p {
  margin: 0.5rem 0 1rem;
  text-align: justify;
}

/* ===================== CARDS ===================== */
.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-content {
  padding: 0.5rem 0;
}

/* ===================== GAMBAR KHUSUS ===================== */
.foto-pemimpin {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 3 / 3;
  object-fit: cover;
  border: var(--border-style);
  border-radius: var(--radius);
  margin: 0 auto;
}

.umkm-img,
.wisata-img,
.struktur-desa,
.img-center {
  display: block;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: var(--border-style);
  border-radius: var(--radius);
  margin: 1rem auto;
}

.image-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.leader-info {
  text-align: center;
  margin-bottom: 2rem;
}

.leader-info h3 {
  margin: 0.2rem 0;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.leader-info p {
  margin: 0.2rem 0;
  font-style: italic;
  color: #555;
}

/* ===================== LINK TAMBAHAN ===================== */
a[target="_blank"] {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background-color: var(--color-primary);
  color: white;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  transition: 0.3s;
}

a[target="_blank"]:hover {
  background-color: #c4510b;
}

/* ===================== ANIMASI SCROLL ===================== */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: transform, opacity;
}

.scroll-animate.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.5s; }
.delay-4 { transition-delay: 0.7s; }

/* ===================== RESPONSIVE - MOBILE ===================== */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
    padding-top: 70px;
  }

  /* Header Mobile */
  header {
    background-color: #f3ebf0;
  }

  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  .logo img {
    height: 38px;
    width: 38px;
  }

  .logo span {
    font-size: 1rem;
  }

  /* Show hamburger on mobile */
  .hamburger {
    display: flex !important;
  }

  /* Hide desktop nav on mobile */
  #desktop-nav {
    display: none;
  }

  /* Hero Mobile */
  .hero-container {
    height: 30vh;
  }

  .slide img,
  .hero-img {
    height: 100%;
    object-fit: cover;
    object-position: 15% center;
    width: 100vw;
    border: none;
  }

  .hero-text {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(156, 201, 226, 0.5);
    color: white;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    max-width: 90%;
    font-family: 'Playfair Display', serif;
  }

  /* Main Mobile */
  main {
    padding: 0 0.8rem;
  }

  section {
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
  }

  section h2 {
    font-size: 1.3rem;
  }

  section h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
  }

  .paragraph-center {
    font-size: 0.95rem;
  }

  /* Images Mobile */
  .foto-pemimpin {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid #e4630d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 0 auto 1rem auto;
    display: block;
  }

  .umkm-img,
  .wisata-img,
  .struktur-desa,
  .img-center {
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    margin: 0.8rem 0;
    border: 1px solid #ccc;
  }

  .leader-info {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
  }

  .card {
    margin-bottom: 1.5rem;
  }
}

/* ===================== DESKTOP LARGE SCREENS ===================== */
@media screen and (min-width: 1024px) {
  #desktop-nav a {
    padding: 0.8rem 1.4rem;
    font-size: 0.95rem;
  }
  
  #desktop-nav ul {
    gap: 1rem;
  }
  
  .nav-container {
    padding: 1rem;
  }
}

/* ===================== DESKTOP SPECIFIC ===================== */
@media screen and (min-width: 769px) {
  .hamburger {
    display: none !important;
  }

  #mobile-nav {
    display: none !important;
  }

  #desktop-nav {
    display: block !important;
  }
  
  .nav-container {
    flex-wrap: nowrap;
  }
  
  #desktop-nav ul {
    flex-wrap: nowrap;
  }
}