/* **** */
/* MENU */
/* **** */


/*header {
  position: sticky;
  top: 0;
  z-index: 100;
}*/

/* Занимает место под fixed-меню. */
.menuSpacer {
  height: 35rlh;
}

.menuGlobal,
.menuSticky {
  width: 100%;
  max-width: 100%;
  top: 0;
  z-index: 100;
}

.menuGlobal {
  position: fixed;

  /* Поднимаем контент ниже до базовой текста */
  margin-bottom: -25rlh;

  /* Чтобы кликалось под меню */
  pointer-events: none;
}

.menuGlobal > menu {
  width: fit-content;
  max-width: 100%;
  padding-block: var(--margin-text);
  pointer-events: auto;
}

.menuSticky {
  position: sticky;
}

menu {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 10rlh;

  /* Перезаписываем дефолты */
  margin: 0;
  padding-inline: 0;

  display: flex;
  align-items: center;
  gap: 50rlh;
  flex-wrap: nowrap;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

menu > li {
  display: flex;
  flex: 0 0 auto;
}

menu > li > p {
  --webkit-user-select: none;
  user-select: none;
}

@media screen and (max-width: 800px) {
  menu {
    gap: 25rlh;
  }
}

@media only screen and (max-width: 360px) {
  menu {
    gap: 25rlh;
  }
}

/* Активный пункт */
menu .disabled,
footer .disabled {
  pointer-events: none;
  position: relative;
}

menu li.selected {
  position: relative;
}

menu li.selected::after {
  content: "\00B7";
  font-size: var(--paragraph-font-size);
  color: var(--text-color);
  position: absolute;
  left: -11rlh;
  top: -8rlh;
}

/* Ховер красит точку */
menu li.selected:has(a:hover)::after {
  color: var(--hover-color);
}


/* Логотип */

.logo {
  position: fixed;
  top: 5rlh;
  right: 25rlh;
  z-index: 200;
  width: 30rlh;
  color: #000;
  contain: layout paint style;
}

.logo svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: optimizeSpeed;
  /* Красим в цвет текста */
  color: var(--text-color);
}

@media screen and (max-width: 800px) {
  .logo {
    position: fixed;
    top: initial;
    bottom: 24rlh;
    right: 15rlh;
    width: 45rlh;
  }
}

/* Плавная смена цвета по скроллу */
menu, .logo svg {
  transition: color 200ms, background 200ms;
}


/* ****** */
/* SUBMENU */
/* ****** */

.submenu {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%vw;
}

.submenu menu {
  gap: 25rlh;
  padding-left: var(--margin-grid);
}

menu.projectTypes {
  padding-inline: 0;
  flex-wrap: wrap;
  overflow: visible;
  gap: 35rlh;
}



/* Переключатель языка вне прокручиваемого menu. */
.menuAccount {
  display: flex;
  align-items: center;
  min-width: 0;
}

.menuAccount > menu {
  width: fit-content;
  max-width: 100%;
  padding-block: var(--margin-text);
  pointer-events: auto;
}

.languageSwitcher {
  position: relative;
  isolation: isolate;
  z-index: 101;
  flex: 0 0 auto;
  margin-right: var(--margin-grid);
  padding-block: var(--margin-text);
  color: var(--text-color);
  pointer-events: auto;
}

.languageSwitcher > summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6rlh;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.languageSwitcher > summary::-webkit-details-marker {
  display: none;
}

.languageSwitcher > summary:hover,
.languageSwitcher > summary:hover p {
  color: var(--hover-color);
}

.languageChevron {
  width: 5rlh;
  height: 5rlh;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.languageName {
  display: none;
}

.languageSwitcher[open] .languageLabel,
.languageSwitcher[open] .languageChevron {
  display: none;
}

.languageSwitcher[open] .languageName {
  display: inline;
}

/* Мягкая четверть круга из правого верхнего угла страницы. */
.languageSwitcher[open]::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: -25rlh;
  right: -25rlh;
  width: 500rlh;
  height: 500rlh;
  background: radial-gradient(circle at top right, var(--background-color) 0 48%, color-mix(in srgb, var(--background-color) 95%, transparent) 60%, transparent 94%);
  filter: blur(20rlh);
  pointer-events: none;
}

.languageOptions {
  position: absolute;
  top: 100%;
  right: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 2 * var(--margin-grid));
  max-height: calc(100dvh - 100rlh);
  overflow-y: auto;
  margin: 0;
  padding: 0;
  text-align: right;
}

.languageOptions > li {
  margin: 0;
}

.languageOptions a {
  display: block;
  padding-block: var(--margin-grid-half);
}

/* ****** */
/* ACCOUNT */
/* ****** */
menu .username {
  min-width: 0;
  opacity: .15;
}
menu .username p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
menu a.loginLink svg {
  height: 15rlh;
  position: relative;
  top: -2.7rlh;
  opacity: .15;
}
menu a.loginLink:hover svg {
  opacity: 1;
}


/* ****** */
/* FOOTER */
/* ****** */

/* Stick footer to the bottom */
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

footer {
  margin-top: auto;
  padding-bottom: var(--margin-text);
  /* Отступ для короны */
  padding-right: 54rlh;
}
