/* ═══════════════════════════════════════════════════════════════
   SimApt — Legal Pages Index (Privacy Policy / Terms and Conditions)
   Table of contents built from the CMS content's <h3> headings
   ═══════════════════════════════════════════════════════════════ */

.legal-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.legal-index {
  flex: 0 0 260px;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--si-white, #ffffff);
  border: 1px solid var(--si-light, #e5e7eb);
  border-radius: 10px;
  padding: 18px 0;
}

.legal-index[hidden] {
  display: none;
}

.legal-index-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0 20px 12px;
  border: 0;
  border-bottom: 1px solid var(--si-light, #e5e7eb);
  background: transparent;
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--si-green-900, #0b4a1d);
  text-align: left;
  cursor: default;
}

.legal-index-title .fa {
  display: none;
  transition: transform 0.2s ease;
}

.legal-index-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  counter-reset: legal-index;
}

.legal-index-list li {
  margin: 0;
  counter-increment: legal-index;
}

.legal-index-list a {
  display: flex;
  gap: 8px;
  padding: 7px 20px 7px 17px;
  border-left: 3px solid transparent;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--si-dark, #374151);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.legal-index-list a::before {
  content: counter(legal-index) ".";
  flex: 0 0 auto;
  min-width: 18px;
  color: var(--si-neutral, #6b7280);
}

.legal-index-list a:hover,
.legal-index-list a:focus {
  color: var(--si-green-700, #117a32);
  background-color: var(--si-green-100, #e8fbe5);
  text-decoration: none;
}

.legal-index-list a.active {
  color: var(--si-green-700, #117a32);
  border-left-color: var(--si-green-700, #117a32);
  background-color: var(--si-green-100, #e8fbe5);
  font-weight: 600;
}

.legal-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Tablet / Mobile: index becomes a collapsible box above the content ── */
@media screen and (max-width: 991px) {
  .legal-layout {
    flex-direction: column;
    gap: 20px;
  }

  .legal-index {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
    padding: 14px 0;
  }

  .legal-index-title {
    padding-bottom: 0;
    border-bottom: 0;
    cursor: pointer;
  }

  .legal-index-title .fa {
    display: inline-block;
  }

  .legal-index.open .legal-index-title {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--si-light, #e5e7eb);
  }

  .legal-index.open .legal-index-title .fa {
    transform: rotate(180deg);
  }

  .legal-index-list {
    display: none;
  }

  .legal-index.open .legal-index-list {
    display: block;
  }
}
