/* Basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

html,
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
}

body {
  max-width: none !important;
  padding: 0 !important;
}

main#manas-content {
  flex: 1 0 auto; /* Розтягує основний контент, футер завжди знизу */
}

/*  Front page text layout */
.manas-frontpage-wrapper {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

.manas-frontpage-container {
  max-width: 820px;
  width: 100%;
  background: #ffffff;
  padding: 2.5rem 3rem;
  box-shadow: 0 10px 30px rgba(58, 95, 204, 0.12);
  border-radius: 12px;
}

.manas-frontpage-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.manas-frontpage-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.manas-frontpage-subtitle {
  font-size: 24px;
  color: #555;
  margin: 0;
}

.manas-frontpage-content {
  font-size: 18px;
  line-height: 1.6;
  color: #222;
  text-align: justify;
}

.manas-frontpage-text {
  margin-bottom: 1.3rem;
  text-indent: 0px;
}

.manas-frontpage-list {
  margin: 1rem 0 1.8rem 1.4rem;
  padding: 0;
}

.manas-frontpage-list li {
  margin-bottom: 0.6rem;
}

.manas-frontpage-highlight {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  background: #f2f6ff;
  border-left: 4px solid red;
  font-style: italic;
  text-indent: 0px;
}

/* Layout */
.manas-main {
  position: relative;
  padding-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Зовнішнє кільце */
.manas-ring {
  height: 100%;
  padding: 18px;
  aspect-ratio: 1 / 1;
  max-height: 70vh;
  max-width: 90vw;
  border-radius: 50%;
  border: 18px solid #c60000;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0; /* впритул */
}

/* Внутрішні кола */
.manas-inner {
  width: 33%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}

/* Ліве коло */
.inner-left {
  width: 220px;
  background-image: url("../images/M.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 130%;
}

/* Праве коло */
.inner-right {
  width: 220px;
  background-image: url("../images/E.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.manas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.manas-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.manas-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.manas-title {
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
}

.manas-brand .manas-title a,
.manas-brand .manas-title a:visited,
.manas-brand .manas-title a:hover,
.manas-brand .manas-title a:focus {
  text-decoration: none !important;
}

.manas-logo img {
  max-height: 50px;
  width: auto;
  display: block;
}

/* Hamburger and dropdown */
.manas-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.manas-menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: #111;
  border-radius: 2px;
}
.manas-page-list-wrap {
  position: relative;
}
.manas-page-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  border-radius: 8px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  display: none;
  z-index: 1000;
}
.manas-page-list a {
  display: block;
  padding: 7px 14px;
  text-decoration: none;
  color: #111;
  font-size: 15px;
}
.manas-page-list a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.manas-page-list[aria-hidden="false"] {
  display: block;
}

/* Footer */
.manas-footer {
  text-align: center;
  font-size: 14px;
  color: #444;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 18px 22px;
  margin-top: auto;
}

/* Manuscript */

.author {
  text-align: center;
  text-indent: 0px;
}

.manuscript-wrapper {
  max-width: 1005px;
  width: 80%;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.6;
  text-align: justify;
  /* hyphens: auto; */
  text-justify: inter-word;
}

.center img {
  display: block;
  margin: 0 auto;
  padding-top: 10px;
  max-width: 100%;
  height: auto;
}

.center-history img {
  display: block;
  margin: 0 auto;
  padding-top: 10px;
  max-width: 100%;
  height: auto;
}

.center-history-high img {
  display: block;
  margin: 0 auto;
  padding-top: 10px;
  max-width: 100%;
  height: auto;
}

figcaption {
  padding-bottom: 20px;
  padding-left: 30px;
  padding-right: 30px;
  font-size: 16px;
}

p {
  margin: 0;
  text-indent: 30px;
}

.abstract {
  margin: 30px 30px 30px 30px;
  text-align: justify;
  font-size: 85%;
}

.manuscript-subtitle {
  padding-bottom: 20px;
  padding-left: 30px;
  text-align: left;
}

.abstract > p {
  text-indent: 0;
  font-size: 16px;
}

a {
  color: blue;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
}

a:visited {
  color: blue;
}

img {
  max-width: 100%;
}

svg {
  height: auto;
  max-width: 100%;
}

h1 {
  line-height: 130%;
  padding-top: 10px;
}

h2 {
  margin-top: 1.4em;
  line-height: 130%;
}

ol,
ul {
  padding-left: 45px;
  margin-top: 1em;
  line-height: 1.5;
  text-align: left;
}

li > ol,
li > ul {
  margin-top: 0;
}

hr {
  border: none;
  border-top: 1px solid #1a1a1a;
  height: 1px;
  margin: 1em 0;
}

header {
  text-align: center;
}

/* CSS for citations */
.citation {
  display: inline-block;
  font-style: italic;
  text-indent: 5px;
}

/* Scroll button */
#scrollToTop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: #0047ab;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 71, 171, 0.35);
  z-index: 9999;
}

#scrollToTop:hover {
  transform: translateY(-4px);
}

#scrollToTop.visible {
  opacity: 0.9;
  pointer-events: auto;
}

/* Download PDF button */
.pdf-download-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0 0 0;
}

.pdf-download-btn {
  background-color: #0047ab; /* кобальтовий */
  color: #ffffff;
  text-decoration: none;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 22px rgba(0, 71, 171, 0.35);
}

.pdf-download-btn:hover {
  background-color: #0a5ed7;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 71, 171, 0.45);
}

.pdf-download-btn,
.pdf-download-btn:visited {
  color: #ffffff;
}

.pdf-download-btn:hover,
.pdf-download-btn:active {
  color: #ffffff;
}

/* Tables*/
hr {
  border: none;
  border-top: 1px solid #1a1a1a;
  height: 1px;
  margin: 1em 0;
}

table {
  margin: 1em 0;
  border-collapse: collapse;
  width: 100%;
  overflow-x: auto;
  display: block;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 12px;
}

table caption {
  margin-bottom: 0.75em;
}

tbody {
  margin-top: 0.5em;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
}

th {
  border-top: 1px solid #1a1a1a;
  padding: 0.25em 0.5em 0.25em 0.5em;
}

td {
  padding: 0.125em 0.5em 0.25em 0.5em;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin: 1em 0;
}

.table-scroll table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.table-scroll th,
.table-scroll td {
  border: 1px solid #444;
  padding: 6px 10px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.table-scroll th {
  background: #f2f2f2;
  font-weight: bold;
  width: 200px;
}

.table-scroll td p {
  margin: 0;
}

mjx-container {
  max-width: 100%;
  /* overflow-x: auto; */
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .pdf-download-btn {
    width: 100%;
    text-align: center;
    max-width: 320px;
  }
  .abstract {
    margin: 30px 0px 30px 0px;
  }
  .manas-frontpage-container {
    padding: 1.6rem 1.4rem;
    border-radius: 8px;
  }
}

@media (max-width: 640px) {
  .manas-header {
    padding: 12px;
  }
  .manas-logo {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 768px) {
  .center img {
    max-width: 450px;
    margin: 0 auto;
  }
  .center-history img {
    max-width: 768px;
    margin: 0 auto;
  }
  .center-history-high {
    max-width: 450px;
    margin: 0 auto;
  }
}

@media print {
  html {
    background-color: white;
  }

  body {
    background-color: transparent;
    color: black;
    font-size: 12pt;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }
}
