/* IRJP site masthead: preserve the existing accessible publisher heading. */
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) {
  display: grid;
  grid-template-columns: 40px 64px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  height: auto;
  min-height: 88px;
  box-sizing: border-box;
  padding-top: 12px;
  padding-bottom: 12px;
}
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]) > h1.pkp_screen_reader {
  position: static !important;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  grid-column: 3;
  grid-row: 1;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  text-align: left;
}
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) > .pkp_site_name {
  position: static;
  grid-column: 2;
  grid-row: 1;
  width: 64px;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) .is_img {
  display: block;
  margin: 0;
  padding: 0;
}
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) .is_img img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
}
.pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) > .pkp_site_nav_toggle {
  top: 50%;
  transform: translateY(-50%);
}
@media (min-width: 768px) {
  .pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]) > h1.pkp_screen_reader { font-size: 26px; }
}
@media (min-width: 992px) {
  .pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) {
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 24px;
    padding: 0 300px 18px 0;
    min-height: 122px;
  }
  .pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]):has(> h1.pkp_screen_reader) > .pkp_site_name {
    grid-column: 1;
    width: 104px;
  }
  .pkp_site_name_wrapper:has(.pkp_site_name > a[href*="/index.php/index/"]) > h1.pkp_screen_reader {
    grid-column: 2;
    font-size: 30px;
  }
}

/* Publisher footer. Applies to the editable OJS Page Footer content. */
.pkp_structure_footer_wrapper {
  background: #111b50;
  color: #e7ecf6;
  border-top: 3px solid #22b8df;
}
.pkp_structure_footer {
  display: flex;
  flex-direction: column;
  padding-top: 28px;
  padding-bottom: 24px;
}
.pkp_structure_footer::before,
.pkp_structure_footer::after { display: none; }
.pkp_structure_footer .pkp_footer_content {
  position: relative;
  float: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 0 22px 88px;
  font-size: 15px;
  line-height: 1.65;
}
.pkp_footer_content > p:has(img),
.pkp_footer_content > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  margin: 0;
}
.pkp_footer_content img {
  display: block;
  width: 64px !important;
  max-width: 64px;
  height: auto !important;
  border-radius: 4px;
}
.pkp_footer_content p { margin: 0 0 10px; }
.pkp_footer_content > p:first-of-type:not(:has(img)),
.pkp_footer_content > p:has(img) + p,
.pkp_footer_content h2,
.pkp_footer_content h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}
.pkp_footer_content a { color: #83ddf4; text-decoration: underline; text-underline-offset: 3px; }
.pkp_footer_content a:hover,
.pkp_footer_content a:focus { color: #fff; }
.pkp_footer_content a:focus-visible { outline: 2px solid #83ddf4; outline-offset: 4px; }
.pkp_structure_footer .pkp_brand_footer {
  float: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255,255,255,.18);
  text-align: left;
}
.pkp_brand_footer a { display: inline-block; padding: 7px 10px; background: #fff; border-radius: 3px; }
.pkp_brand_footer img { display: block; width: 100px; max-width: 100%; height: auto; }
@media (max-width: 767px) {
  .pkp_structure_footer { padding: 24px 20px; }
  .pkp_structure_footer .pkp_footer_content { padding: 82px 0 22px; }
  .pkp_footer_content > p:first-of-type:not(:has(img)),
.pkp_footer_content > p:has(img) + p,
  .pkp_footer_content h2,
  .pkp_footer_content h3 { font-size: 20px; }
}

/* Keep the platform credit beside the publisher content on wider screens. */
@media (min-width: 768px) {
  .pkp_structure_footer {
    flex-direction: row;
    align-items: center;
    column-gap: 40px;
  }
  .pkp_structure_footer .pkp_footer_content {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding-bottom: 0;
  }
  .pkp_structure_footer .pkp_brand_footer {
    flex: 0 0 120px;
    width: 120px;
    padding: 0;
    border-top: 0;
  }
}
/* A pasted blob URL cannot survive a new page load. Use the saved site logo. */
.pkp_footer_content:has(img[src^="blob:"])::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: #fff url("https://www.irjp.org/public/site/pageHeaderTitleImage_en.png") center / contain no-repeat;
}
.pkp_footer_content > p:has(img[src^="blob:"]) { display: none; }
/* Match the two spacer paragraphs present in the saved footer. */
.pkp_footer_content:has(img[src^="blob:"]) > p:nth-of-type(2),
.pkp_footer_content:has(img[src^="blob:"]) > p:nth-of-type(3) { display: none; }
.pkp_footer_content:has(img[src^="blob:"]) > p:nth-of-type(4) {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
}
@media (max-width: 767px) {
  .pkp_footer_content:has(img[src^="blob:"]) > p:nth-of-type(4) { font-size: 20px; }
}

/* Let long journal names wrap on mobile without publisher logo columns. */
@media (max-width: 991px) {
  .pkp_site_name_wrapper:has(.pkp_site_name > a.is_text) {
    height: auto;
    min-height: 56px;
  }
  .pkp_site_name_wrapper:has(.pkp_site_name > a.is_text) .pkp_site_name {
    position: relative;
    left: auto;
    right: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px 0 40px;
    white-space: normal;
    overflow: visible;
  }
  .pkp_site_name_wrapper .pkp_site_name > a.is_text {
    display: block;
    white-space: normal;
    font-size: 18px;
    line-height: 1.35;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Journal pages: remove an otherwise empty Developed By sidebar. */
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_sidebar:has(> .block_developed_by:only-child) {
  display: none;
}
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_content:has(> .pkp_structure_sidebar > .block_developed_by):not(:has(> .pkp_structure_sidebar > :not(.block_developed_by, .block_information))) > .pkp_structure_main {
  float: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_content:has(> .pkp_structure_sidebar > .block_developed_by):not(:has(> .pkp_structure_sidebar > :not(.block_developed_by, .block_information))) > .pkp_structure_main::after {
  left: auto;
  right: 0;
}
/* Keep the signed-in user menu above a tighter journal title/navigation row. */
@media (min-width: 992px) {
  .pkp_structure_head:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_head_wrapper {
    padding-top: 28px;
  }
}

/* Retain standard reader/author links in a compact row below journal content. */
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_sidebar:has(> .block_information):not(:has(> :not(.block_developed_by, .block_information))) {
  float: none;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 30px;
  border-top: 1px solid #ddd;
}
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_sidebar:has(> .block_information):not(:has(> :not(.block_developed_by, .block_information))) .block_developed_by { display: none; }
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_sidebar:has(> .block_information):not(:has(> :not(.block_developed_by, .block_information))) .block_information { margin: 0; padding: 0; }
body:not(:has(.pkp_site_name > a[href*="/index.php/index/"])) .pkp_structure_sidebar:has(> .block_information):not(:has(> :not(.block_developed_by, .block_information))) .block_information .content ul { display: flex; flex-wrap: wrap; gap: 12px 24px; }

/* Article content: wide reading column and right-aligned publication details. */
@media (min-width: 992px) {
  .obj_article_details > .row {
    display: flex;
    align-items: stretch;
  }
  .obj_article_details > .row > .main_entry {
    float: none;
    flex: 0 0 75%;
    width: 75%;
    min-width: 0;
    box-sizing: border-box;
  }
  .obj_article_details > .row > .entry_details {
    float: none;
    flex: 0 0 25%;
    width: 25%;
    min-width: 0;
    margin-left: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }
  .obj_article_details > .row::before,
  .obj_article_details > .row::after { display: none; }
}
@media (max-width: 991px) {
  .obj_article_details > .row > .main_entry,
  .obj_article_details > .row > .entry_details {
    float: none;
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
  }
}
