@import url("https://cdn.jsdelivr.net/gh/jgthms/minireset.css@master/minireset.min.css");

@font-face {
  font-family: "JetBrains Mono";
  src: url("JetBrains Mono Regular.ttf");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("JetBrains Mono Bold.ttf");
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary-color: #1b1b1b;
  --secondary-color: #f4f2f2;
  --addendum-color: #e9e8e8;
}

body {
  color: var(--primary-color);
  background-color: var(--primary-color);
  padding-bottom: 40px;
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  line-height: 24px;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50vh;
  max-height: 50vw;
  overflow: hidden;
}

#banner {
  position: relative;
  width: 100vw;
  z-index: -1;
}

main {
  display: grid;
  gap: 40px;
  grid-template-columns: auto 1fr;
  padding: 40px;
  background-color: var(--secondary-color);
  border-radius: 10px;
  box-shadow: 0 0 10px 10px var(--primary-color);
}

textarea#content {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

nav {
  position: sticky;
  top: 40px;
  margin-bottom: auto;
  max-width: 300px;
}

a {
  color: rgb(107, 0, 0);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p:has(+ p) {
  margin-bottom: 20px;
}

p:has(+ ol, + ul, + .addendum) {
  margin-bottom: 10px;
}

p:has(+ h2, + img) {
  margin-bottom: 40px;
}

h2 {
  font-weight: bold;
  margin-bottom: 10px;
}

code {
  color: var(--secondary-color);
  background-color: var(--primary-color);
  font-family: "JetBrains Mono", monospace;
  text-decoration: none;
}

ul {
  list-style-type: disc;
  padding-left: 20px;
}

ol {
  padding-left: 40px;
}

:is(ul, ol):has(+ p) {
  margin-bottom: 20px;
}

:is(ul, ol):has(+ h2) {
  margin-bottom: 40px;
}

table {
  background-color: var(--addendum-color);
}

table:has(+ h2) {
  margin-bottom: 40px;
}

table,
tr,
th,
td {
  border: 2px solid var(--primary-color);
}

tr,
th,
td {
  padding: 10px;
}

th {
  text-align: left;
}

.header-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50vh;
  max-height: 50vw;
  overflow: hidden;
}

.auth-buttons {
  position: absolute;
  top: 10px;
  right: 40px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.auth-button {
  width: auto;
  padding: 5px 10px;
  height: auto;
  margin: 0;
}

.addendum {
  padding: 10px;
  background-color: var(--addendum-color);
  border: 2px dashed var(--primary-color);
}

.addendum:has(+ h2, + .addendum, + .warning) {
  margin-bottom: 40px;
}

.warning {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 450px;
}

.warning p {
  margin-bottom: 0;
}

.warning strong {
  font-size: 36px;
  font-weight: bold;
  line-height: 48px;
}

.button {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--secondary-color);
  background-color: var(--primary-color);
  margin: 0 auto;
  width: 200px;
  height: 40px;
  border-radius: 5px;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

.image,
.icon {
  float: right;
  margin: 0 0 20px 20px;
}

.image {
  width: 400px;
  max-width: 100%;
  clear: both;
}

.image.small {
  width: 200px;
}

.image.wide {
  width: 500px;
}

.image.extra-wide {
  width: 600px;
}

.icon {
  width: 100px;
}

.icon.big {
  width: 200px;
}

.safe {
  color: darkgreen;
}

.euclid {
  color: darkorange;
}

.keter {
  color: darkred;
}

.explained {
  list-style-type: circle;
}

@media (orientation: portrait) {
  #banner {
    scale: 2;
  }

  main {
    grid-template-columns: auto;
    padding: 20px;
  }

  nav {
    position: static;
    max-width: 100%;
  }

  .banner-links {
    display: flex;
    justify-content: center; /* Центрируем кнопки */
    gap: 10px; /* Расстояние между кнопками */
    margin-top: 10px; /* Отступ от баннера */
}

.banner-button {
    display: inline-flex; /* Используем inline-flex для размеров по контенту */
    justify-content: center;
    align-items: center;
    color: var(--secondary-color);
    background-color: var(--primary-color);
    padding: 5px 10px; /* Меньше padding, чтобы кнопки были меньше */
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px; /* Меньше размер шрифта */
}

.banner-button:hover {
    text-decoration: underline;
}
        /* Стили для черной полосы */

  .image {
    width: 100%;
    float: none;

  .input {
    font-size: 32px;
    font-size: max(16px, 1em);
    font-family: inherit;
    padding: 0.25em 0.5em;
    background-color: #fff;
    border: 2px solid var(--input-border);
    border-radius: 4px;
}

}
