/* ============================================================
   CV page — sticky lateral table of contents
   ============================================================ */

.cv-layout {
  position: relative;
}

.cv-content {
  min-width: 0; /* allow content to shrink inside flex/grid row */
}

/* TOC wrapper -------------------------------------------------- */
.cv-toc-wrapper {
  margin-bottom: 1.5rem;
}

.cv-toc {
  font-size: 0.9rem;
  line-height: 1.4;
}

.cv-toc-details {
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  background-color: rgba(128, 128, 128, 0.04);
}

.cv-toc-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  outline: none;
  user-select: none;
}

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

.cv-toc-summary::after {
  content: "\f078"; /* fa-chevron-down */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  float: right;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  margin-top: 0.25rem;
}

.cv-toc-details[open] > .cv-toc-summary::after {
  transform: rotate(180deg);
}

/* TOC lists ---------------------------------------------------- */
.cv-toc-list,
.cv-toc-list ol {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}

.cv-toc-list ol {
  margin-top: 0.25rem;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(128, 128, 128, 0.2);
}

.cv-toc-list li {
  margin: 0.15rem 0;
}

.cv-toc-list a {
  display: block;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cv-toc-list a:hover,
.cv-toc-list a:focus {
  background-color: rgba(0, 123, 255, 0.08);
  color: #007bff;
  text-decoration: none;
}

.cv-toc-list a.is-active {
  background-color: rgba(0, 123, 255, 0.12);
  color: #007bff;
  font-weight: 600;
}

.cv-toc-label {
  display: block;
}

.cv-toc-period {
  display: block;
  font-size: 0.75rem;
  opacity: 0.65;
}

/* Desktop: sticky --------------------------------------------- */
@media (min-width: 992px) {
  .cv-toc-wrapper {
    position: sticky;
    top: 80px; /* clear navbar */
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    margin-bottom: 0;
  }

  .cv-toc-details {
    background-color: transparent;
    border: none;
    padding: 0;
  }

  .cv-toc-summary {
    margin-bottom: 0.5rem;
  }
}

/* Anchor offset so headings don't hide behind the navbar ------ */
.cv-anchor,
.timeline-item,
.cv-content [id] {
  scroll-margin-top: 80px;
}
