/* =========================================================
   OJS CUSTOM STYLE - MOBILE RESPONSIVE FIX
   ========================================================= */

/* ================= GLOBAL SAFETY NET ================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0 !important;
  padding-bottom: 0 !important;
  max-width: 100%;
  overflow-x: hidden; /* stops sideways scrolling caused by overflowing content */
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

.pkp_structure_page,
.pkp_structure_content,
.pkp_structure_main {
  max-width: 100%;
  min-width: 0;
}

.pkp_structure_main table {
  max-width: 100%;
}

.pkp_structure_main p,
.pkp_structure_main li,
.pkp_structure_main a,
.pkp_structure_main h1,
.pkp_structure_main h2,
.pkp_structure_main h3 {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}


/* ================= HEADER ================= */

.pkp_structure_head {
  background: #ffffff !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pkp_head_wrapper {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.pkp_site_name_wrapper {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  text-align: center;
}

.pkp_site_name {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.pkp_site_name .is_img {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Banner / Logo: fills the full header width, no empty space above it */
.pkp_structure_head,
.pkp_head_wrapper,
.pkp_site_name_wrapper,
.pkp_site_name,
.pkp_site_name .is_img {
  float: none !important;
  max-width: none !important;
  min-height: 0 !important;
}

.pkp_site_name .is_img img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: cover;
  margin: 0 !important;
}

.pkp_navigation_primary_wrapper {
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  padding: 4px 0 !important;
  margin-top: 10px !important;
  clear: both !important;
}

.pkp_navigation_primary > li {
  margin-right: 6px;
}

.pkp_navigation_primary > li > a {
  padding: 10px 18px !important;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pkp_navigation_user_wrapper {
  padding-top: 0 !important;
  padding-right: 20px;
}

.pkp_search {
  margin-top: 0 !important;
}


/* ================= ABSTRACT TEXT ================= */

.obj_article_details .abstract,
.obj_article_details .abstract p,
.obj_article_details .item.abstract,
.obj_article_details .item.abstract p,
.obj_article_summary .summary,
.obj_article_summary .summary p {
  text-align: justify;
}


/* ================= SIDEBAR GAP REDUCE ================= */

.pkp_structure_sidebar .pkp_block {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.pkp_structure_sidebar .journal-menu-block,
.pkp_structure_sidebar .author-downloads-block,
.pkp_structure_sidebar .journal-info-block,
.pkp_structure_sidebar .welcome-ajass-block {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

.pkp_structure_sidebar .block_make_submission {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.pkp_structure_sidebar .block_make_submission a {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.pkp_structure_sidebar h2:empty,
.pkp_structure_sidebar h3:empty {
  display: none !important;
}


/* ================= FOOTER ================= */

.pkp_structure_footer_wrapper {
  background: #ffffff !important;
  padding: 0 !important;
  margin: 0 !important;
}

.pkp_structure_footer {
  background: #ffffff !important;
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.custom-footer {
  background: #ffffff !important;
  color: #333333 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 35px 30px 25px 30px !important;
  box-sizing: border-box;
  font-family: "Times New Roman", Times, serif;
}

.custom-footer-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 25px;
  width: 100%;
  margin: 0;
  padding: 0;
  align-items: flex-start;
  box-sizing: border-box;
}

.footer-box {
  min-width: 0;
}

.footer-box img {
  max-width: 100%;
  height: auto;
}

.footer-box h3 {
  color: #222222 !important;
  font-size: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 6px;
  text-transform: uppercase;
}

.footer-box p,
.footer-box li {
  color: #333333 !important;
  font-size: 14px;
  line-height: 1.6;
  margin: 7px 0;
  overflow-wrap: anywhere;
}

.footer-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-box a {
  color: #333333 !important;
  text-decoration: none;
}

.footer-box a:hover {
  color: #000000 !important;
  text-decoration: underline;
}

.pkp_brand_footer,
.pkp_structure_footer_wrapper::after,
.pkp_structure_footer::after {
  display: none !important;
}


/* ================= WhatsApp ================= */
.apg-wa-smart-block {
  width: 100%;
  margin: 18px 0 30px 0;
  font-family: Arial, Helvetica, sans-serif;
}

.apg-wa-smart-block a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #238b2f;
  color: #ffffff !important;
  text-decoration: none !important;
  border-radius: 5px;
  overflow: hidden;
  min-height: 68px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  transition: all 0.25s ease;
}

.apg-wa-smart-block a:hover {
  background: #1f7d2a;
  transform: translateY(-2px);
  text-decoration: none !important;
}

.apg-wa-left {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 10px 10px;
  flex: 1;
  min-width: 0;
}

.apg-wa-circle {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1fb94d;
  color: #ffffff;
  font-size: 27px;
  font-weight: bold;
  line-height: 1;
}

.apg-wa-text {
  color: #ffffff;
  line-height: 1.05;
}

.apg-wa-small {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.apg-wa-main {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.apg-wa-right {
  flex: 0 0 auto;
  width: 105px;
  min-height: 68px;
  background: #ffffff;
  color: #238b2f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  padding: 8px;
  box-sizing: border-box;
}

.apg-wa-phone-icon {
  width: 22px;
  height: 34px;
  border: 3px solid #238b2f;
  border-radius: 3px;
  position: relative;
}

.apg-wa-phone-icon:after {
  content: "";
  width: 6px;
  height: 6px;
  background: #238b2f;
  border-radius: 50%;
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}


/* ================= AJASS Journal Page ================= */
.ajass-journal-page {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto 0 auto;
  color: #222222;
  background-color: #ffffff;
  border: 1px solid #d9dee5;
  box-sizing: border-box;
  font-family: Georgia, "Times New Roman", serif;
  overflow: hidden;
}

.ajass-journal-page *,
.ajass-journal-page *::before,
.ajass-journal-page *::after {
  box-sizing: border-box;
}

.ajass-header {
  padding: 24px 20px;
  color: #ffffff;
  background-color: #1f5f8b;
}

.ajass-header .ajass-label {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.ajass-header h1 {
  margin: 0 0 8px;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
}

.ajass-header .ajass-subtitle {
  max-width: 850px;
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.8;
}

.ajass-layout {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.ajass-sidebar {
  flex: 0 0 32%;
  width: 32%;
  min-width: 0;
  padding: 18px;
  background-color: #f5f6f8;
  border-right: 1px solid #d9dee5;
}

.ajass-sidebar-box {
  margin-bottom: 20px;
  padding: 14px;
  background-color: #ffffff;
  border: 1px solid #d9dee5;
}

.ajass-sidebar-box:last-child {
  margin-bottom: 0;
}

.ajass-sidebar-box h2 {
  margin: 0 0 10px;
  color: #1f5f8b;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.ajass-sidebar-box p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.7;
}

.ajass-sidebar-box p:last-child {
  margin-bottom: 0;
}

.ajass-navigation a {
  display: block;
  padding: 4px 0;
  color: #1f5f8b;
  line-height: 1.6;
  text-decoration: none;
}

.ajass-navigation a:hover,
.ajass-navigation a:focus {
  color: #163f5d;
  text-decoration: underline;
}

.ajass-email a {
  color: #1f5f8b;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.ajass-main-content {
  flex: 1;
  min-width: 0;
  padding: 20px;
  background-color: #ffffff;
}

.ajass-section {
  margin-bottom: 22px;
  scroll-margin-top: 20px;
}

.ajass-section:last-child {
  margin-bottom: 0;
}

.ajass-section > h2 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  color: #1f5f8b;
  border-bottom: 1px solid #d9dee5;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
}

.ajass-content-box,
.ajass-subject-box {
  padding: 16px;
  background-color: #fbfcfd;
  border: 1px solid #d9dee5;
}

.ajass-content-box p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.9;
  text-align: justify;
}

.ajass-content-box p:last-child {
  margin-bottom: 0;
}

.ajass-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ajass-subject-box h3 {
  margin: 0 0 10px;
  color: #1f5f8b;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.ajass-subject-box ul {
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.9;
}

.ajass-office a {
  color: #1f5f8b;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.ajass-office a:hover,
.ajass-office a:focus {
  text-decoration: underline;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .custom-footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {

  /* ---- Header ---- */
  .pkp_structure_head {
    position: relative !important;
    display: block !important;
  }

  /* navy strip behind the hamburger button; the logo fills the rest */
  .pkp_structure_head {
    background: #003c78 !important;
  }

  .pkp_site_name_wrapper {
    padding: 0 0 0 44px !important; /* leaves room for the hamburger button */
    margin: 0 !important;
    width: 100% !important;
  }

  .pkp_site_name {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pkp_site_name .is_img {
    display: block !important;
    width: 100% !important;
  }

  .pkp_site_name .is_img img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .pkp_navigation_primary > li > a {
    padding: 9px 12px !important;
    font-size: 14px;
  }

  /* ---- Main content ---- */
  .pkp_structure_content {
    display: block !important;
    clear: both !important;
    margin-top: 30px !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .pkp_structure_main,
  .pkp_structure_sidebar {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* ---- Two-column pages (Author Guidelines, Peer Review Process, etc.) ----
     Overrides inline styles like "display:grid; grid-template-columns:260px 1fr".
     601-768px: 40% / 60% side by side. Phones (<=600px) stack: see rule at end of file. */
  .pkp_structure_main .page div[style*="grid-template-columns"],
  .pkp_structure_main .page div[style*="display: grid"],
  .pkp_structure_main .page div[style*="display:grid"] {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important; /* 40 / 60 */
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .pkp_structure_main .page div[style*="grid-template-columns"] > *,
  .pkp_structure_main .page div[style*="display: grid"] > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* same idea if a page uses inline flexbox instead of grid */
  .pkp_structure_main .page div[style*="display: flex"],
  .pkp_structure_main .page div[style*="display:flex"] {
    flex-wrap: nowrap !important;
    gap: 16px !important;
  }

  .pkp_structure_main .page div[style*="display: flex"] > *:first-child,
  .pkp_structure_main .page div[style*="display:flex"] > *:first-child {
    flex: 0 0 40% !important;
    width: 40% !important;
    min-width: 0 !important;
  }

  .pkp_structure_main .page div[style*="display: flex"] > *:last-child,
  .pkp_structure_main .page div[style*="display:flex"] > *:last-child {
    flex: 1 1 60% !important;
    width: 60% !important;
    min-width: 0 !important;
  }

  .pkp_structure_main .page div[style*="max-width"] {
    max-width: 100% !important;
  }

  /* contents box: tighter so it fits in 40% */
  .pkp_structure_main .page div[style*="grid-template-columns"] a,
  .pkp_structure_main .page div[style*="display: flex"] a {
    font-size: 13px;
    line-height: 1.4;
  }

  .pkp_structure_main .page div[style*="grid-template-columns"] p,
  .pkp_structure_main .page div[style*="grid-template-columns"] li {
    font-size: 14px;
    line-height: 1.6;
  }

  /* inline "position: sticky" would float over the text */
  .pkp_structure_main .page [style*="sticky"] {
    position: static !important;
  }

  /* justified text creates huge gaps in narrow columns */
  .pkp_structure_main p,
  .pkp_structure_main li {
    text-align: left !important;
  }

  .pkp_structure_main h1 {
    font-size: 26px;
  }

  .pkp_structure_main h2 {
    font-size: 22px;
  }

  /* ---- Footer ---- */
  .custom-footer {
    padding: 25px 15px 20px 15px !important;
  }

  .custom-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* ---- Abstracts ---- */
  .obj_article_details .abstract,
  .obj_article_details .abstract p,
  .obj_article_details .item.abstract,
  .obj_article_details .item.abstract p,
  .obj_article_summary .summary,
  .obj_article_summary .summary p {
    text-align: left;
  }

  /* ---- AJASS journal page ---- */
  .ajass-header {
    padding: 20px 16px;
  }

  .ajass-header h1 {
    font-size: 25px;
  }

  .ajass-layout {
    display: block;
  }

  .ajass-sidebar {
    width: 100%;
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid #d9dee5;
  }

  .ajass-main-content {
    width: 100%;
    padding: 15px;
  }

  .ajass-section > h2 {
    font-size: 22px;
  }

  .ajass-subject-grid {
    grid-template-columns: 1fr;
  }

  .ajass-content-box p {
    font-size: 15px;
    line-height: 1.75;
    text-align: left;
  }

  .ajass-subject-box ul {
    font-size: 15px;
    line-height: 1.75;
  }
}

@media screen and (max-width: 600px) {
  .custom-footer-inner {
    grid-template-columns: 1fr;
  }

  .apg-wa-smart-block a {
    min-height: 62px;
  }

  .apg-wa-main {
    font-size: 18px;
  }

  .apg-wa-small {
    font-size: 10px;
  }

  .apg-wa-right {
    width: 92px;
    font-size: 11px;
  }

  .apg-wa-circle {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }
}

@media screen and (max-width: 480px) {
  .ajass-journal-page {
    border-right: 0;
    border-left: 0;
  }

  .ajass-header {
    padding: 18px 14px;
  }

  .ajass-header h1 {
    font-size: 22px;
    line-height: 1.35;
  }

  .ajass-header .ajass-subtitle {
    font-size: 15px;
    line-height: 1.65;
  }

  .ajass-sidebar,
  .ajass-main-content {
    padding: 12px;
  }

  .ajass-sidebar-box,
  .ajass-content-box,
  .ajass-subject-box {
    padding: 13px;
  }

  .ajass-section > h2 {
    font-size: 20px;
  }

  .ajass-subject-box h3 {
    font-size: 18px;
  }
}

/* ================= PHONES: STACK THE TWO COLUMNS ================= */
@media screen and (max-width: 600px) {
  .pkp_structure_main .page div[style*="grid-template-columns"],
  .pkp_structure_main .page div[style*="display: grid"],
  .pkp_structure_main .page div[style*="display:grid"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  .pkp_structure_main .page div[style*="display: flex"],
  .pkp_structure_main .page div[style*="display:flex"] {
    flex-wrap: wrap !important;
  }

  .pkp_structure_main .page div[style*="display: flex"] > *:first-child,
  .pkp_structure_main .page div[style*="display:flex"] > *:first-child,
  .pkp_structure_main .page div[style*="display: flex"] > *:last-child,
  .pkp_structure_main .page div[style*="display:flex"] > *:last-child {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .pkp_structure_main .page div[style*="grid-template-columns"] a,
  .pkp_structure_main .page div[style*="display: flex"] a {
    font-size: 15px;
  }

  .pkp_structure_main .page div[style*="grid-template-columns"] p,
  .pkp_structure_main .page div[style*="grid-template-columns"] li {
    font-size: 15px;
    line-height: 1.7;
  }
}
