:root {
  --bg: #f5efe6;
  --fg: #2c2419;
  --mut: #6b5e4e;
  --card: #fffdf9;
  --ac: #8b5e3c;
  --ac-dark: #6b4423;
  --ac2: #a0522d;
  --bd: #e5d9c8;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ========== NAV ========== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--bd);
  box-shadow: 0 1px 4px rgba(44, 36, 25, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  text-decoration: none;
  color: var(--ac-dark);
  font-weight: 700;
  font-size: 15px;
}

.nav-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.nav-links a {
  color: var(--fg);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--bd);
}

/* ========== SECTIONS ========== */
section {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px;
}

h2 {
  font: 700 26px/1.25 Georgia, "Times New Roman", serif;
  margin: 0 0 6px;
  color: var(--fg);
}

.sub {
  color: var(--mut);
  margin: 0 0 22px;
  font-size: 15px;
}

/* ========== DASHBOARD ========== */
#dashboard {
  max-width: none;
  padding: 0 0 56px;
  background: linear-gradient(
    165deg,
    #5c3d2e 0%,
    #8b5e3c 28%,
    #c4a574 58%,
    #e8d5b5 82%,
    #f5efe6 100%
  );
  color: #fff;
}

.hero {
  text-align: center;
  padding: 52px 20px 28px;
}

.logo-wrap {
  display: inline-block;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.hero-logo {
  width: 110px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(44, 36, 25, 0.18));
}

.hero h1 {
  font: 700 clamp(32px, 6vw, 52px)/1.1 Georgia, serif;
  margin: 14px 0 6px;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(44, 36, 25, 0.25);
}

.tagline {
  font: italic 18px/1.4 Georgia, serif;
  margin: 0 0 12px;
  opacity: 0.95;
  color: #faf6f0;
}

.hero-desc {
  max-width: 520px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.vmt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 960px;
  margin: 28px auto 0;
  padding: 0 20px;
}

@media (max-width: 780px) {
  .vmt-grid {
    grid-template-columns: 1fr;
  }
}

.card.vmt .k {
  color: #8b5e3c;
  margin-bottom: 8px;
}

.card.vmt p,
.card.vmt li {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  color: #2c2419;
}

.vmt .k {
  color: #faf6f0;
  margin-bottom: 8px;
}

.vmt p,
.vmt li {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.vmt ul {
  margin: 0;
  padding-left: 18px;
}

.vmt li + li {
  margin-top: 6px;
}

.cta-wrap {
  text-align: center;
  margin-top: 36px;
}

.btn {
  display: inline-block;
  background: var(--ac);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font: 600 15px system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-large {
  background: #fffdf9;
  color: #5c3d2e;
  padding: 14px 36px;
  font-size: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(44, 36, 25, 0.15);
}

.btn-large:hover {
  transform: translateY(-1px);
}

/* ========== CARDS ========== */
.card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 16px;
}

.k {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ac);
  font-weight: 700;
}

/* ========== MAP ========== */
.map-area {
  margin-bottom: 8px;
}

.mapbox {
  position: relative;
  background: #3d3229;
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
  filter: grayscale(0.7) brightness(0.9);
  transition: filter 0.35s ease;
}

.mapbox.has-selection {
  filter: grayscale(0.2) brightness(1);
}

.mapbox img,
.mapbox canvas {
  display: block;
  width: 100%;
  height: auto;
}

.mapbox canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--mut);
  text-align: center;
}

.chip {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--ac);
  background: transparent;
  color: var(--ac);
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}

.chip:hover {
  background: var(--ac);
  color: #fff;
}

/* ========== PANEL ========== */
#panel {
  margin-top: 18px;
}

#panel h3 {
  margin: 0 0 4px;
  font: 700 22px/1.2 Georgia, serif;
}

.panel-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--mut);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.info-item {
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.info-item .k {
  margin-bottom: 8px;
}

.img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bd);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mut);
  font-size: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}

.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-item p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.msg {
  margin: 8px 0;
  color: var(--mut);
  font-size: 14px;
}

.gform-wrap {
  margin-top: 28px;
  text-align: center;
  padding: 22px 18px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
}

.gform-wrap p {
  margin: 0 0 14px;
  color: var(--mut);
  font-size: 14px;
}

/* ========== FLIP CARDS ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 720px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.flip {
  height: 180px;
  perspective: 1000px;
  cursor: pointer;
  user-select: none;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  overflow: auto;
}

.flip-front {
  background: var(--ac);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.28);
}

.flip-front::after {
  content: "Ketuk untuk jawaban";
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
}

.flip-back {
  background: var(--card);
  color: var(--fg);
  border: 2px solid var(--ac);
  transform: rotateY(180deg);
}

/* ========== TIM ========== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 640px) {
  .team-grid {
    grid-template-columns: 1fr;
  }

}

.team-card {
  text-align: center;
  padding: 22px 14px;
}

.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ac);
  color: #fff;
  font: 700 22px/64px Georgia, serif;
  margin: 0 auto 12px;
}

.team-card h3 {
  margin: 0 0 2px;
  font: 700 17px Georgia, serif;
}

.role {
  color: var(--ac);
  font-weight: 600;
  font-size: 12px;
  margin: 0 0 8px;
}

.team-bio {
  margin: 0;
  font-size: 13px;
  color: var(--mut);
}

.contact-card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.contact-card p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  color: var(--mut);
  padding: 24px 20px 36px;
  font-size: 12px;
  border-top: 1px solid var(--bd);
}

/* ========== TABEL PENJELASAN BUDAYA ========== */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 10px;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

.detail-table th,
.detail-table td {
  border: 1px solid var(--bd);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.detail-table th {
  background: #efe6d8;
  color: var(--ac-dark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 140px;
  color: var(--ac-dark);
}

.detail-table td:nth-child(2) {
  font-weight: 600;
  width: 160px;
}

.detail-table tr:nth-child(even) td {
  background: rgba(245, 239, 230, 0.5);
}

@media (max-width: 640px) {
  .detail-table {
    display: block;
    overflow-x: auto;
  }
  .detail-table td:first-child,
  .detail-table td:nth-child(2) {
    white-space: normal;
    width: auto;
  }
}

/* ========== BELAJAR ========== */
.subhead {
  font: 700 18px/1.3 Georgia, serif;
  margin: 28px 0 8px;
  color: var(--ac-dark);
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.book-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
}
.book-cover {
  flex-shrink: 0;
  width: 100px;
  height: 140px;
  border-radius: 6px;
  background: linear-gradient(160deg, #5c3d2e, #c4a574);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 8px;
  box-shadow: 0 4px 12px rgba(44, 36, 25, 0.2);
}
.book-cover-alt { background: linear-gradient(160deg, #3d3229, #8b5e3c); }
.book-cover-title { font: 700 13px/1.25 Georgia, serif; }
.book-cover-author { font-size: 10px; margin-top: 8px; opacity: 0.9; }
.book-meta h4 { margin: 0 0 2px; font: 700 16px Georgia, serif; }
.book-author { margin: 0 0 8px; font-size: 13px; color: var(--ac); font-weight: 600; }
.book-desc { margin: 0 0 12px; font-size: 13px; color: var(--mut); line-height: 1.45; }
.btn-read { font-size: 13px; padding: 8px 14px; }
.btn-ghost {
  background: transparent;
  color: var(--ac-dark);
  border: 1px solid var(--bd);
}
.book-reader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(44, 36, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.book-reader.hidden { display: none; }
.book-reader-panel {
  background: var(--card);
  border-radius: 14px;
  width: min(720px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  overflow: hidden;
}
.book-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bd);
  background: #efe6d8;
}
.book-reader-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
}
.book-reader-body h4 { margin: 0 0 12px; font: 700 20px Georgia, serif; }
.book-reader-body p { margin: 0 0 12px; }
.book-reader-body .page-break {
  border-top: 1px dashed var(--bd);
  margin: 20px 0;
  padding-top: 8px;
  font-size: 12px;
  color: var(--mut);
  text-align: center;
}
.reader-note {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--mut);
  border-top: 1px solid var(--bd);
  text-align: center;
  background: var(--bg);
}
.kamus-wrap { padding: 14px; }
.kamus-search-row { margin-bottom: 12px; }
.kamus-search-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.table-scroll { overflow-x: auto; }
.kamus-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kamus-table th, .kamus-table td {
  border: 1px solid var(--bd);
  padding: 10px 12px;
  text-align: left;
}
.kamus-table th {
  background: #efe6d8;
  color: var(--ac-dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kamus-table tbody tr:hover,
.kamus-table tbody tr.on { background: rgba(139, 94, 60, 0.08); }
.kamus-table tr.hidden-row { display: none; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 720px) {
  .media-grid { grid-template-columns: 1fr; }
  .book-card { flex-direction: column; align-items: center; text-align: center; }
}
.media-card h4 { margin: 4px 0 2px; font: 700 16px Georgia, serif; }
.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #efe6d8;
  color: var(--ac-dark);
}
.team-avatar-soft { background: #c4a574; }
.ig-link { color: var(--ac); font-weight: 600; text-decoration: none; }
.ig-link:hover { text-decoration: underline; }
.contact-card a { color: var(--ac); }
.team-row-center {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 22px;
}

.team-row-center .team-card {
  flex: 0 0 calc((100% - 28px) / 3);
  max-width: calc((100% - 28px) / 3);
}

@media (max-width: 640px) {
  .team-row-center {
    flex-wrap: wrap;
  }
  .team-row-center .team-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ========== HALAMAN PER SECTION ========== */
body > section[id] {
  display: none;
  min-height: calc(100vh - 70px);
  padding-top: 32px;
  padding-bottom: 48px;
}

body > section.page-active {
  display: block;
}

.nav-links a.nav-active {
  background: var(--ac);
  color: #fff;
}

.nav-links a.nav-active:hover {
  background: var(--ac-dark);
  color: #fff;
}

/* ========== PEMBACA PDF ========== */
.book-reader-panel.pdf-mode { width: min(900px, 100%); }
.book-reader-body { overflow-x: auto; }

.pdf-bar {
  position: sticky;
  top: -20px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: -20px -22px 14px;
  padding: 10px;
  background: var(--card);
  border-bottom: 1px solid var(--bd);
}
.pdf-bar .btn { padding: 7px 12px; font-size: 13px; }
.pdf-bar .btn:disabled { opacity: 0.4; cursor: default; }
.pdf-info { font-size: 13px; color: var(--mut); min-width: 110px; text-align: center; }

.pdf-canvas-wrap { display: flex; justify-content: center; }
.pdf-canvas-wrap canvas {
  max-width: none;
  background: #fff;
  box-shadow: 0 4px 18px rgba(44, 36, 25, 0.2);
  -webkit-user-select: none;
  user-select: none;
}

/* ========== COVER BUKU GAMBAR ========== */
.book-cover-img {
  width: 120px;
  height: auto;
  padding: 0;
  background: #efe6d8;
  overflow: hidden;
}

.book-cover-img img {
  display: block;
  width: 100%;
  height: auto;
}