@font-face {
  font-family: "CourierCyr";
  src: url("/assets/fonts/couriercyrps.woff2") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "CourierCyr";
  src: url("/assets/fonts/couriercyrps_bold.woff2") format("truetype");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "CourierCyr";
  src: url("/assets/fonts/couriercyrps_inclined.woff2") format("truetype");
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: "CourierCyr";
  src: url("/assets/fonts/couriercyrps_boldinclined.woff2") format("truetype");
  font-weight: bold;
  font-style: italic;
}

* {
  font-family: "NerdFontsSymbols Nerd Font", "CourierCyr", serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 1;
}

body {
  font-size: 1em;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.link {
  font-size: 18px;
}

.link a {
  color: #0d47a1;
  font-size: 1.1em;
}

.link:hover {
  transform: scale(1.1);
  text-shadow: 0 0 5px rgba(13, 71, 161, 0.2);
}

a {
  color: black;
}

a:hover {
  text-decoration: underline;
}

h1 {
  margin: 10px;
}

header {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

header h1 a:hover {
  cursor: pointer;
  text-decoration: none;
}

.header-container {
  display: flex;
  align-items: center;
  gap: 2em;
}

#header-left {
  gap: 0.5em;
}

.updates-page-container h2 {
  margin: 25px 0;
}

.ascii-art {
  white-space: pre;
  font-size: 12px;
  color: #444;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
}

.updates-container * {
  text-align: left;
}

.updates-container li {
  margin: 10px 0;
}

.base-container {
  max-width: 40em;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.base-container .lang-switcher {
  text-decoration: underline;
  cursor: pointer;
}

.home-container {
  flex-direction: column;
  box-sizing: border-box;
  align-items: self-start;
  gap: 2em;
  margin: 3em 0;
}

.home-title {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.home-title a {
  text-decoration: none;
  cursor: default;
}

h1 a {
  color: black;
  text-decoration: none;
  cursor: default;
}

.cv-container {
  display: flex;
  flex-direction: column;
}

.cv-container li {
  text-align: left;
  margin: 5px 0;
}

.cv-container h3 {
  margin: 10px;
}

footer {
  width: 100%;
  height: 1cm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1cm;
}

footer p {
  color: lightgray;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
}

.footer-info-box {
  display: flex;
}

.footer-link {
  font-size: 15px;
  margin: 15px;
}

.footer-link:hover {
  transform: scale(1.1);
}

.footer-link a {
  color: lightgray;
}

.articles-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 2em;
  gap: 2em;
}

mjx-container[display="true"] {
  pointer-events: none;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Computer Modern Roman";
  src: url("/assets/fonts/cmu.serif-roman.woff2") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Computer Modern Roman";
  src: url("/assets/fonts/cmu.serif-bold.woff2") format("truetype");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "Computer Modern Typewriter";
  src: url("/assets/fonts/cmu.typewriter-text-regular.woff2") format("truetype");
  font-weight: noraml;
  font-style: normal;
}

article {
  width: 50%;
  min-width: 700px;
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

article p {
  text-align: left;
  margin: 0.5em 0;
}

article img {
  display: block;
  margin: 15px auto;
  max-width: 100%;
  height: auto;
}

article ol li {
  margin: 0.5em 0;
}

article ul,
ol {
  text-align: left;
  padding-left: 1.5em;
  margin-left: 0;
}

li::marker {
  font-size: 1em;
}

.article-date {
  text-align: center !important;
  margin: 0.5em 0;
}

.article-date em {
  font-size: 15px !important;
}

.essay-topics {
  text-align: center !important;
}

.essay-topics a {
  font-size: 15px !important;
  font-family: "CourierCyr";
}

.article-topics {
  text-align: center !important;
  margin: 0.5em 0 1em 0;
}

.article-topics code * {
  font-family:
    "NerdFontsSymbols Nerd Font", "Computer Modern Typewriter", serif;
}

article * {
  font-family: "NerdFontsSymbols Nerd Font", "Computer Modern Roman", serif;
  font-size: 18px;
}

article::selection {
  background: rgba(0, 0, 0, 0.1);
}

article h1 {
  margin-bottom: 0;
  font-size: 25px;
}

article h2 {
  text-align: left;
  margin: 1.3em 0em 0.7em 0;
  font-size: 20px;
}

article h3 {
  margin: 0.5cm;
}

article h4 {
  margin: 0.5cm;
}

.articles-container li {
  text-align: left;
  margin: 0.3cm;
}

.poetry-container li {
  text-align: left;
  margin: 0.3cm;
}

.poetry-container h2 {
  margin: 20px 0;
}

pre code {
  display: block;
  /* background-color: #f9f9f9; */
  background-color: rgba(0, 0, 0, 0.02);
  color: #333;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 0.3em;
  overflow-x: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  tab-size: 2;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  white-space: pre-wrap;
  background-clip: padding-box;
}

pre code .tab {
  display: inline-block;
  width: 2em;
  content: "";
}

pre code .tab::selection {
  color: rgba(0, 0, 0, 0);
}

pre code * {
  font-family: "NerdFontsSymbols Nerd Font", "Computer Modern Typewriter";
  font-size: 0.95em;
  line-height: 1.2;
  text-align: left;
}

.tilde {
  font-family: "JetBrains Mono";
}

pre code * .err {
  background-color: transparent !important;
}

pre {
  margin: 0;
}

p code,
li code,
blockquote code {
  background-color: rgba(0, 0, 0, 0.04);
  padding: 0.1em 0.3em;
  margin: 0 0.1em;
  border-radius: 3px;
  font-family:
    "NerdFontsSymbols Nerd Font", "Computer Modern Typewriter", serif;
  font-size: 0.95em;
  color: #333;
}

p code * {
  font-family:
    "NerdFontsSymbols Nerd Font", "Computer Modern Typewriter", serif;
}

.arhive-containter {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.arhive-containter ul {
  width: 100%;
}

.arhive-containter h4 {
  margin-top: 10px;
  width: 100%;
  text-align: left;
}

.tags-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
}

.thanks-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1cm 0 2cm 0;
}

.thanks-container * {
  color: rgba(0, 0, 0, 0.2);
}

.thanks-container p {
  margin: 0 !important;
}

.tag {
  display: inline-block;
  margin: 5px 10px 5px 0;
}

.tags-list h3 {
  margin: 15px 0;
}

.poetry-container {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  flex-grow: 1;
  margin-bottom: 2em;
}

.poetry {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.poetry h1 {
  margin-bottom: 0;
}

.poetry img {
  max-width: 100%;
}

.poetry * {
  font-family: "NerdFontsSymbols Nerd Font", "Computer Modern Roman", serif;
  font-size: 19px;
}

.poetry-text {
  text-align: cetner;
}

.updates-page-container {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.updates-page-container * {
  text-align: left;
}

.updates-page-container p {
  margin: 10px 0;
}

.essay-container p {
  margin: 0.5em 0;
}

blockquote {
  font-style: italic;
  font-size: 1.1rem;
  text-align: left;
  color: #333;
  border-left: 4px solid #aaa;
  padding: 0.5em 1em;
  margin: 0.5em 0;
  quotes: "“" "”" "‘" "’";
}

/* ===== АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ===== */
@media (max-width: 868px) {
  /* Общие корректировки */
  body {
    padding: 0;
  }

  .link {
    font-size: 16px;
    margin: 15px;
  }

  /* Шапка */
  header {
    flex-direction: column;
  }

  .header-container {
    flex-direction: column;
    align-items: center;
  }

  /* Основной контент */
  .base-container {
    width: 100%;
    padding: 0 1rem;
  }

  .home-container {
    width: 100%;
    gap: 1cm;
    margin: 1rem 0 2rem 0;
  }

  /* Статьи и контент */
  article {
    width: 100%;
    min-width: unset;
    padding: 0 10px;
  }

  article * {
    font-size: 16px;
  }

  article h1 {
    font-size: 22px;
  }

  article h2 {
    font-size: 18px;
  }

  article ul,
  article ol {
    padding-left: 1em;
  }

  /* Поэзия */
  .poetry * {
    font-size: 17px;
  }

  /* Футер */
  footer {
    flex-direction: column;
    height: auto;
    padding: 20px;
  }

  .footer-info-box {
    margin-top: 15px;
    order: 2;
  }

  /* ASCII-арт */
  .ascii-art {
    font-size: 10px;
    overflow-x: auto;
  }

  /* Блоки кода */
  pre code {
    padding: 0.8rem;
    font-size: 0.85em;
  }

  /* Навигационные ссылки */
  .footer-link {
    margin: 10px;
  }
}

@media (max-width: 480px) {
  /* Дополнительные корректировки для маленьких экранов */
  .link {
    margin: 10px;
  }

  article h1 {
    font-size: 20px;
  }

  blockquote {
    padding: 0.3em 0.8em;
    font-size: 1rem;
  }
}

/* Обёртка header */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 2rem;
}

/* Бургер‑иконка */
.burger {
  display: none; /* скрываем на больших экранах */
  flex-direction: column;
  justify-content: space-between;
  width: 35px;
  height: 35px;
  border-radius: 100%;
  padding: 6px;
  background-color: white;
  box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  z-index: 800;
  position: fixed;
  left: 100%;
  top: 0%;
  transform: translateY(20px) translateX(calc(-100% - 20px));
}

/* Сайд‑меню (спрятано вправо) */
.side-menu {
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  max-width: 80%;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 700;
  flex-direction: column;
  justify-content: center;
}
.side-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-menu li + li {
  margin-top: 1em;
}
.side-menu a {
  text-decoration: none;
  color: #0d47a1;
  font-size: 18px;
}

/* Оверлей */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 600;
}

/* Класс открытия */
header.is-open .side-menu {
  transform: translateX(0);
}
header.is-open .overlay {
  opacity: 1;
  visibility: visible;
}

/* Показываем бургер на мобильных */
@media (max-width: 868px) {
  .burger {
    display: flex;
  }
  .header-container {
    display: none;
  }
}

footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1cm 2cm;
  background: #fafafa; /* или ваш фон */
}

footer p {
  color: #969696;
  margin: 0;
}

.footer-info-box {
  display: flex;
  gap: 20px;
}

.footer-link a {
  font-size: 15px;
  color: #969696;
  text-decoration: none;
  transition: transform 0.2s;
}

.footer-link:hover {
  transform: scale(1.1);
}

/* ========== АДАПТИВ ========== */
@media (max-width: 868px) {
  footer {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
  }

  footer p {
    margin-bottom: 15px;
  }

  .footer-info-box {
    flex-direction: column;
    gap: 10px;
  }

  .footer-link a {
    font-size: 16px;
  }
  .base-container.home-container {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .ascii-art {
    font-size: 0.65rem;
  }

  .updates-container h3 {
    font-size: 1.25rem;
  }
}

.moss-trigger-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 60px;
  margin: 20% 0 20% 0;
  z-index: 10;
}

.moss-trigger-zone.left {
  left: 0;
}

.moss-trigger-zone.right {
  right: 0;
}

/* Моховый слой */
.moss-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

/* Слой с мхом */
.moss-layer {
  position: absolute;
  height: auto;
  max-width: 30vw;
}

.moss-left {
  transform: translateX(-100%);
  left: -10%;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.moss-right {
  transform: translateX(100%);
  right: -10%;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Когда активен - мох выдвигается */
.moss-overlay.active {
  opacity: 1;
}

.moss-overlay.active .moss-left {
  transform: translateX(0);
}

.moss-overlay.active .moss-right {
  transform: translateX(0);
}

@media (max-width: 868px) {
  .moss-layer {
    max-width: 100vw; /* или любое большее значение, чтобы мох стал плотнее */
  }

  .moss-right {
    right: -60%;
  }

  .moss-left {
    left: -60%;
  }
}

#moss-left-1 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s !important;
  top: 2%;
}

@media (max-width: 868px) {
  #moss-left-1 {
    left: -48%;
    top: -13%;
  }
}
#moss-left-2 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s !important;
  top: 21%;
}

@media (max-width: 868px) {
  #moss-left-2 {
    left: -70%;
    top: 11%;
  }
}
#moss-left-3 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s !important;
  top: 40%;
}

@media (max-width: 868px) {
  #moss-left-3 {
    left: -70%;
    top: 31%;
  }
}

#moss-left-4 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s !important;
  top: 65%;
}

@media (max-width: 868px) {
  #moss-left-4 {
    top: 60%;
    left: -70%;
  }
}

#moss-left-5 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s !important;
  top: 71%;
}

@media (max-width: 868px) {
  #moss-left-5 {
    top: 63%;
    left: -65%;
  }
}

#moss-right-1 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s !important;
  top: -5%;
  right: -15%;
}

@media (max-width: 868px) {
  #moss-right-1 {
    top: -12%;
    right: -76%;
  }
}

#moss-right-2 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s !important;
  top: 10%;
}

@media (max-width: 868px) {
  #moss-right-2 {
    top: 2%;
    right: -72%;
  }
}

#moss-right-3 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s !important;
  top: 39%;
}

@media (max-width: 868px) {
  #moss-right-3 {
    top: 32%;
    right: -65%;
  }
}

#moss-right-4 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s !important;
  top: 50%;
}

@media (max-width: 868px) {
  #moss-right-4 {
    right: -45%;
  }
}

#moss-right-5 {
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s !important;
  top: 72%;
}

@media (max-width: 868px) {
  #moss-right-5 {
  }
}

@font-face {
  font-family: "NerdFontsSymbols Nerd Font";
  src: url("https://www.nerdfonts.com/assets/fonts/Symbols-2048-em Nerd Font Complete.woff2")
    format("woff2");
}

mjx-container,
mjx-container svg {
  font-family: "Times New Roman", serif !important;
}
mjx-container[display="true"] {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px; /* место под скролл */
  pointer-events: auto; /* разрешаем взаимодействие */
}

@media (max-width: 868px) {
  mjx-container svg {
    max-width: 100%;
  }
}

.medium-zoom-overlay {
  z-index: 1000; /* Поверх навигации */
}

.medium-zoom-image {
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1) !important;
}

.medium-zoom-image--opened {
  z-index: 1001;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1) !important;
}

.lang-switcher {
  font-size: inherit;
  cursor: pointer;
}

.books-container {
  flex-direction: column;
  text-align: left;
  margin: 5rem 0;
  max-width: 50%;
}

.book-container {
  flex-direction: column;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
  margin: 2rem 0 5rem 0;
}

.book-cover {
  background-color: #f0f0f0;
  background-image: url("/assets/cover-placeholder.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшетах */
  }
}

@media (max-width: 600px) {
  .book-grid {
    grid-template-columns: 1fr; /* 1 колонка на мобильных */
  }
}

.book-card {
  min-width: 140px;
  max-width: 180px;
  width: 100%;
  max-width: 180px; /* Максимальная ширина карточки */
  box-sizing: border-box;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  transition: transform 0.3s ease; /* Анимация при наведении */

  overflow: hidden;
  word-wrap: break-word;
}

.book-card:hover {
  transform: translateY(-5px); /* Эффект подъема */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.book-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2/3; /* Сохраняем пропорции обложки */
  object-fit: cover;
  margin-bottom: 0.8rem;
  border-radius: 4px;
}

.book-title {
  font-weight: 600;
  text-align: center;
  margin: 0.2rem 0;
}

.book-author {
  color: #666;
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 0.3rem;
}

.book-status {
  font-size: 1.2rem;
}

.book-cover::before {
  content: "Загрузка...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  color: #666;
}
.book-cover[src]::before {
  display: none;
}

.header-logo {
  width: 3rem;
}

.subscribe-banner {
  background-color: #f9f9f9;
  border-radius: 0.5em;
  padding: 0.5em 0.8em;
}

.home-menu-container {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1.5em;
}

.home-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 1.5em;
  max-width: 50%;
}

@media (max-width: 868px) {
  .home-menu {
    max-width: 90%;
  }
}

.follow-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: flex-start;
  flex: none;
  gap: 0.5em;
}

.follow-options-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 0.5em 0.8em;
  flex-wrap: wrap;
  justify-content: flex-start;
}

ul {
  padding-left: 1.2em; /* Отступ для маркеров */
  list-style-position: outside; /* Важно: маркеры вне блока содержимого */
}

li {
  margin-bottom: 0.7em;
  padding-left: 0.4em; /* Дополнительный отступ для текста */
  text-align: left;
}

/* Для мобильной адаптации */
@media (max-width: 868px) {
  .updates-list {
    padding-left: 1.5rem;
  }

  .update-item {
    padding-left: 0.8rem;
  }
}

.about-blog-container {
  display: flex;
  flex: none;
  gap: 0.5em;
  flex-direction: column;
  align-items: flex-start;
}

.about-blog-container p {
  text-align: left;
  font-family: "NerdFontsSymbols Nerd Font", "Computer Modern Roman", serif;
  font-size: 1.1em;
}

.mustreads-container ul li::marker {
  content: "";
  font-size: 0.6em;
}

.mustreads-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
}

.updates-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
}

.go-back-button {
  text-align: center;
}
.go-back-button a {
  text-decoration: none;
}

.go-back-button a:hover {
  text-decoration: underline;
}

.go-back-button * {
  font-family:
    "NerdFontsSymbols Nerd Font", "Computer Modern Typewriter", serif;
}

.search-page-container {
  padding: 1rem;
}

.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 500;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5%;
  overflow-y: scroll;
  overflow: auto;
}

/* Исправления для контейнера модалки */
.search-modal-content {
  position: relative;
  background: white;
  width: 90%;
  max-width: 700px;
  max-height: 80vh; /* Максимальная высота окна */
  border-radius: 8px;
  padding: 1em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;

  /* Ключевые исправления: */
  box-sizing: border-box; /* Учитываем padding в общей высоте */
  overflow-y: scroll; /* Скрываем переполнение */
}

.search-close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #555;
  line-height: 1;
}

/* Исправления для контейнера поиска */
#search-hidden {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: srcoll; /* Важно для работы flex-сжатия */
}

.pagefind-ui {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Разрешаем сжатие */
  overflow-y: scroll; /* Скрываем переполнение */
}

.pagefind-ui__results-area {
  flex: 1;
  overflow-y: scroll; /* Скролл для области результатов */
  min-height: 0; /* Ключевое свойство для flex-потомков */
}

/* Остальные стили без изменений */
.pagefind-ui__results {
  max-height: none !important;
}

.pagefind-ui__form {
  flex-shrink: 0;
  overflow: scroll !important;
  scrollbar-width: none; 
  -ms-overflow-style: none;
  position: relateive;
}

.pagefind-ui__form::-webkit-scrollbar {
  display: none;
}

.search-modal-content {
  animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.modal-open {
  overflow: hidden;
}

.pagefind-ui__search-input {
  position: sticky !important;
  z-index: 510;
}
