/* =========================================================================
   Legal pages (Privacy, Terms, Mentions légales)
   — Long-form content, readable typography, keeps crayon style in headers
   ========================================================================= */

.legal {
  padding: 48px 0 80px;
}

.legal__container {
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* Header */
.legal__header {
  text-align: left;
}

.legal__back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.legal__back:hover {
  color: var(--orange-dark);
}

.legal__title {
  font-family: var(--font-sketch);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.legal__meta {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 20px;
}

.legal__intro {
  background: var(--yellow);
  border: var(--border-w) solid var(--ink);
  border-top-left-radius: 14px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 16px;
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: var(--shadow-hard-sm);
  transform: rotate(-0.4deg);
}

/* Table of contents */
.legal__toc {
  background: #fff;
  border: var(--border-w) solid var(--ink);
  border-top-left-radius: 16px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 18px;
  padding: 22px 26px;
  box-shadow: var(--shadow-hard-sm);
}
.legal__toc-title {
  font-family: var(--font-sketch);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.legal__toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.legal__toc ol li {
  counter-increment: toc-counter;
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  line-height: 1.5;
}
.legal__toc ol li::before {
  content: counter(toc-counter) '.';
  position: absolute;
  left: 0;
  font-family: var(--font-sketch);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
}
.legal__toc a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}
.legal__toc a:hover {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

@media (min-width: 640px) {
  .legal__toc ol {
    grid-template-columns: 1fr 1fr;
  }
}

/* Content */
.legal__content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

.legal__section {
  margin-bottom: 48px;
  scroll-margin-top: 100px;
}

.legal__section h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.legal__section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
  transform: rotate(-0.8deg);
}

.legal__section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 24px 0 10px;
  color: var(--ink);
}

.legal__section p {
  margin-bottom: 14px;
  color: #2d2d2d;
}

.legal__section ul,
.legal__section ol {
  margin: 12px 0 18px 24px;
  padding-left: 8px;
}

.legal__section li {
  margin-bottom: 8px;
  color: #2d2d2d;
  line-height: 1.6;
}

.legal__section ul li::marker {
  color: var(--orange);
}
.legal__section ol li::marker {
  color: var(--orange);
  font-weight: 700;
}

.legal__section strong {
  color: var(--ink);
  font-weight: 700;
}

.legal__section a {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
.legal__section a:hover {
  color: var(--orange-dark);
}

/* Emphasis block (for children's section) */
.legal__section--emphasis {
  background: var(--lavender);
  border: var(--border-w) solid var(--ink);
  border-top-left-radius: 18px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 20px;
  padding: 28px 28px 8px;
  box-shadow: var(--shadow-hard-sm);
  margin-bottom: 48px;
}
.legal__section--emphasis h2 {
  border-bottom-color: var(--violet);
}
.legal__section--emphasis h2::after {
  background: var(--violet);
}
.legal__section--emphasis ul li::marker,
.legal__section--emphasis ol li::marker {
  color: var(--violet);
}

/* Contact card */
.legal__contact-card {
  background: var(--peach);
  border: var(--border-w) solid var(--ink);
  border-top-left-radius: 14px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 16px;
  padding: 20px 22px;
  margin: 16px 0;
  box-shadow: var(--shadow-hard-sm);
  transform: rotate(-0.3deg);
}
.legal__contact-card p {
  margin-bottom: 6px;
  font-size: 15px;
}
.legal__contact-card p:last-child {
  margin-bottom: 0;
}

.legal__footnote {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 20px;
}

/* Back to top button */
.legal__back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--orange);
  color: #fff;
  border: var(--border-w) solid var(--ink);
  border-top-left-radius: 14px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 50;
}
.legal__back-top:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* Desktop : TOC in sticky sidebar */
@media (min-width: 900px) {
  .legal__container {
    grid-template-columns: 260px 1fr;
    grid-template-areas:
      'header  header'
      'toc     content';
    gap: 48px;
    align-items: start;
  }
  .legal__header {
    grid-area: header;
  }
  .legal__toc {
    grid-area: toc;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .legal__toc ol {
    grid-template-columns: 1fr;
  }
  .legal__content {
    grid-area: content;
  }
}
