/* ==========================================================================
   wpflow 플로팅 목차 — HeroUI Pro `floating-toc` 스타일을 바닐라로 복제
   막대(bar) 묶음 → 호버/탭 시 라벨 패널이 펼쳐지고, 현재 섹션이 강조됨
   ========================================================================== */

:root {
  --wf-toc-accent: #3182f6;
  --wf-toc-muted: #c9cdd2;
}

/* 앵커 이동 시 제목이 상단 고정 헤더에 가리지 않도록 */
.single-content h2[id],
.entry-content h2[id],
.post-content h2[id] {
  scroll-margin-top: 90px;
}

.wf-toc {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: none; /* 기본 숨김, 넓은 화면에서만 노출 */
}

@media (min-width: 1100px) {
  .wf-toc {
    display: block;
  }
}

/* ===== 막대 트리거 ===== */
.wf-toc__trigger {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* 오른쪽 패딩 = 막대에서 패널로 마우스가 건너갈 때 hover가 끊기지 않게 하는 다리 */
  padding: 16px 30px 16px 6px;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.wf-toc__bar {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--wf-toc-muted);
  transition: width 0.2s ease, background 0.2s ease;
}

.wf-toc__bar.is-active {
  width: 26px;
  background: var(--wf-toc-accent);
}

/* ===== 펼침 패널 ===== */
.wf-toc__panel {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  min-width: 200px;
  max-width: 300px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #eff0f2;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wf-toc:hover .wf-toc__panel,
.wf-toc.is-open .wf-toc__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.wf-toc__title {
  display: block;
  padding: 6px 12px 8px;
  font-size: 1.152rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8b95a1;
}

.wf-toc__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  margin: 1px 0;
  border: 0;
  border-radius: 9px;
  background: none;
  font-family: inherit;
  font-size: 1.472rem;
  line-height: 1.45;
  color: #4e5968;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wf-toc__item:hover {
  background: #f2f4f6;
}

.wf-toc__item.is-active {
  color: var(--wf-toc-accent);
  font-weight: 700;
}
