/* Styles propres à l'écran « Habitants » (classes préfixées .habitants-). Les composants partagés
   (.figures, .figure, .card, .expander, .card-footer, .gbars, .donut-row) viennent de style.css. */

/* squelette de chargement : mêmes dimensions que les quatre repères */
.habitants-skeleton .skeleton { min-height: 96px; }
.habitants-loading { font-size: var(--fs-13); color: var(--muted); text-align: center; margin: 0; }

/* quatre repères : grille 2 × 2 jusqu'à 1079 px (à 720 la colonne de 592 px ne laisse que 115 px par repère,
   où « 18 760 € » à 34 px ne tient pas sur une ligne), puis 4 en ligne à partir de 1080 px avec la valeur à 28 px,
   un rembourrage réduit et le dénominateur sur sa propre ligne. Un nombre ne se coupe jamais à l'intérieur.
   Le sélecteur porte #fiche pour l'emporter sur la règle :has() des grilles de quatre de style.css. */
.habitants-figures .figure-value .num, .habitants-figures .figure-value .den small { overflow-wrap: normal; white-space: nowrap; }
@media (min-width: 720px) {
  #fiche .habitants-figures { --cols: 2; }
}
@media (min-width: 1080px) {
  #fiche .habitants-figures { --cols: 4; }
}

/* bouton « Sources » sous les repères (même dessin que le pied d'un repère) */
.habitants-sources-wrap { display: flex; flex-direction: column; gap: 0; margin-top: calc(-1 * var(--s2)); }
.habitants-sources-btn { align-self: center; border: 0; background: none; padding: 12px var(--s2); color: var(--accent); font-size: var(--fs-13); font-weight: 500; border-radius: var(--r-8); transition: background-color var(--d-fast); }
.habitants-sources-btn:active { background: var(--surface-3); }
.habitants-sources-btn[aria-expanded="true"] { text-decoration: underline; text-underline-offset: 3px; }
.habitants-sources { padding: 0 var(--s2) var(--s2); font-size: var(--fs-13); }
.habitants-sources .source { margin: 0; }

/* corps d'un dépliant : contexte, graphique, pied */
.habitants-body { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.habitants-body .card-context { margin: 0; }
.habitants-body .figures { margin-top: var(--s1); }
.habitants-bars { min-width: 0; }
.habitants-meta { font-size: var(--fs-13); color: var(--ink-2); line-height: 1.5; margin: 0; }

/* barres à une série : la valeur reste tabulaire, à droite de la barre */
.habitants-single .gbar span { color: var(--ink-2); }

/* impression : le panneau des sources est visible */
@media print {
  .habitants-sources[hidden] { display: block !important; }
  .habitants-sources-btn { display: none; }
}

/* fiche d'une circonscription : liste de ses communes (v5.2) */
.habitants-circo-list { border-radius: 18px; background: var(--surface-2); overflow: hidden; }
.habitants-circo-list .list-row { background: transparent; }
.habitants-circo-list .list-row:last-child { border-bottom: 0; }
.habitants-circo-more { margin-top: var(--s2); }
