/* ============================================================
   UMEOS — Styles Dédiés aux Pages Légales (prod/webroot)
   Parfaitement aligné avec le design system de prod/webroot/style.css
   ============================================================ */

/* Empêche le débordement horizontal sans créer de conteneur de défilement (préserve position: sticky) */
html, body {
  overflow-x: clip !important;
}

/* Hero légal compact et centré reprenant les blobs et styles du site */
.hero.legal-hero {
  min-height: auto;
  padding: 0;
  display: block;
  position: relative;
  overflow: hidden;
}

.hero.legal-hero .hero__inner {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(90px + env(safe-area-inset-top, 25px));
  padding-bottom: 50px;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
  width: 100%;
}

.hero.legal-hero .hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-sky);
  margin-bottom: 18px;
}

.hero.legal-hero .hero__title {
  font-family: 'Work Sans', -apple-system, sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  line-height: 1.18;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.hero.legal-hero .hero__title span {
  font-style: normal;
  color: var(--blue-sky);
}

.hero.legal-hero .hero__sub {
  font-family: 'Work Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  max-width: 720px;
  margin: 0 auto;
}

/* Wrapper principal off-white pour transition douce */
.legal-main-wrapper {
  background-color: var(--off-white);
  padding: 48px 0 90px;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Grille 2 colonnes : sommaire 310px + contenu avec minmax(0, 1fr) */
.legal-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Sidebar Sommaire sticky */
.legal-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 95px;
  align-self: start;
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 20px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid rgba(40, 85, 180, 0.12);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  min-width: 0;
}

.legal-sidebar::-webkit-scrollbar {
  width: 5px;
}
.legal-sidebar::-webkit-scrollbar-thumb {
  background: var(--grey-mid);
  border-radius: 4px;
}

.legal-sidebar__title {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--grey);
}

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

.legal-toc__link {
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all .2s ease;
  line-height: 1.4;
  display: block;
}

.legal-toc__link:hover {
  color: var(--blue);
  background: var(--blue-light);
}

.legal-toc__link.active {
  background: var(--blue-light) !important;
  color: var(--blue-dark) !important;
  font-weight: 700 !important;
  border-left: 3px solid var(--blue) !important;
  padding-left: 14px !important;
  box-shadow: 0 1px 4px rgba(40, 85, 180, 0.08);
}

/* Carte principale de contenu */
.legal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 56px 52px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid rgba(40, 85, 180, 0.12);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

.legal-section {
  margin-bottom: 48px;
  scroll-margin-top: 100px;
  min-width: 0;
}

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

.legal-section h2 {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 18px;
  padding-left: 16px;
  border-left: 4px solid var(--blue);
  line-height: 1.3;
}

.legal-section h3 {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 28px 0 14px;
}

.legal-section h4 {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin: 18px 0 8px;
}

.legal-section p {
  font-size: 15px;
  color: #2D3748;
  margin-bottom: 16px;
  line-height: 1.7;
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 20px 22px;
  color: #2D3748;
  font-size: 15px;
  line-height: 1.65;
}

.legal-section li {
  margin-bottom: 8px;
}

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

/* Callouts / Alertes */
.legal-alert {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-left: 5px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  margin: 28px 0;
  box-sizing: border-box;
}

.legal-alert--warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  border-left-color: #D97706;
}

.legal-alert__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.legal-alert__icon {
  font-size: 18px;
  line-height: 1;
}

.legal-alert__title {
  font-family: 'Work Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0;
}

.legal-alert--warning .legal-alert__title {
  color: #92400E;
}

.legal-alert p {
  font-size: 14px;
  color: var(--blue-dark);
  margin-bottom: 0;
  line-height: 1.6;
}

.legal-alert--warning p {
  color: #78350F;
}

/* Tableaux avec conteneur à défilement horizontal */
.legal-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  display: block;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  min-width: 600px;
}

.legal-table th,
.legal-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--grey);
  line-height: 1.55;
}

.legal-table th {
  background: #F1F5F9;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--blue);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:nth-child(even) td {
  background-color: #F8FAFC;
}

.legal-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
}

/* ============================================================
   RESPONSIVE : TABLETTES & MOBILES
   ============================================================ */

@media (max-width: 992px) {
  .legal-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }
  .legal-sidebar {
    display: none !important;
  }
  .legal-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 36px 20px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
}

@media (max-width: 600px) {
  .legal-main-wrapper {
    padding: 24px 0 60px !important;
  }
  .legal-container {
    padding: 0 12px !important;
  }
  .legal-card {
    padding: 22px 14px !important;
    border-radius: 16px !important;
  }
  .hero.legal-hero .hero__inner {
    padding-top: calc(85px + env(safe-area-inset-top, 20px)) !important;
    padding-bottom: 35px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .hero.legal-hero .hero__eyebrow {
    font-size: 11px !important;
    margin-bottom: 12px !important;
    padding: 5px 12px !important;
  }
  .hero.legal-hero .hero__title {
    font-size: 28px !important;
    line-height: 1.2 !important;
    margin-bottom: 14px !important;
  }
  .hero.legal-hero .hero__sub {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
  }
  .legal-section {
    margin-bottom: 34px !important;
  }
  .legal-section h2 {
    font-size: 18px !important;
    padding-left: 12px !important;
    margin-bottom: 14px !important;
  }
  .legal-section h3 {
    font-size: 15px !important;
    margin: 20px 0 10px !important;
  }
  .legal-section p,
  .legal-section li {
    font-size: 13.5px !important;
    line-height: 1.6 !important;
  }
  .legal-section ul,
  .legal-section ol {
    margin-left: 18px !important;
  }
  .legal-alert {
    padding: 14px 12px !important;
    border-radius: 12px !important;
    margin: 20px 0 !important;
  }
  .legal-table th,
  .legal-table td {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
  }
}
