/* ==========================================================================
   1. RESET & VARIABLE UTAMA
   ========================================================================== */
:root {
  --primary: #1b4332;       
  --secondary: #40916c;     
  --accent: #d4a373;        
  --text-dark: #1a2519;     
  --text-light: #607260;    
  --bg-light: #f8fafd;     
  --bg-alt: #edf2f0;       
  --white: #ffffff;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
}

body {
  overflow-x: hidden;
  line-height: 1.7;
}

section {
  padding: 90px 7% 70px;
}

.bg-alt {
  background-color: var(--bg-alt);
}

/* GLOBAL SECTION TITLE */
.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title span {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--secondary);
  margin-bottom: 6px;
}

.section-title h2 {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* ==========================================================================
   2. NAVIGATION (STICKY GLASSMORPHISM)
   ========================================================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 7%;
  transition: var(--transition);
}

nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  padding: 15px 7%;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

nav.scrolled .nav-logo {
  color: var(--primary);
}

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

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  padding: 5px 0;
}

nav.scrolled .nav-links a {
  color: var(--text-light);
}

nav.scrolled .nav-links a:hover,
nav.scrolled .nav-links a.active {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.menu-toggle .bar {
  width: 25px;
  height: 3px;
  background-color: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

nav.scrolled .menu-toggle .bar {
  background-color: var(--primary);
}

/* ==========================================================================
   3. HERO HEADER
   ========================================================================== */
header {
  height: 90vh;
min-height: 550px;

/* Gradient lebih tipis & transparan agar gunung terlihat terang dan hidup */
background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(15, 23, 42, 0.35) 100%), 
            url('images/back3.webp') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 0 7%;
  position: relative;
  clip-path: ellipse(110% 100% at 50% 0%);
  margin-bottom: 40px;
}

.header-container {
  max-width: 850px;
  animation: fadeInUp 1s ease-out;
}

header h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

header p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto;
}

/* ==========================================================================
   4. SEKSI PROFIL
   ========================================================================== */
.grid-profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.profile-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.profile-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 55px;
  height: 55px;
  background: rgba(64, 145, 108, 0.1);
  color: var(--secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 25px;
  transition: var(--transition);
}

.profile-card:hover .card-icon {
  background: var(--secondary);
  color: var(--white);
}

.profile-card h3 {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.profile-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ==========================================================================
   5. SEKSI WISATA (SPLIT CONTENT)
   ========================================================================== */
.wisata-showcase {
  display: flex;
  flex-direction: column;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.wisata-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.wisata-img-wrapper {
  overflow: hidden;
  height: 380px;
}

.wisata-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.wisata-item:hover .wisata-img-wrapper img {
  transform: scale(1.04);
}

.wisata-content {
  padding: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-tag {
  align-self: flex-start;
  padding: 5px 14px;
  background: rgba(212, 163, 115, 0.15);
  color: #b5835a;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.wisata-content h3 {
  font-size: 1.7rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.wisata-content p {
  color: var(--text-light);
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.wisata-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 15px;
}

.wisata-meta span {
  font-size: 0.9rem;
  font-weight: 600;
}

.wisata-meta span i {
  color: var(--secondary);
  margin-right: 5px;
}

.btn-text {
  text-decoration: none;
  color: var(--secondary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-text:hover {
  color: var(--primary);
  gap: 10px;
}

.wisata-item.inverse .wisata-img-wrapper { grid-column: 2; }
.wisata-item.inverse .wisata-content { grid-column: 1; grid-row: 1; }

/* ==========================================================================
   6. SEKSI GALERI & UMKM (KUSTOMISASI SWIPE HORIZONTAL)
   ========================================================================== */
.gallery-slider, .umkm-flex {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;          
  scroll-snap-type: x mandatory; 
  scroll-behavior: smooth;
  padding: 10px 5px 25px 5px;
  -webkit-overflow-scrolling: touch;
}

/* Gaya Minimalis Scrollbar */
.gallery-slider::-webkit-scrollbar, .umkm-flex::-webkit-scrollbar {
  height: 6px;
}
.gallery-slider::-webkit-scrollbar-track, .umkm-flex::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
}
.gallery-slider::-webkit-scrollbar-thumb, .umkm-flex::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 10px;
}

/* Card Nodes Galeri Umum */
.gallery-node {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 320px;
  min-width: 280px;          
  flex: 0 0 280px;           
  scroll-snap-align: start;  
  box-shadow: var(--shadow-sm);
}

.gallery-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27, 67, 50, 0.85), rgba(0,0,0,0));
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: var(--transition);
}

.gallery-overlay h4 {
  color: var(--white);
  font-size: 1.1rem;
  transform: translateY(10px);
  transition: var(--transition);
}

.gallery-node:hover img { transform: scale(1.06); }
.gallery-node:hover .gallery-overlay { opacity: 1; }
.gallery-node:hover .gallery-overlay h4 { transform: translateY(0); }

/* Card Nodes UMKM (Aturan Dekstop) */
.umkm-mini-card {
  background: var(--white);
  border-radius: var(--radius);
  min-width: 440px;          
  flex: 0 0 440px;           
  scroll-snap-align: start;
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.02);
  transition: var(--transition);
  height: 240px; /* Tingginya dinaikkan dari 220px ke 240px agar tombol lokasi muat */
}

.umkm-mini-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.umkm-thumb {
  width: 42%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.umkm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.umkm-details {
  width: 58%;
  padding: 16px 18px; /* Padding sedikit dirapatkan agar muat presisi */
  display: flex;
  flex-direction: column;
}

.label-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 4px;
}

.umkm-details h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.umkm-details p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 8px;
}

.umkm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto; /* Memaksa footer & tombol lokasi tetap menempel di paling bawah */
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.price-info {
  font-size: 0.85rem;
  font-weight: 600;
  color: #b5835a;
}

.btn-map {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #de5246;
  color: var(--white);
  padding: 6px 14px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(222, 82, 70, 0.2);
}

.btn-map:hover {
  background: #c53929;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(222, 82, 70, 0.3);
}

/* ==========================================================================
   7. KHUSUS SEKSI PERTANIAN & PETERNAKAN (PROPORSI PAS & RAPI)
   ========================================================================== */
#pertanian .gallery-node,
#peternakan .gallery-node {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  height: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#pertanian .gallery-node:hover,
#peternakan .gallery-node:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(27, 67, 50, 0.12);
}

/* Gambar proporsional */
#pertanian .gallery-node img,
#peternakan .gallery-node img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

#pertanian .gallery-node:hover img,
#peternakan .gallery-node:hover img {
  transform: scale(1.04);
}

/* Kontainer Teks Pas di Badan Kartu */
#pertanian .gallery-overlay,
#peternakan .gallery-overlay {
  position: relative !important;
  inset: auto !important;
  background: #ffffff !important;
  padding: 20px 22px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  opacity: 1 !important;
  height: auto !important;
}

/* Judul Kartu */
#pertanian .gallery-overlay h4,
#peternakan .gallery-overlay h4 {
  color: #1b4332 !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  margin-bottom: 8px !important;
  line-height: 1.3 !important;
  transform: none !important;
  text-shadow: none !important;
}

/* Garis Pemanis di BAWAH JUDUL (Aksen Keren) */
#pertanian .gallery-overlay h4::after,
#peternakan .gallery-overlay h4::after {
  content: '';
  display: block;
  width: 30px;
  height: 3px;
  background: #40916c;
  border-radius: 2px;
  margin-top: 8px;
}

#pertanian .gallery-overlay::after,
#peternakan .gallery-overlay::after {
  display: none !important;
}

/* Deskripsi Teks */
#pertanian .gallery-overlay p,
#peternakan .gallery-overlay p {
  color: #607260 !important;
  font-size: 0.88rem !important;
  line-height: 1.5 !important;
  margin: 10px 0 0 0 !important;
  transform: none !important;
  text-shadow: none !important;
}



/* ==========================================================================
   8. SEKSI LOKASI
   ========================================================================== */
.lokasi-grid-panel {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.lokasi-text {
  padding: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lokasi-text .section-title { text-align: left; margin-bottom: 25px; }
.lokasi-text .section-title h2::after { left: 0; transform: none; }

.lokasi-text p { margin-bottom: 15px; font-size: 0.95rem; }
.desc-route {
  color: var(--text-light);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.lokasi-frame { height: 400px; width: 100%; }


/* ==========================================================================
   10. FOOTER
   ========================================================================== */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 50px 7% 25px;
  border-top: 4px solid var(--accent);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 25px;
}

.footer-brand h3 {
  font-size: 1.7rem;
  color: var(--white);
  margin-bottom: 8px;
}

.footer-brand p { font-size: 0.9rem; max-width: 380px; }
.footer-credit { text-align: right; }
.footer-kkn { font-size: 1.05rem; font-weight: 700; color: var(--accent); margin-bottom: 3px; }
.copyright { font-size: 0.8rem; }

/* ==========================================================================
   11. ANIMASI DAN MEDIA QUERY (RESPONSIVE)
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── PERBAIKAN LAYOUT LAPTOP KECIL / TABLET (992PX) ─── */
@media (max-width: 992px) {
  header h1 { font-size: 3rem; }
  
  .wisata-showcase {
    display: flex !important;
    flex-direction: column !important;
    gap: 40px !important;
  }

  .wisata-item { 
    display: flex !important;
    flex-direction: column !important; 
  }

  .wisata-item .wisata-img-wrapper,
  .wisata-item.inverse .wisata-img-wrapper {
    order: 1 !important;
    width: 100% !important;
    height: 280px !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .wisata-item .wisata-content,
  .wisata-item.inverse .wisata-content {
    order: 2 !important;
    width: 100% !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .lokasi-grid-panel { grid-template-columns: 1fr !important; }
  .lokasi-frame { height: 320px !important; }
}

/* ─── PERBAIKAN LAYOUT MOBILE / HP (768PX) ─── */
@media (max-width: 768px) {
  section { padding: 60px 5% 45px; }
  nav { padding: 20px 5%; }
  
  .menu-toggle { display: flex; }
  
  .nav-links {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(27, 67, 50, 0.95); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    gap: 35px; 
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1); 
    z-index: 999;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.6rem; 
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition);
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--accent) !important; 
    transform: scale(1.1);
  }

  .nav-logo, .menu-toggle {
    position: relative;
    z-index: 1001; 
  }

  .menu-toggle.open .bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }
  .menu-toggle.open .bar:nth-child(2) {
    transform: translateY(-5px) rotate(-45deg);
  }

  nav .menu-toggle .bar {
    background-color: var(--white) !important;
  }

  nav:not(.scrolled) .nav-logo { color: var(--white); }
  nav:not(.scrolled) .menu-toggle .bar { background-color: var(--white) !important; }
  
  nav.scrolled .nav-logo { color: var(--primary); }
  nav.scrolled .menu-toggle .bar { background-color: var(--primary) !important; }
  
  nav.scrolled:not(:has(.nav-links.active)) .nav-logo { color: var(--primary); }
  nav.scrolled:not(:has(.nav-links.active)) .menu-toggle .bar { background-color: var(--primary) !important; }
  
  header h1 { font-size: 2.3rem; }
  
  /* PERBAIKAN UMKM KHUSUS HP (VERTICAL STACK) */
  .umkm-mini-card {
    min-width: 280px;
    flex: 0 0 280px;
    flex-direction: column;
    height: auto; /* Reset tinggi dari desktop */
  }

  .umkm-thumb { 
    width: 100%; 
    height: 200px; /* Tinggi wadah foto dinaikkan agar foto potret Seblak muat sempurna */
  }

  .umkm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .umkm-details { 
    width: 100%; 
    padding: 20px; 
  }

  .footer-container { flex-direction: column; text-align: center; }
  .footer-credit { text-align: center; }

  .sponsor-container {
    gap: 30px;
  }
  .sponsor-logo {
    width: 120px;      
    height: 70px;
  }
}

/* ==========================================================================
   SLIDER HORIZONTAL (BISA DI-SCROLL KIRI & KANAN + RATA TENGAH)
   ========================================================================== */

/* 1. Kunci Slider agar bisa di-scroll horizontal */
.gallery-slider {
  display: flex !important;
  flex-wrap: nowrap !important;        /* Dilarang turun ke bawah */
  overflow-x: auto !important;         /* Aktifkan scroll ke samping */
  scroll-snap-type: x mandatory !important; /* Efek membal saat di-scroll */
  gap: 24px !important;
  padding: 15px 20px 25px 20px !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  -webkit-overflow-scrolling: touch; /* Scroll halus di HP iOS/Android */
}

/* 2. Trik agar tetap RATA TENGAH saat kartu sedikit, tapi BISA DI-SCROLL saat melimpah */
.gallery-slider::before,
.gallery-slider::after {
  content: '';
  margin: auto;
}

/* 3. Kunci ukuran kartu slider agar tidak gepeng/tertekan */
.gallery-slider .gallery-node {
  flex: 0 0 310px !important;          /* Lebar tetap 310px */
  width: 310px !important;
  max-width: 85vw !important;          /* Pas di layar HP */
  scroll-snap-align: center !important;/* Kartu mengunci otomatis ke tengah saat di-scroll */
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}

/* 4. Tampilan Scrollbar Mulus (Hijau Khas Dusun) */
.gallery-slider::-webkit-scrollbar {
  height: 6px;
}

.gallery-slider::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.gallery-slider::-webkit-scrollbar-thumb {
  background: #40916c;
  border-radius: 10px;
}

.gallery-slider::-webkit-scrollbar-thumb:hover {
  background: #1b4332;
}

/* ==========================================================================
   PENYESUAIAN TAMPILAN KHUSUS LAYAR HP / MOBILE
   ========================================================================== */
@media (max-width: 768px) {
  header {
    height: 75vh;
    min-height: 480px;
    
    /* Hilangkan lengkungan ekstrem pada HP agar gambar gunung terlihat utuh */
    clip-path: none !important;
    border-radius: 0 0 25px 25px !important; /* Lengkungan sangat tipis & rapi di sudut bawah */
    
    padding: 0 5%;
    background-position: center 50%;
  }

  .header-container {
    margin-top: 20px;
  }

  .header-container h1 {
    font-size: 2.3rem; /* Sesuaikan ukuran judul di layar HP */
    margin-bottom: 12px;
  }

  .header-container p {
    font-size: 0.95rem; /* Sesuaikan deskripsi agar pas dalam 3-4 baris */
    line-height: 1.5;
  }
}