/**
 * Template TheraMap — CSS unique, mobile-first, sans framework.
 * Polices systeme, variables partagees avec le composant com_theramap.
 */

/* ============================================================
   Polices auto-hebergees (RGPD/LPD : plus d'appel a Google Fonts).
   Fichiers variables woff2 dans media/templates/site/theramap/fonts/.
   ============================================================ */
/* latin */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/sans-var-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/sans-var-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/serif-var-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/serif-var-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --tpl-max-width: 1200px;
  --tpl-primary: #2e8540;
  --tpl-primary-dark: #226633;
  --tpl-text: #1e293b;
  --tpl-muted: #64748b;
  --tpl-border: #e2e8f0;
  --tpl-bg: #ffffff;
  --tpl-bg-soft: #f8fafc;
  --tpl-radius: 10px;
  --tpl-font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Variables consommees par le module de connexion OTP (mod_emailotp_login) :
     sans elles, il retombe sur son bleu par defaut. */
  --ifs-primary: var(--tpl-primary);
  --ifs-primary-dark: var(--tpl-primary-dark);
  --ifs-font-body: var(--tpl-font); /* le module OTP hérite de la police du site (Source Sans 3) */
  --ifs-primary-light: #4da05f;
  --ifs-primary-rgb: 46, 133, 64;
  --ifs-secondary-rgb: 46, 133, 64;
  --ifs-text: var(--tpl-text);
  --ifs-text-muted: var(--tpl-muted);
  --ifs-border: var(--tpl-border);

  /* Variables consommees par com_theramap */
  --tm-primary: var(--tpl-primary);
  --tm-primary-dark: var(--tpl-primary-dark);
  --tm-text: var(--tpl-text);
  --tm-muted: var(--tpl-muted);
  --tm-border: var(--tpl-border);
  --tm-bg-soft: var(--tpl-bg-soft);
  --tm-radius: var(--tpl-radius);
  /* Jetons de com_theramap utilises par cette feuille : redefinis ici (memes
     valeurs que theramap.css) pour les pages qui ne chargent pas le composant
     (articles : conditions generales, protection des donnees...). */
  --tm-surface: #ffffff;
  --tm-ink: #0f172a;
  --tm-ink-mid: #334155;
  --tm-muted-soft: #94a3b8;
  --tm-border-strong: #cbd5e1;
  --tm-on-accent: #ffffff;
  --tm-primary-50: #f3f8f4;
  --tm-primary-ink: #2e8540;
  --tm-primary-ink-strong: #226633;
  --tm-warm-bg: #fffaf0;
  --tm-warm-border-strong: #fed7aa;
  --tm-warm-ink: #9a3412;
  --tm-warm-mid: #b8860b;
}

/* ---- Reset minimal ---- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Transitions douces sur tous les elements interactifs du site :
   les survols (couleur, fond, bordure, ombre) glissent au lieu de sauter. */
a,
button,
[role="button"],
input[type="submit"],
select,
summary {
  transition:
    color 0.35s ease,
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.35s ease,
    transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  a,
  button,
  [role="button"],
  input[type="submit"],
  select,
  summary {
    transition: none;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--tpl-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--tpl-text);
  background: var(--tpl-bg);
}

/* Les contrôles de formulaire n'héritent pas de la police par défaut :
   on la force pour éviter qu'ils retombent sur Arial/police système. */
button, input, select, textarea, optgroup {
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--tm-primary-ink-strong);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--tm-primary-ink);
  text-decoration: none;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--tpl-text);
}

:focus-visible {
  outline: 3px solid var(--tpl-primary);
  outline-offset: 2px;
}

/* ---- Structure ---- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tpl-container {
  width: 100%;
  max-width: var(--tpl-max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--tpl-primary-dark);
  color: var(--tm-on-accent);
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
  color: var(--tm-on-accent);
}

/* ---- Topbar ---- */

.tpl-topbar {
  background: var(--tpl-primary-dark);
  color: var(--tm-on-accent);
  font-size: 0.875rem;
  padding-block: 0.35rem;
}

.tpl-topbar a {
  color: var(--tm-on-accent);
}

/* ---- Header ---- */

/* Defilement doux vers les ancres (identique a theramap.css). */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.tpl-header {
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tpl-border);
}

.has-sticky-header .tpl-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.tpl-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  /* Sans cette respiration, le logo touchait le haut de l'ecran des que la
     navigation passait a la ligne (mobile et fenetres etroites). */
  padding-block: 0.8rem;
  flex-wrap: wrap;
  /* La navigation passe a la ligne sur mobile : pas d'espace entre les deux
     lignes quand elle est fermee (le panneau ouvert a sa propre marge). */
  row-gap: 0;
}

.tpl-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-inline-end: auto;
}

/* Marque (feuilles) devant le logotype. */
.tpl-brand__mark {
  display: block;
  flex: none;
  height: 40px;
  width: auto;
}

.tpl-brand__tagline {
  align-self: center;
  padding-top: 0.35rem;
}

.tpl-brand__text {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tm-primary-ink-strong);
}

.tpl-brand__tagline {
  color: var(--tpl-muted);
  font-size: 0.85rem;
  display: none;
}

@media (min-width: 768px) {
  .tpl-brand__tagline {
    display: inline;
  }
}

/* ---- Navigation ---- */

.tpl-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--tpl-border);
  border-radius: calc(var(--tpl-radius) / 2);
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

/* Bouton : trois barres qui se transforment en croix a l'ouverture. */
.tpl-nav-toggle:hover {
  border-color: var(--tpl-primary);
  color: var(--tm-primary-ink-strong);
}

.tpl-nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background-color 0.2s ease;
}

.tpl-nav-toggle__bars::before,
.tpl-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.tpl-nav-toggle__bars::before { top: -6px; }
.tpl-nav-toggle__bars::after  { top: 6px; }

.tpl-nav-toggle[aria-expanded="true"] .tpl-nav-toggle__bars {
  background: transparent;
}

.tpl-nav-toggle[aria-expanded="true"] .tpl-nav-toggle__bars::before {
  transform: translateY(6px) rotate(45deg);
}

.tpl-nav-toggle[aria-expanded="true"] .tpl-nav-toggle__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Panneau : il se deplie (hauteur animee) au lieu d'apparaitre d'un coup. */
.tpl-nav {
  flex-basis: 100%;
  display: grid;
  grid-template-rows: 0fr;
  /* Le bouton « Installer » est un 2e enfant : sa rangee implicite doit se
     replier elle aussi, sinon l'en-tete mobile garde 45 px de vide. */
  grid-auto-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.2, 0.8, 0.3, 1),
    grid-auto-rows 0.3s cubic-bezier(0.2, 0.8, 0.3, 1),
    opacity 0.22s ease,
    visibility 0s linear 0.3s;
}

.tpl-nav > * {
  min-height: 0;
}

@media (max-width: 899.98px) {
  /* Menu replie : le bouton d'installation ne doit rien occuper (son remplissage
     et sa bordure empechent la rangee 0fr de tomber a zero : 22 px de vide). */
  .tpl-nav:not(.is-open) > .tpl-install--nav { display: none; }
}

.tpl-nav.is-open {
  grid-template-rows: 1fr;
  grid-auto-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.2, 0.8, 0.3, 1),
    grid-auto-rows 0.3s cubic-bezier(0.2, 0.8, 0.3, 1),
    opacity 0.22s ease,
    visibility 0s;
}

.tpl-nav ul {
  list-style: none;
  margin: 0;
  /* Aucune marge quand le menu est ferme : sinon le panneau garderait
     quelques pixels de haut et laisserait un vide sous le logo. */
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tpl-nav.is-open ul {
  padding-block: 0.4rem 0.25rem;
}

.tpl-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  border-radius: calc(var(--tpl-radius) / 2);
  color: var(--tpl-text);
  font-weight: 600;
}

/* Chevron discret, mobile seulement : indique que l'entree mene ailleurs. */
.tpl-nav a::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.35;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tpl-nav a:hover,
.tpl-nav .active > a {
  background: var(--tpl-bg-soft);
  color: var(--tm-primary-ink-strong);
}

.tpl-nav a:hover::after {
  opacity: 0.8;
  transform: translateX(3px) rotate(-45deg);
}

/* Page courante : filet vert a gauche. */
.tpl-nav .active > a {
  box-shadow: inset 3px 0 0 var(--tpl-primary);
}

/* Les entrees arrivent l'une apres l'autre. */
.tpl-nav.is-open li {
  animation: tpl-nav-item 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.tpl-nav.is-open li:nth-child(2) { animation-delay: 0.045s; }
.tpl-nav.is-open li:nth-child(3) { animation-delay: 0.09s; }
.tpl-nav.is-open li:nth-child(4) { animation-delay: 0.135s; }
.tpl-nav.is-open li:nth-child(5) { animation-delay: 0.18s; }
.tpl-nav.is-open li:nth-child(n + 6) { animation-delay: 0.22s; }

@keyframes tpl-nav-item {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tpl-nav,
  .tpl-nav.is-open,
  .tpl-nav-toggle__bars,
  .tpl-nav-toggle__bars::before,
  .tpl-nav-toggle__bars::after,
  .tpl-nav a::after { transition: none; }

  .tpl-nav.is-open li { animation: none; }
}

@media (min-width: 900px) {
  .tpl-nav-toggle {
    display: none;
  }

  /* Au-dela du mobile : barre horizontale classique, sans animation ni chevron.
     En rangee, pour que le bouton d'installation reste aligne avec les liens
     au lieu de passer a la ligne. */
  .tpl-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-basis: auto;
    grid-template-rows: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    transition: none;
  }

  .tpl-nav ul {
    flex-direction: row;
    gap: 0.15rem;
    padding: 0;
  }

  .tpl-nav a {
    padding: 0.6rem 0.75rem;
  }

  .tpl-nav a::after {
    display: none;
  }

  .tpl-nav .active > a {
    box-shadow: none;
  }

  .tpl-nav.is-open li {
    animation: none;
  }
}

/* ---- Hero / recherche ---- */

.tpl-hero {
  background: linear-gradient(160deg, var(--tpl-primary-dark), var(--tpl-primary));
  color: var(--tm-on-accent);
  /* Bande allegee (revue design #5) : la carte ne doit pas dominer la page */
  padding-block: 1rem;
}

.tpl-hero h1,
.tpl-hero h2,
.tpl-hero p {
  color: var(--tm-on-accent);
}

.tpl-search {
  padding-block: 1.25rem 0;
}

/* ---- Main ---- */

.tpl-main {
  padding-block: 1.5rem 3rem;
}

.tpl-layout--sidebar {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .tpl-layout--sidebar {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

.tpl-content {
  min-width: 0;
}

/* ---- Cartes de modules ---- */

.tpl-card {
  background: var(--tm-surface);
  border: 1px solid var(--tpl-border);
  border-radius: var(--tpl-radius);
  padding: 1.1rem;
  margin-block-end: 1.25rem;
}

.tpl-card__title {
  margin-block-start: 0;
  font-size: 1.15rem;
}

/* ---- Module « Mon compte » (connexion OTP) : version discrete ---- */

/* Titre de la carte en sur-titre leger */
.tpl-card:has(.mod-emailotp-login) .tpl-card__title,
.tpl-card:has(.tm-wallet-mod) .tpl-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tpl-muted);
  text-align: center;
  margin-block-end: 0.9rem;
}

/* Etat connecte : tout en plus leger */
.tpl-card .mod-emailotp-login--member .auth-header {
  margin-bottom: 0.9rem;
}

.tpl-card .mod-emailotp-login--member .auth-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}

.tpl-card .mod-emailotp-login--member .auth-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.tpl-card .mod-emailotp-login--member .auth-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.tpl-card .mod-emailotp-login--member .auth-subtitle {
  font-size: 0.8rem;
}

/* Bouton compact et sobre, centre */
.tpl-card .mod-emailotp-login--member .auth-btn--primary {
  display: inline-flex;
  width: auto;
  margin-inline: auto;
  padding: 0.45rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  background-image: none;
  color: var(--tm-primary-ink-strong);
  border: 1px solid var(--tpl-primary);
  border-radius: 8px;
  box-shadow: none;
}

.tpl-card .mod-emailotp-login--member {
  text-align: center;
}

.tpl-card .mod-emailotp-login--member .auth-btn--primary:hover {
  background: rgba(46, 133, 64, 0.08);
  color: var(--tm-primary-ink-strong);
  transform: none;
  box-shadow: none;
}

.tpl-card .mod-emailotp-login--member .auth-links {
  margin-top: 0.7rem !important;
}

.tpl-card .mod-emailotp-login--member .auth-links a {
  font-size: 0.8rem;
  color: var(--tpl-muted);
}

/* ---- Module « Mon solde » (porte-monnaie) ---- */

.tm-wallet-mod__rows {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-bottom: 0.6rem;
}

.tm-wallet-mod__row {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.tm-wallet-mod__row strong { font-size: 1.15rem; }

.tm-wallet-mod__label {
  color: var(--tpl-muted);
  font-size: 0.8rem;
}

.tm-wallet-mod__links {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
}

.tm-wallet-mod__links span { color: var(--tpl-muted); margin-inline: 0.3rem; }

/* ---- Module « Gérer ma fiche » (publication + avis) ---- */
.tm-manage-mod__pub {
  padding-bottom: 0;
  margin-bottom: 0;
}

.tm-manage-mod__status {
  margin: 0 0 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.tm-manage-mod__status.is-online { color: var(--tm-primary-ink); }
.tm-manage-mod__status.is-offline,
.tm-manage-mod__status.is-draft { color: var(--tpl-muted); }
.tm-manage-mod__status.is-pending { color: var(--tm-warm-mid); }

.tm-manage-mod__reviews h4 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.tm-manage-mod__reviews p { font-size: 0.85rem; color: var(--tpl-muted); margin: 0 0 0.6rem; }

.tm-manage-mod__hint { font-size: 0.78rem; color: var(--tpl-muted); margin: 0.5rem 0 0; }

.tm-manage-mod__invite-result { margin-top: 0.6rem; }
.tm-manage-mod__invite-link { display: flex; gap: 0.35rem; margin-top: 0.3rem; }
.tm-manage-mod__invite-link input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--tpl-border);
  border-radius: 6px;
  font-size: 0.78rem;
}

.tm-manage-mod__msg { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--tm-primary-ink-strong); }

/* ---- Footer ---- */

.tpl-footer {
  background: var(--tpl-bg-soft);
  border-top: 1px solid var(--tpl-border);
  padding-block: 1.75rem;
  margin-block-start: 2rem;
  color: var(--tpl-muted);
  font-size: 0.925rem;
}

.tpl-footer a {
  color: inherit;
}

.tpl-footer__copy {
  margin: 0.75rem 0 0;
}

/* ---- Impression ---- */

@media print {
  .tpl-topbar,
  .tpl-header,
  .tpl-hero,
  .tpl-search,
  .tpl-sidebar,
  .tpl-footer,
  .skip-link {
    display: none !important;
  }

  body {
    background: var(--tpl-bg);
  }
}

.tpl-footer__links {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  text-align: center;
}

.tpl-footer__links a {
  color: var(--tpl-muted);
}

.tpl-footer__links a:hover {
  color: var(--tm-primary-ink);
}

.tpl-footer__links span {
  margin: 0 0.4rem;
  color: var(--tpl-muted);
}

/* Infos d'article (date de mise a jour des pages legales) : alignees a
   gauche avec le contenu, style discret. */
.article-info {
  margin: 0 0 1.25rem;
  color: var(--tpl-muted);
  font-size: 0.875rem;
}

.article-info dd {
  margin: 0;
}

/* Footer colle en bas meme sur les pages courtes (revue design #3) */
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.tpl-main {
  flex: 1;
}

/* ============ Lot A — Typographie & largeur de lecture (global) ============ */
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.55rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.125rem; font-weight: 700; }
/* Largeur de lecture confortable sur les articles de contenu (hors page d'accueil) */
.com-content-article:not(:has(.tm-home)) { max-width: 72ch; }

/* ===== Pages légales (CGU, protection des données) — pleine largeur, sommaire collant ===== */
.item-page:has(.tm-legal) { max-width: none !important; }
.item-page:has(.tm-legal) .page-header h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin-bottom: 0.15rem; }
.item-page:has(.tm-legal) .article-info { margin-bottom: 0.5rem; }

.tm-legal { --lg-green: var(--tm-primary-ink); --lg-text: var(--tm-text); --lg-muted: var(--tm-muted); --lg-border: var(--tm-border); color: var(--lg-text); }
.tm-legal__lead { font-size: 1.06rem; color: var(--lg-muted); margin: 0.25rem 0 2rem; line-height: 1.6; }
.tm-legal__grid { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 2.75rem; align-items: start; }

.tm-legal__toc { position: sticky; top: 92px; border: 1px solid var(--lg-border); border-radius: 14px; padding: 1.1rem 1.15rem; background: var(--tm-surface); box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05); }
.tm-legal__toc-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; color: var(--lg-muted); margin: 0 0 0.7rem; }
.tm-legal__toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.tm-legal__toc a { display: block; padding: 0.36rem 0.55rem; border-radius: 8px; color: var(--lg-text); text-decoration: none; font-size: 0.855rem; line-height: 1.35; transition: background 0.15s ease, color 0.15s ease; }
.tm-legal__toc a:hover { background: var(--tm-primary-50); color: var(--lg-green); }

.tm-legal__content { min-width: 0; }
.tm-legal__sec { scroll-margin-top: 92px; padding-bottom: 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--lg-border); }
.tm-legal__sec:last-child { border-bottom: 0; margin-bottom: 0; }
.tm-legal__content h2 { font-size: 1.2rem; line-height: 1.3; color: var(--lg-green); margin: 0 0 0.65rem; }
.tm-legal__content p { line-height: 1.72; margin: 0 0 0.7rem; }
.tm-legal__content p:last-child { margin-bottom: 0; }
.tm-legal__content strong { color: var(--lg-text); }

@media (max-width: 900px) {
  .tm-legal__grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .tm-legal__toc { position: static; }
}

/* =====================================================================
   Douceur : transitions homogènes sur tout ce qui réagit (liens, boutons,
   champs, résumés) — sur toutes les pages, y compris l'accueil et les
   articles. Les composants ont déjà leurs propres transitions plus fines
   (cartes, .tm-btn) : celles-ci ne font qu'adoucir ce qui restait « sec ».
   ===================================================================== */
a,
button,
input,
select,
textarea,
summary,
label {
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  a,
  button,
  input,
  select,
  textarea,
  summary,
  label {
    transition: none;
  }
}

/* ============================================================
   Newsletter AcyMailing — formulaire public assorti au design.
   Portee : uniquement les modules dont la classe CSS = « tm-newsletter »
   (parametre « Classe CSS » du module). N'affecte aucun autre formulaire.
   ============================================================ */
.acym_module.tm-newsletter { max-width: 640px; margin: 0 auto; }

.acym_module.tm-newsletter .acym_module_form {
  background: var(--tpl-bg-soft);
  border: 1px solid var(--tpl-border);
  border-radius: calc(var(--tpl-radius) + 4px);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.acym_module.tm-newsletter .acym_introtext {
  margin: 0 0 1rem;
  color: var(--tpl-muted);
  font-size: 0.95rem;
}

.acym_module.tm-newsletter .acym_form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0;
}

.acym_module.tm-newsletter .onefield { flex: 1 1 200px; min-width: 0; margin: 0; }

/* Le champ est enveloppe dans un <label> inline-block qui se retrecit a la
   largeur intrinseque de l'input : on le force en bloc pleine largeur. */
.acym_module.tm-newsletter .onefield label { display: block; width: 100%; }

.acym_module.tm-newsletter .acym_form input[type="text"],
.acym_module.tm-newsletter .acym_form input[type="email"],
.acym_module.tm-newsletter .acym_form input:not([type]) {
  width: 100%;
  max-width: 100%; /* Acy impose max-width:90% */
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--tpl-border);
  border-radius: var(--tpl-radius);
  background: var(--tm-surface);
  color: var(--tpl-text);
  font-size: 1rem;
  line-height: 1.4;
}

.acym_module.tm-newsletter .acym_form input::placeholder { color: var(--tm-muted-soft); }

.acym_module.tm-newsletter .acym_form input:focus {
  outline: none;
  border-color: var(--tpl-primary);
  box-shadow: 0 0 0 3px rgba(46, 133, 64, 0.15);
}

/* Consentement / CGU / suivi : pleine largeur, discret */
.acym_module.tm-newsletter .fieldacyterms,
.acym_module.tm-newsletter .fieldacytracking {
  flex: 1 1 100%;
  font-size: 0.82rem;
  color: var(--tpl-muted);
  line-height: 1.45;
}
.acym_module.tm-newsletter .fieldacyterms a { color: var(--tm-primary-ink); text-decoration: underline; }
.acym_module.tm-newsletter .fieldacyterms input,
.acym_module.tm-newsletter .fieldacytracking input {
  margin-right: 0.4rem;
  accent-color: var(--tpl-primary);
  vertical-align: middle;
}

/* Champ de confirmation d'e-mail (double saisie) : pleine largeur */
.acym_module.tm-newsletter .fieldacyemail_confirmation,
.acym_module.tm-newsletter .acyfield_email_confirm { flex: 1 1 100%; }

/* Bouton d'inscription */
.acym_module.tm-newsletter .acysubbuttons { margin: 1rem 0 0; text-align: center; }
.acym_module.tm-newsletter .acysubbuttons button {
  display: inline-block;
  width: 100%;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: var(--tpl-radius);
  background: var(--tpl-primary);
  color: var(--tm-on-accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.acym_module.tm-newsletter .acysubbuttons button:hover { background: var(--tpl-primary-dark); }

/* Messages (succes / erreur) renvoyes par AcyMailing */
.acym_module.tm-newsletter .acym_module_message,
.acym_module.tm-newsletter .acym_message {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--tpl-radius);
  font-size: 0.92rem;
}

@media (max-width: 560px) {
  .acym_module.tm-newsletter .onefield { flex: 1 1 100%; }
  .acym_module.tm-newsletter .acym_module_form { padding: 1.3rem 1.1rem; }
}

/* Section « Newsletter » de l'accueil (article id 4) */
.tm-home-news { margin: 2.5rem auto; text-align: center; }
.tm-home-news h2 { margin: 0 0 0.4rem; font-weight: 700; letter-spacing: -0.01em; }
.tm-home-news .tm-subtitle { margin: 0 auto 1.2rem; max-width: 46rem; }

/* Ligne legale du pied de page (editeur, forme juridique, adresse, contact). */
.tpl-footer__legal {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--tpl-muted);
}

.tpl-footer__legal a {
  color: inherit;
  text-decoration: underline;
}

/* Banniere « Mode assistance » (admin connecte en tant qu'un therapeute). */
.tpl-assist-banner {
  background: var(--tm-warm-bg);
  border-bottom: 1px solid var(--tm-warm-border-strong);
  color: var(--tm-warm-ink);
  font-size: 0.875rem;
}
.tpl-assist-banner__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.5rem;
}
.tpl-assist-banner a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Newsletter des membres (Mon espace, colonne de droite) — 2026-09-11 */
.acym_module.tm-newsletter--members .acym_fulldiv { padding: 0; background: none; border: 0; }
.acym_module.tm-newsletter--members .acym_introtext { font-size: 0.85rem; color: var(--tm-muted); line-height: 1.45; margin: 0 0 0.7rem; }
.acym_module.tm-newsletter--members .acym_form { display: none; }
.acym_module.tm-newsletter--members .acym_lists { display: none; }
.acym_module.tm-newsletter--members .acysubbuttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
.acym_module.tm-newsletter--members .acysubbuttons .btn { flex: 1 1 8rem; margin: 0; min-height: 2.5rem; font-size: 0.9rem; }
.acym_module.tm-newsletter--members .acysubbuttons .acym_unsub, .acym_module.tm-newsletter--members .acysubbuttons [name="acymunsub"], .acym_module.tm-newsletter--members .acysubbuttons .btn:nth-child(2) { background: var(--tm-surface); color: var(--tm-ink-mid); border: 1px solid var(--tm-border-strong); }

/* Newsletter des membres : pas de boite interne, boutons cote a cote (abonner = vert, desabonner = contour) */
.acym_module.tm-newsletter.tm-newsletter--members .acym_module_form { padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.acym_module.tm-newsletter.tm-newsletter--members .acysubbuttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
.acym_module.tm-newsletter.tm-newsletter--members .acysubbuttons button { display: inline-flex; align-items: center; justify-content: center; width: auto; flex: 1 1 8rem; margin: 0; padding: 0.55rem 0.9rem; min-height: 2.5rem; font-size: 0.9rem; }
.acym_module.tm-newsletter.tm-newsletter--members .acysubbuttons button.subbutton { background: var(--tpl-primary); color: var(--tm-on-accent); border: 1px solid var(--tpl-primary); }
.acym_module.tm-newsletter.tm-newsletter--members .acysubbuttons button.unsubbutton { background: var(--tm-surface); color: var(--tm-ink-mid); border: 1px solid var(--tm-border-strong); }
.acym_module.tm-newsletter.tm-newsletter--members .acysubbuttons button.unsubbutton:hover { background: var(--tm-bg-soft); color: var(--tm-ink); }


/* --- Pied de page : reseaux, mentions et copyright sur un meme fil ------- */
.tpl-footer__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--tpl-muted);
}

.tpl-footer__follow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tpl-footer__follow-label {
  white-space: nowrap;
}

.tpl-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--tpl-border);
  color: var(--tpl-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tpl-social:hover {
  color: var(--tpl-primary);
  border-color: var(--tpl-primary);
  transform: translateY(-1px);
}

.tpl-social__icon {
  width: 15px;
  height: 15px;
  display: block;
}

/* ===== Installer l'application ============================================
   Bouton discret dans le pied de page : il n'apparait que si l'appareil sait
   vraiment installer le site (voir template.js). */
.tpl-footer__install {
  margin: 0.9rem 0 0;
  text-align: center;
}

/* Deja installe : le site tourne dans sa propre fenetre. Proposer de
   l'installer n'aurait plus de sens — et le bouton serait sans effet. La regle
   couvre tous les modes « application », y compris ceux que le manifeste
   propose en repli (display_override). */
@media (display-mode: standalone),
       (display-mode: minimal-ui),
       (display-mode: fullscreen),
       (display-mode: window-controls-overlay),
       (display-mode: tabbed) {
  .tpl-install {
    display: none !important;
  }
}

.tpl-install {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--tpl-border);
  border-radius: 999px;
  background: var(--tm-surface);
  color: var(--tm-primary-ink-strong);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tpl-install:hover {
  border-color: var(--tpl-primary);
  background: var(--tm-primary-50);
  transform: translateY(-1px);
}

.tpl-install:focus-visible {
  outline: 2px solid var(--tpl-primary);
  outline-offset: 2px;
}

.tpl-install svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* --- Variante « dans le menu » ------------------------------------------- */
.tpl-install--nav {
  border: 0;
  background: transparent;
  padding: 0.35rem 0.55rem;
  border-radius: var(--tpl-radius);
  color: var(--tpl-primary);
  font-weight: 600;
  font-size: 0.9rem;
  gap: 0.35rem;
}

.tpl-install--nav:hover {
  background: var(--tm-primary-50);
  border-color: transparent;
  transform: none;
}

.tpl-install--nav svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 900px) {
  /* Dans le panneau deroulant, le bouton se range comme une entree de menu. */
  .tpl-install--nav {
    width: 100%;
    justify-content: flex-start;
    padding: 0.7rem 0.2rem;
  }
}

@media (min-width: 901px) {
  /* Barre d'en-tete : pastille ronde a icone seule, le libelle passe en
     infobulle (data-tip) au survol ou au clavier. */
  .tpl-install--nav {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-left: 0.4rem;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    color: var(--tpl-primary);
  }

  .tpl-install--nav > span {
    display: none;
  }

  .tpl-install--nav svg {
    width: 24px;
    height: 24px;
  }

  .tpl-install--nav::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    padding: 0.35rem 0.6rem;
    border-radius: calc(var(--tpl-radius) / 2);
    background: var(--tm-primary-ink-strong);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .tpl-install--nav:hover::after,
  .tpl-install--nav:focus-visible::after {
    opacity: 1;
    transform: none;
  }
}

/* --- Fenetre d'explication (iPhone / iPad) -------------------------------- */
.tpl-install-dialog {
  max-width: 24rem;
  width: calc(100% - 2rem);
  padding: 1.4rem 1.5rem 1.2rem;
  border: 1px solid var(--tpl-border);
  border-radius: 16px;
  background: var(--tm-surface);
  color: var(--tpl-text);
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
}

.tpl-install-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.tpl-install-dialog__title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.tpl-install-steps {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.tpl-install-note {
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  color: var(--tpl-muted);
}

.tpl-install-close {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: var(--tpl-radius);
  background: var(--tpl-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tpl-install-close:hover {
  background: var(--tpl-primary-dark);
}

/* ===== Carte « VitaNexo grandit grace a vous » (accueil) ===================
   Petite carte non modale en bas a gauche, qui glisse doucement apres un
   moment de lecture. Une seule fois par navigateur (voir template.js). Sur
   mobile elle prend la largeur et se range au-dessus de la bascule de theme. */
.tpl-grow {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 1190;
  width: min(22.5rem, calc(100% - 2.5rem));
  padding: 1.15rem 1.25rem 0.9rem;
  border: 1px solid var(--tpl-border);
  border-radius: 18px;
  background: var(--tpl-bg);
  color: var(--tpl-text);
  box-shadow: 0 24px 60px -18px rgba(15, 23, 42, 0.4), 0 2px 8px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translateY(1.25rem) scale(0.98);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tpl-grow.is-visible {
  opacity: 1;
  transform: none;
}

.tpl-grow.is-leaving {
  opacity: 0;
  transform: translateY(0.75rem);
  transition-duration: 0.3s;
}

.tpl-grow__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tpl-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tpl-grow__close:hover,
.tpl-grow__close:focus-visible {
  background: var(--tpl-bg-soft);
  color: var(--tpl-text);
}

.tpl-grow__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 1.75rem;
  margin-bottom: 0.6rem;
}

.tpl-grow__mark {
  width: 48px;
  height: 32px;
  flex: 0 0 auto;
}

.tpl-grow__kicker {
  margin: 0 0 0.1rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tpl-primary);
}

.tpl-grow__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.tpl-grow__text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--tpl-muted);
}

.tpl-grow__actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.tpl-grow__action {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--tpl-border);
  border-radius: 12px;
  background: var(--tpl-bg-soft);
  color: var(--tpl-text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tpl-grow__action:hover,
.tpl-grow__action:focus-visible {
  border-color: var(--tpl-primary);
  background: var(--tpl-bg);
  transform: translateX(2px);
  text-decoration: none;
}

.tpl-grow__action:focus-visible {
  outline: 2px solid var(--tpl-primary);
  outline-offset: 2px;
}

.tpl-grow__ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--tpl-primary);
}

.tpl-grow__foot {
  margin: 0.6rem 0 0;
  text-align: center;
}

.tpl-grow__later {
  padding: 0.3rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--tpl-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tpl-grow__later:hover,
.tpl-grow__later:focus-visible {
  color: var(--tpl-text);
}

@media (max-width: 640px) {
  .tpl-grow {
    left: 1rem;
    right: 1rem;
    bottom: calc(1.25rem + 3rem + 0.75rem);
    width: auto;
    padding: 1rem 1rem 0.75rem;
  }

  /* Sur petit ecran, le titre suffit : on garde la carte basse. */
  .tpl-grow__text { display: none; }
  .tpl-grow__head { margin-bottom: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tpl-grow,
  .tpl-grow__action { transition: none; }
}

/* ===== Newsletter : engagement sur l'adresse e-mail =======================
   Sous le formulaire AcyMailing (surcharge templates/theramap/html/mod_acym). */
.tm-newsletter__promise {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  max-width: 34rem;
  margin: 1rem auto 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--tpl-muted);
  text-align: left;
}

.tm-newsletter__promise svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  color: var(--tpl-primary);
}

.tm-newsletter__promise strong {
  color: var(--tpl-text);
}

/* ===== Bascule clair / sombre ==============================================
   Pastille flottante en bas a droite. L'icone montre la destination : un
   soleil quand on est en sombre (cliquer = passer au clair), une lune quand on
   est en clair. Le soleil tourne lentement, la lune passe par ses phases grace
   a un masque qui glisse ; les deux animations s'arretent si le visiteur a
   demande a reduire les animations. */
.tpl-theme-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--tpl-primary);
  background: var(--tpl-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.28);
  transition: transform 0.25s ease, background 0.3s ease, box-shadow 0.25s ease;
}

.tpl-theme-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.34);
}

.tpl-theme-toggle:focus-visible {
  outline: 2px solid var(--tpl-primary);
  outline-offset: 3px;
}

.tpl-theme-toggle svg {
  width: 23px;
  height: 23px;
  display: block;
  overflow: visible;
}

/* Par defaut (clair) on propose la lune ; en sombre, le soleil. */
.tpl-theme-toggle .tpl-ico-sun { display: none; }
.tpl-theme-toggle .tpl-ico-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tpl-theme-toggle .tpl-ico-sun { display: block; }
  :root:not([data-theme="light"]) .tpl-theme-toggle .tpl-ico-moon { display: none; }
}

:root[data-theme="dark"] .tpl-theme-toggle .tpl-ico-sun { display: block; }
:root[data-theme="dark"] .tpl-theme-toggle .tpl-ico-moon { display: none; }

.tpl-ico-sun {
  transform-origin: 50% 50%;
  animation: tpl-sun-spin 16s linear infinite;
}

.tpl-moon-shadow {
  transform-box: view-box;
  transform: translateX(-8px);
  animation: tpl-moon-phase 9s linear infinite;
}

@keyframes tpl-sun-spin {
  to { transform: rotate(360deg); }
}

@keyframes tpl-moon-phase {
  0% { transform: translateX(-20px); }
  50% { transform: translateX(20px); }
  100% { transform: translateX(-20px); }
}

@media (prefers-reduced-motion: reduce) {
  .tpl-ico-sun, .tpl-moon-shadow { animation: none; }
  .tpl-theme-toggle { transition: none; }
}

/* Place reservee par la bascule : les autres pastilles flottantes (le
   « retour en haut » de com_theramap) s'en servent pour se ranger a cote au
   lieu de se superposer. Sa valeur = largeur du bouton + gouttiere. */
:root { --tpl-fab-slot: 3.75rem; }

/* ===== Mode sombre : habillage =============================================
   Cette feuille est servie apres theramap.css et son :root fait pointer
   plusieurs jetons --tm-* vers les --tpl-*. Ces alias se resolvent a l'usage :
   assombrir les --tpl-* suffit donc a emmener les --tm-* correspondants, et
   evite deux definitions contradictoires. Les valeurs sont volontairement
   identiques a celles de la palette de com_theramap. */
@media (prefers-color-scheme: dark) {
  /* :not([data-theme="light"]) : un visiteur qui a choisi le mode
     clair garde le clair meme si son appareil est en sombre. */

  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --tpl-bg: #0f172a;
    --tpl-bg-soft: #172033;
    --tpl-text: #e2e8f0;
    --tpl-muted: #94a3b8;
    --tpl-border: #334155;
    --tm-surface: #1e293b;
    --tm-ink: #f8fafc;
    --tm-ink-mid: #cbd5e1;
    --tm-muted-soft: #7f8fa4;
    --tm-border-strong: #475569;
    --tm-on-accent: #ffffff;
    --tm-primary-50: #17321f;
    --tm-primary-ink: #5cba72;
    --tm-primary-ink-strong: #86d49a;
    --tm-warm-bg: #2a2114;
    --tm-warm-border-strong: #5c4620;
    --tm-warm-ink: #f0a06a;
    --tm-warm-mid: #dfa72a;
    /* --tpl-primary et --tpl-primary-dark ne changent pas : c'est l'identite
       de la marque, et le blanc ecrit sur ces verts doit rester lisible. */
  }

  /* L'en-tete colle en haut : il se detache de la page comme une carte. */
  :root:not([data-theme="light"]) .tpl-header{ border-bottom-color: var(--tm-border); }
}

@media screen {

  :root[data-theme="dark"] {
    color-scheme: dark;
    --tpl-bg: #0f172a;
    --tpl-bg-soft: #172033;
    --tpl-text: #e2e8f0;
    --tpl-muted: #94a3b8;
    --tpl-border: #334155;
    --tm-surface: #1e293b;
    --tm-ink: #f8fafc;
    --tm-ink-mid: #cbd5e1;
    --tm-muted-soft: #7f8fa4;
    --tm-border-strong: #475569;
    --tm-on-accent: #ffffff;
    --tm-primary-50: #17321f;
    --tm-primary-ink: #5cba72;
    --tm-primary-ink-strong: #86d49a;
    --tm-warm-bg: #2a2114;
    --tm-warm-border-strong: #5c4620;
    --tm-warm-ink: #f0a06a;
    --tm-warm-mid: #dfa72a;
    /* --tpl-primary et --tpl-primary-dark ne changent pas : c'est l'identite
       de la marque, et le blanc ecrit sur ces verts doit rester lisible. */
  }

  /* L'en-tete colle en haut : il se detache de la page comme une carte. */
  :root[data-theme="dark"] .tpl-header{ border-bottom-color: var(--tm-border); }
}
