:root{
  --accent: #bd93f9;
  --text: #ffffff;
}

#out {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  /* Перенос обычного текста */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  /* Наследование шрифта */
  font: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

#out *,
#out *::before,
#out *::after {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  box-sizing: border-box;
}

/* Чтобы длинные ссылки тоже переносились */
#out a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Чтобы длинные строки в коде не растягивали страницу */
#out pre {
  max-width: 96%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#out code {
  font-family: inherit;
  border: 1px solid #ddd;
  border-left: 3px solid #E7F558;
  page-break-inside: avoid;
  font-family: monospace;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 1.6em;
  max-width: 100%;
  overflow: auto;
  padding: 1em 1.5em;
  display: block;
  word-wrap: break-word;
}

#out {
  width: 96%;
  max-width: 96%;
  min-width: 0;

  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  font: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;

  /* Отступы всего содержимого от краёв */
  padding: 0 1.0rem;
}

/* Красная строка у обычных абзацев */
#out p {
  text-indent: 0em;

  /* Расстояние между абзацами */
  margin: 0 0 0.5em;
}

#out blockquote {
	margin: 1.2em 0;
	padding: 0.8em 1.2em;

	border: 1px solid #afb3df;
	border-left: 4px solid #bd93f9;
	border-radius: 6px;

	background-color: rgba(0, 0, 0, .2);
	color: #d8d4e8;
	font-style: italic;
	line-height: 1.6;
}

/* h2 */
#out h2{
  color: var(--text);
  margin: 0 0 0.7em !important;
}

/* убрать “большую” верхнюю/нижнюю пустоту и чтобы заголовок не уезжал */
#out .h2-wrap{
  margin: 0.2em 0 !important;
}


/* кнопка h2 (заголовок сворачиваемого блока) */
#out .h2-toggle{
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 0;     /* уменьшает ощущение “огромных” отступов */
  margin: 0;              /* важно, т.к. h2 margin мог давать лишнюю высоту */
}
#out .h2-toggle:hover{
  color: var(--accent);
}

/* тело сворачиваемого блока: контролируем отступы внутри */
#out .h2-body{
  overflow: hidden;
  transition: max-height 0.9s ease;
  will-change: max-height;

  /* чтобы при разворачивании не появлялась “пустота” сверху/снизу */
  padding-top: 0;
  padding-bottom: 0;
}


/* чтобы между заголовками было меньше “воздуха” */
#out .h2-wrap + .h2-wrap{
  margin-top: 0;
}

#out {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  /* Перенос обычного текста */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  /* Наследование шрифта */
  font: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

#out *,
#out *::before,
#out *::after {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  box-sizing: border-box;
}

/* Чтобы длинные ссылки тоже переносились */
#out a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Чтобы длинные строки в коде не растягивали страницу */
#out pre {
  max-width: 96%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#out code {
  font-family: inherit;
}

#out {
  width: 96%;
  max-width: 96%;
  min-width: 0;

  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  font: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;

/* Отступы всего содержимого от краёв */
  padding: 0 1.0rem;
}

/* Красная строка у обычных абзацев */
#out p {
  text-indent: 0em;

  /* Расстояние между абзацами */
  margin: 0 0 0.5em;
}

/* Контейнер лайтбокса */
#image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    overflow: hidden; /* Чтобы скроллбары не дергались при зуме */
}

#image-lightbox:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

#image-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.1s ease-out; /* Быстрый отклик на колесико */
    transform-origin: center center; /* Увеличение из центра */
    cursor: zoom-in;
}

#image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

#out .empty-line {
  display: block;
  height: 1em;
}

#out br.empty-line {
  display: block;
  content: "";
  height: 1em;
}

#out h1 {
  font-size: 125%;
}

#out h2 {
  font-size: 120%;
}

#out h3 {
  font-size: 115%;
}

