/* Feuille de style générée par projet_scraping_pir.py
   Direction artistique reprise de l'onglet Analyse fondamentale de capitalantifragile.com :
   fond clair, panneaux blancs, Inter, une encre par rubrique (variable --accent), gravures à une encre. */
:root {
  --texte: #0f172a;
  --texte-2: #475467;
  --texte-3: #667085;
  --fond: #f6f7f9;
  --blanc: #ffffff;
  --trait: #e6e8ec;
  --trait-doux: #f0f1f4;
  --vert: #0E8A5F;
  --rouge: #C2362B;
  --rayon: 16px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --accent: #1B4FD8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, Arial, sans-serif; font-size: 14.5px;
       color: var(--texte); background: var(--fond); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 34px 0 12px; }
h3 { font-size: 16px; font-weight: 700; margin: 18px 0 6px; }
section { margin-bottom: 18px; }
strong { font-weight: 600; }

/* ---- Rail des rubriques (à gauche) ---- */
.rail { position: fixed; top: 0; left: 0; bottom: 0; width: 92px; background: var(--blanc); border-right: 1px solid var(--trait);
        display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 2px; z-index: 30; overflow-y: auto; }
.rail-logo { width: 46px; height: 46px; border-radius: 12px; background: #0f172a; color: white; font-weight: 800; font-size: 15px;
             display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.rail-logo:hover { text-decoration: none; }
.rail-sous { font-size: 9.5px; font-weight: 600; color: var(--texte-3); text-transform: uppercase; letter-spacing: .06em;
             margin: 6px 0 14px; text-align: center; }
.rail-item { width: 80px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px;
             border-radius: 12px; color: var(--texte-2); font-size: 11.5px; font-weight: 500; text-align: center; }
.rail-item i { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
               font-size: 15px; color: var(--teinte); }
.rail-item:hover { background: var(--trait-doux); text-decoration: none; color: var(--texte); }
.rail-item.actif { color: var(--teinte); font-weight: 700; }
.rail-item.actif i { background: var(--teinte); color: white; }

/* ---- Page et en-tête ---- */
.page { margin-left: 92px; padding: 22px 34px 0; max-width: 1380px; }
.tete { background: var(--blanc); border: 1px solid var(--trait); border-radius: 20px; box-shadow: var(--ombre); overflow: hidden; }
.tete-haut { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 26px 34px 20px; }
.tete-texte { max-width: 760px; }
.tete-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12px; color: var(--texte-3); }
.pastille { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 20px; background: #ecfdf3;
            color: #067647; font-weight: 600; }
.pastille .point { width: 7px; height: 7px; border-radius: 50%; background: #12B76A; }
.tete h1 { font-size: 40px; line-height: 1.08; font-weight: 800; letter-spacing: -.035em; margin: 0 0 12px; color: var(--texte); }
.tete h1 .encre { color: var(--accent); }
.chapeau { font-size: 15.5px; color: var(--texte-2); margin: 0; }
.tete-gravure { width: 250px; height: 190px; object-fit: contain; flex-shrink: 0; }
.onglets { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 34px 18px; }
.onglets a { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--trait); color: var(--texte-2); font-size: 13px; font-weight: 500; }
.onglets a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.onglets a.actif { background: var(--accent); border-color: var(--accent); color: white; }
.bande-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--trait);
                  background: #fbfbfc; }
.bande-chiffres div { padding: 16px 22px; border-right: 1px solid var(--trait); }
.bande-chiffres div:last-child { border-right: none; }
.bande-chiffres strong { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.bande-chiffres span { font-size: 12px; color: var(--texte-3); line-height: 1.35; display: block; margin-top: 2px; }
main { padding: 8px 0 30px; }
main > section:first-child:not(.cartes):not(.sans-cadre) { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 18px 24px; margin-top: 22px; font-size: 14.5px; color: var(--texte-2); box-shadow: var(--ombre); }
main > section:first-child { max-width: none; }
main > section:first-child p:first-child { margin-top: 0; }
main > section:first-child p:last-child { margin-bottom: 0; }
main > section:first-child strong { color: var(--texte); }

/* ---- Cartes des rubriques (accueil) ---- */
.cartes-rubriques { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.carte-rubrique { display: flex; flex-direction: column; background: var(--blanc); border: 1px solid var(--trait);
                  border-radius: var(--rayon); overflow: hidden; color: var(--texte); box-shadow: var(--ombre);
                  transition: transform .2s, box-shadow .2s; }
.carte-rubrique:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16,24,40,.10); text-decoration: none; }
.carte-rubrique-image { height: 150px; display: flex; align-items: center; justify-content: center;
                        background: color-mix(in srgb, var(--teinte) 6%, white); }
.carte-rubrique-image img { max-height: 132px; max-width: 86%; object-fit: contain; }
.carte-rubrique-titre { padding: 14px 18px 4px; font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.carte-rubrique-titre i { color: var(--teinte); font-size: 13px; }
.carte-rubrique-texte { padding: 0 18px 16px; font-size: 13px; color: var(--texte-2); }

/* ---- Cartes « chiffre clé » ---- */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 22px; }
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: 14px 18px; box-shadow: var(--ombre); }
.carte p { margin: 0; }
.carte-titre { font-size: 12px; color: var(--texte-3); font-weight: 500; }
.carte-titre a { color: var(--texte-3); }
.carte-valeur { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px !important; color: var(--texte); }
.carte-detail { font-size: 12px; color: var(--texte-3); }

/* ---- Textes ---- */
.intro { font-size: 15px; }
.texte-long { max-width: 860px; }
.texte-long p, .texte-long li { font-size: 15px; color: var(--texte-2); }
.texte-long strong { color: var(--texte); }
.note { font-size: 12.5px; color: var(--texte-3); }
.petit { font-size: 11.5px; color: var(--texte-3); }
code { background: var(--trait-doux); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.fil { font-size: 12px; }
.source-serie { font-size: 12.5px; color: var(--texte-3); margin: 18px 0 0; }
.source-petite { font-size: 11px; color: var(--texte-3); }
.lecture-auto { background: color-mix(in srgb, var(--accent) 5%, white); border: 1px solid color-mix(in srgb, var(--accent) 18%, white);
                padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.liens-series { font-size: 12.5px; color: var(--texte-3); }

/* ---- Mécanisme, bilan, époques ---- */
.mecanisme { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.temps { position: relative; background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: 16px;
         color: var(--texte-2); font-size: 13.5px; box-shadow: var(--ombre); }
.temps strong { display: block; font-size: 15px; font-weight: 700; color: var(--texte); margin-bottom: 4px; padding-right: 36px; }
.temps .numero { position: absolute; top: 12px; right: 14px; font-weight: 800; font-size: 20px; color: var(--accent); }
a.temps:hover { border-color: var(--accent); text-decoration: none; }
.epoques { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.epoque { background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: 4px 18px 12px; font-size: 13.5px;
          color: var(--texte-2); box-shadow: var(--ombre); }
.deux-epoques { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mur-logos { display: flex; flex-wrap: wrap; gap: 10px; }
.mur-logos figure { width: 104px; text-align: center; padding: 10px; }
.mur-logos img { height: 44px; width: 84px; object-fit: contain; }

/* ---- Catalogue des séries ---- */
.recherche { width: 100%; max-width: 620px; padding: 12px 16px; font: 14.5px "Inter", sans-serif; border: 1px solid var(--trait);
             border-radius: 12px; background: var(--blanc); margin: 10px 0 12px; box-shadow: var(--ombre); }
.recherche:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, white); }
.puces-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.puces-categories a { padding: 6px 12px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 20px;
                      font-size: 12.5px; color: var(--texte-2); }
.puces-categories a span { background: var(--trait-doux); color: var(--texte); border-radius: 10px; padding: 0 7px; margin-left: 4px; font-size: 11px; font-weight: 600; }
.entete-categorie { display: flex; gap: 20px; align-items: center; margin: 30px 0 14px; background: var(--blanc);
                    border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.entete-categorie-image { width: 190px; height: 130px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
                          background: color-mix(in srgb, var(--teinte) 7%, white); }
.entete-categorie-image img { max-width: 160px; max-height: 112px; object-fit: contain; }
.entete-categorie h2 { margin: 0 0 4px; color: var(--teinte); }
.entete-categorie p { margin: 0 18px 0 0; color: var(--texte-2); font-size: 13.5px; }
.grille-series { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.carte-serie { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--blanc);
               border: 1px solid var(--trait); border-radius: 14px; color: var(--texte); box-shadow: var(--ombre);
               transition: transform .15s, box-shadow .15s, border-color .15s; }
.carte-serie:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,.09); border-color: var(--teinte); text-decoration: none; }
.carte-serie-titre { font-weight: 600; font-size: 13px; color: var(--texte); min-height: 38px; }
.carte-serie-valeur { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.carte-serie-valeur small { font-size: 11px; color: var(--texte-3); font-weight: 500; letter-spacing: 0; }
.carte-serie-detail { font-size: 11.5px; color: var(--texte-3); }
.sparkline { width: 100%; height: 38px; }

/* ---- Graphiques ---- */
.graphique { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 18px 16px; box-shadow: var(--ombre); }
.graphique-barre { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 34px;
                   border-bottom: 1px solid var(--trait-doux); padding-bottom: 10px; margin-bottom: 10px; }
.lecture { margin: 0; font-size: 13px; color: var(--texte-2); min-height: 20px; }          /* la valeur survolée s'écrit ici */
.lecture strong { color: var(--texte); }
.lecture .unite { color: var(--texte-3); font-size: 11.5px; }
.periodes { display: flex; gap: 2px; background: var(--trait-doux); padding: 3px; border-radius: 9px; }
.periodes button { font: 500 12px "Inter", sans-serif; padding: 5px 10px; border: none; background: none; border-radius: 7px;
                   cursor: pointer; color: var(--texte-2); }
.periodes button:hover { color: var(--texte); }
.periodes button.actif { background: var(--blanc); color: var(--texte); box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.toile { position: relative; }
.bloc-graphique > p { max-width: 900px; color: var(--texte-2); font-size: 13.5px; margin-top: -4px; }

/* ---- Boutons dépliants : pourquoi, données brutes ---- */
details { margin: 14px 0; }
details > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
                    border-radius: 10px; font-weight: 600; font-size: 13.5px; background: var(--accent); color: white; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '\f05a'; font-family: "Font Awesome 6 Free"; font-weight: 900; }
details.donnees-brutes > summary { background: var(--blanc); color: var(--texte); border: 1px solid var(--trait); }
details.donnees-brutes > summary::before { content: '\f0ce'; }
.pourquoi-texte { background: var(--blanc); border: 1px solid var(--trait); border-left: 3px solid var(--accent);
                  border-radius: 0 12px 12px 0; padding: 6px 20px; margin-top: 10px; max-width: 900px; color: var(--texte-2); }
.pourquoi-texte strong { color: var(--texte); }

/* ---- Tableaux ---- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--blanc); font-size: 13px;
        border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; box-shadow: var(--ombre); }
table.etroit { width: 100%; }
thead th { position: sticky; top: 0; z-index: 1; background: #f9fafb; color: var(--texte-2); text-align: left; white-space: nowrap;
           padding: 10px 14px; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--trait); }
td { padding: 9px 14px; border-bottom: 1px solid var(--trait-doux); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, white); }
td.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.large { width: 30%; }
.hausse { color: var(--vert); }
.baisse { color: var(--rouge); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge.oui { background: #ecfdf3; color: #067647; }
.badge.non { background: #fef3f2; color: #b42318; }
.symbole { font-size: 11.5px; color: var(--texte-3); margin-left: 4px; }
tr.pir td { background: color-mix(in srgb, var(--accent) 6%, white); }
tr.ligne-section td { background: #f9fafb; color: var(--texte); font-weight: 700; font-size: 12.5px; }
tr.ligne-region td { font-weight: 600; background: #fbfbfc; }

/* Carte de chaleur */
.case { text-align: center; }
.chaleur td.case { min-width: 64px; }
.chaud3 { background: #B42318 !important; color: white; }
.chaud2 { background: #E36A2E !important; color: white; }
.chaud1 { background: #FCE3CC !important; }
.neutre { background: #F4F5F7 !important; }
.froid1 { background: #DCE7FB !important; }
.froid2 { background: #2E5CC9 !important; color: white; }
.vide { color: #98A2B3; }
.chaud3 .petit, .chaud2 .petit, .froid2 .petit { color: rgba(255,255,255,.85); }
.legende .case { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; margin: 2px; }
.barre { height: 10px; background: var(--accent); opacity: .8; border-radius: 5px; }
.grille-tableaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 20px; }

/* Images */
.avec-logo { display: flex; gap: 22px; align-items: center; }
.logo-source { width: 84px; flex-shrink: 0; background: #0f172a; border-radius: 50%; padding: 6px; }   /* sceau blanc : fond sombre */
.logo-entreprise { width: 150px; max-height: 80px; object-fit: contain; flex-shrink: 0; background: white; padding: 10px; border-radius: 12px; border: 1px solid var(--trait); }
.cellule-logo img { width: 66px; height: 28px; object-fit: contain; display: block; }
.galerie { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
figure { margin: 0; background: var(--blanc); padding: 12px; border-radius: 14px; border: 1px solid var(--trait); }
figure img { width: 100%; display: block; }
figcaption { font-size: 12px; color: var(--texte-3); margin-top: 6px; }
.deux-colonnes { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
ul li { margin-bottom: 4px; }

/* ---- Pied de page ---- */
footer { border-top: 1px solid var(--trait); margin-top: 30px; padding: 18px 0 30px; font-size: 12px; color: var(--texte-3); }
footer .sources span { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-right: 8px; color: var(--texte-2); }
footer p { margin: 4px 0; }

/* ---- Petits écrans : le rail passe en haut ---- */
@media (max-width: 900px) {
  .rail { position: static; width: auto; height: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--trait); padding: 8px; }
  .rail-sous { display: none; }
  .rail-item { width: 70px; flex-shrink: 0; }
  .page { margin-left: 0; padding: 14px 16px 0; }
  .tete-haut { flex-direction: column; align-items: flex-start; padding: 20px; }
  .tete-gravure { display: none; }
  .tete h1 { font-size: 30px; }
  .deux-colonnes, .deux-epoques { grid-template-columns: 1fr; }
  .avec-logo, .entete-categorie { flex-direction: column; align-items: flex-start; }
  table { font-size: 12px; display: block; overflow-x: auto; }
}
