/* ============================================
   MAIN/SHARED.CSS — Styles partagés des pages main
   Charge sur : template main + accueil (voir inc/enqueue.php)
   ============================================ */

/* FUSION 2026-04-08 — déplacé depuis home.css */
.section--respiration {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  padding: var(--space-3xl) clamp(40px, 8vw, 120px);
  background: var(--em-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: justify;
  hyphens: auto;
}

@media (max-width: 767px) {
  .section--respiration {
    padding: var(--space-3xl) clamp(24px, 5vw, 80px);
  }
}

.section--respiration .text-container {
  max-width: 100%;
}

.section--respiration h2.overline {
  margin-bottom: 20px;
  text-align: center;
}

/* FUSION 2026-04-08 — déplacé depuis home.css */
.sticky-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-lg);
  align-items: start;
}

.sticky-layout--reversed {
  grid-template-columns: 7fr 5fr;
}

.sticky-layout > *,
.sticky-layout--reversed > * {
  min-width: 0;
}

.sticky-layout__text {
  padding-top: var(--space-md);
}

.sticky-layout__text .text-container p {
  text-align: justify;
  hyphens: auto;
}

.sticky-layout__text .text-container p + p {
  margin-top: var(--space-sm);
  text-align: justify;
  hyphens: auto;
}

.sticky-layout__image {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.sticky-layout__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sticky-layout,
  .sticky-layout--reversed {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-layout__image {
    position: relative;
    top: 0;
  }
}

@media (max-width: 1024px) {
  .sticky-layout,
  .sticky-layout--reversed {
    grid-template-columns: 1fr;
  }

  .sticky-layout__image {
    position: relative;
    top: 0;
  }

  /* Colonnes étroites : le justify crée des rivières d'espaces (même
     correctif que les cartes Régions de l'accueil). */
  .sticky-layout__text .text-container p,
  .sticky-layout__text .text-container p + p {
    text-align: left;
  }
}

/* ============================================================
   PAGES LEGALES — cartes de telechargement (CGV B2C / B2B)
   ============================================================ */

.legal-downloads {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.legal-downloads__card {
  background: var(--em-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2xs);
}

.legal-downloads__card h3 {
  margin: 0;
}

.legal-downloads__card p {
  margin: 0;
}

.legal-downloads__card .btn {
  margin-top: auto;
  padding-top: var(--space-2xs);
}

@media (max-width: 720px) {
  .legal-downloads {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PAGES LEGALES, ACCESSIBILITE, PLAN DU SITE — mise en page
   ------------------------------------------------------------
   Les regles typographiques globales donnent a CHAQUE titre et a
   chaque paragraphe sa propre max-width (base.css : headings en
   --container-text-narrow, p en --container-text). Dans un
   conteneur centre, ces blocs se collent donc a gauche pendant
   que le trait d'accent, qui porte un margin-inline:auto en
   ligne, se centre : d'ou le decalage visible.
   On recentre les blocs du hero, et on libere la largeur du
   contenu (pages de reference, lues en balayage).
   ============================================================ */

.legal-hero .text-container--center > *,
.accessibilite-hero .text-container--center > *,
.plan-site .section-header > * {
  margin-inline: auto;
}

.legal-content .text-container,
.accessibilite-content .text-container {
  max-width: none;
}

.legal-content .prose-content,
.legal-content .prose-content > *,
.accessibilite-content .prose-content,
.accessibilite-content .prose-content > * {
  max-width: none;
}

/* ============================================================
   PAGES LEGALES — tableau recapitulatif (registre des tiers)
   ------------------------------------------------------------
   Genere par inc/consent-registry.php, rendu par
   template-parts/sections/main/legal/page.php. Six colonnes ne
   tiennent pas sur un telephone : le wrapper scrolle, la page
   non (regle du chantier : jamais de scroll horizontal global).
   ============================================================ */

.legal-table__wrap {
  margin-top: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.legal-table__wrap:focus-visible {
  outline: 2px solid var(--em-primary-dark);
  outline-offset: 4px;
}

.legal-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: left;
}

.legal-table th,
.legal-table td {
  padding: var(--space-2xs) var(--space-xs);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  vertical-align: top;
}

.legal-table thead th {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--em-primary-dark);
  border-bottom-width: 2px;
  white-space: nowrap;
}

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

.legal-table code {
  font-size: 0.875em;
  word-break: break-word;
}

.legal-table__hint {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--em-text-light);
}
