/* ============================================
   LYNKVA — kb.css
   Panduan penggunaan (knowledge base), layout
   mirrors lumirahealth.co.id/knowledge-base
   with the landing design system
   ============================================ */

/* ---------- Hero ---------- */
.kb-hero {
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.kb-eyebrow {
  display: inline-block;
  margin-bottom: 1.2rem;
  padding: 0.375rem 1rem;
  border-radius: var(--r-pill);
  background: var(--pill-gray);
  font-size: var(--t-small);
  color: var(--text-gray-2);
}

.kb-hero .display + p {
  margin-top: 1.2rem;
  font-size: var(--t-feature);
  color: var(--text-gray);
}

/* ---------- Two-column layout ---------- */
.kb {
  display: grid;
  grid-template-columns: 15.625rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

/* sticky glossary index */
.kb-nav {
  position: sticky;
  top: 6rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 7.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* search box above the sections */
.kb-search-wrap {
  position: relative;
  margin-bottom: 1.4rem;
}

.kb-search-icon {
  position: absolute;
  left: 0.8125rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.0625rem;
  height: 1.0625rem;
  color: var(--text-gray);
  fill: currentColor;
  pointer-events: none;
}

.kb-search {
  width: 100%;
  padding: 0.62rem 0.9rem 0.62rem 2.35rem;
  border: 0.0625rem solid transparent;
  border-radius: var(--r-pill);
  background: var(--card-gray);
  font: inherit;
  font-size: var(--t-small);
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.kb-search::placeholder {
  color: var(--text-gray);
}

.kb-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.kb-search:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.14);
}

.kb-nav .label {
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-gray);
  margin-bottom: 0.8rem;
}

/* duotone caret (Phosphor CaretDown) */
.kb-caret {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-gray-2);
  fill: currentColor;
  transition: transform 0.25s ease;
}

.kb-nav-sec.is-open .kb-nav-top .kb-caret,
.kb-art.is-open .kb-art-head .kb-caret {
  transform: rotate(180deg);
}

/* section group (collapsible accordion) */
.kb-nav-sec {
  margin-bottom: 0.35rem;
}

.kb-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  width: 100%;
  padding-block: 0.42rem;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.kb-nav-top-label {
  display: flex;
  gap: 0.7rem;
}

.kb-nav-top b {
  font-weight: 400;
  color: var(--head-gray);
  font-variant-numeric: tabular-nums;
}

/* nested article links — collapse via grid-rows trick */
.kb-nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.kb-nav-sec.is-open .kb-nav-sub,
.kb-nav.searching .kb-nav-sub {
  grid-template-rows: 1fr;
}

.kb-nav-sub-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-left: 0.35rem;
  border-left: 0.0625rem solid rgba(0, 0, 0, 0.09);
}

.kb-nav-sub a {
  padding: 0.3rem 0 0.3rem 0.85rem;
  margin-left: -0.0625rem;
  border-left: 0.0625rem solid transparent;
  font-size: var(--t-small);
  line-height: 1.4;
  color: var(--text-gray-2);
  transition: color 0.2s, border-color 0.2s;
}

.kb-nav-sub a:hover {
  color: var(--ink);
  border-left-color: var(--accent);
}

/* empty search state */
.kb-empty {
  padding: 2rem 0;
  font-size: var(--t-body);
  color: var(--text-gray);
}

/* ---------- Section (divider-separated) ---------- */
.kb-cat {
  border-top: 0.0625rem solid rgba(0, 0, 0, 0.12);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  scroll-margin-top: 6rem;
}

.kb-cat:first-child {
  border-top: none;
  padding-top: 0;
}

.kb-cat-num {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.kb-cat h2 {
  margin-top: 0.5rem;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  letter-spacing: -0.02em;
}

.kb-cat-desc {
  margin-top: 0.7rem;
  max-width: 58ch;
  font-size: var(--t-feature);
  line-height: 1.5;
  color: var(--text-gray);
  text-wrap: pretty;
}

/* ---------- Article (collapsible accordion) ---------- */
.kb-art {
  max-width: 42.5rem;
  border-top: 0.0625rem solid rgba(0, 0, 0, 0.08);
  scroll-margin-top: 6rem;
}

.kb-art:first-of-type {
  border-top: 0;
}

.kb-art-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.95rem 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.kb-art-h {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-weight: 500;
  color: var(--ink);
}

.kb-art-h b {
  font-weight: 400;
  color: var(--head-gray);
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.kb-art-head:hover .kb-art-h {
  color: var(--text-gray-2);
}

/* body collapse via grid-rows trick */
.kb-art-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.kb-art.is-open .kb-art-body {
  grid-template-rows: 1fr;
}

.kb-art-body-inner {
  overflow: hidden;
}

.kb-art.is-open .kb-art-body-inner {
  padding-bottom: 1.7rem;
}

.kb-art-sum {
  margin-top: 0;
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--text-gray);
}

.kb-who {
  margin-top: 1rem;
  font-size: var(--t-small);
  color: var(--text-gray-2);
}

.kb-who b {
  font-weight: 500;
  color: var(--ink-2);
  margin-right: 0.4rem;
}

/* steps */
.kb-steps {
  margin-top: 1.1rem;
}

.kb-steps .label,
.kb-note .label {
  display: block;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.kb-steps ol {
  list-style: none;
  counter-reset: kbstep;
  display: grid;
  gap: 0.45rem;
}

.kb-steps ol li {
  counter-increment: kbstep;
  position: relative;
  padding-left: 2rem;
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink-2);
}

.kb-steps ol li::before {
  content: counter(kbstep);
  position: absolute;
  left: 0;
  top: 0.14em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--pill-gray);
  color: var(--text-gray-2);
  font-size: 0.71875rem;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

/* good-to-know box */
.kb-note {
  margin-top: 1.1rem;
  background: var(--card-gray);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
}

.kb-note ul {
  display: grid;
  gap: 0.4rem;
}

.kb-note ul li {
  position: relative;
  padding-left: 1.1rem;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--text-gray-2);
}

.kb-note ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: var(--text-gray);
}

/* ---------- Responsive ---------- */
@media (max-width: 55rem) {
  .kb {
    grid-template-columns: 1fr;
  }

  .kb-nav {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 1.5rem;
  }
}
