/* 
===============================================
  JMAI Modern Display Stylesheet
  Focus: Clean, Modern, Premium Aesthetic
=============================================== 
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --footer-bg: #0f172a;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Global Reset & Typography */
body,
body.pkp_page_index {
  font-family: 'Inter', sans-serif !important;
  color: var(--text-main);
  background: rgb(242, 248, 255) !important;
  /* AJDHM-inspired page background */
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Merriweather', serif;
  color: var(--text-main);
  margin-top: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ================= HEADER ================= */
.pkp_structure_head {
  background: rgb(242, 248, 255) !important;
  position: relative !important;
  z-index: 1000 !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none !important;
  padding: 50px 0 0 0 !important;
  /* Exactly 50px padding to push the banner down and prevent overlap */
  display: block !important;
}

.pkp_head_wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  /* Allow absolute children to bubble up to structure_head */
  background-color: transparent !important;
  max-width: none !important;
}

/* ===== BANNER: Full-width, tall area for journal title ===== */
.pkp_site_name_wrapper {
  display: block !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  align-self: center !important;
  padding: 0 !important;
  text-align: center;
  overflow: hidden !important;
  position: relative !important;
}

.pkp_site_name_wrapper h1 {
  margin: 0;
}

.pkp_site_name {
  display: block !important;
  float: none !important;
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transform: none !important;
}

.pkp_site_name .is_img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  text-decoration: none !important;
}

.pkp_site_name .is_text {
  font-family: 'Merriweather', serif;
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: block;
  line-height: 1.3;
}

/* ===== SITE NAV ===== */
.pkp_site_nav_menu {
  display: contents !important;
  /* Flattens nav menu so its children become direct siblings of the banner */
}

/* ===== Register/Login & Profile — absolute top-right ===== */
/* Target the UL directly because OJS often strips the wrapper div */
.pkp_head_wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  /* Removed padding, now handled by structure_head */
  box-sizing: border-box !important;
  position: static !important;
  /* Allow absolute children to bubble up to structure_head */
}

#navigationUserWrapper,
.pkp_navigation_user_wrapper {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  /* Position perfectly in the middle of the screen */
  transform: translateX(-50%) !important;
  /* Pull back by half width */
  width: 100vw !important;
  /* Force to be the exact width of the window */
  max-width: 100vw !important;
  height: 50px !important;
  /* Height matches the padding to prevent overlap */
  display: flex !important;
  justify-content: center !important;
  /* Center the 1200px UL below */
  background: transparent !important;
  /* Background belongs to the UL */
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  z-index: 1001 !important;
}


ul.pkp_navigation_user.pkp_nav_list {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  /* Buttons on the right */
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 1200px !important;
  /* Lock background width to 1200px */
  height: 100% !important;
  margin: 0 !important;
  padding: 0 24px !important;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-bottom: 2px solid #cbd5e1 !important;
  list-style: none !important;
  box-sizing: border-box !important;
}


/* Base button for Login/Register or Profile */
.pkp_navigation_user>li>a {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #0d2352 !important;
  background-color: #ffffff !important;
  padding: 6px 18px !important;
  border-radius: 20px !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-shadow: none !important;
}

.pkp_navigation_user>li>a:hover {
  background-color: #0d2352 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
  text-decoration: none !important;
}

/* User Profile Dropdown Box */
.pkp_navigation_user ul {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  background-color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-radius: 4px !important;
  padding: 8px 0 !important;
  border: 1px solid var(--border-color) !important;
  min-width: 150px !important;
  display: none;
  /* normal OJS hover handles display */
}

/* Make OJS submenus display on hover */
.pkp_navigation_user li:hover>ul,
.pkp_navigation_primary li:hover>ul {
  display: block !important;
}

/* Dropdown links for Profile */
.pkp_navigation_user ul li a {
  color: var(--primary) !important;
  background: transparent !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  display: block !important;
  border: none !important;
}

.pkp_navigation_user ul li a:hover {
  background-color: #f8fafc !important;
  text-decoration: none !important;
}

/* ===== NAVBAR: Full-width dark bar at the bottom of the header ===== */
.pkp_navigation_primary_row {
  order: 1 !important;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-bottom: 2px solid #cbd5e1 !important;
  /* Gray break line under nav */
  margin: 0 auto !important;
  align-self: center !important;
  /* Center in flex parent */
  padding: 0 !important;
  width: 100% !important;
  max-width: 1200px !important;
  position: relative !important;
  z-index: 999 !important;
}

.pkp_navigation_primary_wrapper {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  box-sizing: border-box !important;
}

.pkp_navigation_primary {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 2px !important;
  align-items: center !important;
}

.pkp_navigation_primary li a {
  font-weight: 500;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  padding: 12px 14px;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.pkp_navigation_primary li a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* Fix dropdown menus (white background, dark text) */
.pkp_navigation_primary ul {
  background-color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-radius: 4px !important;
  padding: 8px 0 !important;
  border: 1px solid var(--border-color) !important;
}

.pkp_navigation_primary ul li a {
  color: var(--text-main) !important;
  padding: 10px 20px !important;
  font-weight: 400 !important;
}

.pkp_navigation_primary ul li a:hover {
  background-color: #f8fafc !important;
  color: var(--primary) !important;
}

/* Search — transformed into a clean white form input aesthetic */
.pkp_navigation_search_wrapper {
  margin: 0 0 0 auto !important;
  /* Push it to the far right of the flex container */
  padding: 0 !important;
  float: none !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.pkp_navigation_search_wrapper a,
a.pkp_search.pkp_search_desktop {
  background-color: #ffffff !important;
  color: #64748b !important;
  /* Placeholder text color */
  font-size: 13px !important;
  font-weight: 400 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  padding: 6px 16px !important;
  margin: 0 !important;
  border-radius: 20px !important;
  /* Pill shaped input */
  border: 1px solid #e2e8f0 !important;
  min-width: 180px !important;
  /* Form width */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s ease-in-out !important;
  cursor: text !important;
  /* Make it feel like an input */
}

/* Make the search icon look like an input adornment */
.pkp_navigation_search_wrapper a .fa-search,
.pkp_navigation_search_wrapper a .fa {
  color: #94a3b8 !important;
}

.pkp_navigation_search_wrapper a:hover,
a.pkp_search.pkp_search_desktop:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  text-decoration: none !important;
}



/* ================= LAYOUT ================= */
.pkp_structure_content {
  background: #ffffff !important;
  /* White content band over the light page bg */
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 40px 24px !important;
  box-sizing: border-box !important;
  border-left: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  display: flex !important;
  gap: 40px !important;
  flex-direction: column !important;
}

@media(min-width: 992px) {

  /* Enforce flex layout regardless of OJS's structural wrappers */
  .pkp_structure_content.has_sidebar,
  .pkp_structure_content>.row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    /* Pushes content to the extreme left and right */
    width: 100% !important;
  }

  /* Reset bootstrap row margins if present */
  .pkp_structure_content>.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .pkp_structure_main {
    flex: 0 0 calc(100% - 360px) !important;
    /* 280px sidebar + 80px gap = 360px */
    max-width: calc(100% - 360px) !important;
    width: 100% !important;
    border-right: 1px solid #e2e8f0 !important;
    /* Subtle vertical divider */
    padding-right: 40px !important;
    /* Space before the divider */
  }

  /* Keep sidebar readable but compact */
  .pkp_structure_sidebar,
  .pkp_structure_sidebar.left,
  .pkp_structure_sidebar.right {
    flex: 0 0 280px !important;
    width: 280px !important;
    max-width: 280px !important;
    padding-left: 40px !important;
    /* Space after the divider */
  }

  /* Force all sidebars to the right by relying on standard flex DOM order */
  .pkp_structure_sidebar.left {
    order: 0 !important;
  }
}

/* Kill the native OJS vertical divider pseudo-element lines */
.pkp_structure_main::after,
.pkp_structure_main:after,
.pkp_structure_main::before,
.pkp_structure_main:before {
  display: none !important;
  content: none !important;
  border: none !important;
  background: none !important;
  width: 0 !important;
}

/* Allow the content area to completely take over the space left by the dividing line */
#pkp_content_main,
.pkp_structure_main {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* ================= MAIN CONTENT ================= */
.page_index_journal>section,
.page_index_journal>.cmp_announcements {
  background: transparent;
  border: none !important;
  border-bottom: 2px solid #2087B4 !important;
  border-radius: 0;
  padding: 0 0 40px 0;
  margin-bottom: 40px;
  box-shadow: none !important;
}

.page_index_journal>section:last-child,
.page_index_journal>.cmp_announcements:last-child {
  border-bottom: none !important;
}

.homepage_about h2,
.current_issue h2,
.cmp_announcements>h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.homepage_about p,
.homepage_about ul {
  font-size: 15px;
  color: var(--text-muted);
}

/* ================= CURRENT ISSUE ================= */
.current_issue_title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  display: inline-block;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: 20px;
}

.obj_issue_toc .heading {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.obj_issue_toc .cover {
  float: left;
  margin-right: 35px;
  margin-bottom: 25px;
}

.obj_issue_toc .cover img {
  max-width: 200px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.obj_issue_toc .cover img:hover {
  transform: translateY(-5px);
}

.obj_issue_toc .description {
  flex: 1;
  font-size: 14px;
  color: var(--text-muted);
}

.obj_issue_toc .published {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 15px;
  font-weight: 500;
}

/* Article List */
.cmp_article_list.articles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.obj_article_summary {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: box-shadow 0.2sease, transform 0.2sease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.obj_article_summary:hover {
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.obj_article_summary .title a {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}

.obj_article_summary .title a:hover {
  color: var(--primary);
}

.obj_article_summary .authors {
  font-size: 13px;
  color: var(--text-muted);
}

.obj_article_summary .pages {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
  margin-top: 5px;
}

ul.galleys_links {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: flex;
  gap: 10px;
}

.obj_galley_link {
  display: inline-block;
  background-color: var(--primary);
  color: white !important;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background 0.2s;
}

.obj_galley_link:hover {
  background-color: var(--primary-hover);
}

/* ================= SIDEBAR ================= */
/* Remove native OJS vertical divider line */
.pkp_structure_sidebar,
.pkp_structure_sidebar.left,
.pkp_structure_sidebar.right {
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

.pkp_structure_sidebar .pkp_block {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 48px !important;
  box-shadow: none !important;
  transition: none !important;
}

/* Sidebar Title Modernization */
.pkp_structure_sidebar .pkp_block .title,
.pkp_structure_sidebar .pkp_block h2,
.pkp_structure_sidebar .pkp_block h3,
.pkp_structure_sidebar .pkp_block .content>div:first-child[style*="background"] {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 6px 0 6px 16px !important;
  margin: 0 0 20px 0 !important;
  border-left: 4px solid #2087B4 !important;
  /* Signature JMAI Blue */
  border-bottom: 1px solid #f1f5f9 !important;
  background: transparent !important;
  /* Override inline backgrounds */
  display: block !important;
  line-height: 1.4 !important;
}

/* Sidebar Content & Links */
.pkp_structure_sidebar .pkp_block .content {
  font-size: 14px !important;
  color: #64748b !important;
  line-height: 1.6 !important;
}

.pkp_structure_sidebar .pkp_block .content ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

.pkp_structure_sidebar .pkp_block .content ul li {
  padding: 10px 0 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin: 0 !important;
}

.pkp_structure_sidebar .pkp_block .content ul li:last-child {
  border-bottom: none !important;
}

.pkp_structure_sidebar .pkp_block .content a {
  color: #64748b !important;
  text-decoration: none !important;
  display: block !important;
  transition: all 0.2s ease !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.pkp_structure_sidebar .pkp_block .content a:hover {
  color: #2087B4 !important;
  padding-left: 6px !important;
}

/* Specific resets for OJS built-in blocks */
.pkp_block.block_web_feed .content ul {
  display: flex !important;
  flex-direction: row !important;
  gap: 15px !important;
}

.pkp_block.block_web_feed img {
  height: 24px !important;
  opacity: 0.7 !important;
  transition: opacity 0.2s !important;
}

.pkp_block.block_web_feed img:hover {
  opacity: 1 !important;
}

/* ================= ANNOUNCEMENTS ================= */
.cmp_announcements .obj_announcement_summary {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
  overflow: hidden;
}

/* Blue Bottom Bar */
.cmp_announcements .obj_announcement_summary::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #0056b3;
  z-index: 2;
}

.cmp_announcements .obj_announcement_summary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

/* Highlight the first announcement */
.cmp_announcements.highlight_first .obj_announcement_summary:first-of-type {
  background: #ffffff;
  padding: 24px;
  margin-bottom: 32px;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.cmp_announcements.highlight_first .obj_announcement_summary:first-of-type h3 a {
  font-size: 22px;
  font-weight: 700;
  color: #0056b3;
}

/* Styling for the exact HTML structure provided */
.cmp_announcements .obj_announcement_summary h3 {
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.cmp_announcements .obj_announcement_summary h3 a {
  text-decoration: none;
  color: #0056b3;
  font-weight: 700;
  font-size: 20px;
  transition: color 0.2s ease;
  line-height: 1.4;
  display: block;
}

.cmp_announcements .obj_announcement_summary h3 a:hover {
  color: var(--primary);
}

.cmp_announcements .highlight_first h3 a {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.cmp_announcements .highlight_first h3 a:hover {
  color: var(--primary);
}

.cmp_announcements .date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.cmp_announcements .summary {
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
}

.cmp_announcements .summary p {
  margin: 0 0 12px 0;
}

.cmp_announcements .read_more {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.cmp_announcements .read_more:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Announcements and Footer continue... */

/* ================= FOOTER ================= */
.pkp_structure_footer_wrapper {
  background-color: var(--footer-bg);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 0;
  margin-top: 60px;
}

.pkp_structure_footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.pkp_brand_footer img {
  filter: brightness(0) invert(1);
  opacity: 0.6;
  max-width: 200px;
  transition: opacity 0.3s;
}

.pkp_brand_footer img:hover {
  opacity: 1;
}

/* Header Image & Layout Adjustments */
.pkp_structure_head .container,
.pkp_structure_head .pkp_head_wrapper {
  max-width: none !important;
  /* Allow the user nav to go full width */
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.pkp_structure_head .pkp_site_name_wrapper {
  padding: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 1200px !important;
  /* Match the navbar width */
  min-height: auto !important;
}

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

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

.pkp_structure_head .pkp_site_name .is_img img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  max-height: 180px !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: none !important;
}

.pkp_structure_page {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* ===============================================
   RESPONSIVE OVERRIDES (Mobile, Tablet, Desktop)
   =============================================== */

/* 1. Container Constrain (Max width for desktop) */
@media (max-width: 1240px) {

  .pkp_structure_content,
  .pkp_navigation_primary_row,
  .pkp_navigation_primary_wrapper,
  .pkp_navigation_user_wrapper,
  .pkp_structure_footer,
  .pkp_structure_head .pkp_head_wrapper,
  .pkp_structure_head .pkp_site_name_wrapper {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
  }
}

/* 2. Tablet Mode (Stack Sidebar & Refine Nav) */
@media (max-width: 991px) {
  .pkp_structure_content {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
    border: none !important;
    gap: 40px !important;
  }

  .pkp_structure_main,
  .pkp_structure_sidebar,
  .pkp_structure_sidebar.left,
  .pkp_structure_sidebar.right {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    border-right: none !important;
  }

  /* Hide Burger Menu Toggle as requested */
  .pkp_site_nav_toggle {
    display: none !important;
  }

  .pkp_navigation_primary_row {
    background: #0f172a !important;
    /* Darker solid background for mobile menu */
    padding: 0 !important;
    border-bottom: 3px solid #2087B4 !important;
    display: block !important;
    /* Ensure it is always visible since toggle is gone */
  }

  .pkp_navigation_primary_wrapper {
    flex-direction: column !important;
    padding: 20px !important;
    align-items: stretch !important;
  }

  .pkp_navigation_primary {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
    margin-bottom: 20px !important;
  }

  .pkp_navigation_primary li {
    width: 100% !important;
    text-align: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .pkp_navigation_primary li:last-child {
    border-bottom: none !important;
  }

  .pkp_navigation_primary li a {
    padding: 14px !important;
    font-size: 15px !important;
    color: #ffffff !important;
  }

  /* Dropdowns on Mobile: Click-to-Expand behavior */
  .pkp_navigation_primary ul {
    position: static !important;
    display: none !important;
    /* Hidden by default on mobile */
    background: rgba(255, 255, 255, 0.05) !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 5px 0 !important;
  }

  /* Show dropdown when OJS/Bootstrap toggles it via classes */
  /* Removing :focus-within allows the menu to shrink on the second click */
  .pkp_navigation_primary li.show>ul,
  .pkp_navigation_primary li.is_open>ul,
  .pkp_navigation_primary ul.pkp_nav_list--is-visible,
  .pkp_navigation_primary ul.show {
    display: block !important;
  }

  .pkp_navigation_primary ul li a {
    padding: 10px 20px !important;
    font-size: 14px !important;
    color: #cbd5e1 !important;
    border-bottom: none !important;
    background: transparent !important;
  }

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

  .pkp_navigation_search_wrapper a {
    width: 100% !important;
    min-width: unset !important;
    justify-content: center !important;
    height: 44px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border: none !important;
    font-weight: 600 !important;
  }

  /* Center Footer */
  .pkp_structure_footer {
    flex-direction: column !important;
    text-align: center !important;
    gap: 30px !important;
  }
}

/* 3. Mobile Mode (Typography & Grid Resets) */
@media (max-width: 767px) {
  .pkp_navigation_user_wrapper {
    justify-content: center !important;
    padding: 6px 15px !important;
  }

  .pkp_navigation_user.pkp_nav_list {
    justify-content: center !important;
    gap: 8px !important;
  }

  .pkp_navigation_user>li>a {
    padding: 5px 12px !important;
    font-size: 12px !important;
  }

  .pkp_site_name .is_text {
    font-size: 20px !important;
    letter-spacing: 1px !important;
  }

  .pkp_structure_head .pkp_site_name .is_img img {
    height: auto !important;
    /* Allow natural height to prevent stretching/cutting */
    width: 100% !important;
    max-width: 100% !important;
    max-height: unset !important;
    /* Remove height limit on mobile for natural ratio */
    object-fit: contain !important;
    object-position: center !important;
    background: transparent !important;
    /* Transparent as requested */
  }

  .pkp_site_name_wrapper {
    height: auto !important;
    /* Let content determine height */
    padding: 10px 0 !important;
    background: transparent !important;
    /* Transparent as requested */
    display: block !important;
    overflow: hidden !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

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

  /* Force all custom grids to stack (ethics.html, fns.html, reviewer.html) */
  div[style*="display: grid"],
  .grid-container {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Responsive Tables */
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Responsive Images */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Adjust Page Titles */
  .homepage_about h2,
  .current_issue h2,
  .cmp_announcements>h2 {
    font-size: 22px !important;
  }
}

/* 4. Extra Small (Fix for Tiny Screens) */
@media (max-width: 480px) {
  .pkp_structure_content {
    padding: 20px 15px !important;
  }

  .pkp_navigation_primary li a {
    font-size: 13px !important;
    padding: 10px 8px !important;
  }
}

/* Ensure OJS admin tools and modals don't blow out */
#ui-datepicker-div,
.ui-dialog {
  max-width: 95vw !important;
}