/* OAP journal compatibility fixes, validated 2026-07-17. */

/* Responsive containment for legacy journal content components. */
:where(
  .j3dpa-layer .section-print,
  .jawd-shield .section-bar,
  .jawd-aims-scope-section-header,
  .jc-aims-scope-section-header,
  .section-hyphae,
  .section-plastid,
  .section-fiber,
  .jdrr-strand .hero-text,
  .editor-content,
  .ijnx .wcard,
  .pricing-stack .tier-info
) :where(h1, h2, h3, h4) {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

:where(
  .JC-wrapper .jc-u-benefits,
  .JC-wrapper .JC-research-grid,
  .jc-u .jc-u-benefits,
  .bone-page .scroll-container,
  .jpan-n .jpan-n-tabs-nav,
  .jpr-n .jpr-n-benefits-track,
  section#most-cited .rgrid,
  .jcrc-mem .grid
) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

:where(
  .JC-wrapper .jc-u-benefit,
  .JC-wrapper .JC-research-card,
  .jc-u .jc-u-benefit,
  .bone-page .feature-card,
  .jpan-n .jpan-n-tab,
  .jpr-n .jpr-n-benefit,
  section#most-cited .rcard,
  .jcrc-mem .card
) {
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex: 1 1 auto !important;
}

:where(
  .JC-wrapper .jc-u-benefit,
  .JC-wrapper .JC-research-card,
  .jc-u .jc-u-benefit,
  .bone-page .feature-card,
  .jpan-n .jpan-n-tab,
  .jpr-n .jpr-n-benefit,
  section#most-cited .rcard,
  .jcrc-mem .card
) :where(h1, h2, h3, h4) {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.jpr-n,
.jpr-n .jpr-n-benefits,
.pricing-stack,
.pricing-stack .content-wrapper {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.jpr-n .jpr-n-benefits-track {
  min-width: 0 !important;
}

.jc-aims-scope-section-header > h2 {
  width: calc(100% - 60px) !important;
}

.editor-content {
  min-width: 0;
}

.jhor-aims-scope-hero-content > h1.jhor-aims-scope-hero {
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  padding: 0 !important;
  position: static !important;
}

.jnrtx-current section#most-cited .rcard .rt {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
}

@media (max-width: 767.98px) {
  :where(
    .JC-wrapper .jc-u-benefits,
    .JC-wrapper .JC-research-grid,
    .jc-u .jc-u-benefits,
    .bone-page .scroll-container,
    .jpan-n .jpan-n-tabs-nav,
    .jpr-n .jpr-n-benefits-track,
    section#most-cited .rgrid,
    .jcrc-mem .grid,
    .jdrr-strand .split-hero,
    .ijnx .v3,
    .pricing-stack .price-items
  ) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .pricing-stack .price-tier {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .pricing-stack .tier-info,
  .pricing-stack .tier-info > * {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
  }

  :where(
    .ijnx .wcard,
    .pricing-stack .price-tier,
    .jdrr-strand .hero-text
  ) {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
  }
}

/* Mobile overflow containment for shared navigation and legacy inline grids. */
@media (max-width: 991.98px) {
  #navbarCollapse.navbar-collapse {
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .ijmp-premium [style*="grid-template-columns:repeat(5,1fr)"],
  .personalized-medicine [style*="grid-template-columns:repeat(4,1fr)"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.glaucoma-page .hero-vision {
  overflow: hidden !important;
}

/* Page-specific WCAG contrast corrections for legacy journal content. */
.J3DPA-container > h1 { color: #0e7490 !important; }
.J3DPA-container .cta-banner {
  background: linear-gradient(135deg, #155e75, #0e4f5f) !important;
}

.JCY-container .JCY-hero {
  background: linear-gradient(135deg, #166534, #047857 50%, #075985) !important;
}
.JCY-container .JCY-hero-subtitle { color: #fff !important; }
.JCY-container .JCY-scope-title,
.jcy-aims-scope-container .jcy-aims-scope-emerging-note-title {
  color: #166534 !important;
}
.jcy-aims-scope-container .jcy-aims-scope-metrics {
  background: linear-gradient(135deg, #166534, #047857 50%, #075985) !important;
}
.jcy-aims-scope-container .jcy-aims-scope-metrics-title {
  color: #fff !important;
}

.jammbp-about :where(.column-box h3, .topic-card h4) {
  color: #047857 !important;
}
.jammbp-about .cta-section {
  background: linear-gradient(135deg, #065f46, #047857 45%, #5b21b6) !important;
}

.JART-about > h1,
.JART-about :where(
  .scope-card h3,
  .column-box h3,
  .process-timeline h4
) { color: #9a3412 !important; }
.JART-about .cta-container {
  background: linear-gradient(135deg, #9a3412, #7c2d12) !important;
}

html body .JFS-container .JFS-hero {
  background: linear-gradient(135deg, #1e4f7a, #173f63) !important;
}
html body .JFS-container .JFS-subtitle { color: #fff !important; }
html body .JFS-container .JFS-research-areas h3,
html body .JFS-container .JFS-feature-card h3,
html body .JFS-container .JFS-process-step h4,
html body .JFS-container .JFS-board-section h3 { color: #1e4f7a !important; }

.JIG-container .JIG-hero {
  background: linear-gradient(135deg, #78350f, #92400e 50%, #854d0e) !important;
}
.JIG-container .JIG-cta-section {
  background: linear-gradient(135deg, #115e59, #0f766e 50%, #0d6b63) !important;
}

.ijan-about .ijan-header,
.ijan-about .cta-section {
  background: linear-gradient(135deg, #134e4a, #115e59 50%, #0f766e) !important;
}
.ijan-about .topic-card h3 { color: #0f766e !important; }

html body .ijbm-about .hero-right-panel .hero-key-point h4,
html body .ijbm-about .content-panel h3,
html body .ijbm-about .editorial-card h3 { color: #9a3412 !important; }
html body .ijbm-about .hero-right-panel .hero-key-point h4 {
  -webkit-text-fill-color: #9a3412 !important;
}
html body .ijbm-about .cta-container {
  background: linear-gradient(#9a3412, #7c2d12) !important;
}

.IJL-container :where(.IJL-process-step h4, .IJL-board-section h3) {
  color: #92400e !important;
}

.ijmp-about :where(.hero-panel, .cta-container) {
  background: linear-gradient(135deg, #075985, #0369a1 50%, #166534) !important;
}
.ijne-mem .cta-section {
  background: linear-gradient(145deg, #155e75, #0e7490 50%, #164e63) !important;
}

html body .IJNN-container > h1 { color: #0f172a !important; }
.personalized-medicine .hero-left-content h1 { color: #1e1b4b !important; }
.personalized-medicine .hero-left-content .hero-subtitle {
  color: #312e81 !important;
}
.IJSTD-about .IJSTD-highlight-box h3 { color: #92400e !important; }

.journal-page .journal-hero {
  background: linear-gradient(135deg, #064e3b, #065f46 50%, #047857) !important;
}
.journal-page .journal-hero :where(
  h1,
  .hero-subtitle,
  .metrics-title
) { color: #fff !important; }

.jio-about :where(.hero-banner, .testimonial-section) {
  background: linear-gradient(135deg, #075985, #0369a1 50%, #0c4a6e) !important;
}
.IJO-container .IJO-hero {
  background: linear-gradient(145deg, #155e75, #0e7490 50%, #164e63) !important;
}
.IJO-container .IJO-scope-item h4 { color: #0e7490 !important; }

.jpcd-about > h1 { color: #15803d !important; }
.jpcd-about :where(.hero-banner, .cta-section) {
  background: linear-gradient(135deg, #166534, #14532d) !important;
}
.jrnm-about > h1 { color: #0e7490 !important; }
.jrnm-about :where(.hero-banner, .cta-panel) {
  background: linear-gradient(135deg, #0f172a, #134e4a 55%, #155e75) !important;
}
