/* -------------------------------------------------------
   BUMDes Public Theme — Green Village (Centered Layout)
   Nuansa hijau, responsif, konten terpusat otomatis.
   ------------------------------------------------------- */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ====== Design Tokens ====== */
:root{
  --primary-raw: 145, 52%, 36%;
  --primary: hsl(var(--primary-raw));
  --primary-50:  hsl(145, 45%, 96%);
  --primary-100: hsl(145, 45%, 92%);
  --primary-200: hsl(145, 45%, 86%);
  --primary-300: hsl(145, 45%, 77%);
  --primary-400: hsl(145, 45%, 58%);
  --primary-500: hsl(145, 52%, 42%);
  --primary-600: hsl(145, 52%, 36%);
  --primary-700: hsl(145, 52%, 29%);
  --primary-800: hsl(145, 52%, 22%);
  --primary-900: hsl(145, 52%, 16%);

  --bg: #f6f9f7;
  --card: #ffffff;
  --text: #223127;
  --muted: #5f6f66;
  --border: #e6eee8;
  --shadow: 0 10px 30px rgba(0,0,0,.06);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  --trans: 220ms cubic-bezier(.2,.7,.2,1);
}

/* ====== Reset ====== */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(75, 181, 67, .10), transparent 60%),
    radial-gradient(1200px 600px at 110% 10%, rgba(46, 139, 87, .10), transparent 60%),
    linear-gradient(180deg, #f2f8f4 0%, var(--bg) 100%);
  min-height: 100dvh;
}

.no-scroll{ overflow: hidden; }
a{ color: var(--primary-700); text-decoration: none; transition: color var(--trans), opacity var(--trans); }
a:hover{ color: var(--primary-800); }

/* ====== Layout ====== */
.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px;
}

/* Pusatkan seluruh konten halaman otomatis */
.public-body main .container{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 20px;
}
.public-body main .container > section,
.public-body main .container > .card,
.public-body .unit-wrap,
.public-body .section-wrap{
  width: min(100%, 1100px);
  justify-self: center;
}
.public-body main .container > section .grid,
.public-body main .container > .grid{
  width: 100%;
  justify-items: stretch;
}
.auto-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ====== NAVBAR ====== */
.top-navbar{
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top-navbar .nav-inner{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; max-width: 1200px; margin: 0 auto;
}
.brand{
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--primary-800);
}
.brand img{ height: 38px; width: auto; border-radius: 8px; }
.brand i{ color: var(--primary-700); font-size: 22px; }
.brand span{ font-size: 18px; letter-spacing: .2px; }

.nav-toggle{
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px; border: 1px solid var(--border);
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center; gap:4px;
  transition: background var(--trans), border-color var(--trans), transform var(--trans);
}
.nav-toggle:hover{ background: var(--primary-50); border-color: var(--primary-200); }
.nav-toggle .bar{
  display:block; width: 20px; height: 2px; background: #2a3a30; border-radius: 2px;
  transition: transform var(--trans), opacity var(--trans);
}
.nav-toggle.is-open .bar:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .bar:nth-child(2){ opacity: 0; }
.nav-toggle.is-open .bar:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

.nav-menu{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.nav-link, .dropdown-toggle{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 10px; border: 1px solid transparent;
  color: #2a3a30; background: transparent; font-weight: 500;
  transition: background var(--trans), border-color var(--trans), color var(--trans), transform var(--trans);
}
.nav-link:hover, .dropdown:hover > .dropdown-toggle{
  background: var(--primary-50); border-color: var(--primary-200);
}

.chip{
  background: linear-gradient(180deg, var(--primary-600), var(--primary-700));
  color: #fff !important; border: 0; box-shadow: var(--shadow);
}
.chip:hover{ filter: brightness(1.03); transform: translateY(-1px); }

.dropdown{ position: relative; }
.dropdown-toggle{ cursor: pointer; }
.dropdown .caret{ margin-left: 4px; }

.dropdown-menu{
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px; display: none; opacity: 0; transform: translateY(6px);
  transition: opacity var(--trans), transform var(--trans);
  max-height: 380px; overflow: auto;
}
.dropdown.open .dropdown-menu{ display: block; opacity: 1; transform: translateY(0); }
.can-hover .dropdown:hover .dropdown-menu{ display: block; opacity: 1; transform: translateY(0); }

.dropdown-item{
  display: block; padding: 10px 12px; border-radius: 10px; color: #2a3a30;
  transition: background var(--trans), color var(--trans);
}
.dropdown-item:hover{ background: var(--primary-50); color: var(--primary-800); }
.dropdown-empty{ display:block; padding: 10px 12px; color: var(--muted); }

/* Mobile menu */
@media (max-width: 991.98px){
  .nav-toggle{ display: inline-flex; }
  .nav-menu{
    position: fixed; inset: 70px 10px auto 10px; top: 68px;
    background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none; flex-direction: column; align-items: stretch;
    padding: 8px;
    z-index: 110;
  }
  .nav-menu.is-open{ display: flex; animation: fadeInUp var(--trans); }
  .nav-link, .dropdown-toggle{ padding: 12px 14px; }
  .dropdown-menu{ position: static; transform:none; box-shadow:none; border:0; padding: 4px 0 8px; display: none; opacity: 1; }
  .dropdown.open .dropdown-menu{ display: block; }
}

@keyframes fadeInUp{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}

/* ====== Sections & Components ====== */
.section-title{
  display: flex; align-items: center; gap: 10px;
  margin: 28px 0 14px;
  color: var(--primary-900);
  font-weight: 700; letter-spacing: .2px;
}
.muted{ color: var(--muted); }

/* Cards */
.card{
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.card h4{ margin: 0 0 8px; }

/* Grids */
.grid{ display: grid; gap: 16px; }
.grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px){ .grid-3, .grid-4{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; } }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius: 12px; border:1px solid var(--primary-300);
  background: linear-gradient(180deg, var(--primary-100), var(--primary-50));
  color: var(--primary-800); font-weight:600; transition: transform var(--trans), box-shadow var(--trans), filter var(--trans);
}
.btn:hover{ transform: translateY(-1px); filter: saturate(1.05); }
.btn-primary{
  background: linear-gradient(180deg, var(--primary-500), var(--primary-700));
  color: #fff; border: 0;
}
.btn-outline{
  background: transparent; border: 1px solid var(--primary-300); color: var(--primary-800);
}

/* ====== Org Structure ====== */
.org-band{ display:flex; gap:16px; flex-wrap:wrap; align-items:stretch; justify-content:center; }
.org-person{
  flex:1 1 240px; max-width: 320px;
  background:#fff; border:1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align:center;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.org-person:hover{ transform: translateY(-3px); border-color: var(--primary-200); box-shadow: 0 14px 36px rgba(41, 81, 66, .12); }
.org-person img{
  width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--primary-300); box-shadow: 0 6px 18px rgba(0,0,0,.07);
}
.org-title{ font-weight: 700; margin-top: 10px; color: var(--primary-900); }
.org-jabatan{ font-size: 13px; color: var(--muted); }

/* ====== News Cards ====== */
.news-card{
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fff, var(--primary-50));
}
.news-card::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(400px 120px at 110% -10%, rgba(49, 128, 88, .12), transparent 60%);
  pointer-events:none;
}

/* ====== Legalitas ====== */
.legal-row{ display:flex; gap:16px; flex-wrap:wrap; justify-content:center; }
.legal-item{
  flex:1 1 300px; max-width: 420px;
  background: #fff; border:1px solid var(--border); border-radius: var(--radius);
  padding:16px; box-shadow: var(--shadow);
}
.legal-item h4{ color: var(--primary-800); }

/* ====== Charts ====== */
.charts-wrap{
  display:grid; gap:16px;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 1100px); margin: 0 auto;
}
@media (min-width: 1000px){
  .charts-wrap{ grid-template-columns: 1.3fr 1fr; }
}
.card canvas{ width:100% !important; height:100% !important; }

/* ====== Hero mini ====== */
.hero-mini{ background:linear-gradient(180deg, rgba(0,0,0,.04), transparent); padding:28px 0; border-bottom:1px solid var(--border); }
.hero-mini h1{ margin:0; }

/* ====== Footer ====== */
.public-footer{
  margin-top: 36px; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, var(--primary-100));
}
.public-footer .container{ padding-top: 20px; padding-bottom: 18px; }
.footer-content{
  display:flex; align-items:center; justify-content:space-between; gap: 16px; flex-wrap: wrap;
}
.footer-links a{
  width: 38px; height: 38px; display:inline-flex; align-items:center; justify-content:center;
  background:#fff; border: 1px solid var(--border); border-radius: 10px; margin-left: 6px;
  color: var(--primary-800);
  transition: background var(--trans), transform var(--trans), border-color var(--trans), color var(--trans);
}
.footer-links a:hover{ background: var(--primary-50); border-color: var(--primary-300); transform: translateY(-1px); }
.footer-bottom{ text-align:center; color: var(--muted); font-size: 14px; }

/* ====== Utilities ====== */
.text-center{ text-align: center; }
.mt-2{ margin-top: 8px; } .mt-3{ margin-top: 12px; } .mt-4{ margin-top: 16px; } .mt-5{ margin-top: 24px; }
.mb-2{ margin-bottom: 8px; } .mb-3{ margin-bottom: 12px; } .mb-4{ margin-bottom: 16px; } .mb-5{ margin-bottom: 24px; }

/* ====== Dark Mode ====== */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f1613;
    --card: #12201a;
    --text: #eef5f0;
    --muted: #a9b7ae;
    --border: #23352a;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
  }
  .top-navbar{ background: rgba(18,32,26,.8); border-bottom-color: var(--border); }
  .nav-link, .dropdown-toggle{ color: #eaf4ee; }
  .brand span{ color: #eaf4ee; }
  .nav-toggle{ background: #1a2a22; border-color: var(--border); }
  .dropdown-menu{ background: #16261f; }
  .dropdown-item{ color: #eaf4ee; }
  .dropdown-item:hover{ background: rgba(96, 171, 130, .16); }
  .chip{ filter: brightness(1.02); }
  .legal-item, .card, .org-person{ background: var(--card); }
  .public-footer{ background: linear-gradient(180deg, #101a15, #0f1613); }
  a{ color: hsl(145, 45%, 68%); }
}

/* === Fix: Hamburger visibility on mobile === */
.nav-toggle{
  background: #fff;
  border-color: var(--primary-400);
  color: var(--primary-800);
}
.nav-toggle .bar{
  background: var(--primary-700) !important;
}
.nav-toggle:hover{
  background: var(--primary-50);
  border-color: var(--primary-500);
}
.nav-toggle.is-open{
  background: var(--primary-100);
  border-color: var(--primary-600);
}

/* === Fix: teks menu mobile saat pertama dibuka (tanpa hover) === */
@media (max-width: 991.98px){
  .nav-menu{
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--trans), transform var(--trans);
    background: #ffffff !important;
    color: var(--primary-900);
  }
  .nav-menu.is-open{
    opacity: 1;
    transform: translateY(0);
  }
  .nav-menu.is-open .nav-link,
  .nav-menu.is-open .dropdown-toggle,
  .nav-menu.is-open .dropdown-item{
    color: var(--primary-900) !important;
  }
  .nav-menu .nav-link:focus,
  .nav-menu .dropdown-toggle:focus,
  .nav-menu .dropdown-item:focus{
    outline: none;
    background: var(--primary-50);
    color: var(--primary-900);
  }
}

/* === Fix: Kontras dropdown (Unit Usaha & semua dropdown) === */
.top-navbar .dropdown-menu,
.nav-menu .dropdown-menu{
  background: #ffffff !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.top-navbar .dropdown-item,
.nav-menu .dropdown-item{
  color: var(--primary-900) !important;
  background: transparent;
}
.top-navbar .dropdown-item:hover,
.nav-menu .dropdown-item:hover{
  background: var(--primary-50) !important;
  color: var(--primary-800) !important;
}
.top-navbar .dropdown-toggle,
.nav-menu .dropdown-toggle{
  color: var(--primary-900) !important;
}
@media (max-width: 991.98px){
  .nav-menu.is-open{ background: #ffffff !important; color: var(--primary-900) !important; }
  .nav-menu.is-open .dropdown-menu{ background: #ffffff !important; border-color: var(--border); }
  .nav-menu.is-open .dropdown-item{ color: var(--primary-900) !important; }
  .nav-menu.is-open .dropdown-item:hover{ background: var(--primary-50) !important; color: var(--primary-800) !important; }
}
@media (prefers-color-scheme: dark){
  .top-navbar .dropdown-menu,
  .nav-menu .dropdown-menu{
    background: #16261f !important;
    border-color: #244232;
  }
  .top-navbar .dropdown-item,
  .nav-menu .dropdown-item{
    color: #eaf4ee !important;
  }
  .top-navbar .dropdown-item:hover,
  .nav-menu .dropdown-item:hover{
    background: rgba(96, 171, 130, .16) !important;
    color: #f2fbf6 !important;
  }
  .top-navbar .dropdown-toggle,
  .nav-menu .dropdown-toggle{
    color: #eaf4ee !important;
  }
}

/* === Emphasize: label "Unit Usaha" lebih besar & tebal === */
.dropdown-toggle.unit-usaha,
.dropdown.unit-usaha > .dropdown-toggle{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 12px 14px;
}
.dropdown-toggle.unit-usaha i.fa-store,
.dropdown.unit-usaha > .dropdown-toggle i.fa-store{ font-size: 18px; }
.dropdown-toggle.unit-usaha i.fa-caret-down,
.dropdown.unit-usaha > .dropdown-toggle i.fa-caret-down{ font-size: 14px; }

@media (max-width: 991.98px){
  .dropdown-toggle.unit-usaha,
  .dropdown.unit-usaha > .dropdown-toggle{
    font-size: 19px;
    padding: 14px 16px;
  }
}

/* === Emphasize: label "Informasi" sebesar & setegas "Unit Usaha" === */
.dropdown-toggle.informasi,
.dropdown.informasi > .dropdown-toggle{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 12px 14px;
}

.dropdown-toggle.informasi i.fa-newspaper,
.dropdown.informasi > .dropdown-toggle i.fa-newspaper{ font-size: 18px; }

.dropdown-toggle.informasi i.fa-caret-down,
.dropdown.informasi > .dropdown-toggle i.fa-caret-down{ font-size: 14px; }

@media (max-width: 991.98px){
  .dropdown-toggle.informasi,
  .dropdown.informasi > .dropdown-toggle{
    font-size: 19px;
    padding: 14px 16px;
  }
}