/* **** */
/* 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;
}

menu.fadeEnd {
  mask-image: linear-gradient(
    to right,
    black calc(100% - var(--margin-grid)),
    transparent 100%
  );
}

.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;
}



/* Account dropdowns live outside the horizontally scrolling menu. */
.menuAccount {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

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

.accountDropdown {
  --dropdown-gap: var(--margin-text);
  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;
}

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

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

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

.languageChevron {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 8rlh;
  height: 8rlh;
  border-right: 1.7rlh solid currentColor;
  border-bottom: 1.7rlh solid currentColor;
  transform: translateY(-2rlh) rotate(45deg);
}

/* The trigger retains its place while the complete popup covers the account area. */
.accountDropdown[open] {
  z-index: 102;
}
.accountDropdown[open] > summary {
  visibility: hidden;
}

.accountPanel {
  position: absolute;
  top: 0;
  right: 0;
  isolation: isolate;
  width: max-content;
  max-width: 100vw;
  margin: 0;
  text-align: right;
}

/* Keep the popup opaque inside; fade to zero along both outer edges. */
.accountPanel::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 450%;
  height: 450%;
  background: var(--background-color);
  mask-image: radial-gradient(
    ellipse farthest-side at top right,
    black 0 33.333%,
    rgb(0 0 0 / 0.9851) 36.667%,
    rgb(0 0 0 / 0.9416) 40%,
    rgb(0 0 0 / 0.8734) 43.333%,
    rgb(0 0 0 / 0.7861) 46.667%,
    rgb(0 0 0 / 0.6865) 50%,
    rgb(0 0 0 / 0.5817) 53.333%,
    rgb(0 0 0 / 0.4782) 56.667%,
    rgb(0 0 0 / 0.3814) 60%,
    rgb(0 0 0 / 0.295) 63.333%,
    rgb(0 0 0 / 0.2212) 66.667%,
    rgb(0 0 0 / 0.1608) 70%,
    rgb(0 0 0 / 0.1131) 73.333%,
    rgb(0 0 0 / 0.077) 76.667%,
    rgb(0 0 0 / 0.0505) 80%,
    rgb(0 0 0 / 0.0318) 83.333%,
    rgb(0 0 0 / 0.0191) 86.667%,
    rgb(0 0 0 / 0.0106) 90%,
    rgb(0 0 0 / 0.0053) 93.333%,
    rgb(0 0 0 / 0.002) 96.667%,
    transparent 100%
  );
  pointer-events: none;
}

/* Scrolling belongs to the content so it cannot clip the fading background. */
.accountContent {
  box-sizing: border-box;
  max-height: 100dvh;
  overflow-y: auto;
  padding: var(--margin-text) var(--margin-grid);
}

.accountOptions {
  display: grid;
  gap: var(--dropdown-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

.accountOptions > li {
  margin: 0;
}

.accountOptions a {
  display: block;
  text-decoration: none;
}

/* ****** */
/* ACCOUNT */
/* ****** */
.languageUsername {
  display: block;
  margin-top: var(--dropdown-gap);
  opacity: .15;
}

@media screen and (max-width: 800px) {
  .accountDropdown {
    --dropdown-gap: calc(var(--margin-text) * 1.5);
  }
}
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;
}
