/* Pages de texte — confidentialité, conditions, etc.

   Ajout du thème WordPress : le prototype n'avait pas ces pages. Elles
   reprennent le hero interne et la mesure de lecture du journal. Le
   contenu est long et structuré : titres de section bien détachés,
   listes et tableaux lisibles. */

/* A legal title runs long: a step smaller than the hero of the other pages */
.text-page__title {
  font-size: clamp(2.6rem, 6.5vw, 6.5rem);
}

.text-page__body {
  padding-top: var(--space-l);
}

.text-page__content {
  grid-column: 3 / span 8;
  max-width: 72ch;
  color: var(--ink-2);
}

.text-page__content > * + * {
  margin-top: var(--space-m);
}

/* Each section opens with a rule, so a long text reads in chapters */
.text-page__content h2 {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--fs-h3);
  line-height: 1.15;
}

.text-page__content > h2:first-child {
  margin-top: 0;
}

.text-page__content h3,
.text-page__content h4 {
  margin-top: var(--space-l);
  color: var(--ink);
  font-size: var(--fs-h4);
  line-height: 1.2;
}

.text-page__content strong {
  color: var(--ink);
}

.text-page__content a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.text-page__content a:hover {
  color: var(--pink);
}

.text-page__content ul,
.text-page__content ol {
  padding-left: 1.25em;
}

.text-page__content li + li {
  margin-top: var(--space-xs);
}

.text-page__content li::marker {
  color: var(--pink);
}

/* Tables (purposes, retention periods): scroll sideways on a phone */
.text-page__content .wp-block-table {
  overflow-x: auto;
}

.text-page__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

/* Override the block library's boxed cells: rows only, like the rest of the site */
.text-page__content .wp-block-table thead {
  border-bottom: 1px solid var(--line-strong);
}

.text-page__content .wp-block-table th,
.text-page__content .wp-block-table td {
  padding: 0.75rem 1.5rem 0.75rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

/* Key–value tables (no header row): the first column reads as a label */
.text-page__content .wp-block-table table:not(:has(thead)) td:first-child {
  width: 34%;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.text-page__content th {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 1100px) {
  .text-page__content {
    grid-column: 1 / -1;
  }
}

/* Complianz documents (cookie policy…) ---------------------------------------
   Complianz's full stylesheet is switched off in inc/assets.php; only its
   structural one remains (hidden e-mail decoy, consent toggles). These rules
   bring its markup in line with the other text pages. The id selectors are
   there to outrank that structural sheet, which uses them too. */
.text-page__content #cmplz-document > * + * {
  margin-top: var(--space-m);
}

.text-page__content #cmplz-document > h2:first-of-type {
  margin-top: var(--space-l);
}

/* The "last updated / applies to" line: a note, not a lead */
.text-page__content #cmplz-document > p:first-child i {
  font-style: normal;
  color: var(--ink-3);
}

/* One service per row, opened with a pink + / − */
.text-page__content #cmplz-document .cmplz-dropdown {
  margin: 0;
  border-top: 1px solid var(--line);
}

.text-page__content #cmplz-document .cmplz-dropdown:last-of-type {
  border-bottom: 1px solid var(--line);
}

.text-page__content #cmplz-document .cmplz-dropdown summary {
  display: block;
  padding: var(--space-s) 0;
  background: none;
  cursor: pointer;
  list-style: none;
}

.text-page__content #cmplz-document .cmplz-dropdown summary::-webkit-details-marker {
  display: none;
}

.text-page__content #cmplz-document .cmplz-dropdown summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.5rem;
  align-items: baseline;
  gap: var(--space-s);
  padding: 0;
  background: none;
}

.text-page__content #cmplz-document .cmplz-dropdown summary div::after {
  content: "+";
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: auto;
  height: auto;
  background: none;
  transform: none;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--pink);
}

.text-page__content #cmplz-document .cmplz-dropdown[open] summary div::after {
  content: "−";
}

.text-page__content #cmplz-document .cmplz-dropdown summary h3 {
  grid-column: 1;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-h4);
  line-height: 1.2;
}

.text-page__content #cmplz-document .cmplz-dropdown summary p {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.text-page__content #cmplz-document .cmplz-dropdown summary label,
.text-page__content #cmplz-document .cmplz-dropdown summary input {
  display: none;
}

.text-page__content #cmplz-document .cmplz-dropdown:hover summary h3 {
  color: var(--pink);
}

.text-page__content #cmplz-document .cmplz-service-description,
.text-page__content #cmplz-document .cmplz-sharing-data {
  width: auto;
  margin: 0 0 var(--space-s);
  padding: 0;
  background: none;
}

/* Empty "Usage" paragraphs left by services without a description */
.text-page__content #cmplz-document .cmplz-service-description:has(p:empty) {
  display: none;
}

.text-page__content #cmplz-document .cmplz-dropdown h4,
.text-page__content #cmplz-document .cmplz-dropdown h5 {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.text-page__content #cmplz-document .cmplz-dropdown p {
  margin: 0;
}

/* Cookies: one header row, then one row per cookie. "dense" lets each cell
   fall into its column even though Complianz repeats the headers per cookie. */
.text-page__content #cmplz-document .cookies-per-purpose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  grid-auto-flow: row dense;
  margin: 0 0 var(--space-m);
  padding: 0;
  border: 0;
  background: none;
}

.text-page__content #cmplz-document .cookies-per-purpose > div {
  margin: 0;
  padding: 0.6rem 1rem 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
}

.text-page__content #cmplz-document .cookies-per-purpose .purpose {
  grid-column: 1 / -1;
  padding-bottom: 0;
  border-bottom: 0;
}

.text-page__content #cmplz-document .cookies-per-purpose .name-header,
.text-page__content #cmplz-document .cookies-per-purpose .name {
  grid-column: 1;
}

.text-page__content #cmplz-document .cookies-per-purpose .retention-header,
.text-page__content #cmplz-document .cookies-per-purpose .retention {
  grid-column: 2;
}

.text-page__content #cmplz-document .cookies-per-purpose .function-header,
.text-page__content #cmplz-document .cookies-per-purpose .function {
  grid-column: 3;
}

.text-page__content #cmplz-document .cookies-per-purpose .name-header ~ .name-header,
.text-page__content #cmplz-document .cookies-per-purpose .retention-header ~ .retention-header,
.text-page__content #cmplz-document .cookies-per-purpose .function-header ~ .function-header {
  display: none;
}

.text-page__content #cmplz-document .cookies-per-purpose .name {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Consent settings, filled in by Complianz's script: rows, no grey washes */
.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category,
.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header {
  background: none;
}

.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category {
  margin: 0;
  border-top: 1px solid var(--line);
}

.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category:last-child {
  border-bottom: 1px solid var(--line);
}

.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header {
  padding: var(--space-s) 0;
}

.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: var(--fs-h4);
  line-height: 1.2;
}

.text-page__content #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-description {
  padding: 0 0 var(--space-s);
}

.text-page__content #cmplz-manage-consent-container .cmplz-always-active {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
}

@media (max-width: 640px) {
  .text-page__content #cmplz-document .cmplz-dropdown summary div {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
  }

  .text-page__content #cmplz-document .cmplz-dropdown summary p {
    grid-column: 1;
    grid-row: 2;
  }

  .text-page__content #cmplz-document .cmplz-dropdown summary div::after {
    grid-column: 2;
  }

  .text-page__content #cmplz-document .cookies-per-purpose {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .text-page__content #cmplz-document .cookies-per-purpose .function-header,
  .text-page__content #cmplz-document .cookies-per-purpose .function {
    grid-column: 1 / -1;
  }

  .text-page__content #cmplz-document .cookies-per-purpose .function-header {
    display: none;
  }

  .text-page__content #cmplz-document .cookies-per-purpose .name,
  .text-page__content #cmplz-document .cookies-per-purpose .retention {
    border-bottom: 0;
  }
}
