/* ТЭМЗ | Типографика проекта. Значения берутся из библиотеки «Цвета и стили». */
@layer temz-typography {
  /* Основной текст */
  #allrecords :where(
    p,
    .t-text,
    .t-descr,
    .t-input,
    .t-input-title,
    .t-input-subtitle,
    .t-input-phonemask__select-code,
    [data-elem-type="text"] > div.tn-atom
  ) {
    font-family: var(--uc-typo-fontfamily-Sv9IO9ZdL) !important;
    font-size: calc(var(--uc-typo-fontsize-Sv9IO9ZdL) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-Sv9IO9ZdL) !important;
    line-height: var(--uc-typo-lineheight-Sv9IO9ZdL) !important;
    letter-spacing: var(--uc-typo-letterspacing-Sv9IO9ZdL, normal) !important;
  }

  /* Заголовок раздела */
  #allrecords :where(
    .t-title,
    .t-section__title,
    h2
  ):not(:where(.t-menu-base__textlogo, #header *, #footer *, #t-header *, #t-footer *)) {
    font-family: var(--uc-typo-fontfamily-BCg3JjauR4yF) !important;
    font-size: calc(var(--uc-typo-fontsize-BCg3JjauR4yF) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-BCg3JjauR4yF) !important;
    line-height: var(--uc-typo-lineheight-BCg3JjauR4yF) !important;
    letter-spacing: var(--uc-typo-letterspacing-BCg3JjauR4yF, -0.035em) !important;
  }

  /* Заголовок карточки */
  #allrecords :where(
    .t-heading,
    .t-card__title,
    .t-feed__post-title,
    .t-store__card__title,
    h3,
    h4,
    h5,
    h6,
    .about-history-year
  ) {
    font-family: var(--uc-typo-fontfamily-bZ9WX6j) !important;
    font-size: calc(var(--uc-typo-fontsize-bZ9WX6j) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-bZ9WX6j) !important;
    line-height: var(--uc-typo-lineheight-bZ9WX6j) !important;
    letter-spacing: var(--uc-typo-letterspacing-bZ9WX6j, -0.025em) !important;
  }

  /* Действие */
  #allrecords :where(
    .t-btn,
    .t-submit,
    .tn-elem[data-elem-type="button"] > .tn-atom,
    .t-menu__link-item,
    .t-menu-base__right_descr,
    .t-menu-base__textlogo,
    .about-drawing-address,
    .t-menusub__link-item,
    .temz-footer__nav a,
    .temz-footer__contacts a,
    .about-action,
    .temz-action,
    [data-elem-type="text"]:has(> h2) + [data-elem-type="text"] > div.tn-atom:has(> a:only-child),
    .tn-molecule:has(> [data-elem-type="text"] > h3):not(:has(> [data-elem-type="text"] > h3 a, [data-elem-type="image"])) > [data-elem-type="text"] > div.tn-atom:has(> a:only-child)
  ) {
    font-family: var(--uc-typo-fontfamily-e2YvZ35) !important;
    font-size: calc(var(--uc-typo-fontsize-e2YvZ35) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-e2YvZ35) !important;
    line-height: var(--uc-typo-lineheight-e2YvZ35) !important;
    letter-spacing: var(--uc-typo-letterspacing-e2YvZ35, normal) !important;
  }

  /* Подпись логотипа в общей шапке */
  #allrecords .t-menu-base__textlogo {
    font-family: 'Golos Text', Golos, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
  }

  /* Подпись */
  #allrecords :where(
    small,
    time,
    figcaption,
    .t-uptitle,
    .t-caption,
    .t-feed__post-date,
    [data-fe-date-format] > .tn-atom,
    .t-input-group__hint,
    .about-crumb,
    .about-map-pin,
    .about-map-credit,
    .temz-footer__details p,
    .temz-footer__documents a,
    .t657__text
  ) {
    font-family: var(--uc-typo-fontfamily-GJtDY38NJk) !important;
    font-size: calc(var(--uc-typo-fontsize-GJtDY38NJk) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-GJtDY38NJk) !important;
    line-height: var(--uc-typo-lineheight-GJtDY38NJk) !important;
    letter-spacing: var(--uc-typo-letterspacing-GJtDY38NJk, normal) !important;
  }

  /* Заголовок страницы */
  #allrecords :where(
    h1
  ) {
    font-family: var(--uc-typo-fontfamily-zVfG4eLrQQx) !important;
    font-size: calc(var(--uc-typo-fontsize-zVfG4eLrQQx) / var(--zoom, 1)) !important;
    font-weight: var(--uc-typo-fontweight-zVfG4eLrQQx) !important;
    line-height: var(--uc-typo-lineheight-zVfG4eLrQQx) !important;
    letter-spacing: var(--uc-typo-letterspacing-zVfG4eLrQQx, -0.045em) !important;
  }

  #allrecords :where(h1, h2, h3, h4, .t-title, .t-heading, .t-card__title, .tn-atom, .t-btn, .t-submit) :where(a, span, b, strong),
  #allrecords :where(.t-text, .t-descr) :where(span[style*="font-size"], span[style*="font-family"]),
  #allrecords :where(.t-btnflex__text, .tn-atom__button-text) {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
  }
  #allrecords :where(h1, h2, h3, h4, .t-btn, .t-submit, [data-elem-type="button"] .tn-atom) :where(a, span) { font-weight: inherit !important; }
}

#allrecords {

/* Заголовок и описание следуют друг за другом при переносе строк. */
@supports (anchor-scope: --temz-card-title) {
  .tn-molecule:has(> [data-elem-type="image"]):has(> [data-elem-type="text"] > h3):has(> [data-elem-type="text"] > div.tn-atom) {
    anchor-scope: --temz-card-title;
    & > [data-elem-type="text"]:has(> h3) { anchor-name: --temz-card-title; }
    & > [data-elem-type="text"]:has(> h3) + [data-elem-type="text"] {
      top: calc(anchor(--temz-card-title bottom) + 8px) !important;
      height: auto !important;
    }
  }
}
}

/* У текста новостной ленты уже задан вторичный цвет. */
#allrecords [data-fe-post-field="description"] > .tn-atom { opacity: 1 !important; }

/* На узком экране длинное название завода переносится перед кнопкой меню. */
#allrecords .t-menu-base__logowrapper_mobile { min-width: 0; margin-inline-end: 12px; }
#allrecords .t-menu-base__logowrapper_mobile .t-menu-base__logo { min-width: 0; }
#allrecords .t-menu-base__logowrapper_mobile .t-menu-base__imglogo { flex-shrink: 0; }
#allrecords .t-menu-base__logowrapper_mobile .t-menu-base__textlogo {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* На узком телефоне подписи следуют за фотографией в естественном порядке. */
@media (max-width: 379px) {
  #allrecords .tn-molecule:has(> [data-elem-type="image"]):has(> [data-elem-type="text"] > h3):has(> [data-elem-type="text"] > div.tn-atom) {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding-block-start: 16px;
    & > :is([data-elem-type="image"], [data-elem-type="text"]) {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      height: auto !important;
      flex: 0 0 auto;
    }
    & > [data-elem-type="image"] .tn-atom {
      position: relative;
      aspect-ratio: 16 / 9;
      height: auto !important;
      overflow: hidden;
    }
    & > [data-elem-type="image"] .tn-atom__img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100% !important;
      object-fit: cover;
    }
    & > [data-elem-type="text"]:has(> h3) { margin-block-start: 14px; }
    & > [data-elem-type="text"]:has(> h3) + [data-elem-type="text"] {
      top: auto !important;
      margin-block-start: 8px;
    }
  }
}
