
/* ===== TOC Container ===== */
.hover-toc-wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

/* ===== TOC Box ===== */
.hover-toc-block {
  position: relative;
  width: 14px;
  height: 14px;
  background-color: #555555;
  color: #fff;
  border-radius: 2px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

/* Hover effect on desktop */
.hover-toc-block:hover {
  background-color: #F2A11F;
  color: #000;
}

/* ===== Tooltip Base Style ===== */
.hover-label {
  background-color: #F2F1F0;
  color: #000;
  padding: 12px 19px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

/* ===== Desktop: Hover shows tooltip to right ===== */
@media (hover: hover) {
  .hover-label {
    display: block;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 110%;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
  }

  .hover-toc-block:hover .hover-label {
    visibility: visible;
    opacity: 1;
  }
}

/* ===== Mobile: Horizontal TOC + Click to toggle tooltip ===== */
@media (hover: none), (max-width: 768px) {
  .hover-toc-wrap {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
  }

  .hover-toc-block {
    width: 44px;
    height: 44px;
  }

  .hover-label {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    white-space: normal;
    max-width: 220px;
    pointer-events: none;
    text-align: center;
    z-index: 10;
  }

  .hover-label.visible {
    display: block;
    visibility: visible;
    opacity: 1;
  }

  .hover-toc-block:hover .hover-label {
    visibility: hidden;
    opacity: 0;
  }
}
