/* Haijun Platform — lapisan UI kustom di atas CSS asli docs (Mintlify/Tailwind) */
/* Palet Haijun: beige ikon brand #c7beaa; di latar terang link memakai varian
   gelap #7a6f4e agar kontras tetap >= 4.5:1 (WCAG AA). */
:root { --hj-accent: #7a6f4e; --hj-accent-strong: #c7beaa; }

/* ---- dasar: font & warna utk shell build-md ---- */
html, body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { background: var(--cds-surface-1, #fff); color: #1a1a1a; }
.dark body { background: #161616; color: #efeeec; }
html[data-mode="dark"] body { background: #161616; color: #efeeec; }
html[data-mode="light"] body { background: var(--cds-surface-1, #fff); color: #1a1a1a; }

/* placeholder utk gambar konten yang hilang dari origin */
.hj-img-missing {
  margin: 1rem 0; padding: .8rem 1rem; border: 1px dashed rgb(0 0 0 / .25);
  border-radius: 8px; color: rgb(0 0 0 / .55); font-size: .9em; background: rgb(0 0 0 / .03);
}
html[data-mode="dark"] .hj-img-missing { border-color: rgb(255 255 255 / .25); color: rgb(255 255 255 / .55); background: rgb(255 255 255 / .05); }
.hj-article img { max-width: 100%; height: auto; }
.hj-article pre code { white-space: pre; }
.hj-article ul, .hj-article ol { padding-left: 1.4rem; margin: .6rem 0; }
.hj-article li { margin: .25rem 0; }
.hj-article h2, .hj-article h3, .hj-article h4 { scroll-margin-top: 4.5rem; }
.hj-article a { text-underline-offset: 2px; }
.hj-article hr { border: none; border-top: 1px solid rgb(0 0 0 / .12); margin: 1.5rem 0; }
.dark .hj-article hr { border-top-color: rgb(255 255 255 / .14); }
.dark .hj-tablewrap th, .dark .hj-tablewrap td { color: #efeeec; }
.hj-code pre, .hj-code pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* brand di header docs */
.hj-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em;
  color: inherit; text-decoration: none; white-space: nowrap;
}
.hj-brand img { width: 26px; height: 26px; border-radius: 6px; }

/* tombol hamburger sidebar mobile */
.hj-burger { display: none; }
@media (max-width: 1023px) {
  .hj-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin-right: .5rem;
    border: 1px solid rgb(0 0 0 / .12); border-radius: 8px;
    background: transparent; cursor: pointer; color: inherit;
  }
  .dark .hj-burger { border-color: rgb(255 255 255 / .18); }
  aside[id] { display: none; }
  aside[id].hj-open { display: flex; position: fixed; z-index: 60; inset: 3.5rem 0 0 0; width: 100%; max-width: 20rem; background: var(--bg, #fff); overflow-y: auto; }
  .dark aside[id].hj-open { background: #0f0f0f; }
  .hj-backdrop {
    position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .45);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .hj-backdrop.hj-show { opacity: 1; pointer-events: auto; }
}

/* tombol tema */
.hj-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; color: inherit; font-size: 15px; line-height: 1;
}
.hj-theme:hover { background: rgb(0 0 0 / .06); }
.dark .hj-theme:hover { background: rgb(255 255 255 / .1); }

/* modal pencarian */
.hj-modal {
  position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem;
  background: rgb(0 0 0 / .5);
}
.hj-modal[hidden] { display: none; }
.hj-box {
  width: 100%; max-width: 36rem; background: #fff; color: #111;
  border-radius: 14px; box-shadow: 0 24px 64px rgb(0 0 0 / .35);
  overflow: hidden;
}
.dark .hj-box { background: #1a1a1a; color: #eee; }
.hj-box input {
  width: 100%; border: none; outline: none; padding: 1rem 1.15rem;
  font-size: 1rem; background: transparent; color: inherit;
  border-bottom: 1px solid rgb(0 0 0 / .08);
}
.dark .hj-box input { border-bottom-color: rgb(255 255 255 / .12); }
.hj-results { max-height: 46vh; overflow-y: auto; padding: .35rem; }
.hj-results a {
  display: block; padding: .55rem .8rem; border-radius: 8px;
  color: inherit; text-decoration: none; font-size: .92rem;
}
.hj-results a:hover, .hj-results a.sel { background: rgb(217 119 87 / .12); }
.hj-results .r { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .55; margin-left: .4rem; }
.hj-empty { padding: 1.4rem; text-align: center; opacity: .6; font-size: .9rem; }
.hj-hint {
  display: flex; gap: .8rem; padding: .55rem .95rem; font-size: .72rem;
  opacity: .55; border-top: 1px solid rgb(0 0 0 / .08);
}
.dark .hj-hint { border-top-color: rgb(255 255 255 / .12); }
.hj-hint kbd {
  border: 1px solid rgb(0 0 0 / .2); border-radius: 4px; padding: 0 .3em;
  font-family: inherit; font-size: .9em;
}
.dark .hj-hint kbd { border-color: rgb(255 255 255 / .25); }

/* mark hasil */
.hj-results mark { background: rgb(217 119 87 / .3); color: inherit; border-radius: 2px; }

/* ================= layout docs (build-md) ================= */
.hj-header {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; height: 3.5rem; padding: 0 1.25rem;
  border-bottom: 1px solid rgb(0 0 0 / .08); background: var(--cds-surface-1, #fff);
}
.dark .hj-header { border-bottom-color: rgb(255 255 255 / .1); background: #161616; }
.hj-topnav { display: flex; gap: 1rem; }
.hj-topnav a { color: inherit; opacity: .75; text-decoration: none; font-size: .92rem; }
.hj-topnav a:hover { opacity: 1; }
.hj-head-actions { display: flex; align-items: center; gap: .5rem; }
.hj-lang { font-size: .8rem; opacity: .7; text-decoration: none; color: inherit; }
.hj-lang:hover { opacity: 1; }

.hj-layout {
  display: flex; align-items: flex-start;
  max-width: 90rem; margin: 0 auto; padding: 0 1.25rem;
}
.hj-sidebar {
  position: sticky; top: 3.5rem; flex: 0 0 17rem; max-height: calc(100vh - 3.5rem);
  overflow-y: auto; padding: 1.25rem .75rem 3rem; border-right: 1px solid rgb(0 0 0 / .06);
}
.dark .hj-sidebar { border-right-color: rgb(255 255 255 / .08); }
.hj-side-search { margin-bottom: 1rem; }
.hj-side-search .hj-searchbtn { width: 100%; }
.hj-nav-group { margin-bottom: 1.1rem; }
.hj-nav-head { font-weight: 600; font-size: .82rem; margin-bottom: .35rem; }
.hj-nav-link {
  display: block; padding: .28rem .6rem; border-radius: 6px; font-size: .88rem;
  color: inherit; opacity: .78; text-decoration: none;
}
.hj-nav-link:hover { opacity: 1; background: rgb(0 0 0 / .05); }
.dark .hj-nav-link:hover { background: rgb(255 255 255 / .07); }
.hj-nav-link.hj-active { opacity: 1; font-weight: 600; background: rgb(217 119 87 / .12); }

.hj-main { flex: 1 1 auto; min-width: 0; }
.hj-article { max-width: 46rem; padding: 2.25rem 1rem 4rem; }
.hj-article h1 { font-size: 2rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1.25rem; }
.hj-article h2 { font-size: 1.4rem; font-weight: 600; margin: 2rem 0 .75rem; }
.hj-article h3 { font-size: 1.12rem; font-weight: 600; margin: 1.5rem 0 .6rem; }
.hj-article p, .hj-article li { line-height: 1.7; }
.hj-article a { color: var(--hj-accent); }
.dark .hj-article a, html[data-mode="dark"] .hj-article a { color: var(--hj-accent-strong); }
.hj-anchor { opacity: 0; text-decoration: none; margin-left: .35rem; }
.hj-article h2:hover .hj-anchor, .hj-article h3:hover .hj-anchor { opacity: .5; }

.hj-code { border: 1px solid rgb(0 0 0 / .1); border-radius: 10px; overflow: hidden; margin: 1rem 0; }
.dark .hj-code { border-color: rgb(255 255 255 / .12); }
.hj-code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .35rem .75rem; font-size: .75rem; opacity: .75;
  border-bottom: 1px solid rgb(0 0 0 / .08); background: rgb(0 0 0 / .03);
}
.dark .hj-code-head { border-bottom-color: rgb(255 255 255 / .08); background: rgb(255 255 255 / .04); }
.hj-copy { border: none; background: transparent; cursor: pointer; font-size: .72rem; color: inherit; }
.hj-code pre { margin: 0; padding: .9rem 1rem; overflow-x: auto; font-size: .84rem; line-height: 1.55; }

.hj-tablewrap { overflow-x: auto; margin: 1rem 0; }
.hj-tablewrap table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.hj-tablewrap th, .hj-tablewrap td { border: 1px solid rgb(0 0 0 / .12); padding: .45rem .7rem; text-align: left; }
.dark .hj-tablewrap th, .dark .hj-tablewrap td { border-color: rgb(255 255 255 / .14); }
.hj-tablewrap th { background: rgb(0 0 0 / .04); }
.dark .hj-tablewrap th { background: rgb(255 255 255 / .05); }

.hj-article blockquote {
  margin: 1rem 0; padding: .7rem 1rem; border-left: 3px solid var(--hj-accent-strong);
  background: rgb(199 190 170 / .12); border-radius: 0 8px 8px 0;
}

.hj-toc {
  position: sticky; top: 3.5rem; flex: 0 0 14rem; max-height: calc(100vh - 3.5rem);
  overflow-y: auto; padding: 2rem .5rem; font-size: .82rem;
}
.hj-toc-head { font-weight: 600; margin-bottom: .5rem; }
.hj-toc a { display: block; color: inherit; opacity: .7; text-decoration: none; padding: .18rem 0; }
.hj-toc a:hover { opacity: 1; }
.hj-toc-l3 { padding-left: .8rem; }
.hj-toc-l4 { padding-left: 1.6rem; }

.hj-footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  max-width: 90rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid rgb(0 0 0 / .08); font-size: .85rem; opacity: .8;
}
.dark .hj-footer { border-top-color: rgb(255 255 255 / .1); }
.hj-foot-links { display: flex; gap: 1rem; }
.hj-foot-links a { color: inherit; }

.hj-searchbtn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem;
  border: 1px solid rgb(0 0 0 / .14); border-radius: 8px; background: transparent;
  color: inherit; font-size: .82rem; cursor: pointer;
}
.dark .hj-searchbtn { border-color: rgb(255 255 255 / .18); }
.hj-searchbtn kbd {
  border: 1px solid rgb(0 0 0 / .2); border-radius: 4px; padding: 0 .25em; font-size: .72rem;
}
.dark .hj-searchbtn kbd { border-color: rgb(255 255 255 / .25); }

.hj-landing { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hj-landing-box { text-align: center; padding: 2rem; }
.hj-landing-box h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.hj-landing-links { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; }
.hj-btn {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 9px; text-decoration: none;
  border: 1px solid rgb(0 0 0 / .16); color: inherit; font-size: .95rem;
}
.dark .hj-btn { border-color: rgb(255 255 255 / .2); }
.hj-btn-primary { background: var(--hj-accent); border-color: var(--hj-accent); color: #fff; }

@media (max-width: 1023px) {
  .hj-sidebar { display: none; }
  .hj-sidebar.hj-open {
    display: block; position: fixed; z-index: 60; top: 3.5rem; left: 0; bottom: 0;
    width: min(20rem, 85vw); background: var(--cds-surface-1, #fff);
  }
  .dark .hj-sidebar.hj-open { background: #161616; }
  .hj-toc { display: none; }
  .hj-topnav { display: none; }
}

/* sitemap */
.hj-sitemap {
  max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem 5rem;
  columns: 3; column-gap: 2.5rem;
}
@media (max-width: 900px) { .hj-sitemap { columns: 2; } }
@media (max-width: 560px) { .hj-sitemap { columns: 1; } }
.hj-sitemap h2 {
  font-size: .95rem; font-weight: 600; margin: 0 0 .5rem;
  break-inside: avoid; padding-top: .75rem;
}
.hj-sitemap ul { list-style: none; margin: 0 0 1.4rem; padding: 0; break-inside: avoid; }
.hj-sitemap li { margin: .2rem 0; font-size: .85rem; }
.hj-sitemap a { color: inherit; opacity: .75; text-decoration: none; }
.hj-sitemap a:hover { opacity: 1; text-decoration: underline; }
