/* FONTS */

/* VARIABLES */

:root {
  --font-primary: 'DM Sans', Inter, system-ui, Helvetica, Tahoma, Arial, sans-serif;
  --font-secondary: 'Sofia Sans Condensed', Inter, system-ui, Helvetica, Verdana, Arial, sans-serif;

  --color-accent: #400FC7;
  --color-dark-text: #121117;
  --color-medium-text: #594F64;
  --color-light-text: #89789C;
}


/* DOCUMENT */

html, body {
  margin: 0;
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: break-word;
}

body {
  box-sizing: border-box;
  min-width: 360px;

  /* TODO: временно, пока десктопную версию не сверстаем */
  max-width: 960px;
  margin: 0 auto;
}

/* RESETS */

h1, h2, h3 {
  margin: 0;
}

svg {
  pointer-events: none;
}

/* PAGE */

.page__header {
  position: relative;
  height: 64px;
  background: #1B0D2A;
}

.page__body {
  box-sizing: border-box;
  min-height: calc(100vh - 64px);
  padding: 24px 20px 48px;
  background: url('bg.svg') top center no-repeat;
  background-size: 640px 160px;

  @media (min-width: 640px) {
    background-size: 1200px 300px;
  }
}

.page__footer {
  padding: 24px 20px;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  background: #121117;
  color: var(--color-light-text);

  a {
    text-decoration: underline;
    color: var(--color-light-text);;

    /* TODO: уточнить стиль тут */
    &:hover {
      text-decoration: none;
    }
  }
}

/* LOGO */

.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 100%;
  background: url('logo.png') center no-repeat;
  background-size: 109px 40px;
  font-size: 0;
}

/* ARTICLE */

.article__header {
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(130, 136, 168, 0.2);
}

.article__category {
  font-family: var(--font-secondary);
  font-size: 17px;
  line-height: 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent);
}

.article__headline {
  font-weight: 600;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.03em;
  color: var(--color-dark-text);
}

.article__meta {
  margin-top: 16px;
  font-size: 15px;
  line-height: 24px;
  color: var(--color-light-text);
}

.article__content {
  margin-top: 24px;
  font-size: 15px;
  line-height: 24px;
  color: var(--color-medium-text);

  p {
    margin: 8px 0;

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  h2 {
    margin: 24px 0 16px;
    font-size: 24px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--color-dark-text);
  }

  h3 {
    margin: 24px 0 16px;
    font-size: 20px;
    line-height: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-dark-text);
  }

  h4 {
    margin: 24px 0 16px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: var(--color-dark-text);
  }

  ol, ul {
    margin: 8px 0;
    padding: 0 0 0 24px;

    li {
      margin: 8px 0;
    }
  }

  a {
    text-decoration: none;
    color: var(--color-accent);

    /* TODO: уточнить стиль тут */
    &:hover {
      text-decoration: underline;
    }

    &:not([href^="#"]):not([href^="/"]) {
      &::after {
        content: url('external-link.svg');
        position: relative;
        top: 3px;
      }
    }
  }

  video {
    display: block;
    max-width: 100%;
    max-height: 600px;
    background: #000;
  }
}

/* HOTKEY */

.hotkey {
  white-space: nowrap;
}

.hotkey__text {
  display: inline-block;
  box-sizing: border-box;
  font-family: var(--font-secondary);
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  background: #E5E7F3;
  border: 1px solid rgba(64, 15, 199, 0.5);
  box-shadow: inset 0px -2px 0px rgba(64, 15, 199, 0.2);
  border-radius: 3px;
  color: var(--color-accent);
}

.hotkey_size_m {
  .hotkey__icon {
    height: 20px;
    margin-right: 3px;
    vertical-align: -4px;
  }

  .hotkey__text {
    min-width: 20px;
    padding: 0px 5px 0;
    margin-right: 3px;
    vertical-align: 2px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
  }
}

.hotkey_size_l {
  .hotkey__icon {
    height: 24px;
    margin-right: 8px;
    vertical-align: -5px;
  }

  .hotkey__text {
    min-width: 24px;
    padding: 1px 5px 0;
    margin-right: 8px;
    font-size: 15px;
    line-height: 21px;
    vertical-align: 2px;
    letter-spacing: normal; /* иначе от h3 может прийти :-) */
  }
}

.hotkey_key-only {
  .hotkey__icon,
  .hotkey__text {
    margin-right: 0;
  }
}

/* INLINE SPOILER */

.inline-spoiler {
  padding: 2px 4px;
  background: rgba(229, 231, 243, 0.3);
  border: 1px solid rgba(89, 79, 100, 0.2);
  border-radius: 2px;
  color: #594F64;

  &:hover {
    background: rgba(229, 231, 243, 0.6);
    border-color: rgba(89, 79, 100, 0.2);
  }
}

.inline-spoiler_open {
  border-color: rgba(64, 15, 199, 0.5);
  background: rgba(229, 231, 243, 0.6);
}

/* SPOILER CONTENT */

.spoiler-content {
  display: none;
  padding: 8px;
  border: 1px solid rgba(89, 79, 100, 0.2);
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.spoiler-content_visible {
  display: flex;
  flex-direction: column;
}

/* HAMBURGER */

.hamburger {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  background: none;
  border: none;
  padding: 0;
}

/* MOBILE SIDEBAR */

.mobile-sidebar {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.mobile-sidebar__backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #121117;
  opacity: .6;
}

.mobile-sidebar__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 320px;
  box-shadow: 0px 8px 32px rgba(27, 13, 42, 0.3);
}

.mobile-sidebar__header {
  position: relative;
  box-sizing: border-box;
  display: flex;
  gap: 16px;
  height: 64px;
  padding: 16px 20px;
  background: #1B0D2A;
}

.mobile-sidebar__close-button {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: none;
}

.mobile-sidebar__body {
  position: relative;
  box-sizing: border-box;
  overflow: auto;
  height: calc(100% - 64px);
  padding: 8px;
  background: #fff;
}

/* PLATFORM SWITCH */

.platform-switch {
  display: flex;
  width: fit-content;
  background: #251D39;
}

.platform-switch__button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(193, 184, 218, .6);

  &:hover {
    background: rgba(199, 202, 245, 0.1);
  }
}

.platform-switch__button_active {
  color: #fff;

  &, &:hover {
    background: #0984EC;
  }
}

/* TOOLTIP */

.tooltip {
  position: relative;

  &:hover {
    .tooltip__content {
      display: block;
    }
  }
}

.tooltip__content {
  display: none;
  position: absolute;
  top: 50%;
  left: 100%;
  z-index: 1;
  transform: translateY(-50%);
  padding: 5px 7px;
  margin-left: 9px;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid rgba(64, 15, 199, 0.2);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0px 4px 8px rgba(27, 13, 42, 0.1);
  color: var(--color-dark-text);
  pointer-events: none;

  &::before {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    left: -0.5px;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: 50% 50%;
    border: 1px solid #400FC740;
    border-top: 0;
    border-right: 0;
    background: #fff;
  }
}

/* LANG SWITCH */

.lang-switch {
  display: flex;
  width: fit-content;
  background: #251D39;
}

.lang-switch__button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 32px;
  text-transform: uppercase;
  text-decoration: none;
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 600;
  line-height: 16px;
  color: #C1B8DA;

  &:not([href]) {
    background: #4D426C;
    color: #fff;
  }

  &[href] {
    &:hover {
      background: rgba(199, 202, 245, 0.1);
    }
  }
}

/* MOBILE MAIN MENU */

.mobile-main-menu {
  position: relative;
}

.mobile-main-menu__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 8px 12px 6px; /* компенсируем кривости шрифта */
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  text-transform: uppercase;
  text-align: left;
  border-radius: 2px;
  border: 1px solid rgba(64, 15, 199, 0.2);
  background: rgba(229, 231, 243, 0.6);
  color: var(--color-accent);

  svg {
    margin-top: -2px; /* компенсируем компенсацию кривостей шрифта :-) */
    transform-origin: 50% 50%;
    opacity: 0.6;
  }
}

.mobile-main-menu__options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid rgba(64, 15, 199, 0.2);
  background: #fff;
  box-shadow: 0px 8px 32px rgba(27, 13, 42, 0.3);
}

.mobile-main-menu__option {
  box-sizing: border-box;
  height: 40px;
  padding: 8px 12px 6px; /* компенсируем кривости шрифта */
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-light-text);

  /* не имеет смысла на мобилках, но всё ж */
  &:hover {
    background: rgba(84, 34, 222, 0.1);
  }
}

.mobile-main-menu__option_selected {
  background: rgba(84, 34, 222, 0.1);
  color: var(--color-accent);
}

.mobile-main-menu_open {
  .mobile-main-menu__label {
    border-color: var(--color-accent);

    svg {
      opacity: 1;
      transform: rotate(180deg);
    }
  }

  .mobile-main-menu__options {
    display: flex;
  }
}

/* MOBILE MENU */

.mobile-menu {
  padding: 8px 0;
}

.mobile-menu__section {
  & + & {
    margin-top: 24px;
  }
}

.mobile-menu__headline {
  display: block;
  box-sizing: border-box;
  height: 32px;
  padding: 8px 12px 6px; /* компенсируем кривости шрифта */
  font-family: var(--font-secondary);
  font-size: 17px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  color: #1B0D2A;
}

.mobile-menu__item {
  display: block;
  box-sizing: border-box;
  height: 32px;
  padding: 6px 12px;
  font-family: var(--font-primary);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
  color: var(--color-light-text);

  &[href] {
    &:hover {
      background: rgba(84, 34, 222, 0.1);
    }
  }

  &:not([href]) {
    background: rgba(84, 34, 222, 0.1);
    color: var(--color-accent);
  }
}

/* TOC */

/*.toc {
  position: fixed;
  top: 76px;
  right: 12px;
  bottom: 0;
  max-width: 260px;
  width: fit-content;
  height: fit-content;
}

.toc_open {
  height: auto;
  overflow: auto;
}

.toc__content {
  display: none;
}

.toc__trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid rgba(64, 15, 199, 0.2);
  box-shadow: 0px 8px 16px rgba(27, 13, 42, 0.15);
}*/