/* ==========================================================================
   article.css — halaman artikel & indeks.
   Menumpang token dari style.css (--green, --ink, --fd, --fm, dst).
   ========================================================================== */

.post-inner,
.idx-inner { max-width: 760px; padding-top: 34px; padding-bottom: 76px; }

/* ---------- breadcrumb ---------- */
.crumb {
  font-family: var(--fm);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 26px;
}
.crumb a { color: var(--slate); border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.crumb a:hover { color: var(--green); border-bottom-color: var(--green); }
.crumb span[aria-current] { color: var(--ink-2); }

/* ---------- kepala artikel ---------- */
.post-kicker {
  display: inline-block;
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}
.post-head h1,
.idx-head h1 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 43px);
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 16px;
}
.post-lede {
  font-size: 18.5px;
  line-height: 1.58;
  color: var(--ink-2);
  margin-bottom: 20px;
}
.post-meta {
  font-family: var(--fm);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

/* ---------- daftar isi ---------- */
.toc {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 30px 0 8px;
}
.toc-title {
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 12px;
}
.toc ol { counter-reset: toc; list-style: none; display: grid; gap: 7px; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--fm);
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 3px;
}
/* Judul yang sudah bernomor sendiri: jangan diberi nomor lagi. */
.toc-plain li { grid-template-columns: 1fr; }
.toc-plain li::before { content: none; }

.toc a {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--green); border-bottom-color: var(--green); }

/* ---------- badan artikel ---------- */
.post-body { padding-top: 14px; font-size: 17px; line-height: 1.72; color: var(--text); }
.post-body > * + * { margin-top: 20px; }

.post-body h2 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.24;
  letter-spacing: -.018em;
  color: var(--ink);
  margin-top: 50px;
  padding-top: 4px;
  scroll-margin-top: 84px;
  text-wrap: balance;
}
.post-body h3 {
  font-family: var(--fd);
  font-weight: 600;
  font-size: 19.5px;
  line-height: 1.32;
  color: var(--ink);
  margin-top: 34px;
  scroll-margin-top: 84px;
}
.post-body p { margin-top: 18px; }
.post-body strong { color: var(--ink-2); font-weight: 600; }
.post-body a {
  color: var(--green-deep);
  border-bottom: 1px solid rgba(21, 160, 107, .38);
  transition: border-color .15s;
}
.post-body a:hover { border-bottom-color: var(--green); }
.post-body a:focus-visible,
.toc a:focus-visible,
.crumb a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px; }

.post-body ul,
.post-body ol { padding-left: 0; display: grid; gap: 10px; }
.post-body ul li { list-style: none; position: relative; padding-left: 22px; }
.post-body ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.post-body ol { counter-reset: li; }
.post-body ol li { list-style: none; counter-increment: li; position: relative; padding-left: 30px; }
.post-body ol li::before {
  content: counter(li) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--fm);
  font-size: 14px;
  color: var(--green);
}
.post-body li ul,
.post-body li ol { margin-top: 10px; }

/* kode */
.post-body code {
  font-family: var(--fm);
  font-size: .87em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1.5px 5px;
  border-radius: 5px;
  color: var(--ink-2);
  word-break: break-word;
}
.post-body pre {
  background: var(--term-bg);
  color: #D6E2F0;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--fm);
  font-size: 13.5px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  word-break: normal;
}
.post-body pre .c { color: #6E8199; }        /* komentar */
.post-body pre .k { color: #6FD7A8; }        /* perintah / kunci */
.post-body pre .s { color: #F0C987; }        /* string */
.post-body pre .o { color: #7FD1D1; }        /* output / nilai */
.post-body pre .e { color: #F79B7D; }        /* error */

.code-label {
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: -12px;
}

/* tabel */
.post-body .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
.post-body th {
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 400;
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.post-body td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text);
}
.post-body td:first-child { color: var(--ink-2); font-weight: 500; }

/* callout */
.post-body .box {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  font-size: 16px;
}
.post-body .box > * + * { margin-top: 12px; }
.post-body .box p:first-child { margin-top: 0; }
.post-body .box.warn { border-left-color: var(--amber); }
.post-body .box.stop { border-left-color: var(--coral); }
.post-body .box-t {
  font-family: var(--fd);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.post-body blockquote {
  border-left: 3px solid var(--line-2);
  padding-left: 20px;
  color: var(--slate);
  font-style: italic;
}

.post-body hr { border: 0; border-top: 1px solid var(--line); margin-top: 40px; }

/* ---------- artikel terkait ---------- */
.related { margin-top: 58px; padding-top: 30px; border-top: 1px solid var(--line); }
.rel-head {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 18px;
}
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rel-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
.rel-card:hover { border-color: var(--green); transform: translateY(-2px); }
.rel-card:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.rel-kicker {
  font-family: var(--fm);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rel-title {
  font-family: var(--fd);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.36;
  color: var(--ink);
}

/* ---------- halaman indeks ---------- */
.idx-head { padding-bottom: 34px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.idx-group { margin-top: 46px; }
.idx-group h2 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 4px;
}
.idx-list { display: grid; }
.idx-list li { border-bottom: 1px solid var(--line); }
.idx-list a { display: grid; gap: 5px; padding: 18px 0; transition: padding-left .18s; }
.idx-list a:hover { padding-left: 10px; }
.idx-list a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 3px; }
.idx-title {
  font-family: var(--fd);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.34;
  color: var(--ink);
  text-wrap: balance;
}
.idx-list a:hover .idx-title { color: var(--green-deep); }
.idx-desc { font-size: 15px; line-height: 1.55; color: var(--slate); }

@media (max-width: 640px) {
  .post-inner, .idx-inner { padding-top: 22px; }
  .post-body { font-size: 16.5px; }
  .post-body h2 { font-size: 23px; margin-top: 42px; }
  .post-body pre { font-size: 12.5px; padding: 15px 16px; border-radius: 8px; }
  .toc { padding: 17px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .rel-card, .idx-list a { transition: none; }
}
