/* ============================================
   INFOGRAFIS DESA — LAYOUT & TAMPILAN BARU
   File: static/css/infografis.css
   ============================================ */

/* ---- Wrapper ---- */
.infra-report {
  background: #f1f5f9;
  min-height: 100%;
  padding-bottom: 3rem;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

/* Selaras tema landing (.pub-page-section di public.css) */
.infra-report.pub-page-section {
  background: var(--home-fog, #f0faf5);
  padding-bottom: 3rem;
}

.infra-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.infra-breadcrumb { margin-bottom: 1rem; }

/* ---- Header strip: judul kiri, meta kanan ---- */
.infra-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.5rem 0;
}

.infra-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.infra-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}

.infra-header-left p {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
}

.infra-header-right {
  text-align: right;
}

.infra-header-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.infra-header-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.infra-header-meta strong { color: #0f172a; }

/* ---- KPI bar: satu baris 3 angka + pembagi ---- */
.infra-kpi-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.infra-kpi-item {
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-right: 1px solid #e2e8f0;
}

.infra-kpi-item:last-child { border-right: none; }

.infra-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  display: block;
}

.infra-kpi-item.total .infra-kpi-value { color: #0d5c42; }
.infra-kpi-item.laki .infra-kpi-value { color: #1e40af; }
.infra-kpi-item.perempuan .infra-kpi-value { color: #9d174d; }

.infra-kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

.infra-kpi-sublabel {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* ---- SID source bar (satu baris) ---- */
.infra-source-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.infra-source-bar a { color: #0d5c42; font-weight: 600; }
.infra-source-dot { width: 4px; height: 4px; background: #94a3b8; border-radius: 50%; }
.infra-source-idm, .infra-source-sdgs {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0d5c42;
}

/* ---- Section block (judul + isi) ---- */
.infra-block {
  margin-top: 1.75rem;
}

.infra-block-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.infra-block-desc {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 1rem 0;
}

/* ---- Kartu isi (chart/tabel) ---- */
.infra-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.infra-chart-box {
  position: relative;
  height: 280px;
  width: 100%;
}

.infra-chart-box-tall { height: 380px; }
.infra-chart-box-short { height: 240px; }

/* ---- Grid layout baru ---- */
.infra-grid-bento {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.infra-grid-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.infra-full { grid-column: 1 / -1; }

/* ---- Piramida: chart kiri, tabel kanan ---- */
.infra-piramida-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.infra-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.infra-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.infra-legend-dot.laki { background: #0d9488; }
.infra-legend-dot.perempuan { background: #be185d; }

/* ---- Tabel ---- */
.infra-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.infra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.infra-table thead th {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.infra-table thead th.text-center { text-align: center; }

.infra-table tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.infra-table tbody td.text-center { text-align: center; }

.infra-table tbody tr:last-child td { border-bottom: none; }
.infra-table tbody tr:hover td { background: #fafafa; }

.infra-table .num {
  font-weight: 600;
  color: #0d5c42;
  font-variant-numeric: tabular-nums;
}

.infra-table-caption {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

.infra-table-scroll {
  max-height: 340px;
  overflow-y: auto;
}

/* ---- Pendidikan: chart atas, tabel bawah ---- */
.infra-edu-chart { margin-bottom: 1.25rem; }

/* ---- SDGS grid 3 kolom ---- */
.infra-sdgs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.infra-sdgs-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.infra-sdgs-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.infra-sdgs-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #fff;
}

.infra-sdgs-body { flex: 1; min-width: 0; }

.infra-sdgs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.infra-sdgs-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.infra-sdgs-score {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.infra-progress {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.infra-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.infra-progress-fill.high { background: #059669; }
.infra-progress-fill.mid { background: #d97706; }
.infra-progress-fill.low { background: #dc2626; }

/* ---- Empty state ---- */
.infra-empty {
  text-align: center;
  padding: 2rem;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.875rem;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .infra-grid-bento,
  .infra-grid-half { grid-template-columns: 1fr; }
  .infra-piramida-layout { grid-template-columns: 1fr; }
  .infra-sdgs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .infra-kpi-bar { grid-template-columns: 1fr; }
  .infra-kpi-item { border-right: none; border-bottom: 1px solid #e2e8f0; }
  .infra-kpi-item:last-child { border-bottom: none; }
  .infra-header-inner { flex-direction: column; align-items: flex-start; }
  .infra-header-right { text-align: left; }
  .infra-sdgs-grid { grid-template-columns: 1fr; }
}
