@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;700&display=swap');

/*
================================================================================
| OJS 3.5.0.1 - CUSTOM HEADER AND LAYOUT STYLESHEET                            |
| Goal: Top bar for User Nav, followed by a full-width banner logo.            |
================================================================================
*/

/*
--------------------------------------------------------------------------------
| 1. HEADER REORDERING & LAYOUT (Desktop)                                      |
| Stacks the header elements vertically.                                       |
--------------------------------------------------------------------------------
*/
/* Apply flex layout to the main header container */
.pkp_head_wrapper {
  display: flex;
  flex-direction: column;
  /* Stack children vertically */
  padding-top: 0 !important;
  background: none;
  /* Remove any default background from the wrapper */
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* Ensure the outer structure also adapts */
.pkp_structure_head {
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* Change user navigation link color to be visible on dark background */
.pkp_navigation_user_wrapper a {
  color: #ffffff;
}

.pkp_navigation_user_wrapper a:hover {
  color: #dddddd;
}

/* Tier 2: Site Logo Banner (this holds the full-width image) */
.pkp_site_name {
  order: 2;
  /* Second item */
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  /* No padding so the image fits edge-to-edge */
  background-color: #0d4b6b;
  /* Same dark teal to merge with the top bar */
  line-height: 1;
  /* Remove extra space below the image */
  position: relative !important;
  /* Force relative positioning to avoid overlap at theme-specific breakpoints */
  height: auto !important;
  overflow: visible !important;
}

/* Tier 3: Primary Navigation (Current, Archives, About) */
.pkp_navigation_primary_wrapper {
  order: 3;
  /* Third item */
  background-color: #f8f8f8;
  /* Light background for the nav bar */
  width: 100%;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.15);
  /* Subtle shadow for depth */
}

.pkp_navigation_primary_wrapper .pkp_navigation_primary {
  text-align: left;
  /* Align menu items to the left */
  padding: 0 20px;
}

.pkp_navigation_primary>li>a {
  color: #333;
  /* Dark text for light background */
  font-weight: bold;
  padding-top: 10px;
  padding-bottom: 10px;
}

.pkp_navigation_primary>li>a:hover,
.pkp_navigation_primary>li>a:focus {
  color: #000;
  background-color: #eee;
  border-color: transparent;
}

/*
--------------------------------------------------------------------------------
| 2. FULL-WIDTH BANNER LOGO STYLE (Desktop)                                    |
| This ensures the logo stretches to fill its container.                       |
--------------------------------------------------------------------------------
*/
/* This rule styles the image itself to act as a banner */
.pkp_site_name .is_img img {
  width: 100% !important;
  /* Stretch image to full width */
  height: auto !important;
  /* Maintain aspect ratio */
  display: block;
  max-height: none;
  /* Remove any height restrictions */
}

/*
--------------------------------------------------------------------------------
| 3. GENERAL LONG-TEXT JUSTIFICATION                                           |
--------------------------------------------------------------------------------
*/
.obj_article_details .abstract,
.obj_article_details .abstract p,
.page_about_journal .pkp_structure_main p,
.page_about .pkp_structure_main p,
.page_announcement .pkp_structure_main p,
.page_article .main_entry p {
  text-align: justify !important;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  line-height: 1.65;
  margin-bottom: 1em;
}

.obj_article_details .abstract h2,
.obj_article_details .abstract h3,
.page_about_journal h2,
.page_about_journal h3,
.page_announcement h2,
.page_announcement h3,
.page_article h2,
.page_article h3 {
  text-align: left !important;
}

/*
--------------------------------------------------------------------------------
| 4. CUSTOM SIDEBAR MENU STYLE                                                 |
--------------------------------------------------------------------------------
*/
/* Variant 1: Used with .title and .content ul (likely manual HTML blocks) */
.custom-sidebar-menu .title {
  background-color: #e1d5e7;
  color: #584a60;
  padding: 10px 15px;
  margin: 0 0 5px 0;
  font-size: 0.9em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-sidebar-menu .content ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e0e0e0;
}

.custom-sidebar-menu .content li a {
  display: block;
  background-color: #f9f8f8;
  padding: 12px 15px;
  color: #424242;
  text-decoration: none;
  font-size: 0.95em;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.custom-sidebar-menu .content li:last-child a {
  border-bottom: none;
}

.custom-sidebar-menu .content li a:hover,
.custom-sidebar-menu .content li a:focus {
  background-color: #584a60;
  color: #ffffff;
}

/* Variant 2: Used with .menu-title and direct ul (likely OJS custom navigation blocks) */
.custom-sidebar-menu {
  margin-bottom: 25px;
  font-family: Arial, sans-serif;
}

.custom-sidebar-menu .menu-title {
  background-color: #e1d5e7;
  color: #584a60;
  padding: 10px 15px;
  margin: 0 0 5px 0;
  font-size: 0.9em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-sidebar-menu ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e0e0e0;
}

.custom-sidebar-menu li {
  margin: 0;
}

.custom-sidebar-menu li a {
  display: block;
  background-color: #f9f9f9;
  padding: 12px 15px;
  color: #424242;
  text-decoration: none;
  font-size: 0.95em;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.custom-sidebar-menu li:last-child a {
  border-bottom: none;
}

.custom-sidebar-menu li a:hover,
.custom-sidebar-menu li a:focus {
  background-color: #584a60;
  color: #ffffff;
}

/* 
 * Locale-specific refinements for Bengali (bn-IN)
 * Ensures connected characters (ligatures) look correct and legibility is high.
 */
html[lang="bn-IN"] .pkp_block.block_custom,
html[lang="bn-IN"] .custom-sidebar-menu {
  font-family: 'Hind Siliguri', 'Siyam Rupali', 'SolaimanLipi', Arial, sans-serif !important;
}

html[lang="bn-IN"] .pkp_block.block_custom .title,
html[lang="bn-IN"] .custom-sidebar-menu .menu-title {
  letter-spacing: normal !important;
  /* Prevents disconnection of Bengali characters */
  text-transform: none !important;
  /* Redundant for Bengali */
  font-size: 1.1em !important;
  /* Bengali script often needs to be slightly larger for clarity */
}

html[lang="bn-IN"] .pkp_block.block_custom a,
html[lang="bn-IN"] .custom-sidebar-menu li a {
  line-height: 1.6 !important;
  /* Increased spacing for complex Bengali glyphs */
  font-size: 1.1em !important;
}

/*
--------------------------------------------------------------------------------
| 4.5 SUB-MENU VISIBILITY (Global)                                             |
| Fixes white-on-white text in dropdowns (e.g., About menu).                   |
--------------------------------------------------------------------------------
*/
.pkp_navigation_primary ul {
  background-color: #ffffff !important;
  padding: 10px 0 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.pkp_navigation_primary ul li a {
  color: #333333 !important;
  /* Dark grey text */
  background-color: #ffffff !important;
  /* White background */
  display: block;
  padding: 10px 20px !important;
  text-decoration: none;
  font-size: 0.9em;
  border-bottom: 1px solid #f0f0f0;
}

.pkp_navigation_primary ul li a:hover,
.pkp_navigation_primary ul li a:focus {
  color: #ffffff !important;
  /* White text on hover */
  background-color: #006798 !important;
  /* Blue background on hover */
}

/*
================================================================================
| 5. MOBILE RESPONSIVE STYLES                                                  |
| Styles for screens smaller than 768px (tablets and phones).                  |
================================================================================
*/
@media (max-width: 768px) {

  /* Ensures the entire header resizes to fit its content on mobile */
  .pkp_structure_head,
  .pkp_head_wrapper {
    height: auto !important;
    min-height: initial !important;
  }

  /* Center the top user navigation links */
  .pkp_navigation_user_wrapper {
    justify-content: center;
  }

  /* Adjust the logo banner for mobile */
  .pkp_site_name {
    padding: 0px !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Scale the logo down on mobile */
  .pkp_site_name .is_img img {
    width: auto !important;
    max-width: 100%;
    max-height: 30px;
    /* Reduced from 80px for a cleaner mobile look */
  }

  /* Stack the main navigation links vertically */
  .pkp_navigation_primary_wrapper .pkp_navigation_primary {
    padding: 0;
  }

  .pkp_navigation_primary>li {
    display: block;
    text-align: center;
    border-bottom: 1px solid #ddd;
  }

  .pkp_navigation_primary>li:last-child {
    border-bottom: none;
  }

  .pkp_navigation_primary>li>a {
    padding: 12px 15px;
  }

  /* Fix for sub-menu items (e.g., under "About") which were appearing white-on-white */
  #navigationPrimary li ul {
    background: #fdfdfd !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  #navigationPrimary li ul li a {
    color: #006798 !important;
    /* Dark blue for visibility */
    background-color: #fdfdfd !important;
    padding: 12px 20px !important;
    font-size: 0.9em !important;
    border-top: 1px solid #eee !important;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  #navigationPrimary li ul li a:hover {
    background-color: #006798 !important;
    color: #ffffff !important;
  }
}

/*
================================================================================
| 5.5 TABLET/RESPONSIVE OVERRIDE (768px - 992px)                               |
| Handles the gap between mobile and desktop where overlap persists.             |
================================================================================
*/
/*
================================================================================
| 6. FOOTER CUSTOMIZATIONS                                                     |
| Reduces the vertical height of the PKP brand footer.                         |
================================================================================
*/
.pkp_structure_footer_wrapper,
.pkp_content_footer,
.pkp_structure_footer {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.pkp_brand_footer {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

.pkp_brand_footer .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.pkp_brand_footer a[href*="pkp.sfu.ca"] img {
  max-height: 10px !important;
}