.doc {
  --offset: 10px;
}

.doc__wrapper {
  box-sizing: border-box;
  padding-left: var(--offset);
  padding-right: var(--offset);
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--offset));
  min-width: 0;
}

.doc__main,
.doc__article {
  display: contents;
}

.doc__article {}

.doc__popup {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: fixed;
  top: -100%;
  width: 100%;
  height: 60px;
  color: hsl(var(--color-blue));
  background-color: var(--color-background);
  box-shadow: 0 12px 10px 0 rgb(0 0 0 / 10%);
  z-index: 2;
  transition: top 0.5s;
}

.doc__popup:not([hidden]) {
  top: 0;
}

.doc__popup-icon {
  width: calc(var(--font-size-m) * 1.27);
}

.doc__popup-text {
  color: currentColor;
  font-size: calc(var(--font-size-m) * 1.07);
}

.doc__feedback-form {
  order: 2;
  z-index: 0;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--offset);
  padding-right: var(--offset);
  padding-top: 100px;
  max-width: 672px;
}

.doc__linked-articles {
  margin-block-start: min(102px, 26%);
  margin-block-end: min(102px, 26%);
  display: flex;
  gap: var(--offset, 20px);
}

.doc__related-articles {
  overflow: hidden;
  padding-inline: 0;
  padding-block-start: 65px;
  padding-block-start: min(65px, 18%);
}

@media not all and (width >= 768px) {
  .doc__linked-articles {
    flex-direction: column;
    gap: 13px;
    margin-block-start: 30px;
    margin-block-end: 0;
  }
}

@media not all and (width >= 1024px) {
  .doc__linked-articles,
  .doc__related-articles {
    padding-inline: inherit;
  }
}

@media (width >= 1024px) {
  .doc {
    --offset: 20px;
    --aside-with: 25%;
    --content-width: 1087px;
    --columns-template: var(--aside-with) 1fr;
    display: grid;
    grid-template-columns: var(--columns-template);
    grid-template-rows: auto 1fr auto;
    align-items: start;
    align-content: start;
    min-height: calc(100vh - var(--header-height, 0) * 1px);
  }

  .doc > * {
    grid-column: 2 / -1;
  }

  .doc__article {
    grid-column: 1 / -1;
  }
}

@media (width >= 2000px) {
  .doc {
    --columns-template: var(--aside-with) 1fr var(--aside-with);
  }

  .doc__wrapper {
    margin-left: auto;
    margin-right: auto;
  }
}
