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

.toc {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 8px;
  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;
  list-style-type: none;
}

.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: #FF5D01;
}

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

.toc--mobile {
  margin: 0 0 24px;
  width: 100%;
  position: static;
  background: #fafafa;
  border: 1px solid #e0e0e0;
}

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

.toc--desktop {
  width: 300px;
  float: right;
  clear: right;
  margin-left: 0;
  margin-top: 0;
  margin-bottom: 1.5rem;
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  align-self: start;
  background-image: linear-gradient(
    to bottom,
    rgba(255, 93, 1, 0.08),
    transparent
  );
  z-index: 100;  /* add this so it stays above content when fixed */
}

/* 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: #FF5D01;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.toc-toggle:hover {
  color: #cc4a00;
}

.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);
}
