/* ============================================================
   kampung. — design tokens
   Palette terinspirasi papan nama kios & pasar kampung:
   hijau daun tua sebagai warna utama, kuning marigold sebagai
   aksen "papan pengumuman", clay red untuk penekanan tipis.
   ============================================================ */
:root {
  --bg: #FAF7F0;
  --bg-soft: #F1ECDF;
  --ink: #211F1A;
  --ink-soft: #57534A;
  --primary: #1F4B3F;
  --primary-light: #2F6B57;
  --primary-dark: #143329;
  --accent: #E3A526;
  --accent-soft: #F6DFA0;
  --clay: #C4502D;
  --card: #FFFFFF;
  --border: #E9E2CF;
  --shadow-sm: 0 2px 10px rgba(33, 31, 26, 0.06);
  --shadow-md: 0 10px 30px rgba(33, 31, 26, 0.10);
  --shadow-lg: 0 20px 50px rgba(33, 31, 26, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-weight: 600;
}

.mono { font-family: var(--font-mono); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg-soft); color: var(--ink); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-wa { background: #22A45D; color: #fff; }
.btn-wa:hover { background: #1c8a4d; box-shadow: var(--shadow-md); }
.btn-danger { background: #fff; color: var(--clay); border: 1.5px solid var(--clay); }
.btn-danger:hover { background: var(--clay); color: #fff; }
.btn-block { width: 100%; }

/* ---------------- Navbar ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
.navbar.is-scrolled { box-shadow: var(--shadow-sm); }
.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  transform: rotate(-4deg);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; background: var(--accent); border-radius: 3px;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 3px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------------- Hero: papan pengumuman kampung ---------------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(33,31,26,0.06) 1px, transparent 0);
  background-size: 22px 22px;
}
.hero-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: rotate(-1.5deg);
  animation: floatSlow 5s ease-in-out infinite;
}
.hero-pin .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1;
  font-weight: 800;
  margin: 20px 0 16px;
  max-width: 760px;
}
.hero h1 .accent-underline {
  position: relative;
  color: var(--primary);
}
.hero h1 .accent-underline svg {
  position: absolute; left: 0; bottom: -6px; width: 100%; height: 14px;
}
.hero p.lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 560px;
  margin-bottom: 32px;
}

.search-bar {
  display: flex;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-md);
  max-width: 640px;
}
.search-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  color: var(--ink);
}
.search-bar select {
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  color: var(--ink-soft);
  outline: none;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.hero-stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--primary);
}
.hero-stat .label {
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-6px) rotate(-1.5deg); }
}

/* ---------------- Stories strip ---------------- */
.stories-section { padding: 8px 0 40px; }
.stories-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  scrollbar-width: thin;
}
.story-item { flex: 0 0 auto; text-align: center; width: 84px; }
.story-ring {
  width: 76px; height: 76px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 210deg, var(--accent), var(--clay), var(--accent));
  transition: transform .2s ease;
}
.story-item:hover .story-ring { transform: scale(1.06); }
.story-ring-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background-size: cover;
  background-position: center;
}
.story-item .story-name {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- Section heading ---------------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 30px; font-weight: 800; }
.section-head p { color: var(--ink-soft); margin: 6px 0 0; }

/* ---------------- Signature: signboard UMKM card ---------------- */
.umkm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 26px;
}
.umkm-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  opacity: 0;
  transform: translateY(18px);
}
.umkm-card.reveal { animation: cardIn .6s ease forwards; }
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

.umkm-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.umkm-card:hover .card-ribbon { transform: rotate(0deg) translateY(-2px); }

.card-media { position: relative; border-radius: var(--radius-md) var(--radius-md) 0 0; overflow: hidden; height: 168px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.umkm-card:hover .card-media img { transform: scale(1.07); }

.card-ribbon {
  position: absolute;
  top: -10px; left: 16px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease;
  z-index: 2;
}
.card-ribbon::after {
  content: '';
  position: absolute;
  top: -4px; left: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 2px #fff;
}

.card-body { padding: 18px 18px 20px; }
.card-body h3 { font-size: 17px; margin-bottom: 4px; }
.card-body p.desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.card-meta span { display: flex; align-items: center; gap: 5px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.status-active { background: #E4F3EA; color: #1F4B3F; }
.status-pending { background: #FBEFD8; color: #8A5A0F; }
.status-inactive { background: #F3E7E2; color: var(--clay); }

/* ---------------- Filters chip row ---------------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- News cards ---------------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.news-card { background: var(--card); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.news-card img { height: 160px; object-fit: cover; }
.news-card .body { padding: 16px 18px 20px; }
.news-card .date { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); }
.news-card h3 { font-size: 16px; margin: 6px 0 8px; }

/* ---------------- Footer ---------------- */
footer { background: var(--primary-dark); color: #EFEADA; padding: 56px 0 28px; margin-top: 40px; }
footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
footer h4 { color: #fff; font-size: 15px; }
footer a { color: #C9C2AC; font-size: 14px; }
footer a:hover { color: var(--accent); }
footer .foot-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; font-size: 12.5px; color: #A69F87; flex-wrap: wrap; gap: 8px;
}

/* ---------------- Detail page ---------------- */
.detail-hero { padding: 32px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--primary); }

.gallery {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 420px;
}
.gallery .main-img { grid-row: span 2; background-size: cover; background-position: center; cursor: pointer; }
.gallery .sub-img { background-size: cover; background-position: center; cursor: pointer; position: relative; }
.gallery .sub-img.has-more::after {
  content: attr(data-more);
  position: absolute; inset: 0;
  background: rgba(20,51,41,.55);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
}

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-top: 34px; align-items: start; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }
.info-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.info-row:last-of-type { border-bottom: none; }
.info-row .label { color: var(--ink-soft); min-width: 90px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; margin-top: 18px; }
.product-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card img { height: 130px; object-fit: cover; }
.product-card .p-body { padding: 12px 14px 16px; }
.product-card .p-price { font-family: var(--font-mono); font-weight: 700; color: var(--primary); font-size: 14px; }
.product-card h4 { font-size: 14px; margin: 0 0 4px; }

.video-block { margin-top: 34px; }
.video-block video { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ---------------- Story viewer ---------------- */
.story-viewer { position: fixed; inset: 0; background: #0e0e0c; z-index: 100; display: flex; align-items: center; justify-content: center; }
.story-viewer .story-frame { width: min(420px, 92vw); height: min(720px, 88vh); position: relative; border-radius: var(--radius-lg); overflow: hidden; background-size: cover; background-position: center; }
.story-progress { position: absolute; top: 12px; left: 12px; right: 12px; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; }
.story-progress-fill { height: 100%; background: #fff; width: 100%; }
.story-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }
.story-caption .umkm-name { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.story-close { position: absolute; top: 16px; right: 16px; color: #fff; background: rgba(0,0,0,.35); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.story-nav { position: absolute; top: 0; bottom: 0; width: 50%; cursor: pointer; }

/* ---------------- Forms (used by admin too) ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form-hint { font-size: 12px; color: var(--ink-soft); margin-top: 5px; font-family: var(--font-mono); }
input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14.5px;
  background: var(--card);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,75,63,.12);
}
textarea { resize: vertical; min-height: 100px; }
input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 13.5px;
}

.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #E4F3EA; color: #1F4B3F; }
.alert-error { background: #F9E4DD; color: #92321A; }
.alert-info { background: #E8F0FE; color: #1A4B92; }

/* ---------------- Empty state ---------------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 42px; margin-bottom: 12px; }

/* ---------------- Reveal on scroll ---------------- */
.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal-up.in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .info-card { position: static; }
  footer .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .gallery { height: 320px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s ease, opacity .25s ease;
    padding: 0 20px;
  }
  .nav-links.open {
    max-height: 400px;
    opacity: 1;
    padding: 14px 20px 20px;
  }
  .nav-links a {
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
    width: 100%;
  }
  .nav-links a:last-of-type { border-bottom: none; }
  .nav-links a.active::after { display: none; }
  .nav-links .btn { margin-top: 10px; width: 100%; }
  .search-bar { flex-direction: column; }
  .search-bar select { border-left: none; border-top: 1px solid var(--border); }
  .gallery { grid-template-columns: 1fr; height: auto; }
  .gallery .main-img { height: 240px; }
  .gallery .sub-img { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
