/* Bilan de mandat d'un sénateur — /senateur/{slug}/bilan
   Charte « édition » : les jetons --ed-* viennent de edition.css, qui est
   chargée par base.html avant cette feuille. Rien n'est redéfini ici. */

.bilan-entete { padding-top: 2.5rem; }

.bilan-chapo {
  font-family: var(--ed-serif);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ed-muted);
  max-width: 44em;
  margin-top: .8rem;
}

.bilan-anciennete {
  font-size: .92rem;
  line-height: 1.5;
  color: var(--ed-muted);
  margin-top: .8rem;
  max-width: 44em;
}

.bilan-partiel {
  background: var(--ed-acid);
  color: var(--ed-acid-ink);
  border-left: 3px solid var(--ed-acid-ink);
  padding: .7rem .9rem;
  margin-top: 1rem;
  font-size: .92rem;
  line-height: 1.5;
  max-width: 44em;
}

.bilan-actions { margin-top: 1.4rem; }

/* `.edition a { color: inherit }` (edition.css) a une spécificité de (0,1,1) et
   écrase un simple `.bilan-pdf` : le libellé sortait en encre sombre sur fond
   sombre, soit un rectangle noir. Deux classes suffisent à reprendre la main. */
.edition .bilan-pdf {
  display: inline-block;
  background: var(--ed-ink);
  color: var(--ed-surface);
  font-family: var(--ed-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .55rem 1.1rem;
  border: 0;
}
.edition .bilan-pdf:hover { background: var(--ed-orange-deep); color: var(--ed-surface); }

/* Même raison : sans cela les liens des tableaux et des renvois ne se
   distinguent plus du texte courant. */
.edition .bilan-table a,
.edition .bilan-lien a,
.edition .bilan-methode a { border-bottom: 1px solid var(--ed-rule); }
.edition .bilan-table a:hover,
.edition .bilan-lien a:hover,
.edition .bilan-methode a:hover { border-bottom-color: var(--ed-orange); }

/* --- chiffres clés --- */
.bilan-essentiel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ed-rule);
  border: 1px solid var(--ed-rule);
  margin-top: 2rem;
}
.bilan-chiffre { background: var(--ed-surface); padding: 1.1rem 1rem; }
.bilan-chiffre b {
  display: block;
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ed-orange-deep);
}
.bilan-chiffre span {
  display: block;
  margin-top: .35rem;
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ed-ink);
}
.bilan-chiffre i {
  display: block;
  margin-top: .2rem;
  font-style: normal;
  font-size: .8rem;
  color: var(--ed-muted);
}

/* --- blocs --- */
.bilan-bloc { margin-top: 2.6rem; }
.bilan-bloc h2 {
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: 1.75rem;
  border-bottom: 2px solid var(--ed-ink);
  padding-bottom: .3rem;
  margin-bottom: .9rem;
}
.bilan-bloc p { max-width: 44em; }

.bilan-avertissement {
  background: var(--ed-acid);
  color: var(--ed-acid-ink);
  border-left: 3px solid var(--ed-acid-ink);
  padding: .85rem 1rem;
  margin: 1.1rem 0;
  font-size: .95rem;
  line-height: 1.5;
  max-width: 44em;
}

.bilan-lien { margin-top: .9rem; font-weight: 600; }

/* --- tableaux --- */
.bilan-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .95rem; }
.bilan-table th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ed-muted);
  border-bottom: 1.5px solid var(--ed-ink);
  padding: .4rem .5rem;
}
.bilan-table td { padding: .5rem; border-bottom: 1px solid var(--ed-rule-soft); vertical-align: top; }
.bilan-table td.num, .bilan-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bilan-table td.tag {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ed-muted);
  white-space: nowrap;
}
.bilan-table td.ok { color: var(--ed-ok); font-weight: 600; }
.bilan-table td.wait { color: var(--ed-muted); }

/* --- barres « textes travaillés » ---
   Les deux barres sont empilées dans un conteneur de largeur fixe : la barre
   « adoptés » est un sous-ensemble des « déposés », pas une série à côté. */
.bilan-barres { margin-top: 1.1rem; }
.bilan-barre {
  display: grid;
  grid-template-columns: minmax(0, 20em) minmax(0, 1fr) 11em;
  gap: .9rem;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--ed-rule-soft);
}
.bilan-barre__lab { font-size: .88rem; line-height: 1.3; }
.bilan-barre__bars { min-width: 0; }
.bilan-barre__dep, .bilan-barre__ado { display: block; height: .55rem; }
.bilan-barre__dep { background: var(--ed-ink); }
.bilan-barre__ado { background: var(--ed-orange); margin-top: 2px; }
.bilan-barre__n { font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.bilan-barre__n i { display: block; font-style: normal; font-size: .76rem; color: var(--ed-muted); }

.bilan-methode p { font-size: .9rem; color: var(--ed-muted); }
.bilan-methode a { color: inherit; }

/* --- index /bilans --- */
.bilan-liste { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.bilan-liste__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--ed-rule-soft);
}
.bilan-liste__item a { display: block; border: 0; }
.bilan-liste__item b { display: block; font-weight: 700; }
.bilan-liste__item span { display: block; font-size: .82rem; color: var(--ed-muted); }
.bilan-liste__item i {
  font-style: normal;
  font-size: .78rem;
  color: var(--ed-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- mobile --- */
@media (max-width: 560px) {
  .bilan-liste__item { flex-direction: column; gap: .15rem; }
  .bilan-liste__item i { white-space: normal; }
}

/* Les tableaux de rapports et de questions portent une colonne « Sujet » qui
   fait plusieurs lignes : à 390 px, la grille la réduit à un mot par ligne et
   la page atteint dix mille pixels de haut. Chaque ligne redevient donc un
   bloc — date et type sur une ligne de chapeau, sujet dessous. La table de
   comparaison, elle, garde sa grille : ses quatre colonnes sont des nombres
   courts qui n'ont de sens qu'alignés. */
@media (max-width: 560px) {
  .bilan-table:not(.bilan-table--compare) thead { display: none; }
  .bilan-table:not(.bilan-table--compare),
  .bilan-table:not(.bilan-table--compare) tbody,
  .bilan-table:not(.bilan-table--compare) tr,
  .bilan-table:not(.bilan-table--compare) td { display: block; width: 100%; }
  .bilan-table:not(.bilan-table--compare) tr {
    padding: .65rem 0;
    border-bottom: 1px solid var(--ed-rule-soft);
  }
  .bilan-table:not(.bilan-table--compare) td { border: 0; padding: .1rem 0; }
  .bilan-table:not(.bilan-table--compare) td.tag,
  .bilan-table:not(.bilan-table--compare) td.ok,
  .bilan-table:not(.bilan-table--compare) td.wait {
    display: inline-block;
    width: auto;
    margin-right: .7rem;
  }
  .bilan-table:not(.bilan-table--compare) td.num { text-align: left; }
  .bilan-table--compare { font-size: .8rem; }
  .bilan-table--compare td, .bilan-table--compare th { padding: .35rem .2rem; }
}

@media (max-width: 760px) {
  .bilan-essentiel { grid-template-columns: repeat(2, 1fr); }
  .bilan-chiffre b { font-size: 2rem; }
  .bilan-barre {
    grid-template-columns: 1fr;
    gap: .25rem;
    padding: .6rem 0;
  }
  .bilan-barre__n { text-align: left; }
  .bilan-barre__n i { display: inline; margin-left: .4rem; }
  .bilan-table { font-size: .88rem; }
  .bilan-table td, .bilan-table th { padding: .4rem .3rem; }
}
