/* Colors */
:root {
  --lightgray: #e0e0e0;
  --gray: #C0C0C0;
  --darkgray: #333;
  --navy: #17050F;
  --blue: #082840;
  --white: #fff;
}

/* Global stylesheet */
* {
  box-sizing: border-box;
}
html,
body {
  padding: 0;
  margin: 0;
  background-image: none;
  background-size: cover;
  max-width: 1150px;
  margin: auto;
  font-family: 'Inter', sans-serif;
  color: var(--darkgray);
  background-color: rgb(233, 230, 218);
  background-image: none;
  background-size: cover;
  height: 100%; /* Задаем высоту 100% для html и body */


}
html {
background-color:#2a2a2a;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);

}

body {
  position: flex; /* Чтобы псевдоэлементы позиционировались относительно body */
  flex-direction: column;
}
body ul {
  background-color: rgb(231, 228, 217);
}
@media (max-width: 780px) {
html {
  background-color: rgb(51, 67, 12);
 }
}
hr { /* линия */
  margin: 0; /* Убираем отступы сверху и снизу */
  color: rgb(105, 20, 20);
}

.hhr { /* класс заголовка под линию */
  padding-top: 10px;
  margin: 0; /* Убираем все отступы */
  margin-bottom: 8px; /* Добавляем отступ снизу */
  color: rgb(105, 20, 20);
  text-transform: uppercase;
}

hr {
  border: none; /* Удаляем стандартную границу */
  border-top: 1.1px solid rgb(105, 20, 20); /* Рисуем новую линию */
}

details {
  margin-bottom: 20px; /* Отступ между элементами details */
}
p:last-child {
  margin-bottom: 0;
}
p,
.tmpl-post li,
img, picture, .page-image {
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}
p,
.tmpl-post li {
  line-height: 1.45;
}
a[href] {
  max-width: 100%; /* Ограничиваем ширину изображения до 100% родительского элемента */
  color: #153f5f;
  text-decoration: none;
}
a[href]:visited {
  color: #132e42;
}
a[href]:hover {
  color: #245b85;
}
#toc a {
  font-weight: bold; /* Делаем текст жирным */
}

main {
  padding: 1rem;

}
main :first-child {
  margin-top: 0;
}
header {
  height: 230px; /* Задайте высоту для header */
  position: relative; /* Относительное позиционирование для элемента header */
  overflow: hidden;
  z-index: 1; /* Устанавливаем z-index выше других элементов */
  background-color:rgb(231, 228, 217);


}
header:after {
  content: "";
  display: table;
  clear: both;
}
table {
  margin: 1em 0;
}
table td,
table th {
  padding-right: 1em;
}

pre,
code {
  font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
  line-height: 1.5;
}
pre {
  font-size: 14px;
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  padding: 1em;
  margin: .5em 0;
  background-color: #f6f6f6;
}
code {
  word-break: break-all;
}
.highlight-line {
  display: block;
  padding: 0.125em 1em;
  text-decoration: none; /* override del, ins, mark defaults */
  color: inherit; /* override del, ins, mark defaults */
}

/* allow highlighting empty lines */
.highlight-line:empty:before {
  content: " ";
}
/* avoid double line breaks when using display: block; */
.highlight-line + br {
  display: none;
}

.highlight-line-isdir {
  color: #b0b0b0;
  background-color: #222;
}
.highlight-line-active {
  background-color: #444;
  background-color: hsla(0, 0%, 27%, .8);
}
.highlight-line-add {
  background-color: #45844b;
}
.highlight-line-remove {
  background-color: #902f2f;
}

/* Header */
header {
  position: relative;
  width: 100%;
  height: 330px;
  overflow: hidden;
  object-fit: contain
}

.home-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Точка входа (ссылка, логотип и т.п.) */
.home {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0;
  margin: 0;
}

/* Удаляем max-width: 600px */
.home-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

@media (max-width: 768px) {
 .home-image {
  max-width: 100%; /* Ограничиваем ширину изображения до 100% родительского элемента */
  height: auto; /* Сохраняем пропорции изображения */
  display:flex; /* Убираем пробелы под изображением */
  position: absolute;
  z-index: 1000;
  top: 0;
  left: 0; /* Прикрепляем к левому краю */
  right: 0; /* Прикрепляем к правому краю */
  justify-content: center; /* Центрируем по горизонтали */
  z-index: 666; /* Устанавливаем z-index выше других элементов */
  }
 }

.home :link:not(:hover) {
  text-decoration: none;
}
/*spoiler content*/
a[href].spoiler-content,
a[href].spoiler:visited {
  color: inherit;
}
a[href].spoiler-content:hover,
a[href].spoiler:focus {
  background-color: var(--lightgray);
}
/* Nav */
.nav {
  display: flex;
  margin-top:10px;
  height: 48px;
  list-style: none;
  bottom: 0; /* Прикрепляем к нижней части родителя */
  left: 0; /* Прикрепляем к левому краю */
  right: 0; /* Прикрепляем к правому краю */
  flex-wrap: nowrap;
  justify-content: left; /* Центрируем по горизонтали */
  z-index: 889; /* Устанавливаем z-index выше других элементов */
  padding-top: 10px;
  padding-right:10px;
  background-color:rgb(231, 228, 217);
  max-width: 100%;
  max-height: 100%;

}

.nav li.nav-item {
  margin: 0 1rem;
  z-index: 890;
  background-color: rgb(123, 95, 20);
}

.nav li.nav-item,   .active {
  float: left;
  margin: 0 0 4px;
  height: 44px;
  color: rgb(51, 45, 21);
  text-shadow: 0 1px rgba(0, 0, 0, 0.9);
  background-color: rgba(44, 36, 36, 0.05);
  border: 1px solid #232428;
  border-bottom-color: #1f2326;
  background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  -webkit-box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px #262a2e, 0 3px #1f2326, 0 4px 3px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px #262a2e, 0 3px #1f2326, 0 4px 3px rgba(0, 0, 0, 0.2);
  z-index: 900;
  background-color:  rgb(123, 95, 20)
}
.nav  li.nav-item:hover {
  color: #2f7eb9;
  text-shadow: 0 1px black, 0 0 20px rgba(255, 255, 255, 0.5);
  background-color:  rgb(123, 95, 20)
}
.nav  li.nav-item-active,
.nav  .nav-item:active,
.nav  li.nav-item:active {
  position: relative;
  z-index: 912;
  margin: 3px 0 0;
  height: 44px;
  color: rgb(51, 45, 21);
  text-shadow: 0 1px black;
  background-color: rgb(123, 95, 20)

}

.nav  li.nav-item  a {
  display: block;
  line-height: 44px;
  padding: 0 21px;
  font-size: 26.5px;
  font-weight: bold;
  color: inherit;
  text-decoration: none;
  outline: 0;
  z-index: 898;
}

@media (max-width: 768px) {
  .nav  li.nav-item  a {
    flex: 1 1 auto; /* Элементы могут расти и сжиматься */
    display: flex;
    line-height: 30px;
    margin: 1px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: bold;
    color: inherit;
    text-decoration: none;
    outline: 0;
    z-index: 1100;


  }
  .nav {
    display: flex;
    position: absolute;
    justify-content: center; /* Распределяет элементы равномерно */
    z-index: 1010;
    top: 130px;
    max-width: 100px;
    box-sizing: border-box; /* чтобы padding не вылезал за границы */
    padding: 10px 10px; /* уменьшенные отступы */
    margin: 0 auto;
    width: 100%;
  }
  .nav li.nav-item,   .active {
    width: 100px; /* Задайте фиксированную ширину для всех элементов */
    height: 30px;
    display: flex;
    align-items: center; /* Вертикальное центрирование текста */
    justify-content: center; /* Горизонтальное центрирование текста */
  }
  image {
    display: block; /* Убирает пробелы под изображением */
    max-width: 100%; /* Ограничивает ширину изображения до 100% родительского элемента */
    height: auto; /* Сохраняет пропорции изображения */
  }
  header {
  max-height: 180px;
  }
}


/* Posts list */
.postlist {
  list-style: none;
  padding: 0;
}
.postlist-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  counter-increment: start-from -1;
  line-height: 1.8;
}
.postlist-item:before {
  display: none;
  pointer-events: none;
  content: "" counter(start-from, decimal-leading-zero) ". ";
  line-height: 100%;
  text-align: right;
}
.postlist-date,
.postlist-item:before {
  font-size: 0.8125em; /* 13px /16 */
}
.postlist-date {
  word-spacing: -0.5px;
}
.postlist-link {
  padding-left: .25em;
  padding-right: .25em;
  text-decoration: none;
  text-underline-position: from-font;
  text-underline-offset: 0;
  text-decoration-thickness: 1px;
}

.postlist-item-active .postlist-link {
  font-weight: bold;
}
.tmpl-home {
margin-top: 0;
padding: 20px;
background-color: rgb(231, 228, 217);
}
.tmpl-home .postlist-link {
  font-size: 1.3em; /* 19px /16 */
  font-weight: 700;
  color: black;
}
.tmpl-home .postlist-link:hover {
  color: #2f7eb9;
}
.tmpl-home .postlist-link:hover:visited {
  color: #2f7eb9;
}


/* Tags */
.post-tag {
  display: none;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 0.75em; /* 12px /16 */
  padding: 0.08333333333333em 0.3333333333333em; /* 1px 4px /12 */
  margin-left: 0.6666666666667em; /* 8px /12 */
  margin-top: 0.5em; /* 6px /12 */
  margin-bottom: 0.5em; /* 6px /12 */
  color: var(--darkgray);
  border: 1px solid var(--gray);
  border-radius: 0.25em; /* 3px /12 */
  text-decoration: none;
  line-height: 1.8;
}
a[href].post-tag,
a[href].post-tag:visited {
  color: inherit;
}
a[href].post-tag:hover,
a[href].post-tag:focus {
  background-color: var(--lightgray);
}
.postlist-item > .post-tag {
  align-self: center;
}
a[href].postlist-link:visited {
color: rgb(0,0,0);
}
/* Warning */
.warning {
  background-color: #ffc;
  padding: 1em 0.625em; /* 16px 10px /16 */
}
.warning ol:only-child {
  margin: 0;
}

/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: .1em;
}
a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
}
a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover > a[href].direct-link,
:hover > a[href].direct-link:visited {
  color: transparent;
}
.nav li.nav-item {
  position: relative;
  z-index: 890;
  }

  /* Таблицы */

/* Основные настройки таблицы */
.tg {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  width: 100% !important;
  margin: 20px 0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 0.4px rgba(44, 62, 80, 0.1) !important; /* Легкая тень */
}

/* Заголовки */
.tg th {
  background: #c2bba3 !important; /* Цвет заголовка */
  font-weight: 550 !important;
  padding: 15px !important;
  border: none !important;
  vertical-align: middle !important; /* Центрирование по вертикали */
  text-align: center !important;
  border: 0.5px solid rgba(0, 0, 0, 0.1) !important; /* Едва заметные границы */

}
  /* Ячейки */
.tg td {
  background: #fcf9ef !important; /* Цвет ячейки */
  padding: 12px !important;
  border-bottom: 0.3px solid transparent !important; /* Светло-голубой */
  transition: all 0.3s ease !important;
  border: 0.5px solid rgba(0, 0, 0, 0.1) !important; /* Едва заметные границы */

}

/* Убираем границы у первого столбца */
.tg td:first-child {
  border-left: none !important;
}

/* Чередование строк */
.tg tr:nth-child(even) td {
  background: #f5f2e6 !important; /* Чередующийся цвет */
}

/* Ховер-эффект */
.tg tr:hover td {
  background: #e9e6db !important; /* Цвет выделения */
}

/* Закругления */
.tg thead tr:first-child th:first-child {
  border-radius: 0.5px 0 0 0 !important;
}

.tg thead tr:first-child th:last-child {
  border-radius: 0 0.5px 0 0 !important;
}

.tg tbody tr:last-child td:first-child {
  border-radius: 0 0 0 0.5px !important;
}

.tg tbody tr:last-child td:last-child {
  border-radius: 0 0 0.5px 0 !important;
}

/* Специальные символы (тире) */
.tg td:contains("—") {
  color: #bdc3c7 !important; /* Серый */
}
/* Рамка */
.wrapper {
  min-width: 100%;
  min-height: 100%;
  background-color: #e9e6da; /* пергаментный фон */
  border: 8px solid #bfa85e; /* двойная рамка золотистого цвета */
  border-bottom: none;
  box-shadow:
    0 0 0 4px #2a2a2a, /* внешний тёмно-зелёный слой */
    0 0 12px rgba(0, 0, 0, 0.4); /* лёгкая тень */
  border-radius: 12px;
}
