/* agrimaps.id — tema default (Inter, hijau brand #0b8457) */
:root {
  --green: #0b8457;
  --green2: #2aa877;
  --nav: linear-gradient(135deg, #074833 0%, #072b1f 45%, #095c41 100%);
  --ink: #0a2a1e;
  --muted: #54655d;
  --line: #e3ebe7;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink); background: #f7faf9;
}
a { color: var(--green); text-decoration: none; }

/* ── Navbar (hanya brand) ── */
.navbar {
  height: 52px; display: flex; align-items: center;
  padding: 0 22px; background: var(--nav); color: #fff;
}
.navbar .brand { font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: #fff; display: flex; align-items: center; gap: 10px; }
.navbar .brandlogo {
  height: 28px; width: auto;
  box-sizing: content-box;
  padding: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .92);
  object-fit: contain;
}

/* ── Landing (index) ── */
.landing {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: var(--nav);
}
/* Bentuk logo mengikuti area member: ubin putih membulat (rounded tile)
   dengan padding tipis dan object-fit contain. */
.brandlogo {
  height: 42px; width: auto; display: block;
  box-sizing: content-box;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  object-fit: contain;
}
.brandline { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 52px; }
/* Blok isi landing: mengisi ruang di atas footer dan tetap center vertikal.
   .sitefoot tidak boleh memakai margin-top:auto lagi — itu mendorong isi ke atas. */
.landing-main {
  flex: 1 1 auto; width: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.landing h1 { color: #fff; font-size: 40px; margin: 0; letter-spacing: -.03em; font-weight: 800; }
.landing p { color: rgba(255,255,255,.8); margin: 0 0 28px; font-size: 16px; }
.landing .gbox {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px;
  padding: 8px 8px 8px 22px; width: 640px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.landing input[type=text] { flex: 1; border: 0; outline: 0; font-size: 17px; font-family: inherit; padding: 8px 0; }
.landing button { background: var(--green); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 28px; font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit; }
.landing button:hover { background: var(--green2); }
.landing .hint { color: rgba(255,255,255,.55); font-size: 13px; margin-top: 16px; }

/* ── Halaman hasil (search) ── */
.layout { display: flex; height: calc(100vh - 52px - 42px); }
#map { flex: 1; height: 100%; min-height: 300px; position: relative; z-index: 0; }

.sidebar {
  width: 380px; max-width: 40vw; background: #fff; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
}

/* search bar di atas sidebar */
.sidebar .searchbar {
  display: flex; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.sidebar .suggest-wrap { position: relative; flex: 1; min-width: 0; }
.sidebar .searchbar input[type=text] {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
.sidebar .searchbar input[type=text]:focus { border-color: var(--green); }

.suggest { position: absolute; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,40,25,.12); margin-top: 6px; overflow: hidden;
  z-index: 30; display: none; }
.suggest .item { padding: 10px 16px; cursor: pointer; font-size: 14px; color: var(--ink); }
.suggest .item:hover { background: #eaf4ef; }
.suggest .item small { color: var(--muted); margin-left: 6px; }

.sidebar .head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.sidebar .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.sidebar .empty { padding: 22px 18px; color: var(--muted); font-size: 14px; }
.card-item { padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.card-item:hover { background: #f2f8f5; }
.card-item h4 {
  margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-item h4 > span:first-child,
.card-item h4 .gh-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-item .badge {
  flex: none;
  font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  color: #fff; white-space: nowrap;
}
.card-item .meta { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.card-item .potensi {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 7px; font-weight: 800; color: var(--green); font-size: 15px;
}
.card-item .potensi .potensi-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 2px 8px; font-size: 12.5px; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 600; }

/* ── Kartu informasi pin (popup Leaflet peta publik) ── */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(4, 40, 28, .18);
  overflow: hidden;
}
.leaflet-popup-content {
  margin: 0;
  width: auto !important;
  min-width: 264px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.leaflet-popup-tip { box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button {
  top: 9px; right: 9px; width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted); font-size: 17px; font-weight: 400;
  transition: background .15s, color .15s;
}
.leaflet-container a.leaflet-popup-close-button:hover { background: #eef4f1; color: var(--ink); }

.pin-card { display: block; }
.pin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 40px 0 16px;
}
.pin-title {
  font-size: 15px; font-weight: 800; letter-spacing: -.2px; color: var(--ink);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pin-sub {
  margin: 4px 16px 0;
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis;
}
.pin-rows { margin: 12px 0 0; }
.pin-row {
  display: grid; grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px; padding: 7px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.pin-row dt { color: var(--muted); font-weight: 500; }
.pin-row dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.pin-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; padding: 10px 16px;
  border-top: 1px solid var(--line); background: #f2f8f5;
}
.pin-foot span {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.pin-foot b { font-size: 15px; font-weight: 800; color: var(--green); }
.pin-foot b.is-empty { color: var(--muted); font-weight: 700; }

/* ── Menu navigasi (navbar) ── */
.navbar .navmenu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.navbar .navmenu a {
  color: rgba(255,255,255,.82); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; white-space: nowrap;
}
.navbar .navmenu a:hover { background: rgba(255,255,255,.12); color: #fff; }
.navbar .navmenu a.active { background: rgba(255,255,255,.2); color: #fff; }
/* tautan area member di kanan atas (halaman peta) */
.navbar .navmenu a.navmember { color: #f0d6a4; }
.navbar .navmenu a.navmember:hover { color: #2a1d05; background: #e6c48a; }

/* menu di halaman landing */
.landingnav {
  position: absolute; top: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 14px 18px;
}
.landingnav a {
  color: rgba(255,255,255,.82); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
}
.landingnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.landingnav a.navpremium { color: #f0d6a4; }
.landingnav a.navpremium:hover { color: #2a1d05; background: #e6c48a; }
/* ── Dropdown bahasa: ID · EN · DE (di navbar hijau tua) ── */
.langdd { position: relative; flex: none; }
.langdd > summary {
  list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 9px 6px 11px; border-radius: 8px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  transition: background .16s, border-color .16s;
}
.langdd > summary::-webkit-details-marker { display: none; }
.langdd > summary::marker { content: ""; }
.langdd > summary:hover { background: rgba(255, 255, 255, .2); }
.langdd[open] > summary { background: rgba(255, 255, 255, .22); }
.langdd .langdd-caret { width: 12px; height: 12px; transition: transform .18s; }
.langdd[open] .langdd-caret { transform: rotate(180deg); }
.langdd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  min-width: 214px; padding: 6px; border-radius: 12px;
  background: #0a2a20; border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}
.langdd-name { white-space: nowrap; }
.langdd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: 8px; text-decoration: none;
  color: rgba(255, 255, 255, .86); font-size: 13px; font-weight: 600;
}
.langdd-item:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.langdd-item.is-on { background: rgba(255, 255, 255, .16); color: #fff; }
.langdd-code {
  min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: inherit;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
}
.langdd-item.is-on .langdd-code { background: #fff; color: #0b4a35; }
.navbar .langdd { margin-left: 10px; }
.landingnav .langdd { margin-left: 6px; }   /* dropdown di kanan tautan Member */

/* ── Daftar rumah kaca: seksi, cocok, tanpa koordinat ── */
.section-title {
  padding: 10px 18px; background: #f2f8f5; border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  position: sticky; top: 0; z-index: 5;
}
.card-item.match { border-left: 3px solid var(--green); background: #fbfefc; }
.card-item.muted { cursor: default; opacity: .85; }
.card-item.muted:hover { background: #fff; }
.card-item .badge.badge-muted { background: #9aa8a2; }
.card-item .coord-empty { color: #a15c00; }

/* ringkasan halaman peta */
.sidebar .mapsub { padding: 0 18px 12px; font-size: 12.5px; color: var(--muted); }
.statbar { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.7; }
.statbar b { color: var(--ink); }
.legendbox { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.legendbox .legendtitle { font-weight: 700; color: var(--ink); margin-bottom: 4px; font-size: 12.5px; }
.legendbox i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* ── Mobile ── */
.navtoggle { display: none; }
.navscrim {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(4,24,17,.55); opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}

@media (max-width: 820px) {
  /* header: brand + hamburger; menu pindah ke drawer kanan */
  .navbar {
    height: auto; min-height: 52px;
    padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
    gap: 10px; flex-wrap: nowrap;
    position: relative; z-index: 60; /* stacking context: drawer di atas scrim */
  }
  .navbar .brand {
    font-size: 15px; gap: 8px; min-width: 0; flex: 0 1 auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .navbar .brandlogo { height: 24px; flex: 0 0 auto; }
  .navbar .navtoggle {
    display: inline-flex; flex: 0 0 auto; margin-left: auto;
    flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 0 9px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px; cursor: pointer;
  }
  .navbar .navtoggle span { display: block; width: 100%; height: 2px; border-radius: 2px; background: #fff; }
  .navbar .navtoggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

  .navbar .navmenu {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
    width: 272px; max-width: 86vw; margin: 0;
    padding: calc(66px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    background: var(--nav); box-shadow: -14px 0 36px rgba(0,0,0,.3);
    transform: translateX(102%); visibility: hidden;
    transition: transform .22s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .navbar .navmenu.open { transform: translateX(0); visibility: visible; }
  .navbar .navmenu a { padding: 13px 14px; font-size: 15px; border-radius: 10px; white-space: normal; }
  .navscrim { display: block; }
  .navscrim.open { opacity: 1; pointer-events: auto; }
  body.navopen { overflow: hidden; }

  /* halaman peta/hasil: peta di atas, daftar di bawah */
  .layout { flex-direction: column; height: auto; }
  #map { flex: none; width: 100%; height: 46vh; min-height: 260px; }
  .sidebar {
    width: 100%; max-width: 100%; border-left: 0; border-top: 1px solid var(--line);
    overflow-y: visible;
  }
  .sidebar .searchbar { position: sticky; top: 0; z-index: 20; }
  .section-title { top: var(--sbh, 0px); }
  .sidebar .head { padding: 12px 14px; }
  .sidebar .mapsub { padding: 0 14px 12px; }
  .statbar, .legendbox, .card-item { padding-left: 14px; padding-right: 14px; }
  .card-item { padding-top: 13px; padding-bottom: 13px; }
  .card-item h4 { flex-wrap: wrap; row-gap: 4px; }
  .card-item .meta, .sidebar .head, .statbar, .legendbox, .mapsub { overflow-wrap: anywhere; }

  /* landing: judul & kotak cari ditumpuk, tidak meluber */
  .landing { padding: 76px 18px 44px; }
  .landingnav { padding: calc(10px + env(safe-area-inset-top)) 12px 0; gap: 2px; }
  .landingnav a { font-size: 13px; padding: 7px 10px; }
  .navbar .langdd { margin-left: 8px; }
  .langdd > summary { padding: 5px 8px 5px 9px; font-size: 11.5px; }
  .langdd-menu { min-width: 172px; }
  .brandline { flex-direction: column; gap: 12px; margin-bottom: 32px; }
  .landing .brandlogo { height: 38px; }
  .landing h1 { font-size: clamp(26px, 8vw, 34px); line-height: 1.18; }
  .landing .gbox { width: 100%; max-width: 520px; padding: 6px 6px 6px 16px; gap: 4px; }
  .landing input[type=text] { min-width: 0; font-size: 15px; padding: 8px 0; }
  .landing button { padding: 11px 18px; font-size: 14px; }
  .landing .hint { font-size: 12.5px; margin-top: 14px; padding: 0 4px; line-height: 1.6; }
}

@media (max-width: 480px) {
  #map { height: 40vh; min-height: 240px; }
  .landing h1 { font-size: 27px; }
  .landing .brandline { margin-bottom: 26px; }
}

/* ── Footer situs ── */
.sitefoot {
  display: flex; align-items: center; justify-content: center;
  width: 100%; text-align: center;
  font-size: 12.5px; line-height: 1.45; letter-spacing: .01em;
  color: var(--muted);
}
/* halaman peta/hasil: strip terang setinggi tetap di bawah layout */
body > .layout + .sitefoot {
  height: 42px; padding: 0 18px;
  background: #fff; border-top: 1px solid var(--line);
}
/* landing (latar gradien gelap): menempel di dasar halaman */
.landing .sitefoot {
  flex: 0 0 auto; margin-top: 0; padding-top: 22px;
  color: rgba(255, 255, 255, .55);
}
@media (max-width: 820px) {
  body > .layout + .sitefoot { height: auto; padding: 14px 16px; }
  .landing .sitefoot { padding-top: 18px; font-size: 11.5px; }
}
