/* =========================================================
   TRHC Pages — pages.css
   KHUSUS halaman (contact/privacy/terms/offline/404/cookies)
   - Menggunakan token & mode dari theme.css (tidak didefinisikan ulang)
   - Tidak styling header/footer (gunakan chrome.css)
   ======================================================= */

/* Reset ringan halaman */
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
        "Segoe UI Emoji";
}
:focus {
    outline: none;
}
:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Layout konten halaman */
.main {
    min-height: calc(100dvh - 140px);
}
.container {
    max-width: 1120px;
    margin-inline: auto;
    padding: 16px;
}
@media (min-width: 768px) {
    .container {
        padding: 24px;
    }
}

/* Komponen umum halaman */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
}
.card.tinted {
    background: color-mix(in oklab, var(--panel), var(--brand) 5%);
}

/* Tombol minimal agar konsisten (tidak bentrok app.css) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
}
.btn:hover {
    filter: brightness(1.05);
}
.btn:active {
    transform: scale(0.98);
}
.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.alt {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-sm {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}
.btn-block {
    display: block;
    width: 100%;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--muted);
}

/* Prose & link */
.prose h1 {
    font-size: clamp(28px, 2.8vw, 40px);
    line-height: 1.2;
    margin: 6px 0 14px;
}
.prose h2 {
    font-size: clamp(20px, 2.2vw, 28px);
    margin: 18px 0 10px;
}
.prose p {
    margin: 10px 0;
}
.prose a {
    color: var(--brand);
    text-decoration: none;
    text-underline-offset: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.breadcrumbs a {
    color: inherit;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Grid util */
.grid {
    display: grid;
    gap: 16px;
}
.grid-2 {
    grid-template-columns: 1fr;
}
.grid-3 {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
.center {
    display: grid;
    place-items: center;
}
.mt-2 {
    margin-top: 0.5rem;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-3 {
    margin-bottom: 0.75rem;
}
.mb-4 {
    margin-bottom: 1rem;
}

/* ===========================
   FORMS (Contact) — rapi & responsif
   =========================== */
.contact-form {
    display: grid;
    gap: 16px;
}

/* grid bidang: stacked di mobile, 2 kolom di ≥700px */
.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}
@media (min-width: 700px) {
    .form-grid.two {
        grid-template-columns: 1fr 1fr;
    }
}

/* field & label */
.field {
    display: grid;
    gap: 6px;
}
.label {
    font-weight: 600;
    color: var(--text);
}

/* input/textarea/select */
.input,
.textarea,
.select {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.textarea {
    min-height: 140px;
    resize: vertical;
}
.input::placeholder,
.textarea::placeholder {
    color: color-mix(in oklab, var(--muted), transparent 15%);
}
.input:focus,
.textarea:focus,
.select:focus {
    border-color: color-mix(in oklab, var(--brand), var(--border) 35%);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 30%, transparent);
    outline: none;
}

/* state invalid (HTML5 constraint) */
.input:invalid,
.textarea:invalid {
    border-color: color-mix(in oklab, #ef4444 70%, var(--border));
}
.input:invalid:focus,
.textarea:invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in oklab, #ef4444 25%, transparent);
}

/* help text */
.help {
    font-size: 12px;
    color: var(--muted);
}

/* actions */
.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
@media (max-width: 420px) {
    .form-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* Aside box (kontak langsung) */
aside.card h3 {
    margin-top: 0;
}
aside.card p {
    margin: 8px 0;
}
.alert {
    border-left: 4px solid var(--brand);
    background: color-mix(in oklab, var(--surface), var(--brand) 6%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

/* Tabel */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table thead th {
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table.striped tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}
.table.hover tbody tr:hover {
    background: color-mix(in oklab, var(--brand) 6%, transparent);
}
th[data-sort] {
    cursor: pointer;
    user-select: none;
}
th[data-sort]::after {
    content: " ↕";
    opacity: 0.55;
}
th[data-sort].asc::after {
    content: " ↑";
}
th[data-sort].desc::after {
    content: " ↓";
}

/* Code blocks */
pre,
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
pre {
    margin: 0;
    padding: 14px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: auto;
    position: relative;
}
pre .btn.copy {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Reveal */
.reveal {
    opacity: 0;
    translate: 0 6px;
    transition: opacity 0.4s ease, translate 0.4s ease;
}
.reveal-in {
    opacity: 1;
    translate: 0 0;
}

/* Print */
@media print {
    .card {
        box-shadow: none;
        border-color: #ccc;
    }
}
