/* Accueil / Thématiques v2 — compléments locaux, aucune règle globale. */
html body.corpus-unified .tm-reference-count {
  display: block;
  margin-top: 5px;
  color: #6d7a81;
  font: 550 12px/1.4 "Savoy Source Sans 3", Arial, sans-serif;
  letter-spacing: 0;
}
html body.corpus-unified .tm-preview {
  margin: 20px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid #e4e8ea;
}
html body.corpus-unified .tm-preview-title {
  font: 700 12px/1.5 "Savoy Source Sans 3", Arial, sans-serif !important;
  color: #49565d !important;
  margin: 0 0 12px !important;
}
html body.corpus-unified .tm-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 12px;
}
html body.corpus-unified .tm-preview-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  background: #fafbfb;
  border: 1px solid #e3e8ea;
  min-width: 0;
}
html body.corpus-unified .tm-preview-kind {
  color: #7d5550;
  font: 700 10px/1.35 "Savoy Source Sans 3", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .045em;
}
html body.corpus-unified .tm-preview-name {
  color: #29343a;
  font: 550 14px/1.4 "Savoy Source Sans 3", Arial, sans-serif;
}
html body.corpus-unified .tm-full-search {
  padding: 25px clamp(20px, 4vw, 48px) 29px;
  border-top: 3px solid #2b3338;
  border-bottom: 1px solid #dee4e7;
  background: #fff;
  margin: 0 0 30px;
  scroll-margin-top: 28px;
}
html body.corpus-unified .tm-full-search h2 {
  font: 550 clamp(24px, 2.8vw, 34px)/1.2 "Savoy Cabin", "Gill Sans", Arial, sans-serif !important;
  margin: 0 0 10px !important;
  color: #272f35 !important;
}
html body.corpus-unified .tm-full-search p {
  font: 400 15px/1.6 "Savoy Source Sans 3", Arial, sans-serif;
  color: #58666f;
  max-width: 850px;
  margin: 0 0 17px !important;
}
html body.corpus-unified .tm-full-search form {
  display: flex;
  gap: 8px;
  max-width: 760px;
}
html body.corpus-unified .tm-full-search label {
  display: block;
  font: 700 12px/1.5 "Savoy Source Sans 3", Arial, sans-serif;
  margin: 0 0 7px;
  color: #343d43;
}
html body.corpus-unified .tm-full-search input {
  flex: 1; min-width: 0; min-height: 46px;
  padding: 9px 14px;
  border: 1px solid #aebbc2;
  color: #243139;
  background: #fff;
  border-radius: 0;
  font: 450 15px/1.3 "Savoy Source Sans 3", Arial, sans-serif;
}
html body.corpus-unified .tm-full-search button {
  flex: 0 0 auto;
  min-height: 46px; padding: 10px 18px;
  border: 1px solid #252d33;
  background: #252d33; color: #fff;
  font: 700 13px/1.35 "Savoy Source Sans 3", Arial, sans-serif;
  cursor: pointer; border-radius: 0;
}
html body.corpus-unified .tm-full-search button:hover { background: #45525c; }
html body.corpus-unified .tm-full-search .tm-full-search-more {
  margin-top: 11px !important;
  font-size: 13px !important;
}
html body.corpus-unified .tm-full-search .tm-full-search-more a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 720px) {
  html body.corpus-unified .tm-preview-list { grid-template-columns: minmax(0,1fr); }
  html body.corpus-unified .tm-full-search { margin-bottom: 24px; }
  html body.corpus-unified .tm-full-search form { flex-direction: column; }
  html body.corpus-unified .tm-full-search button { width: 100%; }
}

/* 2026-11-18: Mobile-first table of contents.
   Show the primary theme families without forcing an undiscoverable sideways swipe. */
@media (max-width: 650px) {
  html body.accueil-theme .tm-side {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow-x: visible !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  html body.accueil-theme .tm-side > strong,
  html body.accueil-theme .tm-side > hr {
    grid-column: 1 / -1;
  }
  html body.accueil-theme .tm-side > a {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    min-width: 0 !important;
    line-height: 1.35 !important;
  }
}

/* accueil-wcag-aa-contrastes-20261118: legibility of theme numbering and reference counts */
html body.accueil-theme .tm-theme summary .tm-index,
html body.accueil-theme .tm-theme summary .tm-reference-count {
  color: #46565d !important;
}
