
/* Zyvexia — navegación lateral de páginas largas */
:root {
  --section-nav-bg: rgba(15, 18, 22, .94);
  --section-nav-border: rgba(201, 164, 78, .24);
  --section-nav-gold: #c9a44e;
  --section-nav-text: rgba(255,255,255,.72);
  --section-nav-active: #fff;
}

.page-toc {
  position: fixed;
  z-index: 40;
  left: max(10px, calc((100vw - 1180px) / 2 - 236px));
  top: 50%;
  transform: translateY(-42%);
  width: clamp(90px, calc((100vw - 1180px) / 2 - 20px), 220px);
  padding: 16px 14px;
  border: 1px solid var(--section-nav-border);
  border-radius: 12px;
  background: var(--section-nav-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
}

.page-toc__title {
  margin: 0 0 10px;
  padding: 0 6px 9px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--section-nav-gold);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

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

.page-toc__link {
  position: relative;
  display: block;
  padding: 7px 8px 7px 15px;
  color: var(--section-nav-text);
  font-size: .82rem;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 7px;
  transition: color .18s ease, background .18s ease;
}

.page-toc__link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  transform: translateY(-50%);
  transition: background .18s ease, transform .18s ease;
}

.page-toc__link:hover,
.page-toc__link:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.page-toc__link.is-active {
  color: var(--section-nav-active);
  background: rgba(201,164,78,.09);
}

.page-toc__link.is-active::before {
  background: var(--section-nav-gold);
  transform: translateY(-50%) scale(1.45);
}

.mobile-toc {
  display: none;
  margin: 18px auto 4px;
  width: min(calc(100% - 32px), 760px);
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--section-nav-border);
  border-radius: 10px;
  background: rgba(15,18,22,.95);
}

.mobile-toc summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--section-nav-gold);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  list-style: none;
  overflow-wrap: anywhere;
}

.mobile-toc summary::-webkit-details-marker { display:none; }

.mobile-toc summary::after {
  content: "+";
  float: right;
  color: rgba(255,255,255,.68);
}

.mobile-toc[open] summary::after { content: "–"; }

.mobile-toc nav {
  padding: 0 10px 10px;
}

.mobile-toc a {
  display: block;
  padding: 9px 8px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  border-top: 1px solid rgba(255,255,255,.06);
  overflow-wrap: anywhere;
}

@media (max-width: 390px) {
  .mobile-toc { width: calc(100% - 26px); }
}

.mobile-toc a.is-active {
  color: #fff;
  background: rgba(201,164,78,.08);
}

.section-anchor {
  scroll-margin-top: 96px;
}

@media (min-width: 1400px) and (max-width: 1599px) {
  .page-toc {
    padding: 10px 8px;
  }

  .page-toc__title {
    padding-inline: 3px;
    font-size: .62rem;
    letter-spacing: .07em;
  }

  .page-toc__link {
    padding: 5px 3px 5px 10px;
    font-size: .68rem;
  }

  .page-toc__link::before {
    left: 2px;
  }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .page-toc {
    left: 12px;
    top: 50%;
    width: 160px;
    max-height: calc(100vh - 98px);
    padding: 11px 9px;
    overflow-y: auto;
    transform: translateY(-42%);
  }

  .page-toc__title {
    margin-bottom: 7px;
    padding: 0 4px 7px;
    font-size: .66rem;
    line-height: 1.2;
    letter-spacing: .07em;
  }

  .page-toc__link {
    padding: 5px 4px 5px 11px;
    font-size: .72rem;
    line-height: 1.25;
  }

  .page-toc__link::before {
    left: 3px;
  }

  .page-toc + main .container,
  .page-toc + main.container,
  .page-toc ~ .article-body .container {
    width: calc(100% - 216px);
    max-width: 1180px;
    margin-left: 190px;
    margin-right: 26px;
  }
}

@media (max-width: 1023.98px) {
  .page-toc { display: none; }

  .mobile-toc {
    position: fixed;
    z-index: 49;
    top: calc(var(--header-h, 74px) + 10px);
    right: 12px;
    display: block;
    width: min(320px, calc(100% - 24px));
    max-height: calc(100vh - var(--header-h, 74px) - 22px);
    margin: 0;
    overflow-y: auto;
    box-shadow: 0 12px 36px rgba(0,0,0,.28);
  }
}
