/* LOA TOC Fixer — Table of Contents Styles */

.loa-toc {
  background: #FFFFFF;
  border: 1px solid #E2D9CC;
  border-left: 4px solid #C9A84C;
  border-radius: 0 6px 6px 0;
  margin: 0 0 2rem;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
}

/* Header */
.loa-toc__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #0F1F3D;
  cursor: pointer;
  user-select: none;
}
.loa-toc__icon { color: #C9A84C; flex-shrink: 0; display: flex; }
.loa-toc__title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #FAF8F4;
  flex: 1;
}
.loa-toc__count {
  font-size: .7rem;
  color: rgba(201,168,76,.65);
  font-weight: 600;
}
.loa-toc__toggle {
  background: none;
  border: none;
  color: rgba(250,248,244,.5);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color .2s, transform .2s;
  min-height: auto;
}
.loa-toc__toggle:hover { color: #C9A84C; }
.loa-toc__toggle.collapsed { transform: rotate(180deg); }

/* List */
.loa-toc__list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  transition: max-height .3s ease, opacity .2s;
  max-height: 2000px;
  overflow: hidden;
}
.loa-toc__list.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

/* Sub-list (H3s) */
.loa-toc__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.loa-toc__sub .loa-toc__link {
  padding-left: 40px;
  font-size: .78rem;
  color: #8A95A3;
}
.loa-toc__sub .loa-toc__link:hover { color: #7A5E10; }
.loa-toc__sub .loa-toc__link::before { content: '↳'; margin-right: 6px; color: #C9A84C; opacity: .6; }

/* Items */
.loa-toc__item { margin: 0; }

.loa-toc__link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 16px;
  color: #1A1A2E;
  text-decoration: none;
  font-size: .825rem;
  font-weight: 500;
  line-height: 1.4;
  transition: background .15s, color .15s, padding .15s;
  position: relative;
}
.loa-toc__link:hover {
  background: #F2EDE4;
  color: #7A5E10;
  padding-left: 20px;
}
.loa-toc__link.active {
  background: rgba(201,168,76,.08);
  color: #7A5E10;
  font-weight: 700;
}
.loa-toc__link.active .loa-toc__num { color: #C9A84C; }

.loa-toc__num {
  font-size: .7rem;
  font-weight: 800;
  color: #C9A84C;
  min-width: 18px;
  flex-shrink: 0;
  opacity: .7;
}

.loa-toc__text { flex: 1; }

/* Progress bar inside link */
.loa-toc__progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(201,168,76,.12);
  transition: width .3s linear;
  pointer-events: none;
  z-index: 0;
}
.loa-toc__link > * { position: relative; z-index: 1; }

/* Footer */
.loa-toc__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid #EAE2D8;
  font-size: .75rem;
  color: #8A95A3;
  font-family: 'Montserrat', sans-serif;
}

/* Mobile — collapsed by default */
@media (max-width: 768px) {
  .loa-toc {
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
  }
  .loa-toc__title { font-size: .7rem; }
  .loa-toc__link { font-size: .8rem; padding: 8px 14px; }
  .loa-toc__list.mobile-collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }
}

/* Smooth active state transition */
.loa-toc__item { transition: opacity .2s; }
