/* ===== Legal Pages Stylesheet ===== */

.legal-page {
  background-color: #FFFFFF;
  padding-top: 68px;
}

/* Scope isolation: prevent homepage section styles from leaking */
.legal-page section {
  background-color: transparent !important;
  color: #2A2A2A !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===== Legal Page Layout ===== */
.legal-page .legal-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 68px);
}

/* ===== Table of Contents ===== */
.legal-toc {
  padding: 40px 28px 40px 0;
  position: sticky;
  top: 108px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  border-right: 1px solid #E8E2D8;
}

.legal-toc h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E1B2E;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #D4956A;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc-counter;
}

.legal-toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 6px;
}

.legal-toc ol li a {
  display: block;
  padding: 7px 12px;
  font-size: 0.88rem;
  color: #4A4A4A;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.legal-toc ol li a::before {
  content: counter(toc-counter) ". ";
  color: #D4956A;
  font-weight: 700;
  font-size: 0.82rem;
}

.legal-toc ol li a:hover {
  background-color: #F8F4EE;
  color: #1E1B2E;
}

/* ===== Legal Main Content ===== */
.legal-main {
  padding: 56px 0 56px 48px;
  max-width: 780px;
}

.legal-main .page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1E1B2E;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.legal-main .effective-date {
  display: inline-block;
  color: #508070;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 40px;
  padding: 4px 12px;
  background-color: #F0EBE0;
  border-radius: 4px;
}

.legal-main .legal-intro {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #F0EBE0;
}

.legal-main .legal-intro p {
  color: #4A4A4A;
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-main section {
  margin-bottom: 36px;
  scroll-margin-top: 100px;
}

.legal-main section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1E1B2E;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0EBE0;
}

.legal-main section h2 .section-num {
  color: #D4956A;
  margin-right: 8px;
}

.legal-main section p {
  color: #4A4A4A;
  font-size: 0.98rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-main section ul {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal-main section ul li {
  color: #4A4A4A;
  font-size: 0.98rem;
  line-height: 1.8;
  margin-bottom: 6px;
}

.legal-main section ul li ul {
  list-style: circle;
  margin-top: 6px;
  margin-bottom: 0;
}

/* ===== Back to Home Link ===== */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #D4956A;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 36px;
  transition: color 0.25s ease;
}

.back-home:hover {
  color: #508070;
}

/* ===== Legal Page Footer ===== */
.legal-page-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 2px solid #F0EBE0;
  text-align: center;
}

.legal-page-footer p {
  color: #8B8B8B;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.legal-page-footer a {
  color: #D4956A;
  font-weight: 600;
  transition: color 0.25s ease;
}

.legal-page-footer a:hover {
  color: #508070;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .legal-page .legal-container {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    border-right: none;
    border-bottom: 1px solid #E8E2D8;
    padding: 28px 0;
    max-height: none;
    overflow-y: visible;
  }

  .legal-main {
    padding: 32px 0 48px 0;
  }

  .legal-main .page-title {
    font-size: 1.7rem;
  }

  .legal-main section h2 {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .legal-main .page-title {
    font-size: 1.5rem;
  }

  .legal-main {
    padding: 24px 0 40px 0;
  }
}
