/* =====================================================================
   Шапка и меню (плагин journalDesign)
   Высота баннера и ширина правой колонки — переменные --jd-banner-h
   и --jd-side-w в site.css: от них зависят закреплённое меню и «Поиск».
   ===================================================================== */

.ajsp_head.pkp_site_name_wrapper {
  height: auto;
  padding: 0;
  background: var(--jd-primary);
}

.ajsp_banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo main side";
  align-items: center;
  column-gap: 28px;
  padding: 0 0 0 32px;
  height: var(--jd-banner-h);
  color: #fff;
}

/* --- логотип журнала --- */
.ajsp_logo {
  grid-area: logo;
  display: block;
  line-height: 0;
  border-radius: 50%;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ajsp_logo img {
  display: block;
  width: 120px;
  height: 120px;
  max-width: none;
}
.ajsp_logo:hover,
.ajsp_logo:focus {
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(var(--jd-accent-rgb), .55);
  outline: 0;
}

/* --- центр: название --- */
.ajsp_main {
  grid-area: main;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.ajsp_titlebox {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 0 18px;
  min-width: 0;
}
.ajsp_title,
.ajsp_subtitle {
  margin: 0;
  padding: 0;
  font-family: var(--jd-serif);
  font-weight: 700;
  color: #fff;
}
.ajsp_title {
  font-size: 2.15rem;
  line-height: 1.1;
  letter-spacing: .01em;
}
.ajsp_title a,
.ajsp_title a:hover,
.ajsp_title a:focus {
  color: #fff;
  text-decoration: none;
}
.ajsp_subtitle {
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: .02em;
}

/* --- вход / регистрация (меню пользователя OJS) --- */
.ajsp_head .ajsp_user.pkp_navigation_user_wrapper {
  position: absolute;
  top: 12px;
  right: 24px;
  left: auto;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  transform: none;
  z-index: 1001;
}
.ajsp_head .ajsp_user .pkp_navigation_user {
  display: flex;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}
.ajsp_head .ajsp_user .pkp_navigation_user > li {
  position: relative;
  display: block;
}
/* кнопки «Вход / Регистрация» и языки — одна группа рамок со скруглёнными краями */
.ajsp_head .ajsp_user .pkp_navigation_user > li > a,
.ajsp_langs a,
.ajsp_langs span {
  display: block;
  margin: 0 0 0 -1px;
  border: 1px solid rgba(var(--jd-accent-rgb), .55);
  font-family: var(--jd-serif);
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.ajsp_head .ajsp_user .pkp_navigation_user > li > a {
  padding: 4px 16px;
  font-size: .85rem;
  color: var(--jd-accent);
}
.ajsp_head .ajsp_user .pkp_navigation_user > li:first-child > a,
.ajsp_langs li:first-child a,
.ajsp_langs li:first-child span { margin-left: 0; border-radius: 4px 0 0 4px; }
.ajsp_head .ajsp_user .pkp_navigation_user > li:last-child > a,
.ajsp_langs li:last-child a,
.ajsp_langs li:last-child span  { border-radius: 0 4px 4px 0; }
.ajsp_head .ajsp_user .pkp_navigation_user > li:only-child > a,
.ajsp_langs li:only-child a,
.ajsp_langs li:only-child span  { border-radius: 4px; }
.ajsp_head .ajsp_user .pkp_navigation_user > li > a:hover,
.ajsp_head .ajsp_user .pkp_navigation_user > li > a:focus,
.ajsp_langs a:hover,
.ajsp_langs a:focus {
  background: var(--jd-primary-hover);
  color: var(--jd-accent-light);
  outline: 0;
}
/* выпадающее меню после входа: синий фон, белый текст, золото при наведении */
.ajsp_head .ajsp_user .pkp_navigation_user ul {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  min-width: 11em;
  margin: 2px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--jd-primary-alt);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  z-index: 1002;
}
.ajsp_head .ajsp_user .pkp_navigation_user ul a {
  display: block;
  padding: 6px 14px;
  border-left: 4px solid transparent;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.ajsp_head .ajsp_user .pkp_navigation_user ul a:hover,
.ajsp_head .ajsp_user .pkp_navigation_user ul a:focus {
  background: var(--jd-primary-hover);
  border-color: var(--jd-accent);
  color: var(--jd-accent-light);
}

/* --- правая колонка: ISSN, издатель, языки --- */
.ajsp_side {
  grid-area: side;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 22px;
}
.ajsp_publisher {
  display: block;
  line-height: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
  transition: transform .25s ease, box-shadow .25s ease;
}
.ajsp_publisher img {
  display: block;
  width: 72px;
  height: 72px;
  max-width: none;
}
.ajsp_publisher:hover,
.ajsp_publisher:focus {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--jd-accent), 0 6px 12px rgba(0, 0, 0, .3);
  outline: 0;
}
.ajsp_issn {
  font-family: var(--jd-serif);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.ajsp_issn:hover,
.ajsp_issn:focus {
  color: var(--jd-accent-light);
  text-decoration: underline;
}
.ajsp_langs {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ajsp_langs li { display: block; }
.ajsp_langs a,
.ajsp_langs span {
  padding: 2px 10px;
  font-size: .75rem;
  letter-spacing: .04em;
}
.ajsp_langs a { color: var(--jd-accent); }
.ajsp_langs .current {
  background: var(--jd-accent);
  border-color: var(--jd-accent);
  color: var(--jd-primary);
}

/* =====================================================================
   Меню сайта (компьютер): полупрозрачная полоса, золотой текст,
   закрепляется сверху при прокрутке; «Поиск» — под правой колонкой баннера
   ===================================================================== */
@media (min-width: 992px) {
  /* тонкая золотая линия между баннером и меню (inset — не меняет высоту баннера) */
  .ajsp_head.pkp_site_name_wrapper {
    box-shadow: inset 0 -1px 0 rgba(var(--jd-accent-rgb), .6);
  }
  .ajsp_banner .ajsp_side {
    width: var(--jd-side-w);
    box-sizing: border-box;
  }

  /* баннер уезжает вверх, остаётся строка меню */
  .pkp_structure_head {
    position: -webkit-sticky;
    position: sticky;
    top: calc(-1 * var(--jd-banner-h));
    z-index: 1000;
    background-color: transparent;   /* фон даёт сама полоса меню */
  }

  /* «матовое стекло»: .78 — непрозрачность (меньше — прозрачнее) */
  .pkp_navigation_primary_row {
    position: relative;
    background: rgba(var(--jd-primary-rgb), .78);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  }
  .pkp_navigation_primary_wrapper { position: static; }

  #navigationPrimary > li > a,
  .pkp_navigation_search_wrapper a,
  .pkp_navigation_user > li > a { color: var(--jd-accent); }

  #navigationPrimary > li > a:hover,
  .pkp_navigation_search_wrapper a:hover,
  .pkp_navigation_user > li > a:hover { color: var(--jd-accent-light); border-color: var(--jd-accent); }

  /* выпадающее подменю «Журнал» */
  #navigationPrimary ul a:hover,
  #navigationPrimary ul a:focus {
    background: var(--jd-primary-hover);
    border-color: var(--jd-accent);
    color: var(--jd-accent-light);
  }

  /* нажатый / выделенный пункт (видно и при навигации с клавиатуры) */
  #navigationPrimary > li > a:focus,
  #navigationPrimary > li > a:active,
  .pkp_navigation_primary_row .pkp_navigation_search_wrapper a:focus,
  .pkp_navigation_primary_row .pkp_navigation_search_wrapper a:active,
  .pkp_navigation_user > li > a:focus {
    background: var(--jd-primary-dark);
    color: var(--jd-accent-light);
    border-color: var(--jd-accent);
    outline: 0;
  }

  .pkp_navigation_search_wrapper {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--jd-side-w);
    float: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pkp_navigation_search_wrapper a { margin: 0; }
}

/* --- планшет и телефон --- */
@media (max-width: 991px) {
  .ajsp_head.pkp_site_name_wrapper { padding-top: 2.857rem; }   /* место под кнопку меню */
  .ajsp_banner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo main"
      "side side";
    column-gap: 16px;
    height: auto;
    padding: 8px 16px 0;
  }
  .ajsp_logo img { width: 72px; height: 72px; }
  .ajsp_main { flex-direction: column; align-items: flex-start; }
  .ajsp_titlebox { padding: 0; align-items: flex-start; text-align: left; }
  .ajsp_title { font-size: 1.25rem; }
  .ajsp_subtitle { font-size: .75rem; }
  .ajsp_head .ajsp_user.pkp_navigation_user_wrapper {
    top: calc(-2.857rem + 8px);
    right: 0;
  }
  .ajsp_head .ajsp_user .pkp_navigation_user > li > a { padding: 3px 10px; font-size: .78rem; }
  .ajsp_side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(var(--jd-accent-rgb), .35);
  }
  .ajsp_publisher img { width: 44px; height: 44px; }
}
