/* ========================================================================
   MJBS — Feuille CSS COMPLETE de remplacement (2026-11-03)
   Remplace Stylesheets(1).css et les anciennes versions MJBS 7 logos.
   Desktop : 7 logos a gauche + les memes 7 a droite.
   Mobile/tablette : 7 logos UNE SEULE FOIS dans une grille compacte.
   Ne cible plus globalement les images par leur alt/src (ancienne erreur).
   ======================================================================== */

/* 1. Corriger les anciens grands logos du tableau dans le footer, s'il reste
   dans un ancien bloc HTML. :has() est pris en charge par Chrome recent. */
.pkp_structure_footer table:has(img[src*="reseachgate"]),
.pkp_structure_footer table:has(img[alt="Google Scholar"]),
.pkp_brand_footer table:has(img[src*="reseachgate"]) {
  display: none !important;
}

/* 2. Supprimer les doublons Zenodo / Bing des anciens blocs de la sidebar.
   La sidebar "Information" et "Language" reste visible normalement. */
.pkp_structure_sidebar img[alt="Zenodo"],
.pkp_structure_sidebar img[alt="Bing"],
.pkp_structure_sidebar img[src*="zenodo-gradient"],
.pkp_structure_sidebar img[src*="Bing_Fluent_Logo"] {
  display: none !important;
}
.pkp_structure_sidebar a:has(> img[alt="Zenodo"]),
.pkp_structure_sidebar a:has(> img[alt="Bing"]),
.pkp_structure_sidebar p:has(> img[alt="Zenodo"]),
.pkp_structure_sidebar p:has(> img[alt="Bing"]) {
  display: none !important;
}

/* 3. Ne pas couper les rails quand ils depassent du pied de page. */
.pkp_structure_footer,
.pkp_brand_footer {
  overflow: visible !important;
}

/* 4. Deux rails lateraux uniquement sur grand ecran. */
.mjbs-logo-rail {
  position: fixed !important;
  top: max(125px, 22vh) !important;
  z-index: 900;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 112px;
  max-height: calc(100vh - 145px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 2px;
  scrollbar-width: thin;
}
.mjbs-logo-rail--left { left: 7px !important; right: auto !important; }
.mjbs-logo-rail--right { right: 7px !important; left: auto !important; }

.mjbs-logo-rail > a {
  box-sizing: border-box;
  width: 106px;
  height: 52px;
  flex: 0 0 52px;
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 6px;
  border: 1px solid #e2e7ee;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .11);
  text-decoration: none !important;
  text-align: center;
}
.mjbs-logo-rail > a:focus-visible {
  outline: 2px solid #107a94;
  outline-offset: 2px;
}
.mjbs-logo-rail > a > img {
  /* Neutralise l'ancien CSS qui rendait TOUTES les images fixes/geantes. */
  position: static !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 92px !important;
  height: 37px !important;
  max-height: 37px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain !important;
  transform: none !important;
}
.mjbs-logo-rail .mjbs-scienceopen {
  color: #5b6065;
  font: 700 12px/1.2 Arial, Helvetica, sans-serif;
  white-space: nowrap;
}
.mjbs-logo-rail .mjbs-scienceopen span { color: #6cae2e; }

/* 5. Signature du footer, lisible et centree a toutes les tailles. */
.mjbs-footer-signature {
  box-sizing: border-box;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 12px 18px;
  text-align: center !important;
  overflow-wrap: anywhere;
}
.mjbs-footer-signature p {
  margin: 0 0 12px;
  text-align: center !important;
}
.mjbs-footer-brand img {
  position: static !important;
  display: inline-block !important;
  width: 100px !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  object-fit: contain;
}
.mjbs-footer-signature .mjbs-footer-copyright { font-size: 14px; line-height: 1.5; }
.mjbs-footer-contact { font-size: 14px; line-height: 1.65; }
.mjbs-footer-contact a { overflow-wrap: anywhere; word-break: break-word; }

/* 6. Tablette ET telephone : un seul jeu de logos, dans le flux du footer.
   Plus aucune colonne flottante sur mobile. */
@media (max-width: 1250px) {
  .mjbs-logo-rail--right { display: none !important; }
  .mjbs-logo-rail.mjbs-logo-rail--left {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    justify-items: stretch;
    gap: 8px;
    box-sizing: border-box;
    width: min(100%, 468px) !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 6px auto 20px !important;
    padding: 2px 8px !important;
    transform: none !important;
  }
  .mjbs-logo-rail.mjbs-logo-rail--left > a {
    display: flex !important;
    width: 100% !important;
    min-width: 0;
    height: 51px !important;
    flex: none;
    padding: 5px;
    margin: 0 !important;
  }
  .mjbs-logo-rail.mjbs-logo-rail--left > a > img {
    width: 100% !important;
    max-width: 96px !important;
    height: 34px !important;
    max-height: 34px !important;
  }
}

@media (max-width: 600px) {
  .mjbs-logo-rail.mjbs-logo-rail--left {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 360px) !important;
    gap: 7px;
    padding: 2px 10px !important;
  }
  .mjbs-logo-rail--left > a:last-child { grid-column: 2; }
  .mjbs-logo-rail .mjbs-scienceopen { font-size: 11px; }
  .mjbs-footer-signature { padding: 4px 14px 14px; }
  .mjbs-footer-brand img { width: 86px !important; }
  .mjbs-footer-signature .mjbs-footer-copyright,
  .mjbs-footer-contact { font-size: 12px; line-height: 1.55; }
}
