/* ==========================================================================
   KOMPONEN: Modal — jendela overlay utama
   ========================================================================== */
.c-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 14, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: var(--z-modal);
}
/* Pastikan [hidden] attribute benar-benar menyembunyikan modal (override display:flex) */
.c-modal-overlay[hidden] {
  display: none !important;
}
.c-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--ink-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden; /* header/footer tetap, hanya body yang scroll */
}
.c-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.c-modal .modal-head h3 {
  margin: 0;
  font-size: var(--fs-lg);
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-width: 0;
}
.c-modal .modal-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.c-modal .modal-close:hover {
  background: var(--ink-4);
  color: var(--washi);
}
.c-modal .modal-body {
  padding: var(--space-4);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.c-modal .modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Mobile: modal mepet ke tepi layar & lebih tinggi agar konten tidak ketutup */
@media (max-width: 480px) {
  .c-modal-overlay {
    padding: var(--space-2);
    align-items: flex-end;
  }
  .c-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}
