/* =====================================================================
   DataHUB Kabupaten Buton — Komponen Halaman (katalog, detail, dokumen)
   ===================================================================== */

/* ---------------------------- Layout katalog ---------------------------- */
.catalog-layout {
    display: grid; grid-template-columns: 288px minmax(0, 1fr);
    gap: 28px; align-items: start;
}
.filter-panel {
    position: sticky; top: calc(var(--header-h) + 16px);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden;
}
.filter-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 15px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.filter-head h2 { font-size: 14.5px; margin: 0; display: flex; align-items: center; gap: 8px; }
.filter-head a { font-size: 12.6px; font-weight: 700; }
.filter-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 20px; }
.filter-group { display: flex; flex-direction: column; gap: 9px; }
.filter-group > label, .filter-title {
    font-size: 11.6px; font-weight: 800; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted);
}
.filter-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 11px; border-radius: 9px; font-size: 13.8px;
    color: var(--ink-soft); border: 1px solid transparent; transition: all .16s;
}
.filter-option:hover { background: var(--bg-soft); color: var(--ink); }
.filter-option.is-active { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); font-weight: 700; }
.filter-option .count { font-size: 11.8px; font-weight: 700; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 1px 8px; }
.filter-option.is-active .count { background: var(--brand-600); color: #fff; }

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.toolbar-result { font-size: 14px; color: var(--muted); }
.toolbar-result strong { color: var(--ink); font-weight: 800; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .form-select, .toolbar .form-control { height: 42px; font-size: 14px; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.active-filter {
    display: inline-flex; align-items: center; gap: 7px; font-size: 12.6px; font-weight: 600;
    background: var(--brand-50); color: var(--brand-700);
    border: 1px solid var(--brand-100); border-radius: 999px; padding: 5px 8px 5px 12px;
}
.active-filter a { display: inline-flex; color: inherit; }
.active-filter a:hover { color: var(--danger-600); }

/* ---------------------------- Detail dataset ---------------------------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--header-h) + 16px); }

.detail-hero {
    background:
        radial-gradient(700px 220px at 100% 0%, rgba(245, 165, 36, .18), transparent 60%),
        linear-gradient(135deg, var(--brand-900), var(--brand-800));
    border-radius: var(--radius-xl); padding: clamp(24px, 3vw, 38px); color: #fff;
    border: 1px solid rgba(255, 255, 255, .1);
}
.detail-hero .breadcrumb { margin-bottom: 18px; }
.detail-hero h1 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.15rem); margin-bottom: .5em; }
.detail-hero p { color: rgba(255, 255, 255, .84); margin-bottom: 20px; font-size: 15.2px; }
.detail-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.detail-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.detail-hero-meta .icon { color: var(--accent-500); }

.meta-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
.meta-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.meta-item dt { font-size: 12.2px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.meta-item dd { margin: 0; font-size: 14.4px; font-weight: 600; color: var(--ink); word-break: break-word; }

.download-card { background: linear-gradient(150deg, var(--brand-700), var(--brand-900)); color: #fff; border: 0; }
.download-card .card-head { border-color: rgba(255, 255, 255, .16); }
.download-card .card-head h3 { color: #fff; }
.download-list { display: flex; flex-direction: column; gap: 10px; }
.download-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px; color: #fff; transition: background .18s, transform .18s;
}
.download-item:hover { background: rgba(255, 255, 255, .18); transform: translateX(3px); color: #fff; }
.download-item .fi {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .16); font: 700 10.5px var(--font-mono); flex: none;
}
.download-item .fi-txt { flex: 1; min-width: 0; }
.download-item .fi-txt strong { display: block; font-size: 13.6px; }
.download-item .fi-txt small { font-size: 11.8px; color: rgba(255, 255, 255, .72); }

.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.side-list li { display: flex; gap: 10px; font-size: 13.6px; color: var(--ink-soft); line-height: 1.5; }
.side-list .icon { color: var(--brand-600); margin-top: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); overflow-x: auto; margin-bottom: 22px; }
.tab {
    padding: 11px 18px; font-size: 14.2px; font-weight: 700; color: var(--muted);
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; cursor: pointer;
    background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit;
    white-space: nowrap; transition: color .18s, border-color .18s;
}
.tab:hover { color: var(--brand-600); }
.tab.is-active { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.tab-panel[hidden] { display: none; }

.preview-scroll { overflow: auto; max-height: 440px; border-radius: var(--radius); border: 1px solid var(--line); }
.preview-table { border-collapse: collapse; width: 100%; font-size: 13.4px; min-width: 560px; }
.preview-table th, .preview-table td { padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.preview-table thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; font-size: 12.4px; color: var(--muted); z-index: 2; }
.preview-table tbody tr:nth-child(even) { background: var(--surface-2); }
.preview-table tbody tr:hover { background: var(--brand-50); }
.preview-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.preview-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }

.code-block {
    background: #0b1220; color: #d7e3f7; border-radius: var(--radius);
    padding: 16px 18px; overflow: auto; font: 13px/1.65 var(--font-mono);
    max-height: 420px; border: 1px solid #1b2740;
}
.code-block .k { color: #7cc0ff; }
.code-block .s { color: #a5e8c4; }
.code-block .n { color: #ffcc80; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-500);
}
.timeline .t-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline .t-text { font-size: 13.8px; color: var(--ink-soft); }

/* ---------------------------- Produsen data ---------------------------- */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.org-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; display: flex; flex-direction: column; gap: 12px;
    transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.org-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.org-logo {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand-50), var(--brand-100));
    color: var(--brand-700); font-weight: 800; font-size: 17px; flex: none; overflow: hidden;
}
.org-logo img { width: 100%; height: 100%; object-fit: contain; }
.org-head { display: flex; gap: 14px; align-items: flex-start; }
.org-head h3 { font-size: 15.6px; margin: 0 0 4px; }
.org-head h3 a { color: var(--ink); }
.org-head h3 a:hover { color: var(--brand-600); }
.org-card p { font-size: 13.4px; color: var(--muted); margin: 0; flex: 1; line-height: 1.55; }
.org-stats { display: flex; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.org-stats div { flex: 1; text-align: center; }
.org-stats strong { display: block; font-size: 16.5px; font-weight: 800; color: var(--brand-600); }
.org-stats span { font-size: 11.4px; color: var(--muted); }

.org-hero {
    display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap;
    padding: clamp(22px, 3vw, 34px); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
}
.org-hero .org-logo { width: 84px; height: 84px; border-radius: 20px; font-size: 28px; }
.org-hero-body { flex: 1; min-width: 260px; }
.org-hero-body h1 { font-size: clamp(1.4rem, 2.4vw, 1.95rem); margin-bottom: .4em; }
.org-hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.4px; color: var(--muted); }
.org-hero-facts span { display: inline-flex; align-items: center; gap: 7px; }
.org-hero-facts .icon { color: var(--brand-500); }

/* ---------------------------- Regulasi ---------------------------- */
.reg-list { display: flex; flex-direction: column; gap: 14px; }
.reg-item {
    display: flex; gap: 18px; align-items: flex-start;
    padding: 20px 22px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.reg-item:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); border-color: var(--brand-100); }
.reg-item.is-priority { border-left: 4px solid var(--accent-500); background: linear-gradient(90deg, rgba(245, 165, 36, .06), transparent 40%); }
.reg-no {
    min-width: 76px; padding: 10px; text-align: center; border-radius: 12px;
    background: var(--brand-50); color: var(--brand-700);
    font: 700 13px/1.35 var(--font-mono);
}
.reg-body { flex: 1; min-width: 0; }
.reg-body h3 { font-size: 16px; margin-bottom: 6px; }
.reg-body p { font-size: 13.8px; color: var(--muted); margin: 8px 0 0; }
.reg-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.reg-download {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13.4px; font-weight: 700;
    padding: 9px 15px; border-radius: 999px; background: var(--brand-600); color: #fff;
}
.reg-download:hover { background: var(--brand-700); color: #fff; }
.reg-link {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13.4px; font-weight: 700;
    padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--ink-soft);
}
.reg-link:hover { border-color: var(--brand-500); color: var(--brand-600); }

/* ---------------------------- Insight / chart ---------------------------- */
.insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.insight-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column;
    transition: transform .2s var(--ease), box-shadow .2s;
}
.insight-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.insight-head { padding: 18px 20px 6px; }
.insight-head h3 { font-size: 15.4px; margin-bottom: 4px; }
.insight-head p { font-size: 13.2px; color: var(--muted); margin: 0; }
.insight-highlight {
    display: flex; align-items: baseline; gap: 8px; padding: 4px 20px 0;
}
.insight-highlight strong { font-size: clamp(1.5rem, 2vw, 1.9rem); font-weight: 800; color: var(--brand-600); letter-spacing: -.03em; }
.insight-highlight span { font-size: 12.6px; color: var(--muted); font-weight: 600; }
.insight-chart { padding: 12px 16px 18px; position: relative; height: 230px; }
.insight-foot { margin-top: auto; padding: 11px 20px; border-top: 1px solid var(--line); font-size: 12.2px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }

/* ---------------------------- Halaman dokumen ---------------------------- */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 34px; align-items: start; }
.doc-toc {
    position: sticky; top: calc(var(--header-h) + 16px);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 18px;
}
.doc-toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.doc-toc a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 13.6px; color: var(--ink-soft); }
.doc-toc a:hover { background: var(--brand-50); color: var(--brand-700); }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 18px; }
.step {
    position: relative; padding: 20px 22px 20px 68px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 20px; top: 20px; width: 34px; height: 34px;
    border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand-600), var(--brand-800));
    color: #fff; font-weight: 800; font-size: 15px;
}
.step h3 { font-size: 15.8px; margin-bottom: 6px; }
.step p { font-size: 14.2px; color: var(--muted); margin: 0; }

.callout {
    display: flex; gap: 13px; padding: 16px 18px; border-radius: var(--radius);
    background: var(--brand-50); border: 1px solid var(--brand-100); margin: 18px 0;
}
.callout .icon { color: var(--brand-600); margin-top: 2px; }
.callout p { margin: 0; font-size: 14.2px; color: var(--ink-soft); }
.callout.accent { background: var(--accent-100); border-color: color-mix(in srgb, var(--accent-500) 35%, transparent); }
.callout.accent .icon { color: var(--accent-600); }
.callout.danger { background: var(--danger-100); border-color: color-mix(in srgb, var(--danger-600) 30%, transparent); }
.callout.danger .icon { color: var(--danger-600); }

.endpoint {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}
.endpoint-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.method {
    font: 700 11.5px var(--font-mono); padding: 4px 10px; border-radius: 6px;
    background: var(--success-100); color: var(--success-600); letter-spacing: .06em;
}
.endpoint-path { font: 500 14.4px var(--font-mono); color: var(--ink); word-break: break-all; }
.endpoint-desc { margin-left: auto; font-size: 13px; color: var(--muted); }
.endpoint-body { padding: 16px 18px; }
.param-table { width: 100%; border-collapse: collapse; font-size: 13.6px; }
.param-table th, .param-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.param-table th { font-size: 11.6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.param-table code { font: 500 13px var(--font-mono); color: var(--brand-600); background: var(--brand-50); padding: 2px 7px; border-radius: 5px; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 26px; align-items: start; }
.info-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.info-card .ic {
    width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand-600);
}
.info-card h4 { font-size: 14.4px; margin-bottom: 3px; }
.info-card p { font-size: 13.6px; color: var(--muted); margin: 0; }

.stat-inline { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 13.6px; color: var(--muted); }
.stat-inline strong { color: var(--ink); }

/* ---------------------------- Responsive ---------------------------- */
@media (max-width: 1080px) {
    .catalog-layout, .detail-layout, .doc-layout, .contact-grid { grid-template-columns: 1fr; }
    .filter-panel, .detail-side, .doc-toc { position: static; }
    .meta-list { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .reg-item { flex-direction: column; gap: 12px; }
    .reg-no { min-width: 0; }
    .step { padding: 62px 18px 20px; }
    .endpoint-desc { margin-left: 0; width: 100%; }
}
