/* =============================================================================
   IJHCRS Journal Header Styles
   Matches the two-row header layout:
     Row 1 (dark navy): primary nav left | user links right
     Row 2 (white):     logo + title | search bar | action dropdowns
   ============================================================================= */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  --topbar-bg:        #1c2b3a;   /* dark navy */
  --topbar-text:      #c8d6e0;
  --topbar-hover:     #ffffff;
  --topbar-active-underline: #c9a84c;  /* gold/amber accent under active item */

  --brandbar-bg:      #ffffff;
  --brandbar-border:  #e0e4e8;

  --brand-title-color:  #1c2b3a;
  --brand-subtitle-color: #6b7a8a;

  --search-border:    #c8d0d8;
  --search-btn-bg:    #2563c8;
  --search-btn-hover: #1a4fa0;

  --action-text:      #1c2b3a;
  --action-hover:     #2563c8;

  --font-ui: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   TOP BAR  (dark navy row)
   -------------------------------------------------------------------------- */
.pkp_topbar {
  background-color: var(--topbar-bg);
  width: 100%;
}

.pkp_topbar_inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 42px;
}

/* Primary nav list */
.pkp_navigation_primary_top {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.pkp_navigation_primary_top > li {
  position: relative;
}

.pkp_navigation_primary_top > li > a {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--topbar-text);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.pkp_navigation_primary_top > li > a:hover,
.pkp_navigation_primary_top > li > a:focus {
  color: var(--topbar-hover);
}

/* Active / current page — gold underline + slightly brighter text */
.pkp_navigation_primary_top > li.current > a,
.pkp_navigation_primary_top > li > a.is_active {
  color: #ffffff;
}

.pkp_navigation_primary_top > li.current > a::after,
.pkp_navigation_primary_top > li > a.is_active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--topbar-active-underline);
}

/* First item "IJHCRS" is always treated as the site/journal abbreviation */
.pkp_navigation_primary_top > li:first-child > a {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pkp_navigation_primary_top > li:first-child > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--topbar-active-underline);
}

/* User nav: Login | Register */
.pkp_topbar_user {
  display: flex;
  align-items: center;
}

.pkp_navigation_user_top {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.pkp_navigation_user_top > li > a {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--topbar-text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pkp_navigation_user_top > li > a:hover {
  color: var(--topbar-hover);
}

/* Vertical divider between Login and Register */
.pkp_navigation_user_top > li + li::before {
  content: '|';
  color: #4a6070;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   BRAND BAR  (white row)
   -------------------------------------------------------------------------- */
.pkp_brandbar {
  background-color: var(--brandbar-bg);
  border-bottom: 1px solid var(--brandbar-border);
  width: 100%;
}

.pkp_brandbar_inner {
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  gap: 20px;
  min-height: 80px;
}

/* --------------------------------------------------------------------------
   Brand Identity: logo + title block
   -------------------------------------------------------------------------- */
.pkp_brand_identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.pkp_brand_logo img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;        /* compass logo is circular */
  border: 1px solid #dde2e8;
}

.pkp_brand_text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pkp_brand_title {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-title-color);
  text-decoration: none;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pkp_brand_title:hover {
  color: var(--search-btn-bg);
  text-decoration: none;
}

.pkp_brand_subtitle {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--brand-subtitle-color);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Search bar
   -------------------------------------------------------------------------- */
.pkp_brandbar_search {
  flex: 1 1 auto;
  max-width: 360px;
  min-width: 200px;
}

.pkp_search_input_wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--search-border);
  border-radius: 4px;
  overflow: hidden;
  height: 38px;
}

.pkp_search_input_wrap input[type="text"] {
  flex: 1;
  height: 100%;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: #333;
  border: none;
  outline: none;
  background: transparent;
}

.pkp_search_input_wrap input[type="text"]::placeholder {
  color: #9eaab4;
}

.pkp_search_input_wrap button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 100%;
  background: var(--search-btn-bg);
  border: none;
  cursor: pointer;
  color: #ffffff;
  font-size: 14px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.pkp_search_input_wrap button[type="submit"]:hover {
  background: var(--search-btn-hover);
}

/* --------------------------------------------------------------------------
   Secondary action nav: Read | Publish | Subscribe | Help
   -------------------------------------------------------------------------- */
.pkp_brandbar_actions {
  display: flex;
  align-items: center;
  margin-left: auto;   /* push to the right */
  flex-shrink: 0;
}

.pkp_navigation_secondary {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.pkp_navigation_secondary > li {
  position: relative;
}

.pkp_navigation_secondary > li > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--action-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.pkp_navigation_secondary > li > a:hover {
  color: var(--action-hover);
}

/* Chevron arrow after dropdown labels */
.pkp_navigation_secondary > li.has_submenu > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4.5px solid currentColor;
  opacity: 0.65;
}

/* Dropdown panels */
.pkp_navigation_secondary > li > ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  padding: 6px 0;
  list-style: none;
  margin: 0;
  z-index: 200;
}

.pkp_navigation_secondary > li:hover > ul,
.pkp_navigation_secondary > li:focus-within > ul {
  display: block;
}

.pkp_navigation_secondary > li > ul > li > a {
  display: block;
  padding: 8px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--action-text);
  text-decoration: none;
  transition: background 0.1s;
}

.pkp_navigation_secondary > li > ul > li > a:hover {
  background: #f0f4f8;
  color: var(--action-hover);
}

/* --------------------------------------------------------------------------
   Mobile toggle (hidden on desktop)
   -------------------------------------------------------------------------- */
.pkp_site_nav_toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   Screen reader utility
   -------------------------------------------------------------------------- */
.pkp_screen_reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Responsive — collapse to single-bar mobile layout
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .pkp_brandbar_search {
    max-width: 220px;
  }
  .pkp_brand_title {
    font-size: 14.5px;
    white-space: normal;
    max-width: 220px;
  }
}

@media (max-width: 720px) {
  .pkp_topbar_inner {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 16px;
  }

  .pkp_navigation_primary_top,
  .pkp_navigation_user_top {
    flex-wrap: wrap;
  }

  .pkp_brandbar_inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .pkp_brandbar_actions {
    width: 100%;
    margin-left: 0;
  }

  .pkp_site_nav_toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid #c0cdd8;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    color: var(--action-text);
  }
}
