/* ======================================================================
   MJBS | STYLESHEET COMPLET | 04 novembre 2026
   Compatible avec le FOOTER HTML SANS LIENS (balises <div class="mjbs-logo-item">).

   Grand ecran (> 1250 px) : 8 logos a gauche + 8 logos a droite.
   Tablette / telephone    : UNE SEULE serie de 8 logos dans une grille.
   Ordre du HTML : ResearchGate, Google Scholar, ScienceOpen, OpenAlex,
                   DataCite, Zenodo, CORE, Bing.

   Ce fichier REMPLACE l'ancienne feuille CSS MJBS de logos :
   ne pas l'ajouter en parallele a une ancienne version.
   ====================================================================== */

/* 1. Eviter qu'un conteneur OJS coupe les colonnes flottantes. */
.pkp_structure_footer,
.pkp_brand_footer {
  overflow: visible !important;
}

/* 2. Empecher les anciens grands logos, s'ils subsistent dans un tableau
      de l'ancien footer, de s'afficher en double. Preferer supprimer ce
      tableau directement dans le HTML du footer. */
.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;
}

/* 3. Masquer les doublons historiques Zenodo/Bing provenant d'anciens
      blocs de la barre laterale, sans masquer "Information" ni "Language". */
.pkp_structure_sidebar :is(a, p):has(> img[alt="Zenodo"]),
.pkp_structure_sidebar :is(a, p):has(> img[alt="Bing"]),
.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;
}

/* 4. Colonnes de logos sur grand ecran. */
.mjbs-logo-rail {
  position: fixed !important;
  top: clamp(100px, 20vh, 160px) !important;
  z-index: 900;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 114px;
  max-width: 114px;
  max-height: calc(100vh - 115px);
  max-height: calc(100dvh - 115px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 !important;
  padding: 3px 2px !important;
  scrollbar-width: none;
}
.mjbs-logo-rail::-webkit-scrollbar { display: none; }
.mjbs-logo-rail--left  { left: 7px !important; right: auto !important; }
.mjbs-logo-rail--right { right: 7px !important; left: auto !important; }

/* 5. Cartes NON CLIQUABLES : les 8 items sont des <div>, pas des <a>. */
.mjbs-logo-rail > .mjbs-logo-item {
  box-sizing: border-box;
  display: flex !important;
  flex: 0 0 52px;
  align-items: center;
  justify-content: center;
  width: 106px !important;
  min-width: 0;
  height: 52px !important;
  min-height: 52px;
  padding: 6px !important;
  margin: 0 !important;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.11);
  text-align: center;
  cursor: default;
  overflow: hidden;
}

/* 6. Dimensions des images : aucun logo geant ni position fixe. */
.mjbs-logo-rail > .mjbs-logo-item > img {
  position: static !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 92px !important;
  height: 36px !important;
  max-height: 36px !important;
  margin: 0 auto !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;
}

/* 7. ScienceOpen / DataCite : logos typographiques non cliquables. */
.mjbs-logo-rail .mjbs-text-logo {
  display: block;
  width: 100%;
  color: #515861;
  font: 700 12px/1.25 Arial, Helvetica, sans-serif;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.mjbs-logo-rail .mjbs-text-logo strong { color: #70ad32; }
.mjbs-logo-rail .mjbs-datacite-logo {
  color: #008bb5;
  font-size: 15px;
  font-weight: 700;
}

/* 8. Garder le logo de la revue et les coordonnees au centre du footer. */
.mjbs-footer-signature {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto !important;
  padding: 12px 12px 18px;
  text-align: center !important;
  overflow-wrap: anywhere;
}
.mjbs-footer-signature p {
  margin: 0 0 12px !important;
  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;
  border: 0 !important;
  box-shadow: none !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.6;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* 9. Tablette : un seul groupe de 8 logos dans le footer, 4 par ligne. */
@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;
    width: min(100%, 480px) !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 8px auto 20px !important;
    padding: 2px 8px !important;
    transform: none !important;
  }

  .mjbs-logo-rail.mjbs-logo-rail--left > .mjbs-logo-item {
    width: 100% !important;
    height: 53px !important;
    min-height: 53px;
    min-width: 0;
    padding: 5px !important;
    margin: 0 !important;
    flex: none;
  }

  .mjbs-logo-rail.mjbs-logo-rail--left > .mjbs-logo-item > img {
    width: 100% !important;
    max-width: 94px !important;
    height: 34px !important;
    max-height: 34px !important;
  }
}

/* 10. Telephone : 2 colonnes x 4 lignes, sans barres laterales flottantes. */
@media (max-width: 600px) {
  .mjbs-logo-rail.mjbs-logo-rail--left {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 360px) !important;
    gap: 8px;
    margin: 8px auto 18px !important;
    padding: 2px 10px !important;
  }

  .mjbs-logo-rail.mjbs-logo-rail--left > .mjbs-logo-item {
    height: 52px !important;
    min-height: 52px;
  }

  .mjbs-logo-rail .mjbs-text-logo { font-size: 12px; }
  .mjbs-logo-rail .mjbs-datacite-logo { font-size: 14px; }
  .mjbs-footer-signature { padding: 5px 12px 14px; }
  .mjbs-footer-brand img { width: 86px !important; }
  .mjbs-footer-signature .mjbs-footer-copyright,
  .mjbs-footer-contact { font-size: 12px; line-height: 1.55; }
}
