/* ==========================================================================
   ux.css — penyesuaian UX/UI berdasarkan panduan "UI Design Principles".
   Dimuat TERAKHIR di setiap halaman. Prinsip yang diterapkan:
   - Teks tidak boleh < 13px (isi/input 16px); line-height ~1.6 untuk teks isi
   - Target interaktif >= 40px (desktop) dan >= 44px (layar sentuh)
   - Kontras WCAG AA (token warna teks ada di theme.css)
   - Spasi berskala 8 (4 untuk setengah langkah)
   - Semua state tombol/form: hover, focus-visible, active, disabled
   - Micro-interaction singkat (<= 250ms) dan hormati prefers-reduced-motion
   ========================================================================== */

:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px; --sp-5: 32px; --sp-6: 48px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* --- Tipografi: tidak ada teks di bawah 13px --- */
.badge, .badge-success, .badge-method, .badge-folder, .api-folder-badge, .style-chip-name,
.style-cat-btn, .stat-label, .quick-desc, .service-count, .metric-label, .stat-row-label,
.chart-tab, .code-tab, .code-copy, .nav-pop-link, .dock-item span, .footer-status,
footer h4, footer a, footer span, .chart-empty, .empty-state, th { font-size: max(13px, 0.8125rem); }
.eyebrow, small, .field-label, .kbd, .docs-sidebar-title, .code-card-title, .tc-mini, .style-count-badge,
footer, footer *, .dock-item span, .dock-item b, th, .docs-sidebar a, td code, b, strong, pre.code-pre, .btn span { font-size: max(13px, 0.8125rem) !important; }
small, .footer-top *, .footer-bottom *, .footer-col h4, .footer-col a, .playground-meta span, .param-hint, .quick-card span, .dock-item > *:not(svg):not(i),
.copy-all, [class*="style-"] span, [class*="style-"] code { font-size: max(13px, 0.8125rem) !important; }
.footer-col a { min-height: 40px; display: inline-flex; align-items: center; }
input[type="range"] { min-height: 44px; }
code.ep-path, .tok-func, .tok-str, .tok-kw, .tok-punct, pre code { font-size: max(13px, 0.8125rem); }
.stat-label, .quick-desc, .metric-label, .stat-row-label, .service-count { line-height: 1.5; }
p, li, .quick-desc { line-height: 1.6; }
h1, h2, h3 { letter-spacing: -0.01em; }
p, .lead { max-width: 68ch; } /* panjang baris yang nyaman dibaca (~50–70 karakter) */

/* --- Target sentuh --- */
.btn, .style-chip, .style-cat-btn, .chart-tab, .code-tab, .code-copy, .api-folder-header,
.nav-pop-link, .footer-status, .drawer-close { min-height: 40px; }
.btn { padding-inline: max(24px, 1.5rem); }
.btn, .code-copy, .code-tab, .chart-tab, .style-chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); }
#docsSearchInput, input[type="search"], .playground-params input, .select-wrap select { min-height: 44px; font-size: max(16px, 1rem); }
footer a, .docs-nav a, .side a { display: inline-flex; align-items: center; min-height: 40px; }
@media (pointer: coarse), (max-width: 600px) {
  .btn, .style-chip, .style-cat-btn, .chart-tab, .code-tab, .code-copy, .api-folder-header,
  .nav-pop-link, .footer-status, .drawer-close, footer a { min-height: 44px; min-width: 44px; }
  .dock-item { min-height: 56px; }
}

/* --- State yang konsisten --- */
:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn:active, .style-chip:active, .style-cat-btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn, .style-chip, .style-cat-btn, .chart-tab, .code-tab, .code-copy, .dock-item, a {
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .12s var(--ease-out);
}

/* --- Kartu terlihat bisa diklik: sedikit terangkat saat hover --- */
@media (hover: hover) { a.quick-card:hover, .api-card:hover, .service-card:hover { transform: translateY(-2px); } }

/* --- Hormati preferensi gerak --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
