/* DMI JMST v1.7.1 — Citation formats popover.
   Works with PKP Citation Style Language plugin markup; no OJS template
   overrides or changes to citation downloads and URL handling. */

/* Allow the dropdown to extend beyond the metadata rail, but not its width. */
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details > .row > .entry_details,
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .entry_details .item.citation,
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .entry_details .citation_display,
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .entry_details .citation_display > .value {
  overflow: visible !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats {
  position: relative !important;
  z-index: 15;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  border: 1px solid #cddde4 !important;
  border-radius: 8px !important;
  background: #fff !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0;
  min-height: 46px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 10px 35px 10px 13px !important;
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #173d51 !important;
  font: 700 13px/1.35 var(--dmi-sans, Arial, sans-serif) !important;
  text-transform: none !important;
  text-align: left !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  white-space: normal;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button:hover,
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button[aria-expanded="true"] {
  background: #edf5f7 !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button::after {
  content: "▾" !important;
  position: absolute !important;
  top: 50% !important;
  right: 14px !important;
  display: inline-block !important;
  transform: translateY(-50%) !important;
  font: 700 17px/1 var(--dmi-sans, Arial, sans-serif) !important;
  color: #235c72;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button[aria-expanded="true"]::after {
  content: "▴" !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_button:focus-visible {
  outline: 3px solid #d5a652 !important;
  outline-offset: 3px !important;
}
/* Crucial: a popover stays outside the document's height calculation. */
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_list {
  position: absolute !important;
  top: calc(100% + 7px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  box-sizing: border-box;
  max-height: min(350px, 54vh) !important;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  padding: 5px 0 !important;
  margin: 0 !important;
  border: 1px solid #cbdce3 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 16px 38px rgba(8, 38, 57, .19) !important;
  z-index: 200 !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_list[aria-hidden="true"] {
  display: none !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_list[aria-hidden="false"] {
  display: block !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_styles {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_styles > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_styles a {
  display: block !important;
  box-sizing: border-box;
  min-height: 38px;
  padding: 9px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf2f4 !important;
  background: #fff;
  color: #185d75 !important;
  font: 500 13px/1.4 var(--dmi-sans, Arial, sans-serif) !important;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_styles a:is(:hover,:focus-visible) {
  background: #edf5f7 !important;
  color: #0b354b !important;
}
body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_list > .label {
  padding: 13px 13px 8px !important;
  margin: 0 !important;
  font: 700 11px/1.35 var(--dmi-sans, Arial, sans-serif) !important;
  letter-spacing: .045em !important;
  color: #425f6d !important;
}
@media (max-width: 760px) {
  body.dmi-theme.dmi-header-fixed .page_article .obj_article_details .citation_display .citation_formats_list {
    max-height: min(300px, 45vh) !important;
  }
}
