/* Graxynet RANS Green v2.1.18
   Structural mobile header fix: ISSN is a separate row on journal pages,
   removed on publisher index, and all masthead text is constrained. */

@media (max-width: 767px) {
  html, body,
  html body .pkp_structure_page,
  html body .pkp_structure_head,
  html body .pkp_structure_head .pkp_head_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  /* Utility area */
  html body .pkp_structure_head .jampl-utility-inner {
    padding: 18px 14px 16px !important;
    gap: 12px !important;
  }

  html body .pkp_structure_head .jampl-utility-links {
    width: 100% !important;
    justify-content: center !important;
    gap: 8px 24px !important;
  }

  html body .pkp_structure_head .jampl-utility-links > a,
  html body .pkp_structure_head .rans-publisher-toggle {
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  /* Login/Register/account row: no bullets, no collision. */
  html body .pkp_structure_head .jampl-utility-user,
  html body .pkp_structure_head .pkp_navigation_user_wrapper.jampl-utility-user {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body .pkp_structure_head .jampl-utility-user ul,
  html body .pkp_structure_head .jampl-utility-user li,
  html body .pkp_structure_head .jampl-utility-user .rans-mobile-account-list {
    list-style: none !important;
  }

  html body .pkp_structure_head .jampl-utility-user li::before,
  html body .pkp_structure_head .jampl-utility-user li::marker {
    content: none !important;
    display: none !important;
  }

  html body .pkp_structure_head .jampl-utility-user > .pkp_navigation_user,
  html body .pkp_structure_head .jampl-utility-user > ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .pkp_structure_head .jampl-utility-user > .pkp_navigation_user > li > a,
  html body .pkp_structure_head .jampl-utility-user > ul > li > a,
  html body .pkp_structure_head .jampl-utility-user > .pkp_navigation_user > li > button {
    min-width: 108px !important;
    max-width: 44vw !important;
    min-height: 44px !important;
    padding: 10px 16px !important;
    border: 1px solid #c9ddd0 !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #0f5132 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Masthead itself: no ISSN inside this area on mobile. */
  html body .pkp_structure_head .pkp_site_name_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 92px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 16px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    text-align: center !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
  }

  html body .pkp_structure_head .pkp_site_name {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  html body .pkp_structure_head .pkp_site_name a,
  html body .pkp_structure_head .pkp_site_name .is_text,
  html body .pkp_structure_head .pkp_site_name .is_text a {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-size: clamp(17px, 5vw, 22px) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: .1px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-align: center !important;
  }

  html body .pkp_structure_head .pkp_site_name img,
  html body .pkp_structure_head .pkp_site_name .is_img img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: min(82vw, 360px) !important;
    max-height: 76px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
  }

  /* Mobile ISSN is now a separate row below the masthead. */
  html body .pkp_structure_head .jampl-issn.rans-mobile-issn-row {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    border: 0 !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 0 !important;
    background: #0f5132 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    text-align: center !important;
    white-space: normal !important;
    text-shadow: none !important;
    overflow: hidden !important;
  }

  html body .pkp_structure_head .jampl-issn.rans-mobile-issn-row .rans-issn-line {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* Publisher/all-journals page: no RANS ISSN at all. */
  html body.rans-site-index .pkp_structure_head .jampl-issn,
  html body.rans-site-index .pkp_structure_head .rans-mobile-issn-row {
    display: none !important;
  }

  html body.rans-site-index .pkp_structure_head .pkp_site_name_wrapper {
    min-height: 96px !important;
    padding: 18px 22px !important;
  }

  html body.rans-site-index .pkp_structure_head .pkp_site_name .is_text,
  html body.rans-site-index .pkp_structure_head .pkp_site_name .is_text a,
  html body.rans-site-index .pkp_structure_head .pkp_site_name > a:not(.is_img) {
    max-width: 94vw !important;
    font-size: clamp(18px, 5.4vw, 24px) !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
  }

  /* Homepage tab labels: allow clean multi-line wrapping. */
  html body .rans-tabs-wrapper .nav-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  html body .rans-tabs-wrapper .nav-tabs .nav-link {
    min-width: 0 !important;
    min-height: 60px !important;
    padding: 8px 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    line-height: 1.22 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Hero buttons and all-journals text stay inside the viewport. */
  html body .rans-journals-intro,
  html body .rans-journals-intro-content,
  html body .rans-journals-intro h1,
  html body .rans-journals-intro p,
  html body .rans-hero-actions,
  html body .rans-hero-btn {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  html body .rans-hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html body .rans-hero-btn {
    width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
  }
}

@media (max-width: 390px) {
  html body .pkp_structure_head .pkp_site_name img,
  html body .pkp_structure_head .pkp_site_name .is_img img {
    max-width: min(78vw, 300px) !important;
    max-height: 66px !important;
  }

  html body .pkp_structure_head .jampl-issn.rans-mobile-issn-row {
    gap: 2px 8px !important;
    padding: 7px 10px !important;
    font-size: 10px !important;
  }

  html body .rans-tabs-wrapper .nav-tabs .nav-link {
    font-size: 10.5px !important;
  }
}
