/* ========================================================================== 
   KERUEN JOURNAL — PRODUCTION STYLESHEET

   01. Переменные проекта
   02. Страницы статей и выпусков
   03. Пользовательское боковое меню
   04. Подвал OJS
   05. Заголовки главной страницы
   06. Блок «О журнале»
   07. Блок «Индексирование и регистрация»
   08. Адаптивная версия

   Стили меню ограничены .keruen-sidebar. Ширина колонок OJS и основной
   шрифт сайта не переопределяются. Каждое правило объявлено один раз.
   ========================================================================== */

/* 01. ПЕРЕМЕННЫЕ ПРОЕКТА
   ========================================================================== */

:root {
  --keruen-primary: #3438a2;
  --keruen-primary-dark: #292d83;
  --keruen-gold: #d9b044;
  --keruen-gold-dark: #c99e34;
  --keruen-system-gold: #f7bc4a;
  --keruen-heading: #132457;
  --keruen-text: #30394c;
  --keruen-muted: #838da7;
  --keruen-border: #dce1ed;
  --keruen-border-light: #f0f2f7;
  --keruen-surface: #ffffff;
  --keruen-surface-soft: #fafbff;
  --keruen-surface-hover: #f5f6fc;
}

/* 02. СТРАНИЦЫ СТАТЕЙ И ВЫПУСКОВ
   ========================================================================== */

/* Метаданные в кратком описании статьи. */
.obj_article_summary .meta {
  position: relative;
  padding-top: 0.357rem;
  color: rgba(0, 0, 0, 0.87);
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.43rem;
}

/* Заголовки информационных разделов на странице статьи. */
.obj_article_details .main_entry .label {
  display: inline-block;
  padding: 0 0 0.357rem;
  color: rgba(0, 0, 0, 0.87);
  border-bottom: 3px solid var(--keruen-system-gold);
  font-weight: 600;
  text-transform: uppercase;
}

/* DOI и ORCID. */
.obj_article_details .orcid a,
.obj_article_details .doi a {
  color: var(--keruen-primary);
  font-weight: 600;
  text-decoration: none;
}

.obj_article_details .orcid a:hover,
.obj_article_details .doi a:hover {
  color: var(--keruen-primary-dark);
  text-decoration: underline;
}

/* Название статьи в содержании выпуска. */
.obj_article_summary > .title {
  margin: 0;
  color: rgba(0, 0, 0, 0.87);
  border-bottom: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.43rem;
}

.obj_article_summary > .title a,
.obj_article_summary .title a {
  color: var(--keruen-primary);
  text-decoration: none;
  text-transform: none;
}

.obj_article_summary > .title a:hover,
.obj_article_summary .title a:hover {
  color: var(--keruen-primary-dark);
  text-decoration: underline;
}

/* Системные заголовки выпуска и названия PDF без верхнего регистра. */
.galleys h2,
.sections .section h2,
#issueTocGalleyLabel,
.obj_galley_link.pdf {
  text-transform: none !important;
}

/* Сведения об авторах и организациях. */
.obj_article_details .authors .affiliation {
  color: rgba(0, 0, 0, 0.87);
  font-size: 0.93rem;
}

.obj_article_details .entry_details .sub_item .label {
  color: rgba(0, 0, 0, 0.87);
}

/* 03. ПОЛЬЗОВАТЕЛЬСКОЕ БОКОВОЕ МЕНЮ
   ========================================================================== */

/* Контейнер не изменяет ширину стандартной боковой колонки OJS. */
.keruen-sidebar {
  width: 100%;
  box-sizing: border-box;
  color: var(--keruen-primary);
  font-family: inherit;
}

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

/* Наследуем шрифт темы OJS. */
.keruen-sidebar *,
.keruen-sidebar a,
.keruen-sidebar span,
.keruen-sidebar h3,
.keruen-sidebar li {
  font-family: inherit !important;
}

/* Карточки меню. */
.keruen-sidebar .keruen-card {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  overflow: hidden;
  background: var(--keruen-surface);
  border: 1px solid var(--keruen-border);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(28, 42, 80, 0.04);
}

/* Единый заголовок карточек: язык, авторы, политика, индексирование. */
.keruen-sidebar .menu-card-title {
  display: block;
  margin: 0;
  padding: 11px 17px;
  color: var(--keruen-heading);
  background: var(--keruen-surface);
  border-bottom: 1px solid var(--keruen-border);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

/* Компактный служебный заголовок для дополнительных блоков. */
.keruen-sidebar .keruen-label {
  display: block;
  margin: 0;
  padding: 14px 17px 9px;
  color: var(--keruen-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Обычные ссылки внутри карточек. */
.keruen-sidebar .keruen-menu {
  display: block;
  width: 100%;
  margin: 0;
  padding: 3px 0;
  list-style: none;
}

.keruen-sidebar .keruen-menu li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.keruen-sidebar .keruen-menu a {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 30px 8px 18px;
  color: var(--keruen-primary);
  background: var(--keruen-surface);
  border-bottom: 1px solid var(--keruen-border-light);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color 0.2s ease, background-color 0.2s ease, padding-left 0.2s ease;
}

.keruen-sidebar .keruen-menu li:last-child a {
  border-bottom: 0;
}

.keruen-sidebar .keruen-menu a::after {
  position: absolute;
  top: 50%;
  right: 17px;
  color: #8993aa;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  content: "›";
  transform: translateY(-50%);
}

.keruen-sidebar .keruen-menu a:hover,
.keruen-sidebar .keruen-menu a:focus {
  padding-left: 21px;
  color: var(--keruen-primary-dark);
  background: var(--keruen-surface-hover);
  text-decoration: none;
}

.keruen-sidebar .keruen-menu a:hover::after,
.keruen-sidebar .keruen-menu a:focus::after {
  color: var(--keruen-primary);
}

/* Переключатель языков. */
.keruen-sidebar .language-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 10px 12px 13px;
}

.keruen-sidebar .language-tabs a {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 3px;
  color: var(--keruen-primary);
  background: var(--keruen-surface);
  border: 1px solid var(--keruen-border);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.keruen-sidebar .language-tabs a:hover,
.keruen-sidebar .language-tabs a:focus {
  color: var(--keruen-primary-dark);
  background: var(--keruen-surface-hover);
  border-color: #bfc4e5;
  text-decoration: none;
}

/* Активный язык определяется локалью страницы. */
html[lang^="ru"] .keruen-sidebar .language-ru,
html[lang^="kk"] .keruen-sidebar .language-kk,
html[lang^="en"] .keruen-sidebar .language-en,
.keruen-sidebar .language-tabs a.active {
  color: #ffffff;
  background: var(--keruen-primary);
  border-color: var(--keruen-primary);
}

/* Сетка индексирования в боковой панели. */
.keruen-sidebar .indexing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 10px 18px 13px;
}

.keruen-sidebar .indexing-grid a {
  display: flex;
  min-width: 0;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  color: var(--keruen-primary);
  background: var(--keruen-surface-soft);
  border: 1px solid var(--keruen-border);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.keruen-sidebar .indexing-grid a:hover,
.keruen-sidebar .indexing-grid a:focus {
  color: #ffffff;
  background: var(--keruen-primary);
  border-color: var(--keruen-primary);
  text-decoration: none;
}

/* Основные кнопки. */
.keruen-sidebar .sidebar-actions {
  display: block;
  width: 100%;
  margin: 4px 0 16px;
  padding: 0;
}

.keruen-sidebar .sidebar-action {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin: 0 0 9px;
  padding: 10px 36px;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.keruen-sidebar .sidebar-action:last-child {
  margin-bottom: 0;
}

.keruen-sidebar .sidebar-action:hover,
.keruen-sidebar .sidebar-action:focus {
  text-decoration: none;
  transform: translateY(-1px);
}

.keruen-sidebar .sidebar-action-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
}

.keruen-sidebar .sidebar-action span:last-child {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.keruen-sidebar .sidebar-action.submit {
  color: #10266f;
  background: var(--keruen-gold);
}

.keruen-sidebar .sidebar-action.submit:hover,
.keruen-sidebar .sidebar-action.submit:focus {
  color: #10266f;
  background: var(--keruen-gold-dark);
}

.keruen-sidebar .sidebar-action.instruction {
  color: #ffffff;
  background: var(--keruen-primary);
  font-size: 13px;
}

.keruen-sidebar .sidebar-action.instruction:hover,
.keruen-sidebar .sidebar-action.instruction:focus {
  color: #ffffff;
  background: var(--keruen-primary-dark);
}

/* Доступность и изображения. */
.keruen-sidebar a:focus-visible {
  outline: 2px solid var(--keruen-gold);
  outline-offset: 2px;
}

.keruen-sidebar img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 04. ПОДВАЛ OJS
   ========================================================================== */

.pkp_structure_footer_wrapper {
  background: #f7f8fb;
  border-top: 1px solid var(--keruen-border);
  border-bottom: 6px solid var(--keruen-primary);
}

.pkp_structure_footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  box-sizing: border-box;
  padding: 25px 35px;
}

.pkp_footer_content {
  flex: 1;
  margin: 0;
  padding: 0;
  color: var(--keruen-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.pkp_footer_content p {
  margin: 0 0 8px;
}

.pkp_footer_content p:last-child {
  margin-bottom: 0;
}

.pkp_footer_content a {
  color: var(--keruen-primary);
  text-decoration: none;
}

.pkp_footer_content a:hover,
.pkp_footer_content a:focus {
  color: var(--keruen-primary-dark);
  text-decoration: underline;
}

/* Логотип Platform & workflow by OJS/PKP. */
.pkp_brand_footer {
  flex: 0 0 125px;
  width: 125px;
  margin: 0;
  padding: 0;
  text-align: right;
}

.pkp_brand_footer a {
  display: block;
  width: 125px;
  height: auto;
  margin: 0 0 0 auto;
}

.pkp_brand_footer img {
  display: block;
  width: 100%;
  max-width: 125px;
  height: auto;
  margin: 0;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

.pkp_brand_footer a:hover img {
  opacity: 1;
}

/* Лицензия Creative Commons. */
.footer-license {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.footer-license img,
.pkp_footer_content .footer-license img {
  display: block;
  flex: 0 0 88px;
  width: 88px;
  height: 31px;
  max-height: 31px;
  margin: 0;
}

.footer-license p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

/* 05. ЗАГОЛОВКИ ГЛАВНОЙ СТРАНИЦЫ
   ========================================================================== */

/*
 * Повторяет системный заголовок .pkp_page_index .current_issue h2.
 * Линия создаётся border-bottom по ширине текста, без псевдоэлемента.
 */
.pkp_structure_main .journal-section-title {
  display: inline-block;
  margin: 2.857rem 0 1.43rem;
  padding-bottom: 0.5em;
  color: rgba(0, 0, 0, 0.54);
  border-bottom: 3px solid var(--keruen-system-gold);
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    "Oxygen-Sans",
    "Ubuntu",
    "Cantarell",
    "Helvetica Neue",
    sans-serif;
  font-size: 1.285rem;
  font-weight: 700;
  line-height: 2.143rem;
  text-transform: uppercase;
}

/* 06. БЛОК «О ЖУРНАЛЕ»
   ========================================================================== */

.journal-about {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--keruen-border);
}

.journal-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--keruen-border);
  border-left: 1px solid var(--keruen-border);
}

.journal-fact {
  min-height: 92px;
  padding: 14px 16px;
  background: var(--keruen-surface);
  border-right: 1px solid var(--keruen-border);
  border-bottom: 1px solid var(--keruen-border);
  transition: background-color 0.2s ease;
}

.journal-fact:hover {
  background: var(--keruen-surface-soft);
}

.journal-fact strong {
  display: block;
  margin-bottom: 6px;
  color: var(--keruen-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.journal-fact span {
  display: block;
  color: var(--keruen-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

/* 07. БЛОК «ИНДЕКСИРОВАНИЕ И РЕГИСТРАЦИЯ»
   ========================================================================== */

.journal-indexing {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--keruen-border);
}

.journal-indexing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.journal-indexing-grid a {
  display: flex;
  min-height: 66px;
  flex-direction: column;
  justify-content: center;
  padding: 12px 15px;
  color: var(--keruen-primary);
  background: var(--keruen-surface);
  border: 1px solid var(--keruen-border);
  border-left: 3px solid var(--keruen-gold);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

.journal-indexing-grid strong {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 700;
}

.journal-indexing-grid span {
  color: #5e687d;
  font-size: 12px;
  line-height: 1.35;
}

.journal-indexing-grid a:hover,
.journal-indexing-grid a:focus {
  color: var(--keruen-primary-dark);
  background: #f7f8fc;
  border-color: #bfc5df;
  border-left-color: var(--keruen-primary);
  transform: translateY(-1px);
}

/* 08. АДАПТИВНАЯ ВЕРСИЯ
   ========================================================================== */

@media (max-width: 850px) {
  .journal-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .pkp_structure_footer {
    display: block;
    padding: 24px 20px;
  }

  .pkp_footer_content {
    text-align: center;
  }

  .pkp_brand_footer {
    width: 125px;
    margin: 22px auto 0;
    text-align: center;
  }

  .pkp_brand_footer a {
    width: 125px;
    margin: 0 auto;
  }

  .footer-license {
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .journal-indexing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .journal-facts {
    grid-template-columns: 1fr;
  }

  .journal-fact {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .keruen-sidebar .keruen-label,
  .keruen-sidebar .menu-card-title {
    padding-right: 15px;
    padding-left: 15px;
  }

  .keruen-sidebar .indexing-grid {
    padding-right: 15px;
    padding-left: 15px;
  }

  .keruen-sidebar .language-tabs {
    padding-right: 10px;
    padding-left: 10px;
  }

  .keruen-sidebar .sidebar-action {
    padding-right: 34px;
    padding-left: 34px;
  }

  .keruen-sidebar .sidebar-action-icon {
    left: 12px;
  }

  .keruen-sidebar .keruen-menu a {
    padding-right: 30px;
    padding-left: 16px;
  }

  .keruen-sidebar .keruen-menu a:hover,
  .keruen-sidebar .keruen-menu a:focus {
    padding-left: 19px;
  }
}
