.ids {
  & a {
    color: rgb(var(--ids__link-RGB));
    text-decoration: underline;
    will-change: color;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: none;
    text-decoration-color: rgba(var(--ids__link-RGB), 0.2);
    transition:
      color 0.5s ease,
      text-decoration 0.5s ease;

    &:hover {
      color: rgb(var(--ids__hover-RGB));
      text-decoration-color: rgba(var(--ids__hover-RGB), 0.2);
      transition:
        color 0s ease,
        text-decoration 0s ease;
    }
  }

  .ids__promo-link {
    display: flex;
    justify-content: center;

    & a {
      display: inline-block;
      padding: 0.45em 0.6em 0.5em;
      border: 1px solid rgba(var(--ids__text-RGB), 0.5);
      border-right: 0;

      &:hover {
        background-color:rgba(var(--ids__hover-RGB), 0.1)
      }

      &:first-child {
        border-radius: 0.3em 0 0 0.3em;
        padding-left: 1em;
      }

      &:last-child {
        border-radius: 0 0.3em 0.3em 0;
        padding-right: 1em;
        border-right: 1px solid rgba(var(--ids__text-RGB), 0.5)
      }

      &.active {
        color: RGB(var(--ids__text-RGB));
        background-color: rgba(var(--ids__text-RGB), 0.05);
        -webkit-text-decoration: none;
        text-decoration: none;
        cursor: default;
      }

      &.active::after {
        content: " ↓";
      }
    }
  }


  & p {
    margin-top: 0;
    margin-bottom: calc(var(--ids__density) * 0.4em);

    &.loud {
      font-size: 2em;
      line-height: 1.2;
    }

    &.huge {
      font-size: 6em;
      line-height: 1;

      @media (max-width: 767px) {
        &.huge {
          font-size: 3.2em;
        }
      }

      @media (max-width: 549.98px) {
        &.huge {
          font-size: 2.8em;
        }
      }
    }
  }

  & h1,
  & h2,
  & h3,
  & h4,
  & h5,
  & h6 {
    margin: 0;
    font-weight: 600;
  }

  & h1 {
    font-size: 3.6em;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: calc(var(--ids__density) / 1.3);
    margin-bottom: 0.4em;

    @media (width < 768px) {
      font-size: 2.6em;
    }

    &.S {
      font-size: 2.4em;
      font-weight: 650;
    }
    &.XS {
      font-size: 1.6em;
      font-weight: 600;
    }
  }

  & h2 {
    font-size: 2.4em;
    font-weight: 650;
    line-height: calc(var(--ids__density) / 1.2);
    margin-bottom: 0.5em;

    &.XS {
      font-size: 1.2em;
      font-weight: 600;
    }
  }

  & h3 {
    font-size: 1.5em;
    line-height: calc(var(--ids__density) / 1.1);
    margin-bottom: 0.6em;
  }

  & h4 {
    font-size: 1.1em;
    line-height: var(--ids__density);
    margin-bottom: 0.5em;
  }

  & h5 {
    font-size: 1em;
    line-height: var(--ids__density);
    margin-bottom: 0.5em;
  }

  & h6 {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: var(--ids__density);
    margin-bottom: 0.5em;
  }

  & strong,
  & b {
    font-weight: 600;
  }

  & mark {
    color: rgb(var(--ids__text-RGB));
    background-color: rgb(var(--ids__mark-RGB));
  }

  & ul,
  & ol {
    margin: 0 0 calc(var(--ids__density) * 0.75em) 0;
    padding: 0;

    & li {
      position: relative;
      margin-bottom: calc(var(--ids__density) * 0.5em);
    }
  }

  & ul {
    & li {
      list-style-type: none;
      padding-left: calc(var(--ids__density) * 0.75em);

      &:before {
        position: absolute;
        left: 0;
        content: "⋅ ";
      }
    }
  }

  & ol {
    & li {
      list-style: decimal inside none;
    }
  }

  & blockquote {
    font-size: 1.4em;
    line-height: var(--ids__density);
    margin: 0;
    padding-left: calc(var(--ids__density) * 0.75em);
    margin-bottom: calc(var(--ids__density) * 1em);
  }

  & aside {
    margin: 0;
    margin-bottom: calc(var(--ids__density) * 0.5em);
    background: rgb(var(--ids__surface-RGB));
    padding-top: calc(var(--ids__density) * 0.4em);
    padding-right: calc(var(--ids__density) * 1.5em);
    padding-bottom: calc(var(--ids__density) * 0.4em);
    padding-left: calc(var(--ids__density) * 0.5em);
    border-radius: 0.2em;

    @media (width < 768px) {
      padding-right: calc(var(--ids__density) * 0.75em);
    }
  }

  & code {
    font-size: 0.9em;
    font-family: "Inter";
    letter-spacing: 0.02em;
    font-weight: 450;
    padding: 0.1em 0.25em;
    border-radius: 0.2em;
    color: rgba(var(--ids__code-RGB), 1);
    border: 1px solid rgba(var(--ids__code-RGB), 0.1);
    background: rgba(var(--ids__code-RGB), 0.1);
  }

  & .ids__year {
    display: inline-block;
    box-sizing: border-box;
    font-size: 0.9em;
    font-family: "Inter";
    color: rgba(var(--ids__code-RGB), 1);
  }

  & figure {
    margin: 0 0 calc(var(--ids__density) * 0.5em) 0;

    &.XXS,
    &.ids__figure__XXS {
      width: 25%;
    }
    &.XS,
    &.ids__figure__XS {
      width: 50%;
    }
    &.S,
    &.ids__figure__S {
      width: 75%;
    }

    & figcaption {
      margin-top: calc(var(--ids__density) * 0.25em);
      font-size: 0.8em;
      line-height: var(--ids__density);
      opacity: 0.7;
    }
  }

  & details {
    padding: 0.5em;
    cursor: pointer;
    border-radius: var(--ids__radius);

    & summary {
      padding-bottom: var(--ids__micro-padding);
    }
  }

  & table {
    border-spacing: 0;
    background-color: inherit;

    @media (max-width: 767px) {
      font-size: 0.7em;
    }

    thead {
      background-color: inherit;
    }

    tr {
      background-color: inherit;

      & th {
        position: sticky;
        top: 0px;
        text-align: left;
        border-bottom: 2px solid rgba(var(--ids__text-RGB), 1);
        padding-bottom: 0.3em;
        background-color: inherit;

        @media (max-width: 767px) {
          padding-top: 0.8em;
        }
      }

      & td {
        padding: 0.8em 0.5em 1em 0;
        border-bottom: 1px solid rgba(var(--ids__text-RGB), 0.5);
        vertical-align: top;
      }

      &:last-child {
        & td {
          border-bottom: none;
        }
      }
    }

  }

  & hr {
    border-top-color: rgba(var(--ids__text-RGB), 0.2);
    border-bottom: 0;
  }
}

body.personal-layout {
  --personal-sidebar-width: 9em;
  --personal-sidebar-gap: 1em;
}

body.personal-layout #personal-topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  row-gap: 0.35em;
  width: var(--personal-sidebar-width);
  margin: 0;
  position: fixed;
  top: 0.3em;
  left: 0.3em;
  z-index: 2;
}


body.personal-layout main {
  padding-left: calc(var(--personal-sidebar-width) + var(--personal-sidebar-gap));
}

body.personal-layout .ids #personal-topbar-name {
  margin: 0;
  font-size: 0.675em;
  font-weight: 500;
  line-height: var(--ids__density);
  order: 2;
}

body.personal-layout #personal-dropdown {
  position: relative;
  margin-left: 0;
  order: 1;
  width: 100%;
}

body.personal-layout #personal-dropdown-select {
  font: inherit;
  font-size: 0.675em;
  font-weight: 500;
  color: rgb(var(--ids__text-RGB));
  border: 1px solid rgba(var(--ids__text-RGB), 0.5);
  border-radius: 0.25em;
  padding: 0.25em 2em 0.25em 0.5em;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}

@media (width < 768px) {
  body.personal-layout #personal-topbar {
    position: static;
    width: fit-content;
    margin: 1em 0;
  }

  body.personal-layout main {
    padding-left: 0;
  }
}

.ids .fact-generator__media {
  width: clamp(4.5em, 15vw, 6em);
  aspect-ratio: 1;
  margin-inline: auto;
  margin-bottom: calc(var(--ids__density) * 0.6em);
}

.ids .fact-generator__media.is-balashov {
  width: clamp(6.75em, 22.5vw, 9em);
}

.ids .fact-generator__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ids .fact-generator__media img.is-contained {
  object-fit: contain;
}

.ids .fact-generator {
  text-align: center;
}

.ids .fact-generator a {
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  transition: color 0s ease, text-decoration 0s ease;
}

.ids .fact-generator a:hover,
.ids .fact-generator a:focus-visible {
  text-decoration-color: currentColor;
}

.ids .fact-generator #other-fact-link {
  text-decoration-style: dashed;
}

.ids .facts-sequence {
  --gap: 0.25em;
}

.ids .facts-sequence .ids__sequence-item {
  --columns: 5;
  --fact-card-width: 6.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(100%, var(--fact-card-width));

  @media (width < 768px) {
    --columns: 3;
  }
}

.ids .facts-sequence .fact-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: calc(var(--ids__density) * 0.25em);
  object-fit: cover;
  object-position: center;
}

.ids .facts-sequence .fact-card__text {
  width: 100%;
  margin: 0;
  font-size: 0.5em;
  line-height: 1.2;
  text-align: left;
  text-wrap: pretty;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}


