/* ===========================
   TABLE OF CONTENTS — SHARED
   =========================== */

.toc {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  padding: 20px 24px;
  box-sizing: border-box;
}

.toc-title {
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  color: #333;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin: 0;
  padding: 0;
}

.toc-item.toc-level-2 {
  padding-left: 0;
  font-size: 14px;
}

.toc-item.toc-level-3 {
  padding-left: 12px;
  font-size: 13px;
}

.toc-link {
  display: block;
  padding: 4px 0;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: 12px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-link:hover {
  color: #111;
  border-left-color: #ccc;
}

.toc-link--active {
  color: #111;
  font-weight: 600;
  border-left-color: #1EBFBF;
}

/* ===========================
   MOBILE  (≤ 1400px)
   =========================== */

.toc--mobile {
  margin: 16px 10px 24px 0px;
  width: 100%;
  position: static;
}

/* ===========================
   DESKTOP  (> 1400px)
   =========================== */

/* Flex layout so TOC and article share space */
@media (min-width: 1401px) {
  .container-article.section-article {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    overflow: visible;
  }

  .container.section-article > .article {
    flex: 1;
    min-width: 0;
  }
}

.toc-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: relative;
}

.toc--desktop {
  position: fixed;
  top: 180px;
  width: 320px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.toc--desktop::-webkit-scrollbar {
  width: 4px;
}

.toc--desktop::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Expandable TOC */
.toc-item--hidden {
  display: none;
}

.toc-item--hidden.toc-item--visible {
  display: list-item;
}

.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  color: #1EBFBF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.toc-toggle:hover {
  color: #144a75;
}

.toc-toggle-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.25s ease;
}

.toc-toggle.is-expanded .toc-toggle-arrow {
  transform: rotate(180deg);
}
