.ids {
  & a {
    color: var(--ids__link);
    text-decoration: underline;
    will-change: color;
    text-decoration-thickness: var(--ids__border-width-s);
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: none;
    text-decoration-color: color-mix(in srgb, var(--ids__link) 20%, transparent);
    transition:
      color var(--ids__duration-base) var(--ids__easing-base),
      text-decoration var(--ids__duration-base) var(--ids__easing-base);

    &:hover {
      color: var(--ids__hover);
      text-decoration-color: color-mix(in srgb, var(--ids__hover) 20%, transparent);
      transition:
        color var(--ids__duration-instant) var(--ids__easing-base),
        text-decoration var(--ids__duration-instant) var(--ids__easing-base);
    }
  }

  .ids__promo-link {
    display: flex;

    & a {
      display: inline-block;
      padding: 0.45em 0.6em 0.5em;
      border: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 50%, transparent);
      border-right: 0;

      &:hover {
        background-color: color-mix(in srgb, var(--ids__hover) 10%, transparent);
      }

      &:first-child {
        border-radius: var(--ids__radius-m) 0 0 var(--ids__radius-m);
        padding-left: 1em;
      }

      &:last-child {
        border-radius: 0 var(--ids__radius-m) var(--ids__radius-m) 0;
        padding-right: 1em;
        border-right: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 50%, transparent);
      }

      &.active {
        color: var(--ids__text);
        background-color: color-mix(in srgb, var(--ids__text) 5%, transparent);
        -webkit-text-decoration: none;
        text-decoration: none;
        cursor: default;
      }

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

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

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

  /* Кегли и веса заголовков — со старого сайта Shift */

  & h1 {
    font-size: 3.23em;
    font-weight: 650;
    line-height: calc(var(--ids__density) / 1.3);
    margin-bottom: 0.5em;

    @media (width < 768px) {
      font-size: 2.25em;
      margin-bottom: 0.3em;
    }

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

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

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

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

    /* h2, выглядящий как h3 (попадает в оглавление, но мельче) */
    &.h3 {
      font-size: 1.4em;
      font-weight: 570;
      line-height: calc(var(--ids__density) / 1.1);
      margin-bottom: 0.6em;

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

    /* (под)заголовок серый CAPS LOCK */
    &.special {
      font-size: 0.85em;
      font-weight: 570;
      letter-spacing: 0.13em;
      text-transform: uppercase;
      line-height: var(--ids__density);
      margin-top: 2em;
      margin-bottom: 2em;
      color: color-mix(in srgb, var(--ids__text) 50%, transparent);

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

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

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

  & h4 {
    font-size: 1.01em;
    font-weight: 600;
    line-height: var(--ids__density);
    margin-top: 1.4em;
    margin-bottom: calc(var(--ids__density) * 0.75em);
  }

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

  /* Якоря не прилипают к верху окна (под фиксированным хедером) */
  & h2,
  & h3,
  & h4 {
    scroll-margin-top: 5em;
  }

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

  & mark {
    color: var(--ids__color-gray-950);
    background-color: var(--ids__mark);
  }

  & ul,
  & ol {
    margin: 0;
    margin-top: calc(var(--ids__density) * 0.5em);
    margin-bottom: calc(var(--ids__density) * 0.6em);
    padding: 0;
  }

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

      &::before {
        position: absolute;
        left: 0;
        top: 0.13em;
        font-size: 0.85em;
        content: "•";
        color: color-mix(in srgb, var(--ids__text) 50%, transparent);
      }
    }
  }

  & ol {
    counter-reset: inst;

    & > li {
      list-style: none;
      display: block;
      position: relative;
      counter-increment: inst;
      padding-top: 0.6em;
      padding-left: calc(var(--ids__density) * 1em);
      margin-top: -0.5em;

      &::before {
        position: absolute;
        content: counter(inst) ".";
        margin-left: calc(var(--ids__density) * -1em);
        text-align: center;
      }
    }
  }

  /* для списков, относящихся к <p> (убирает большой маржин после <p>) */
  & p + ul {
    margin-top: -0.13em;
  }

  & 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);
  }

  & .lead {
    font-size: 1.5em;
    margin: 1em 0;
    padding-left: 1em;
  }

  & .subdued {
    opacity: 0.55;
  }

  /* Описание публикации (под h1) */
  & .ids__description {
    font-family: var(--shift__description-font);
    font-weight: 200;
  }

  & aside {
    margin: 0;
    margin-bottom: calc(var(--ids__density) * 0.5em);
    background-color: var(--shift__aside-background);
    border-radius: 0.9em;
    padding: 1.2em 1.4em;

    & h2,
    & h3,
    & h4 {
      margin: 0;
    }

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

    & ul,
    & ol {
      margin-bottom: 0;

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

    &.tight {
      padding: 0.8em 0.8em 0.3em 0.8em;
      max-width: max-content;
      border-radius: 0.45em;
      border: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 15%, transparent);
    }
  }

  & code {
    font-size: 0.9em;
    letter-spacing: 0.02em;
    font-weight: 450;
    padding: 0.1em 0.25em;
    border-radius: var(--ids__radius-s);
    color: var(--ids__code);
    border: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__code) 10%, transparent);
    background: color-mix(in srgb, var(--ids__code) 10%, transparent);
  }

  & 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: 0.7em;
      margin-bottom: 1.3em;
      font-size: 0.7em;
      line-height: var(--ids__density);
      color: var(--ids__text-caption);
    }
  }

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

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

  & .ids__table-wrapper {
    overflow-x: auto;
  }

  & table {
    border-spacing: 0;
    background-color: inherit;
    font-size: 0.8em;

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

    & th {
      text-align: left;
    }

    & thead th {
      font-weight: 600;
      border-bottom: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 15%, transparent);
      padding-bottom: 0.3em;

      @media (max-width: 767px) {
        padding: 0 0.4em 0.5em 0;
        max-width: 6.6em;
        word-wrap: break-word;
      }
    }

    & tbody th {
      padding-right: 0.5em;
      padding-top: 0.78em;
      border-bottom: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 15%, transparent);
      font-weight: 500;

      /* строка-подзаголовок таблицы */
      &.colspan {
        padding-top: calc(var(--ids__density) * 1.1em);
        padding-bottom: calc(var(--ids__density) * 0.6em);
      }
    }

    & td {
      padding: 0.8em 0.5em 1em 0;
      border-bottom: var(--ids__border-width-s) solid color-mix(in srgb, var(--ids__text) 15%, transparent);
      vertical-align: top;
    }

    & tbody tr:last-child {
      & td,
      & th {
        border-bottom: none;
      }
    }
  }

  & hr {
    border-top-color: var(--ids__border);
    border-bottom: 0;
  }
}
