/* ==========================================================================
   GJS · PAGES LÉGALES & RGPD
   Mentions légales · Confidentialité · Cookies · Exercer vos droits.
   Structure reprise du site de Gabin, matière Soufil : onglets entre les
   4 pages, titre et repères (mise à jour, rubriques, lecture), sommaire
   collant (colonne sur ordinateur, barre repliable sur téléphone),
   « L'essentiel » en aplat citron, rubriques numérotées, tableaux empilés en
   fiches sur téléphone, panneaux « votre choix » et « ce navigateur »,
   formulaire « Exercer vos droits », carte « page suivante ».
   ========================================================================== */

/* ---- Onglets entre les 4 pages ------------------------------------------ */

.legal-tabs {
  margin-bottom: clamp(32px, 1rem + 3vw, 56px);
}

.legal-tabs__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.legal-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-height: 56px;
  padding: 10px 14px;
  background: var(--cream);
  color: var(--ink);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.6s var(--ease-expo), box-shadow 0.6s var(--ease-expo), background-color 0.2s;
}

.legal-tab__num {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.legal-tab[aria-current="page"] {
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1.2deg);
}

.legal-tab:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (hover: hover) {
  .legal-tab:not([aria-current]):hover {
    background: var(--cream-2);
    box-shadow: 4px 4px 0 var(--ink);
    transform: translate(-2px, -2px);
  }
}

/* L'onglet de la page se colle à l'arrivée */
@keyframes legal-tab-in {
  from { opacity: 0; transform: translateY(-10px) rotate(-7deg) scale(1.06); }
}

.has-motion:not([data-motion="reduced"]) .legal-tab[aria-current="page"] {
  animation: legal-tab-in 0.8s var(--ease-expo) 0.2s both;
}

@media (min-width: 900px) {
  .legal-tabs__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .legal-tab { min-height: 64px; padding: 12px 16px; font-size: 0.9375rem; }
}

/* ---- En-tête de page ----------------------------------------------------- */

/* « Confidentialité » tient sur une ligne dès 320 px */
.legal-hero__title {
  font-size: clamp(2.625rem, 1.4rem + 6vw, 7rem);
}

.legal-hero__actions {
  padding-top: 4px;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: clamp(28px, 1rem + 2vw, 44px);
}

.legal-meta > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px 7px;
  background: var(--cream-2);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius);
}

.legal-meta dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.legal-meta dd {
  font-weight: 600;
}

/* ---- Mise en page : sommaire + texte ----------------------------------- */

.legal__layout {
  display: grid;
  align-items: start;
}

.legal__layout > * {
  min-width: 0;
}

/* ---- Sommaire ------------------------------------------------------------- */

.legal-toc {
  position: relative;
}

/* Barre « Sommaire » (téléphone, ajoutée par legal.js) : masquée par défaut */
.legal-toc__toggle,
.legal-toc__up,
.legal-toc__bar-progress {
  display: none;
}

.legal-toc__panel {
  display: grid;
  gap: 14px;
  padding: 20px 18px 16px;
  background: var(--card);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
}

.legal-toc__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.legal-toc__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  text-transform: uppercase;
}

.legal-toc__count {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.legal-toc__track {
  position: relative;
  padding-left: 14px;
}

/* Rail de lecture : se remplit au fil du texte */
.legal-toc__rail {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 4px;
  overflow: hidden;
  background: var(--cream);
  border-radius: 2px;
}

.legal-toc__rail > span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleY(var(--progress, 0));
  transform-origin: 50% 0;
}

.legal-toc__list {
  display: grid;
  gap: 2px;
  list-style: none;
}

.legal-toc__link {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  min-height: 44px;
  padding: 9px 10px;
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.3s var(--ease-expo);
}

.legal-toc__num {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1;
  color: var(--fg-2);
}

.legal-toc__link:hover {
  background: var(--cream);
}

.legal-toc__link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

/* Rubriques déjà lues : numéro barré d'un coup de marqueur */
.legal-toc__link.is-read .legal-toc__num {
  color: var(--ink);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* Rubrique en cours de lecture */
.legal-toc__link[aria-current="true"] {
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 600;
}

.legal-toc__link[aria-current="true"] .legal-toc__num {
  color: var(--ink);
}

.legal-toc__top {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

/* Ordinateur : sommaire collant à gauche, texte à droite */
@media (min-width: 1024px) {
  .legal__layout {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 72px;
  }

  .legal-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: grid;
    max-height: calc(100svh - var(--header-h) - 48px);
    transition: top 0.6s var(--ease-expo), max-height 0.6s var(--ease-expo);
  }

  /* Le header se range au défilement : le sommaire remonte avec lui */
  body:has(.header.is-hidden) .legal-aside {
    top: 24px;
    max-height: calc(100svh - 48px);
  }

  .legal-toc {
    display: grid;
    min-height: 0;
  }

  .legal-toc__panel {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* Téléphone et tablette : barre collante « Sommaire » qui suit la lecture et
   déroule la liste des rubriques (legal.js). Sans JS, la liste reste
   affichée en tête du texte. */
@media (max-width: 1023px) {
  .legal-aside {
    margin-bottom: clamp(36px, 6vw, 56px);
  }

  .legal-toc__top {
    display: none;
  }

  .legal-aside.is-enhanced {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 20;
    transition: top 0.6s var(--ease-expo);
  }

  body:has(.header.is-hidden) .legal-aside.is-enhanced {
    top: 10px;
  }

  .legal-aside.is-enhanced .legal-toc {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    background: var(--cream);
    border: var(--border-thin) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--ink);
  }

  .legal-aside.is-enhanced .legal-toc__toggle {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 46px;
    padding: 0 10px 0 6px;
    background: none;
    border: 0;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .legal-toc__toggle-label {
    flex-shrink: 0;
    padding: 0.32em 0.55em 0.18em;
    background: var(--ink);
    color: var(--lime);
    border-radius: 3px;
    font-family: var(--font-display);
    font-size: 1.0625rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .legal-toc__toggle-current {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: var(--fs-small);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .legal-toc__chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.45s var(--ease-expo);
  }

  .legal-aside.is-open .legal-toc__chevron {
    transform: translateY(2px) rotate(-135deg);
  }

  .legal-aside.is-enhanced .legal-toc__up {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 46px;
    height: 46px;
    background: var(--lime);
    color: var(--ink);
    border: var(--border-thin) solid var(--ink);
    border-radius: 3px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
  }

  .legal-aside.is-enhanced .legal-toc__bar-progress {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 3px;
    display: block;
    height: 3px;
    overflow: hidden;
    border-radius: 2px;
    pointer-events: none;
  }

  .legal-toc__bar-progress > span {
    display: block;
    height: 100%;
    background: var(--ink);
    transform: scaleX(var(--progress, 0));
    transform-origin: 0 50%;
  }

  .legal-aside.is-enhanced .legal-toc__panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-height: min(64svh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.45s var(--ease-expo), visibility 0s linear 0.45s;
  }

  .legal-aside.is-enhanced.is-open .legal-toc__panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  .legal-aside.is-enhanced .legal-toc__head {
    display: none;
  }
}

/* ---- L'essentiel : l'aplat citron de la page ----------------------------- */

.legal-essentials {
  position: relative;
  padding: 28px 22px 24px;
  background: var(--lime);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-0.6deg);
}

/* Ruban adhésif */
.legal-essentials::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 28px;
  width: 112px;
  height: 28px;
  background: var(--cream-2);
  border: 1px solid rgba(20, 20, 20, 0.18);
  opacity: 0.95;
  transform: rotate(-4deg);
}

.legal-essentials__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.legal-essentials__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.legal-essentials__note .sticker {
  font-size: 1rem;
  box-shadow: 3px 3px 0 var(--cream);
}

.legal-essentials__list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.legal-essentials__list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-weight: 500;
}

.legal-essentials__star {
  width: 16px;
  height: 16px;
  margin-top: 0.3em;
  fill: var(--ink);
}

.legal-essentials a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

/* ---- Rubriques ------------------------------------------------------------ */

.legal-essentials + .legal-section,
.legal-section + .legal-section {
  margin-top: clamp(56px, 2.5rem + 2vw, 80px);
}

/* Sur téléphone, une ancre (#hebergement…) s'arrête sous la barre collante du
   sommaire : scroll-margin-top s'ajoute au scroll-padding-top de <html>, avec
   ou sans JavaScript (Lenis applique les deux). */
@media (max-width: 1023px) {
  .legal-section,
  .rights-form__group,
  .rights-form .field {
    scroll-margin-top: 72px;
  }
}

.legal-section__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.legal-section__num {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  min-width: 2.2em;
  height: 2.2em;
  padding: 0.16em 0.24em 0;
  background: var(--ink);
  color: var(--lime);
  border-radius: var(--radius);
  font-size: 0.6em;
  transform: rotate(-4deg);
}

.legal-section__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legal-section__body > * + * {
  margin-top: 1em;
}

.legal-section__body p,
.legal-section__body li {
  max-width: var(--measure);
}

.legal-section__body h3 {
  margin-top: 1.8em;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-section__body h3 + * {
  margin-top: 0.6em;
}

.legal-section__body ul:not([class]) {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  list-style: square;
}

.legal-section__body a:not(.btn) {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.legal-section__body code {
  padding: 0.05em 0.35em;
  background: var(--cream-2);
  border: 1px solid rgba(20, 20, 20, 0.25);
  border-radius: 3px;
  font-family: var(--font-text);
  font-size: 0.9em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.legal-action {
  padding-top: 0.4em;
}


/* ---- Fiches « libellé : valeur » ----------------------------------------- */

.legal-facts {
  display: grid;
  background: var(--cream);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}

.legal-facts > div {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
}

.legal-facts > div + div {
  border-top: 1px solid rgba(20, 20, 20, 0.2);
}

.legal-facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.legal-facts dd {
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .legal-facts > div {
    grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
  }
}

/* ---- Tableaux ------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--cream);
}

.table-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  border-bottom: var(--border-thin) solid var(--ink);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--lime);
  font-weight: 600;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap td:first-child {
  font-weight: 600;
}

.table-wrap:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* Les clés de stockage restent entières, une par ligne si besoin */
.table-wrap code {
  display: inline-block;
  margin-block: 2px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.table-wrap--cols-4 th:first-child {
  width: 30%;
}

.legal-cell-note {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-2);
}

/* Téléphone : chaque ligne devient une fiche, le libellé de colonne au-dessus */
@media (max-width: 639px) {
  .table-wrap {
    overflow: visible;
    background: none;
    border: 0;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-wrap tr {
    background: var(--cream);
    border: var(--border-thin) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 3px 3px 0 var(--ink);
    overflow: hidden;
  }

  .table-wrap tr + tr {
    margin-top: 14px;
  }

  .table-wrap td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(20, 20, 20, 0.2);
  }

  .table-wrap tr:last-child td { border-bottom: 1px solid rgba(20, 20, 20, 0.2); }
  .table-wrap tr td:last-child { border-bottom: 0; }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-2);
  }

  .table-wrap td:first-child {
    background: var(--lime);
    border-bottom: var(--border-thin) solid var(--ink);
  }

  .table-wrap td:first-child::before {
    color: var(--ink);
  }
}

/* ---- Panneaux « sur ce navigateur » -------------------------------------- */

.legal-panel {
  padding: 18px 18px 16px;
  background: var(--cream-2);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}

.legal-panel > * + * {
  margin-top: 12px;
}

.legal-panel__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1;
  text-transform: uppercase;
}

.legal-panel__note,
.legal-panel__status {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.legal-panel__status {
  font-weight: 600;
  color: var(--ink);
}

.legal-panel__status:empty {
  display: none;
}

.legal-consent__list {
  display: grid;
}

.legal-consent__list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.2);
}

.legal-consent__list dt {
  font-weight: 600;
}

.legal-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  background: var(--cream);
  border: var(--border-thin) solid var(--ink);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.legal-state::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--ink-2);
  border-radius: 50%;
}

.legal-state--on {
  background: var(--lime);
}

.legal-state--on::before {
  background: var(--ink);
}

.legal-device__list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.legal-device__list li {
  position: relative;
  padding-left: 20px;
  overflow-wrap: anywhere;
}

.legal-device__list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--lime);
  border: var(--border-thin) solid var(--ink);
}

.legal-panel__actions .btn {
  min-height: 46px;
}

/* ---- Vos droits, un par un (accordéon de la FAQ) ------------------------- */

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

.legal-rights .faq__q {
  gap: 12px;
}

.legal-rights__name {
  flex: 1;
  min-width: 0;
}

.legal-rights__ref {
  flex-shrink: 0;
  padding: 3px 8px 2px;
  background: var(--cream);
  border: var(--border-thin) solid var(--ink);
  border-radius: 3px;
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}

.legal-rights .faq__item[open] .legal-rights__ref {
  background: var(--lime);
}

/* ---- Formulaire « Exercer vos droits » ---------------------------------- */

.rights-form {
  display: grid;
  gap: 26px;
  margin-top: 26px;
  padding: 24px 18px;
  background: var(--card);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
}

@media (min-width: 720px) {
  .rights-form { padding: 32px 30px; }
}

.rights-form__errors {
  padding: 16px 18px;
  background: var(--cream);
  border: 4px dashed var(--ink);
  border-radius: var(--radius);
}

.rights-form__errors ul {
  margin-top: 8px;
  padding-left: 20px;
  list-style: square;
}

.rights-form__errors a {
  font-weight: 600;
  text-decoration: underline;
}

.rights-form__group {
  min-width: 0;
  padding: 0;
  border: 0;
}

.rights-form__legend {
  margin-bottom: 14px;
  font-weight: 600;
  line-height: 2;
}

.rights-form__step {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 2em;
  margin-right: 8px;
  padding: 0.15em 0.3em 0;
  background: var(--ink);
  color: var(--lime);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  vertical-align: middle;
}

.rights-form__choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.rights-choice .choice__box {
  align-items: flex-start;
}

.rights-choice .choice__mark {
  margin-top: 2px;
}

.rights-choice__text {
  display: grid;
  gap: 2px;
}

.rights-choice__name {
  font-weight: 600;
}

.rights-choice__hint {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-2);
}

.choice input:checked + .choice__box .rights-choice__hint {
  color: var(--ink);
}

@media (min-width: 560px) {
  .rights-form__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rights-choice--wide { grid-column: 1 / -1; }
}

@media (min-width: 1280px) {
  .rights-form__choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rights-choice--wide { grid-column: auto; }
}

.rights-form__row {
  display: grid;
  align-items: start;
  gap: 22px;
}

@media (min-width: 720px) {
  .rights-form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rights-form .field__label {
  line-height: 2;
}

.rights-form__preview {
  padding: 16px 18px;
  background: var(--cream);
  border: var(--border-thin) dashed var(--ink);
  border-radius: var(--radius);
}

.rights-form__preview > * + * {
  margin-top: 6px;
}

.rights-form__preview-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
}

.rights-form__preview-line {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.rights-form__preview-key {
  font-weight: 600;
}

.rights-form__preview-body {
  margin-top: 12px;
  font-family: var(--font-text);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rights-form__note {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.rights-form__note a {
  color: var(--ink);
}

.rights-form__status {
  padding: 12px 14px;
  background: var(--lime);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
}

.rights-form__status:empty {
  display: none;
}

@media (max-width: 479px) {
  .rights-form__actions .btn { width: 100%; }
}

/* ---- Page suivante -------------------------------------------------------- */

.legal-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 20px;
  margin-top: clamp(64px, 2rem + 4vw, 104px);
  padding: 24px 22px 22px;
  background: var(--ink);
  color: var(--cream);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--lime);
  text-decoration: none;
  transition: transform 0.6s var(--ease-expo), box-shadow 0.6s var(--ease-expo);
}

.legal-next__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
}

.legal-next__title {
  grid-column: 1;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.legal-next__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--lime);
  color: var(--ink);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 600;
  transition: transform 0.6s var(--ease-expo);
}

.legal-next:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

@media (hover: hover) {
  .legal-next:hover {
    box-shadow: 9px 9px 0 var(--lime);
    transform: translate(-3px, -3px);
  }

  .legal-next:hover .legal-next__arrow {
    transform: translateX(6px) rotate(-8deg);
  }
}

/* ---- Impression : le texte seul ------------------------------------------ */

@media print {
  .legal-tabs,
  .legal-aside,
  .legal-next,
  .legal-hero__actions,
  .legal-action,
  .legal-panel,
  .rights-form {
    display: none !important;
  }

  .legal-essentials {
    box-shadow: none;
    transform: none;
  }

  .legal-essentials + .legal-section,
  .legal-section + .legal-section { margin-top: 32px; }
}

/* Sans JavaScript, il n'y a ni bandeau ni choix à gérer : les boutons qui l'ouvrent disparaissent */
.no-js .legal-hero__actions:has([data-cookie-manage]),
.no-js .legal-action {
  display: none;
}

/* Écrans tactiles : zone de toucher d'au moins 44 px pour les liens posés seuls
   dans une liste ou une fiche (navigateurs, email, CNIL…), sans changer la mise
   en page : le rembourrage est compensé par une marge négative. */
@media (pointer: coarse) {
  .legal-section__body li > a:only-child,
  .legal-section__body dd > a:only-child,
  .legal-section__body p > a:only-child {
    display: inline-block;
    padding-block: 10px;
    margin-block: -10px;
  }
}
