/* Open Library Publications — Journal nav spacing + dark PDF hover polish — 2026-09-13 v90
 * Incremental theme-only override.
 * Baseline lineage: openlibTheme(4) -> clean v86 -> article v87/v88/v89.
 */

/* --------------------------------------------------------------------------
   1) Journal desktop navigation: equal spacing across BOTH menu lists.

   The header template intentionally uses two sibling <ul> elements:
   - .openlib_journal_home_nav  = Publications + Home
   - .pkp_navigation_primary   = Current + Archives + About

   Older rules gave each list its own gap but the parent nav had gap:0, making
   the Home -> Current distance different from the other menu distances.
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
  html body.openlib-journal-page .openlib_journal_nav {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  html body.openlib-journal-page .openlib_journal_nav > .openlib_journal_home_nav,
  html body.openlib-journal-page .openlib_journal_nav > .pkp_navigation_primary {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  html body.openlib-journal-page .openlib_journal_nav > .openlib_journal_home_nav > li,
  html body.openlib-journal-page .openlib_journal_nav > .pkp_navigation_primary > li {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* All top-level items share one geometry. Active/hover state changes color,
     not size, so spacing does not visually jump between pages. */
  html body.openlib-journal-page .openlib_journal_nav > .openlib_journal_home_nav > li > a,
  html body.openlib-journal-page .openlib_journal_nav > .pkp_navigation_primary > li > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 13px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  /* Publications uses the same outer spacing as every other item while keeping
     its back icon and softer visual treatment. */
  html body.openlib-journal-page .openlib_journal_home_nav {
    margin-right: 0 !important;
  }
  html body.openlib-journal-page .openlib_publications_nav,
  html body.openlib-journal-page .openlib_publications_link {
    margin: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   2) Dark mode: PDF galley button must have an obvious hover/focus state.
   A prior dark-current-issue rule uses !important on the idle state, so this
   later override explicitly targets interaction states with equal/higher
   specificity.
   -------------------------------------------------------------------------- */
html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease,
              box-shadow .16s ease, transform .16s ease !important;
}

html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link:hover,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link:focus-visible,
html[data-openlib-color-mode="dark"] body.openlib-journal-page.pkp_page_index .openlib_current_issue_panel .obj_galley_link:hover,
html[data-openlib-color-mode="dark"] body.openlib-journal-page.pkp_page_index .openlib_current_issue_panel .obj_galley_link:focus-visible {
  background: #dc2626 !important;
  border-color: #ef5a63 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(220, 38, 38, .28) !important;
  transform: translateY(-1px) !important;
  outline: none !important;
}

html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link:hover *,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Preserve keyboard accessibility with a visible ring. */
html[data-openlib-color-mode="dark"] body.openlib-journal-page .obj_galley_link:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 90, 99, .24), 0 6px 16px rgba(220, 38, 38, .28) !important;
}
