:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;

  --text: #1f242b;
  --text-soft: #4d5662;
  --text-uk: #69727d;
  --muted: #7c8590;

  --line: #e3e7eb;
  --line-strong: #d6dce2;

  --accent: #245f8d;
  --accent-dark: #194a70;
  --accent-soft: #eef5fa;

  --en-bg: #f2f7fb;
  --en-border: #8eb4cf;

  --radius: 14px;
  --radius-small: 9px;
  --shadow: 0 10px 30px rgba(31, 36, 43, 0.06);
}

/* Base */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
          "Segoe UI Variable",
          "Inter",
          "Segoe UI",
          Roboto,
          Helvetica,
          Arial,
          sans-serif;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

/* Header */

.site-header {
  background: rgb(9 41 65);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  color: white;
}

.site-header__inner,
.page-shell,
.site-footer__inner {
  width: min(1095px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: #e7f1ff;
}

.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(36, 95, 141, 0.16);
}

.site-header__tag {
  color: #dcdcdc;
  font-size: 0.84rem;
}

/* Layout */

.page-shell {
  padding: 34px 0 52px;
}

.article-card,
.home-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Article hero */

.article-hero {
  padding: 28px 36px 26px;
  background: #245f8d;
  border-bottom: 1px solid var(--line);
  /* color: red; */
}

.article-hero__eyebrow {
  margin: 0 0 2px;
  color: #b9d7ed;
  font-size: 0.76rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.article-hero h1 {
  margin: 0;
  /* max-width: 899px; */
  color: #ffffff;
  font-family: inherit;
  font-size: clamp(1.32rem, 2.55vw, 1.82rem);
  line-height: 1.25;
  font-weight: 620;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.article-hero__uk-title {
  margin: 12px 0 0;
  max-width: 880px;
  color: #c5c5c5;
  font-family: inherit;
  font-size: clamp(1rem, 1.65vw, 1.14rem);
  line-height: 1.25;
  font-weight: 450;
  text-wrap: balance;
}

.article-content {
  padding: 0 36px 34px;
}

/* Generic bilingual blocks */

.field-pair,
.article-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.lang-item + .lang-item {
  margin-top: 14px;
}

/* English block:
   EN is the main version, so it gets a light accent background
   and a clearer left marker. UK remains plain and slightly softer. */
.lang-item:not([lang="uk"]),
.language-block--en {
  padding: 15px 17px;
  background: var(--en-bg);
  border: 1px solid #dbe8f1;
  border-left: 4px solid var(--en-border);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.lang-item[lang="uk"],
.language-block--uk {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.field-label,
.section-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.lang-item:not([lang="uk"]) > .field-label,
.language-block--en > .section-label {
  color: #416985;
}

.lang-item:not([lang="uk"]) .field-value,
.lang-item:not([lang="uk"]) .abstract,
.language-block--en {
  color: var(--text);
}

/* Language markers without changing the HTML */
.lang-item:not([lang="uk"]) > .field-label::after {
  /* content: " · EN"; */
  /* color: var(--accent); */
  /* font-weight: 700; */
}

.lang-item[lang="uk"] > .field-label::after {
  /* content: " · UK"; */
  color: #9aa2ab;
  font-weight: 550;
}

.language-block--en > .section-label::after {
  content: " · EN";
  color: var(--accent);
  font-weight: 700;
}

.language-block--uk > .section-label::after {
  /* content: " · UK"; */
  color: #9aa2ab;
  font-weight: 550;
}

.field-value {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.field-value--strong {
  font-size: 1.04rem;
  line-height: 1.5;
  font-weight: 580;
  letter-spacing: -0.006em;
}

.lang-item[lang="uk"] .field-label,
.lang-item[lang="uk"] .field-value,
.lang-item[lang="uk"] .abstract {
  color: var(--text-uk);
}

/* Conference block */

.conference-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.conference-meta > .field-pair {
  grid-column: 1 / -1;
  padding: 0 0 8px;
  border-bottom: 0;
}

.conference-meta__item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.conference-meta__item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
}

/* Authors */

.article-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.language-block {
  min-width: 0;
}

.language-block--en {
  color: var(--text);
}

.language-block--uk {
  color: var(--text-uk);
}

.authors {
  margin: 0;
  padding: 0;
  list-style: none;
}

.authors li {
  position: relative;
  padding: 0 0 16px 18px;
}

.authors li:last-child {
  padding-bottom: 0;
}

.authors li::before {
  content: "";
  position: absolute;
  top: 0.67em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9aa6b2;
}

.language-block--uk .authors li::before {
  background: #b1b7bd;
}

.authors .name,
.authors .affiliation,
.authors .author-alt,
.authors .author-email,
.authors .orcid {
  display: block;
}

.authors .name {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.42;
  font-weight: 620;
}

.language-block--en .authors .name {
  color: #183c56;
}

.language-block--uk .authors .name {
  color: #555e68;
  font-weight: 570;
}

.authors .affiliation {
  margin-bottom: 3px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.authors .author-alt {
  margin: 3px 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.authors .author-email {
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.authors .author-email a {
  color: var(--accent);
  text-decoration: none;
}

.authors .author-email a:hover {
  text-decoration: underline;
}

.language-block--uk .authors .affiliation {
  color: var(--text-uk);
}

.authors .orcid {
  font-size: 0.82rem;
  line-height: 1.45;
}

.authors .orcid a {
  overflow-wrap: anywhere;
  color: var(--accent);
  text-decoration: none;
}

.authors .orcid a:hover {
  text-decoration: underline;
}

/* Keywords */

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.keyword {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  background: #ffffff;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  color: #000000;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 600;
}

.lang-item[lang="uk"] .keyword {
  background: #eceff1;
  border-color: #dde1e4;
  color: #68717a;
}

/* Abstract */

.abstract {
  margin: 0;
  max-width: 880px;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.72;
  text-align: left;
  text-wrap: pretty;
}

/* DOI / PDF */

.resource-panel {
  margin-top: 26px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  background: #092941;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.resource-panel__label {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 0.74rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.doi-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #a0cdf0;
  font-weight: 600;
}

.pdf-button,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(36, 95, 141, 0.14);
  transition:
          background-color 0.15s ease,
          transform 0.15s ease,
          box-shadow 0.15s ease;
}

.pdf-button:hover,
.button:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(36, 95, 141, 0.18);
}

.pdf-button svg {
  width: 17px;
  height: 17px;
}

.pdf-meta {
  margin-top: 5px;
  color: #eaeff6;
  font-size: 0.78rem;
  text-align: center;
}

/* Home page */

.home-card {
  padding: 34px 36px;
}

.home-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.28;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.home-card p {
  max-width: 760px;
  color: var(--text-soft);
}

.article-link {
  margin-top: 22px;
  padding: 17px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.article-link a {
  font-weight: 620;
}

.references-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.references {
  margin: 0;
  padding-left: 24px;
}

.references li {
  margin-bottom: 18px;
  padding-left: 5px;
  color: var(--text);
}

.references li:last-child {
  margin-bottom: 0;
}

.reference-text {
  font-size: 0.94rem;
  line-height: 1.68;
}

.reference-links {
  margin-top: 5px;
}

.reference-links a {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--accent);
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: none;
}

.reference-links a:hover {
  text-decoration: underline;
}

/* 404 */

.error-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 54px 48px 50px;
  text-align: center;
}

.error-code {
  margin: 0 0 8px;
  color: #c0c6cc;
  font-size: clamp(3.8rem, 10vw, 6.6rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.error-page h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.3;
  font-weight: 620;
  letter-spacing: -0.018em;
}

.error-page .uk-text {
  color: var(--text-uk);
}

.error-page h1 + .uk-text {
  margin: 7px 0 26px;
  font-size: 1.02rem;
}

.error-page p:not(.uk-text) {
  margin: 0 auto 8px;
  max-width: 560px;
  color: var(--text-soft);
}

.error-page p.uk-text:not(:first-of-type) {
  margin: 0 auto;
  max-width: 560px;
}

.error-page .button {
  margin-top: 28px;
}

/* Footer */

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer__inner {
  padding: 19px 0;
  font-size: 0.82rem;
}

/* Responsive */

@media (max-width: 720px) {
  .site-header__tag {
    display: none;
  }

  .page-shell {
    padding: 20px 0 34px;
  }

  .article-hero {
    padding: 23px 20px 21px;
  }

  .article-hero h1 {
    font-size: 1.28rem;
    line-height: 1.34;
  }

  .article-hero__uk-title {
    font-size: 0.98rem;
  }

  .article-content {
    padding: 0 20px 24px;
  }

  .field-pair,
  .article-section,
  .conference-meta {
    padding: 20px 0;
  }

  .conference-meta {
    grid-template-columns: 1fr;
  }

  .conference-meta > .field-pair {
    grid-column: auto;
  }

  .lang-item:not([lang="uk"]),
  .language-block--en {
    padding: 14px;
  }

  .lang-item[lang="uk"],
  .language-block--uk {
    padding: 0;
  }

  .field-value--strong {
    font-size: 1rem;
  }

  .resource-panel {
    grid-template-columns: 1fr;
    padding: 17px;
  }

  .pdf-button {
    width: 100%;
  }

  .home-card {
    padding: 25px 20px;
  }

  .error-page {
    padding: 42px 22px 40px;
  }
}

@media (max-width: 420px) {
  .site-header__inner,
  .page-shell,
  .site-footer__inner {
    width: min(100% - 22px, 980px);
  }

  .article-hero,
  .article-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-hero h1 {
    font-size: 1.2rem;
  }

  .authors li {
    padding-left: 15px;
  }
}
/* DKZ repository v2 optional metadata */
.article-link small { color: #667085; }
.references-section + .references-section { margin-top: 1.25rem; }

/* v7: English-first article presentation ---------------------------------- */

/* Ukrainian title is a translation, so it remains clearly secondary to H1. */
.article-hero__translation {
  margin: 10px 0 0;
  max-width: 940px;
  color: #e0e9f0;
  font-family: inherit;
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  line-height: 1.3;
  font-weight: 450;
  letter-spacing: -0.006em;
  text-wrap: balance;
}

/* Author: EN is the main highlighted card; UK translation is plain white. */
.authors-section {
  gap: 8px;
}

.authors-section__label {
  margin-bottom: 0;
  color: #416985;
}

.authors--paired .author-pair {
  padding: 0;
}

.authors--paired .author-pair::before {
  display: none;
}

.authors--paired .author-pair + .author-pair {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.author-version--en {
  padding: 15px 17px;
  background: var(--en-bg);
  border: 1px solid #dbe8f1;
  border-left: 4px solid var(--en-border);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.author-version--translation {
  margin-top: 8px;
  padding: 9px 0 0;
  background: #fff;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.author-version--en .name,
.author-version--translation .name {
  font-size: 1rem;
  line-height: 1.42;
  font-weight: 620;
}

.author-version--en .name {
  color: #183c56;
}

.author-version--translation .name {
  color: #3f4d58;
  font-weight: 590;
}

.author-version--en .affiliation,
.author-version--translation .affiliation {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.author-version--translation .affiliation {
  color: #626d77;
}

.author-identifiers {
  margin-top: 7px;
}

/* Conference/event block returns after Authors, as in the first template. */
.conference-meta__conference {
  grid-column: 1 / -1;
}

.conference-meta__translation {
  display: block;
  margin-top: 3px;
  color: var(--text-uk);
}

/* Ukrainian keywords are a visible translation only; EN remains the main metadata language. */
.lang-item[lang="uk"] .keywords {
  margin-top: 1px;
}

.lang-item[lang="uk"] .keyword {
  background: #fff;
  border-color: #dde2e7;
  color: #4d5963;
}

@media (max-width: 640px) {
  .article-hero__translation {
    font-size: 1rem;
  }
}

/* v12: event-level HTML/PHP slots ---------------------------------------------- */
/*
 * HTML/PHP is loaded from /events/<event>/before.php and after.php and rendered before/after
 * every article attached to that event. The slot itself adds only spacing;
 * the inserted HTML may define its own visual design.
 */
.event-slot {
  width: 100%;
}

.event-slot--before {
  margin: 0 0 18px;
}

.event-slot--after {
  margin: 18px 0 0;
}

.event-slot img {
  max-width: 100%;
  height: auto;
}

.event-slot > :first-child {
  margin-top: 0;
}

.event-slot > :last-child {
  margin-bottom: 0;
}

/* Optional helper class for a linked image/banner placed in an event slot. */
.event-banner {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
}

.event-banner img {
  display: block;
  width: 100%;
}


/* Language tabs ----------------------------------------------------------- */

.article-hero__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.article-hero__topline .article-hero__eyebrow {
  margin: 0;
}

.language-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
}

.language-tab {
  min-height: 32px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d7e8f4;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.language-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.language-tab.is-active {
  background: #ffffff;
  color: #194a70;
}

.language-tab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.language-panel[hidden] {
  display: none !important;
}

.language-panel--hero h1 {
  margin: 0;
}

.language-panel--content > :first-child {
  margin-top: 0;
}

.language-panel--content .lang-item,
.language-panel--content .language-block--en,
.language-panel--content .language-block--uk {
  color: inherit;
}

/* In tab mode each language is shown independently, so the UK version no
   longer needs to look like a secondary inline translation. */
.language-panel--content[lang="uk"] .lang-item[lang="uk"],
.language-panel--content[lang="uk"] .language-block--uk {
  color: var(--text);
}

.language-panel--content[lang="uk"] .lang-item[lang="uk"] .field-label,
.language-panel--content[lang="uk"] .lang-item[lang="uk"] .field-value,
.language-panel--content[lang="uk"] .lang-item[lang="uk"] .abstract {
  color: var(--text);
}

.language-panel--content[lang="uk"] .lang-item[lang="uk"] .keyword {
  background: #ffffff;
  border-color: #dce6ed;
  color: #000000;
}

@media (max-width: 640px) {
  .article-hero__topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .language-tabs {
    width: 100%;
  }

  .language-tab {
    flex: 1 1 50%;
  }
}

/* Equal visual treatment for the Ukrainian tab. */
.language-panel--content[lang="uk"] .lang-item[lang="uk"] {
  padding: 15px 17px;
  background: var(--en-bg);
  border: 1px solid #dbe8f1;
  border-left: 4px solid var(--en-border);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.language-panel--content[lang="uk"] .lang-item[lang="uk"] > .field-label {
  color: #416985;
}
