/* ==========================================================================
   Legal Pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   Legal Hero
   -------------------------------------------------------------------------- */

.legal-hero {
  background: linear-gradient(
    135deg,
    var(--color-background) 0%,
    var(--color-accent-light) 100%
  );
  padding-bottom: 40px;
}

.legal-hero h1 {
  max-width: 850px;
}

.legal-hero .page-hero-description {
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: none;
}

.legal-hero .legal-effective-date {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 20px 0 0;
}

/* --------------------------------------------------------------------------
   Legal Layout
   -------------------------------------------------------------------------- */

.legal-body {
  padding: 48px 0 72px;
}

.legal-layout {
  align-items: start;
  display: grid;
  gap: 64px;
  grid-template-columns: 220px minmax(0, 1fr);
  max-width: 1100px;
}

/* --------------------------------------------------------------------------
   Legal Navigation
   -------------------------------------------------------------------------- */

.legal-navigation {
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  position: sticky;
  top: 32px;
}

.legal-navigation h2 {
  font-size: 1.25rem;
  margin-bottom: 18px;
}

.legal-navigation nav {
  display: grid;
  gap: 10px;
}

.legal-navigation a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-navigation a:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Legal Content
   -------------------------------------------------------------------------- */

.legal-content {
  max-width: 760px;
}

.legal-content > :first-child {
  margin-top: 0;
}

.legal-content section {
  scroll-margin-top: 120px;
}

.legal-content section + section {
  margin-top: 44px;
}

.legal-content h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0 0 16px;
}

.legal-content h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 28px 0 10px;
}

.legal-content p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0 0 16px;
}

.legal-content ul,
.legal-content ol {
  margin: 12px 0 24px;
  padding-left: 26px;
}

.legal-content li {
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
  padding-left: 4px;
}

.legal-content li:last-child {
  margin-bottom: 0;
}

.legal-content li::marker {
  color: var(--color-accent);
}

.legal-content a:not(.button) {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

.legal-content a:not(.button):hover {
  text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .legal-body {
    padding: 28px 0 40px;
  }

  .legal-hero {
    padding-bottom: 32px;
  }

  .legal-layout {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-navigation {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .legal-navigation h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }

  .legal-navigation nav {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-content {
    max-width: 100%;
    min-width: 0;
  }

  .legal-content h2 {
    font-size: 1.5rem;
  }

  .legal-content section + section {
    margin-top: 32px;
  }
}

/* --------------------------------------------------------------------------
   Mobile Legal Navigation
   -------------------------------------------------------------------------- */

.legal-navigation-mobile {
  display: none;
}

@media (max-width: 600px) {
  .legal-navigation-desktop {
    display: none;
  }

  .legal-navigation-mobile {
    display: block;
  }

  .legal-navigation-mobile summary {
    color: var(--color-text);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    list-style: none;
  }

  .legal-navigation-mobile summary::-webkit-details-marker {
    display: none;
  }

  .legal-navigation-mobile summary::after {
    content: "+";
    float: right;
    font-size: 1.4rem;
    font-weight: 400;
  }

  .legal-navigation-mobile[open] summary::after {
    content: "−";
  }

  .legal-navigation-mobile nav {
    margin-top: 16px;
  }
}
