/* Mesures (V2) : nouveau/mesures/index.html, généré par scripts/pages_v2.py à
   partir de site/mesures/index.html, dont il reprend le contenu, les classes
   (toolbar, chapter, group, n / p / r…) et le script de recherche (index.js).
   Section « Outils » propre à la V2. Couleurs : jetons de radiologik.css. */

/* --- Outils (fiches rangées dans la rubrique Mesures) ----------------------- */

.outils {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outils__titre,
.rubrique--mesures .group h3 {
  font-family: var(--police-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-texte);
}

.outils__liste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
}

.outil {
  height: 100%;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--texte);
  text-decoration: none;
}

.outil:hover {
  border-color: var(--accent-texte);
}

.outil__titre {
  font-size: 15px;
  font-weight: 600;
}

.outil__texte {
  font-size: 13px;
  line-height: 1.5;
  color: var(--texte-attenue);
}

/* --- Recherche et chapitres : barre collée en haut --------------------------- */

.rubrique--mesures .toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -12px 0 0;
  padding: 12px 0;
  background: var(--fond);
  border-bottom: 1px solid var(--barre-bord);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  background: var(--champ);
  border: 1px solid var(--champ-bord);
  border-radius: var(--rayon);
  color: var(--texte);
  font: inherit;
}

.search-row input::placeholder {
  color: var(--texte-attenue);
}

.search-row input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

.count {
  font-family: var(--police-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--texte-attenue);
}

.chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: 999px;
  color: var(--texte);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent-texte);
}

.chip.is-empty {
  opacity: 0.4;
  pointer-events: none;
}

.notice {
  padding: 10px 14px;
  background: var(--alerte-fond);
  border: 1px solid var(--alerte-bord);
  border-radius: 8px;
  color: var(--alerte-texte);
  font-size: 13px;
  line-height: 1.5;
}

.notice b {
  font-weight: 600;
}

.empty-note {
  font-family: var(--police-mono);
  font-size: 12px;
  color: var(--texte-attenue);
}

/* --- Chapitres et tableaux --------------------------------------------------- */

.chapter {
  padding: 22px 22px 14px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon-carte);
  scroll-margin-top: 140px;
}

.chapter h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.rubrique--mesures .group h3 {
  margin: 18px 0 6px;
}

.rubrique--mesures table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.rubrique--mesures thead th {
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--carte-bord);
  font-family: var(--police-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.rubrique--mesures thead th:nth-child(1) {
  width: 27%;
}

.rubrique--mesures thead th:nth-child(2) {
  width: 19%;
}

.rubrique--mesures thead th:nth-child(3) {
  width: 26%;
}

.rubrique--mesures tbody th,
.rubrique--mesures tbody td {
  padding: 8px;
  border-bottom: 1px solid var(--barre-bord);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.rubrique--mesures tbody tr:last-child th,
.rubrique--mesures tbody tr:last-child td {
  border-bottom: 0;
}

.rubrique--mesures tbody th {
  font-weight: 500;
}

.rubrique--mesures tbody th small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--texte-attenue);
}

/* Valeur normale / anormale : couleurs « succès » et « erreur » de la charte. */
td.n,
td.p {
  font-family: var(--police-mono);
  font-size: 12.5px;
}

td.n {
  color: var(--ok-texte);
}

td.p {
  color: var(--erreur-texte);
}

td.r {
  font-size: 12.5px;
  color: var(--texte-attenue);
}

td.r a {
  font-family: var(--police-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-texte);
}

td.r a:hover {
  text-decoration: underline;
}

/* --- Téléphone : une ligne de chapitres qui défile, tableaux en fiches ------- */

@media (max-width: 720px) {
  .rubrique--mesures .toolbar {
    top: 56px;
    margin: 0;
  }

  .chips {
    margin: 10px -16px 0;
    padding: 0 16px 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chapter {
    padding: 18px 14px 10px;
    scroll-margin-top: 170px;
  }

  .rubrique--mesures thead {
    display: none;
  }

  .rubrique--mesures table,
  .rubrique--mesures tbody,
  .rubrique--mesures tr,
  .rubrique--mesures tbody th,
  .rubrique--mesures tbody td {
    display: block;
    width: 100%;
  }

  .rubrique--mesures tbody tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--barre-bord);
  }

  .rubrique--mesures tbody tr:last-child {
    border-bottom: 0;
  }

  .rubrique--mesures tbody th,
  .rubrique--mesures tbody td {
    padding: 2px 0;
    border: 0;
  }

  .rubrique--mesures tbody td::before {
    content: attr(data-l);
    display: inline-block;
    min-width: 72px;
    font-family: var(--police-mono);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--texte-attenue);
  }

  .rubrique--mesures td.r:empty,
  .rubrique--mesures td.r::before {
    display: none;
  }
}
