/*
 * Table of Contents - one design for every article.
 * Markup:
 *   <div class="eq-toc">
 *     <div class="eq-toc-head">Table of Contents</div>
 *     <nav class="eq-toc-nav" id="toc-nav"><a href="#section-id">Section title</a> ...</nav>
 *   </div>
 * The current section is highlighted by assets/js/toc.js.
 */
.eq-toc {
  --eq-toc-blue: #007cc3;
  --eq-toc-blue-pale: #f4fbff;
  --eq-toc-text: #2d3f55;
  --eq-toc-border: #dde9f3;

  position: sticky;
  top: 108px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--eq-toc-border);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 60, 120, .06);
  overflow: hidden;
  font-family: inherit;
}

.eq-toc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 20px;
  margin: 0;
  background: var(--eq-toc-blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* list icon */
.eq-toc-head::before {
  content: "";
  width: 14px;
  height: 12px;
  flex-shrink: 0;
  opacity: .85;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 50% / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 100% / 100% 2px no-repeat;
}

.eq-toc-nav {
  display: block;
  padding: 12px 0;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
}

.eq-toc-nav a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 20px;
  border-left: 3px solid transparent;
  color: var(--eq-toc-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s, background-color .2s, border-color .2s;
}

/* chevron */
.eq-toc-nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-top: 2px solid var(--eq-toc-blue);
  border-right: 2px solid var(--eq-toc-blue);
  opacity: .6;
  transform: translateY(-2px) rotate(45deg);
}

.eq-toc-nav a:hover,
.eq-toc-nav a.active {
  color: var(--eq-toc-blue);
  background: var(--eq-toc-blue-pale);
  border-left-color: var(--eq-toc-blue);
}

/* the theme's <main class="fix"> uses overflow:hidden, which stops sticky from working;
   clip hides overflow the same way without breaking it */
main.fix:has(.eq-toc) {
  overflow: clip;
}

/* some articles already make the wrapper around the TOC sticky - then the card itself stays put */
.toc-wrap > .eq-toc {
  position: static;
}

@media (max-width: 991px) {
  .eq-toc {
    position: static;
  }
  .eq-toc-nav {
    max-height: none;
  }
}

/* jumping to a section from the TOC lands below the fixed site header */
html {
  scroll-padding-top: 110px;
}

/* articles split over several full-width sections: one column for the TOC, one for all the sections */
.eq-split-article .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
