/* Open Library Publications — article detail grid repair — 2026-09-08 v88
 * Fix OJS 3.5 article_details' legacy fixed-width floats inside the custom
 * journal shell. Without this, .entry_details can fall below .main_entry and
 * an article/issue cover may expand across the whole article card.
 */

/* Keep the article's OJS main/meta columns in one responsive layout. */
html body.openlib-journal-page .page_article .obj_article_details > .row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 250px) !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 18px 0 0 !important;
  border-top: 1px solid #e6e8ed !important;
  border-bottom: 1px solid #e6e8ed !important;
  overflow: hidden !important;
}

html body.openlib-journal-page .page_article .obj_article_details > .row::before,
html body.openlib-journal-page .page_article .obj_article_details > .row::after {
  display: none !important;
  content: none !important;
}

html body.openlib-journal-page .page_article .obj_article_details .main_entry,
html body.openlib-journal-page .page_article .obj_article_details .entry_details {
  float: none !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

html body.openlib-journal-page .page_article .obj_article_details .main_entry {
  border: 0 !important;
  border-right: 1px solid #e6e8ed !important;
}

html body.openlib-journal-page .page_article .obj_article_details .entry_details {
  border: 0 !important;
  background: #fbfcfd !important;
  align-self: stretch !important;
}

/* Meta-sidebar items stay compact instead of becoming another full article. */
html body.openlib-journal-page .page_article .obj_article_details .entry_details > .item {
  margin: 0 !important;
  padding: 16px !important;
  border: 0 !important;
  border-bottom: 1px solid #e6e8ed !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow-wrap: anywhere !important;
}
html body.openlib-journal-page .page_article .obj_article_details .entry_details > .item:last-child {
  border-bottom: 0 !important;
}
html body.openlib-journal-page .page_article .obj_article_details .entry_details .label {
  margin: 0 0 6px !important;
  color: #6b7280 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .035em !important;
}
html body.openlib-journal-page .page_article .obj_article_details .entry_details .value,
html body.openlib-journal-page .page_article .obj_article_details .entry_details .value a {
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}

/* The problematic article/issue cover remains a thumbnail in the meta column. */
html body.openlib-journal-page .page_article .obj_article_details .entry_details .cover_image,
html body.openlib-journal-page .page_article .obj_article_details .entry_details .cover_image .sub_item {
  text-align: center !important;
}
html body.openlib-journal-page .page_article .obj_article_details .entry_details .cover_image img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 300px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

/* Long references/DOIs must never force the main column wider. */
html body.openlib-journal-page .page_article .obj_article_details .main_entry,
html body.openlib-journal-page .page_article .obj_article_details .main_entry p,
html body.openlib-journal-page .page_article .obj_article_details .main_entry a {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Dark mode: geometry identical, only surfaces/contrast change. */
html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details > .row {
  border-color: #313a47 !important;
}
html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details .main_entry {
  border-right-color: #313a47 !important;
}
html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details .entry_details {
  background: #151b23 !important;
}
html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details .entry_details > .item {
  border-bottom-color: #313a47 !important;
}
html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details .entry_details .label {
  color: #aeb7c5 !important;
}

/* On narrower article cards, stack cleanly; never allow the cover to become huge. */
@media (max-width: 980px) {
  html body.openlib-journal-page .page_article .obj_article_details > .row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body.openlib-journal-page .page_article .obj_article_details .main_entry {
    border-right: 0 !important;
  }
  html body.openlib-journal-page .page_article .obj_article_details .entry_details {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    border-top: 1px solid #e6e8ed !important;
  }
  html body.openlib-journal-page .page_article .obj_article_details .entry_details .cover_image img {
    max-height: 220px !important;
  }
  html[data-openlib-color-mode="dark"] body.openlib-journal-page .page_article .obj_article_details .entry_details {
    border-top-color: #313a47 !important;
  }
}

@media (max-width: 640px) {
  html body.openlib-journal-page .page_article .obj_article_details .entry_details {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body.openlib-journal-page .page_article .obj_article_details .entry_details .cover_image img {
    max-width: 190px !important;
    max-height: 260px !important;
  }
}
