/* ========================================================================
   MJBS — Feuille CSS COMPLETE de remplacement (2026-11-04)
   Remplace Stylesheets(1).css et les anciennes versions MJBS 8 logos.
   Desktop : 8 logos a gauche + les memes 8 a droite (ordre corrige).
   Mobile/tablette : 8 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(2, minmax(0, 1fr));
    width: min(100%, 350px) !important;
    gap: 7px;
    padding: 2px 10px !important;
  }
  
  .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; }
}

/* 7. DataCite Commons — libellé typographique (aucun droit de marque implicite).
      Les DOI MJBS sont trouvables via Zenodo ; ce n'est pas un badge de membre. */
.mjbs-logo-rail .mjbs-datacite {
  color: #008bb5;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.1;
}
@media (max-width: 600px) {
  .mjbs-logo-rail .mjbs-datacite { font-size: 14px; }
}

/* 8. ORDRE GARANTI : agit sur les deux colonnes et sur la grille mobile.
   Ces valeurs corrigent aussi visuellement un ancien Footer si son HTML
   n'a pas encore ete remplace. Pas de changement de taille ou de position. */
.mjbs-logo-rail > a[href*="researchgate.net"]   { order: 1 !important; }
.mjbs-logo-rail > a[href*="scholar.google.com"] { order: 2 !important; }
.mjbs-logo-rail > a[href*="scienceopen.com"]   { order: 3 !important; }
.mjbs-logo-rail > a[href*="openalex.org"]      { order: 4 !important; }
.mjbs-logo-rail > a[href*="commons.datacite.org"] { order: 5 !important; }
.mjbs-logo-rail > a[href*="zenodo.org"]        { order: 6 !important; }
.mjbs-logo-rail > a[href*="core.ac.uk"]        { order: 7 !important; }
.mjbs-logo-rail > a[href*="bing.com"]          { order: 8 !important; }
