/* IKIBI - Pages légales (premium editorial) */

.legal-page {
  background: var(--navy);
}

.legal-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.1);
  background: linear-gradient(180deg, #fafbfd 0%, var(--navy) 100%);
}

.legal-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
  max-width: 16ch;
  margin: 0.75rem auto 0;
}

.legal-hero-lead {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--grey-200);
}

.legal-hero-meta {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-400);
  font-weight: 600;
}

.legal-body {
  padding: 56px 0 100px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 96px;
  padding: 24px 0;
}

.legal-toc-title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: 16px;
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc a {
  display: block;
  padding: 8px 0 8px 14px;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-200);
  line-height: 1.4;
  transition: color var(--transition), border-color var(--transition), padding-left var(--transition);
}

.legal-toc a:hover {
  color: var(--blue);
  padding-left: 18px;
}

.legal-toc a.is-active {
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

.legal-prose {
  max-width: 42rem;
}

.legal-prose > p.lead {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--grey-200);
  margin-bottom: 2.5rem;
}

.legal-section {
  scroll-margin-top: 100px;
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid rgba(51, 65, 85, 0.1);
  opacity: 0;
  transform: translateY(12px);
  animation: legalReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.legal-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-section:nth-of-type(1) { animation-delay: 0.05s; }
.legal-section:nth-of-type(2) { animation-delay: 0.1s; }
.legal-section:nth-of-type(3) { animation-delay: 0.15s; }
.legal-section:nth-of-type(4) { animation-delay: 0.2s; }
.legal-section:nth-of-type(5) { animation-delay: 0.25s; }
.legal-section:nth-of-type(6) { animation-delay: 0.3s; }
.legal-section:nth-of-type(7) { animation-delay: 0.35s; }
.legal-section:nth-of-type(8) { animation-delay: 0.4s; }
.legal-section:nth-of-type(9) { animation-delay: 0.45s; }
.legal-section:nth-of-type(10) { animation-delay: 0.5s; }
.legal-section:nth-of-type(11) { animation-delay: 0.55s; }
.legal-section:nth-of-type(12) { animation-delay: 0.6s; }

@keyframes legalReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.legal-section h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 1rem;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.5rem 0 0.5rem;
}

.legal-section p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--grey-200);
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 1rem 1.25rem;
  color: var(--grey-200);
  line-height: 1.75;
}

.legal-section li {
  margin-bottom: 0.5rem;
}

.legal-section li::marker {
  color: var(--blue);
}

.legal-section a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

.legal-section a:hover {
  opacity: 0.85;
}

.legal-card {
  background: var(--navy-light);
  border: 1px solid rgba(51, 65, 85, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(51, 65, 85, 0.1);
}

.legal-related-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: 12px;
}

.legal-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.legal-related-links a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blue);
}

.legal-toc-mobile {
  display: none;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--navy-light);
  border: 1px solid rgba(51, 65, 85, 0.12);
  border-radius: var(--radius-md);
}

.legal-toc-mobile summary {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-400);
  cursor: pointer;
  list-style: none;
}

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

.legal-toc-mobile nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.legal-toc-mobile a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-200);
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-toc {
    display: none;
  }

  .legal-toc-mobile {
    display: block;
  }

  .legal-prose {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-section {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .legal-toc a {
    transition: none;
  }
}
