/* ==========================================================================
   SATAF – feuille de styles (charte graphique)
   ========================================================================== */

:root {
  --vert: #39562e;
  --vert-2: #4b6d39;
  --vert-3: #659c44;
  --vert-4: #91b94d;
  --bordeaux: #7a2e2e;
  --moutarde: #ba9137;
  --orange: #c86a39;
  --noir: #23282b;
  --beige: #ebe4d8;
  --beige-clair: #f1e5da;
  --fond: #f6f1ea;
  --gris-texte: #4a4f52;
  --bordure: #e2d9cb;
  --titres: "Asap Condensed", Arial, sans-serif;
}

body { font-size: 16px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--titres); font-weight: 700; }

/* --- Mise en page générale + pied de page collant (sticky footer) ---------
   La page occupe au moins toute la hauteur de l'écran ; le contenu prend
   l'espace disponible et pousse le pied de page en bas. Si le contenu est
   plus long que l'écran, le pied de page suit simplement à la fin. */
html, body { height: auto; }
body.bslib-page-navbar {
  min-height: 100vh; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
body.bslib-page-navbar > .navbar { flex: 0 0 auto; }
body.bslib-page-navbar > .container-fluid {
  flex: 1 0 auto; display: flex; flex-direction: column;
  padding: 0 !important; width: 100%;
}
body.bslib-page-navbar > .container-fluid > .tab-content { flex: 1 0 auto; }

.container-sataf { max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
/* Pages pleine largeur (Géoportails) */
.container-sataf.pleine-largeur { max-width: none; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 64px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 28px; }
.discret { color: var(--gris-texte); margin: 0; }

/* --- Barre de navigation ------------------------------------------------- */
.navbar { margin-bottom: 0 !important; background: #fff !important; border-bottom: 1px solid var(--bordure); padding: 10px 24px; }
.navbar-brand { display: flex; align-items: center; padding: 0; margin: 0 16px 0 0; line-height: 1; }
.sataf-brand { display: flex; align-items: center; gap: 12px; color: var(--noir); }
.sataf-brand-text { display: flex; flex-direction: column; }
.sataf-wordmark { font-family: var(--titres); font-weight: 700; font-size: 28px; line-height: 1; }
.sataf-descriptor { font-family: var(--titres); font-weight: 600; font-size: 11px; line-height: 1.2; }
.sataf-app-name {
  margin-left: 14px; padding-left: 14px; border-left: 1px solid #d6ccbd;
  font-family: var(--titres); font-size: 18px; color: var(--vert-2);
}
.navbar .nav-link {
  font-weight: 600; color: var(--vert) !important; padding: 10px 18px !important;
  border-radius: 6px; margin-left: 4px;
}
.navbar .nav-link.active { background: var(--vert); color: #fff !important; }
@media (max-width: 720px) { .sataf-app-name { display: none; } }

/* --- Boutons --------------------------------------------------------------- */
.btn-sataf, .btn-sataf-outline {
  display: inline-block; padding: 13px 22px; border-radius: 6px;
  font-weight: 600; text-decoration: none; text-align: center;
}
.btn-sataf { background: var(--vert); color: #fff !important; border: 1px solid var(--vert); }
.btn-sataf:hover { background: var(--noir); border-color: var(--noir); }
.btn-sataf-outline { border: 1px solid var(--vert); color: var(--vert); }
.btn-sataf-outline:hover { background: var(--vert); color: #fff; }

/* --- Bandeau d'ouverture --------------------------------------------------- */
.hero { background: var(--beige-clair); }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 60px; padding-bottom: 60px; }
.hero-texte { flex: 1 1 500px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { margin: 0; font-size: clamp(34px, 4.2vw, 52px); line-height: 1.05; color: var(--vert); }
.hero-intro { margin: 0; font-size: 18px; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.surtitre { margin: 0; font-family: var(--titres); font-weight: 600; font-size: 16px; color: var(--bordeaux); }
.surtitre.vert { color: var(--vert-2); }

.mosaique { flex: 0 1 480px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 100%; }
.mosaique > * { aspect-ratio: 1 / 1; width: 100%; display: block; }
.mosaique img { object-fit: cover; }
.q-tl { border-top-left-radius: 100%; }
.q-br { border-bottom-right-radius: 100%; }

/* --- Chiffres clés ---------------------------------------------------------- */
.chiffres { background: var(--vert); color: #fff; }
.chiffres-grille {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 24px; padding-top: 34px; padding-bottom: 34px;
}
.chiffre { display: flex; flex-direction: column; gap: 2px; }
.chiffre-valeur { font-family: var(--titres); font-weight: 700; font-size: 38px; line-height: 1.1; }
.chiffre-label { font-size: 14px; color: #e6eedd; }

/* --- Sections ---------------------------------------------------------------- */
.section-entete { display: flex; flex-direction: column; gap: 8px; max-width: 800px; }
.section-entete h2 { margin: 0; font-size: 36px; color: var(--vert); }
.section-entete p { margin: 0; font-size: 17px; }
.section-entete.ligne { max-width: none; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; }

.grille-resultats { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; }
.carte-resultat {
  background: #fff; border-radius: 12px; padding: 26px; border-top: 6px solid;
  display: flex; flex-direction: column; gap: 10px;
}
.carte-resultat h3 { margin: 0; font-size: 23px; line-height: 1.2; }
.carte-resultat p { margin: 0; font-size: 15px; }
.resultat-code { font-family: var(--titres); font-weight: 700; color: var(--bordeaux); }
.carte-resultat.fonce { background: var(--vert); color: #fff; }
.carte-resultat.fonce .resultat-code { color: #d6e8b8; }

.grille-filieres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-radius: 12px; overflow: hidden; margin-top: 8px; margin-bottom: 48px;
}
.grille-filieres figure { margin: 0; position: relative; }
.grille-filieres img { width: 100%; height: 260px; object-fit: cover; display: block; }
.grille-filieres figcaption {
  position: absolute; left: 0; bottom: 0; color: #fff; padding: 8px 16px;
  font-family: var(--titres); font-weight: 700; font-size: 18px; border-top-right-radius: 24px;
}

/* --- Activités Nitidæ ----------------------------------------------------- */
.bloc-beige { background: var(--beige); }
.bloc-beige .section { padding-bottom: 64px; }
.grille-activites {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px;
}
.grille-activites li { background: #fff; border-radius: 10px; padding: 22px; display: flex; gap: 16px; align-items: flex-start; }
.grille-activites h3 { margin: 0 0 4px; font-size: 20px; }
.grille-activites p { margin: 0; font-size: 15px; }
.activite-code {
  flex: 0 0 48px; height: 48px; border-radius: 0 0 48px 0; background: var(--vert); color: #fff;
  font-family: var(--titres); font-weight: 700; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.grille-graphiques { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; }
.carte-graphique { background: #fff; border-radius: 12px; padding: 24px; }
.carte-graphique h3 { margin: 0 0 8px; font-size: 20px; }

/* --- Indicateurs ------------------------------------------------------------ */
.grille-indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.carte-indicateur { background: #fff; border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.ind-libelle, .ind-cible { font-size: 14px; color: var(--gris-texte); }
.ind-valeur { font-family: var(--titres); font-weight: 700; font-size: 34px; line-height: 1.1; }
.barre { height: 10px; background: #f1ece3; border-radius: 5px; overflow: hidden; }
.barre-remplie { height: 10px; background: var(--vert); }

/* --- Géoportails ------------------------------------------------------------- */
.geo-entete { background: var(--vert); color: #fff; padding-top: 34px; }
.geo-entete h1 { margin: 0 0 6px; font-size: 42px; }
.geo-entete p { margin: 0 0 18px; color: #e6eedd; max-width: 760px; font-size: 17px; }

.onglets-pays .form-group { margin: 0; }
.onglets-pays .shiny-options-group { display: flex; flex-wrap: wrap; gap: 6px; }
.onglets-pays .radio-inline { margin: 0 !important; padding: 0 !important; }
.onglets-pays input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.onglets-pays .radio-inline > span {
  display: inline-block; min-height: 48px; padding: 12px 22px; cursor: pointer;
  border-radius: 10px 10px 0 0; background: var(--vert-2); color: #fff; font-weight: 600;
}
.onglets-pays input:checked + span { background: var(--fond); color: var(--noir); }
.onglets-pays input:focus-visible + span { outline: 3px solid var(--vert-4); outline-offset: 2px; }

.geo-corps { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 28px; padding-bottom: 56px; }
.geo-carte { flex: 999 1 640px; align-self: stretch; min-width: 0; background: #fff; border: 1px solid var(--bordure); border-radius: 12px; overflow: hidden; }
.geo-barre { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--bordure); font-family: var(--titres); font-size: 19px; }
.pastille { width: 14px; height: 14px; border-radius: 0 0 14px 0; flex: 0 0 14px; }
.geo-iframe { display: block; width: 100%; height: calc(100vh - 330px); min-height: 520px; border: 0; }
.geo-vide { height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #e3ead6; }
.geo-vide h3 { color: var(--vert); margin: 0 0 6px; }
.geo-vide p { color: var(--gris-texte); max-width: 420px; margin: 0; }

.geo-panneau { flex: 0 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.geo-fiche { background: #fff; border-radius: 12px; padding: 22px; border-top: 6px solid; display: flex; flex-direction: column; gap: 14px; }
.geo-fiche h2 { margin: 0; font-size: 26px; }
.fiche-bloc { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.fiche-label { font-size: 14px; font-weight: 600; color: var(--gris-texte); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-filiere { padding: 4px 12px; border-radius: 0 12px 0 12px; color: #fff; font-size: 14px; font-weight: 600; }
.geo-aide { background: var(--beige); border-radius: 12px; padding: 20px; font-size: 14px; }
.geo-aide h3 { font-size: 17px; margin: 0 0 6px; }
.geo-aide p { margin: 0; }

/* --- Pied de page ------------------------------------------------------------ */
.sataf-footer { flex-shrink: 0; margin-top: auto; position: static; width: 100%; background: var(--beige-clair); border-top: 1px solid var(--bordure); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-top: 24px; padding-bottom: 24px; }
.logo-partenaire { height: 40px; width: auto; }
.logo-placeholder { padding: 10px 14px; border: 1px dashed #b8ab96; border-radius: 6px; font-size: 14px; }
.footer-sep { width: 1px; height: 32px; background: var(--noir); }

@media (max-width: 600px) {
  .container-sataf, .container-sataf.pleine-largeur { padding-left: 16px; padding-right: 16px; }
  .grille-activites, .grille-graphiques { grid-template-columns: 1fr; }
}

/* --- Sélecteur de langue (barre de navigation) ----------------------------- */
.selecteur-langue { display: flex; align-items: center; margin-left: 12px; }
.selecteur-langue .form-group { margin: 0; }
.selecteur-langue select {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--vert); border-radius: 6px;
  background-color: #fff; color: var(--vert); font-weight: 600; cursor: pointer;
}
.selecteur-langue select:focus-visible { outline: 3px solid var(--vert-4); outline-offset: 2px; }
