/* tradutora-blog.css — оформление нашего блога: ленты, статьи, подпись автора,
   метка раздела и блок «Смотрите также».

   Числа здесь не придуманы: они сняты с работающего сайта до замены. Обмер
   лежит в qa/blog/evidence/blog-measure.json, снимался харнессами
   qa/blog/_bp.mjs, _bpfeed.mjs, _rel2.mjs. Эта волна меняет устройство блога,
   а не его облик, поэтому кегли, интерлиньяж, отступы и геометрия карточек
   повторяют прежние. */

/* На сайте есть правила уровня идентификатора (#allrecords ul, #allrecords a),
   и они перебивают обычные классы. Там, где это меняет вид, повышаем точность
   селектора тем же идентификатором — вместо !important. */

/* ─── лента ───────────────────────────────────────────────────────────────── */
.trd-feed {
  box-sizing: border-box;
  max-width: 1160px;
  margin: 0 auto;
  font-family: Arial, Helvetica, sans-serif;
}

/* переключатель разделов */
.trd-feed__cats,
#allrecords .trd-feed__cats {
  display: block;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
.trd-feed__cat {
  display: inline-block;
  margin: 0 5px 10px;
  border: 2px solid #333;
}
.trd-feed__cat a,
.trd-feed__cat button,
#allrecords .trd-feed__cat a,
#allrecords .trd-feed__cat button {
  display: inline-block;
  padding: 6px 18px;
  border: 0;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 16.2px;
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: none;
  color: #333;
  cursor: pointer;
}
.trd-feed__cat.is-active { background: #f2f2f2; }
/* «Все» показываем только когда лента отфильтрована — так же, как было */
.trd-feed__cat[data-cat=""] { display: none; }
.trd-feed.is-filtered .trd-feed__cat[data-cat=""] { display: inline-block; }

/* сетка карточек */
.trd-feed__grid,
#allrecords .trd-feed__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 40px;
  row-gap: 90px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Подсказка «листайте вбок» нужна только когда карточки лежат лентой. */
.trd-feed__hint { display: none; }
.trd-feed__hint-dot {
  animation: trd-feed-hint 2.9s infinite linear;
}
@keyframes trd-feed-hint {
  0%   { opacity: 1; transform: translateX(0);      width: 16px; animation-timing-function: ease-in-out; }
  27%  { opacity: 1; transform: translateX(-20px);  width: 21px; animation-timing-function: ease-out; }
  37%  { opacity: 1; transform: translateX(-22px);  width: 16px; animation-timing-function: ease-in-out; }
  54%  { opacity: 0; transform: translateX(-22px);  width: 16px; animation-timing-function: ease-in-out; }
  100% { opacity: 0; transform: translateX(-22px);  width: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .trd-feed__hint-dot { animation: none; }
}

.trd-feed__item { display: block; }
.trd-feed__item[data-trd-hidden] { display: none; }

.trd-feed__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .3);
  text-decoration: none;
  color: #333;
}
.trd-feed__img {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  border-radius: 5px 5px 0 0;
  background-size: cover;
  background-position: center;
  background-color: #f2f2f2;
}
.trd-feed__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 20px;
}
.trd-feed__text { display: block; }
.trd-feed__title {
  display: block;
  padding-bottom: 10px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  color: #333;
}
.trd-feed__descr {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 300;
  color: #333;
}
.trd-feed__meta {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}
.trd-feed__date,
.trd-feed__tag {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 1px;
  color: #333;
}
.trd-feed__card:hover .trd-feed__title { opacity: .7; }

/* «Загрузить еще» */
.trd-feed__morewrap {
  display: flex;
  justify-content: center;
  padding-top: 90px;
}
.trd-feed__more {
  padding: 18.8px 60px;
  border: 0;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 22.4px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}
.trd-feed__morewrap[hidden] { display: none; }


/* ─── верхняя полоса страницы статьи ──────────────────────────────────────── */
/* Белая полоса поверх страницы: стрелка «назад» в ленту, название ленты и
   «поделиться». Размеры и цвета сняты с прежнего релиза. */
.trd-postbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .2);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  font-family: Arial, Helvetica, sans-serif;
}
.trd-postbar__back {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 23px;
  height: 23px;
  line-height: 0;
}
.trd-postbar__chevron { transform: rotate(180deg); vertical-align: top; }
.trd-postbar__title {
  display: inline-block;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: #333;
  opacity: .8;
}
/* Значок «поделиться» стоял ровно под круглой кнопкой меню и мышью не
   нажимался. Сдвигаем его левее ширины этой кнопки — сама полоса, её высота
   и стиль остаются прежними. Кнопка меню не двигается. */
.trd-postbar__share { position: absolute; right: 88px; z-index: 10; }
.trd-postbar__share-btn {
  display: block;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.trd-postbar__share-panel {
  position: absolute;
  right: -2px;
  top: 30px;
  z-index: 15;
  display: flex;
  padding: 15px 10px;
  border-radius: 5px;
  background: #333;
  box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.trd-postbar__share-panel[hidden] { display: none; }
.trd-postbar__share-arrow {
  position: absolute;
  right: 8px;
  top: -13px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-bottom: 8px solid #333;
}
.trd-postbar__badge {
  display: block;
  width: 23px;
  height: 23px;
  line-height: 0;
}
.trd-postbar__badge + .trd-postbar__badge { margin-left: 4px; }
.trd-postbar__badge_fb { background: #3b5998; }
.trd-postbar__badge_x { background: #000; }

/* ─── статья ──────────────────────────────────────────────────────────────── */
.trd-article {
  box-sizing: border-box;
  max-width: 800px;          /* 760 текста + по 20 полей */
  margin: 0 auto;
  padding: 95px 20px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333;
}
.trd-article__head { padding: 0 0 15px; }
.trd-article__title {
  margin: 0;
  font-size: 36px;
  line-height: 1.23;
  font-weight: 600;
  color: #333;
}
.trd-article__cover { margin: 15px 0 30px; }
.trd-article__cover img { display: block; width: 100%; height: auto; }

.trd-article__p,
.trd-article__list {
  margin: 0 0 12px;
  padding: 4px 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 300;
}
.trd-article__list { padding-left: 20px; }
/* У самого первого блока текста верхнего поля не было — так и оставляем,
   иначе всё содержимое статьи съезжает вниз на четыре пикселя. */
.trd-article__body > :first-child { padding-top: 0; margin-top: 0; }
.trd-article__list li { margin: 0; }
/* Цвет ссылок в тексте статьи задают общие стили сайта — так было и раньше,
   поэтому своего цвета здесь не назначаем. */

.trd-article__h2,
.trd-article__h3,
.trd-article__h4 {
  margin: 32px 0 12px;
  padding: 4px 0;
  line-height: 1.3;
  font-weight: 700;
  word-break: break-word;
}
.trd-article__h2 { font-size: 30px; }
.trd-article__h3 { font-size: 28px; }
.trd-article__h4 { font-size: 22px; }

.trd-article__quote {
  margin: 16px 0;
  padding-left: 20px;
  border-left: 3px solid #333;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 300;
}
.trd-article__figure { margin: 16px 0; }
.trd-article__img { display: block; width: 100%; height: auto; }
.trd-article__caption { margin-top: 5px; font-size: 18px; font-style: italic; opacity: .5; }
/* Таблица — как в прежней вёрстке: прокрутка вбок, обёртка по содержимому,
   рамка цветом текста с прозрачностью, внутренний блок ячейки. */
.trd-article__tableview {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 13px 4px 13px 0;
  position: relative;
}
.trd-article__tableview * { box-sizing: inherit; }
.trd-article__tablewrap { margin-bottom: 16px; position: relative; width: fit-content; }
.trd-article__table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
  table-layout: auto;
}
.trd-article__tr { padding: 0; }
.trd-article__tr + .trd-article__tr .trd-article__td { border-top: none; }
.trd-article__td {
  border: 1px solid color-mix(in srgb, currentcolor 25%, transparent 75%);
  position: relative;
  text-align: start;
  vertical-align: top;
}
.trd-article__td + .trd-article__td { border-left: none; }
.trd-article__td-in {
  font-size: 14px;
  line-height: 1;
  max-width: 100%;
  min-height: 34px;
  padding: 9px;
  white-space: pre-wrap;
  width: 100%;
  word-break: break-word;
}

/* видео в тексте — та же пропорция 16:9 и тот же отступ сверху */
.trd-article__embed {
  position: relative;
  height: 0;
  padding: 25px 0 56.25%;
}
.trd-article__embed iframe {
  position: absolute;
  top: 25px;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* подпись автора */
.trd-article__author {
  display: flex;
  align-items: center;
  margin-top: 35px;
  text-decoration: none;
}
.trd-article__author-img {
  display: block;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #f2f2f2;
}
.trd-article__author-name {
  font-size: 14px;
  line-height: 1.55;
  font-weight: 300;
  color: #333;
}

/* метка раздела */
.trd-article__tags { display: flex; margin-top: 45px; }
.trd-article__tag { text-decoration: none; }
.trd-article__tag-label {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 1px;
  color: #333;
}

/* ─── смотрите также ──────────────────────────────────────────────────────── */
/* Список строк в той же колонке, что и статья: слева маленькая картинка,
   справа заголовок и подводка. */
/* Блок стоит внутри статьи, в той же колонке — своей ширины ему не нужно. */
.trd-related { font-family: Arial, Helvetica, sans-serif; }
.trd-related__label {
  margin: 100px 0 45px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: #333;
}
.trd-related__item {
  display: flex;
  margin-bottom: 25px;
  text-decoration: none;
  color: #333;
}
.trd-related__img {
  flex: 0 0 100px;
  width: 100px;
  height: 66px;
  margin-right: 15px;
  background-size: cover;
  background-position: center;
  background-color: #f2f2f2;
}
.trd-related__text { display: block; }
.trd-related__title {
  display: block;
  margin-bottom: 3px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: #333;
}
.trd-related__descr {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 300;
  color: #333;
}
.trd-related__item:hover .trd-related__title { opacity: .7; }

/* ─── от 981 до 1200 ──────────────────────────────────────────────────────── */
@media screen and (max-width: 1200px) {
  .trd-feed { max-width: 940px; padding: 0 20px; }
  .trd-feed__grid { column-gap: 20px; }

  .trd-article { max-width: 660px; }
  .trd-article__title { font-size: 32px; }
  .trd-article__p,
  .trd-article__list,
  .trd-article__quote { font-size: 18px; }
  .trd-article__h2 { font-size: 28px; }
  .trd-article__h3 { font-size: 26px; }
  .trd-article__h4 { font-size: 20px; }
  .trd-article__caption { font-size: 16px; }
}

/* ─── до 980: лента становится лентой прокрутки ───────────────────────────── */
@media screen and (max-width: 980px) {
  .trd-feed { max-width: none; padding: 0; }
  .trd-feed__cats,
  #allrecords .trd-feed__cats { padding: 0 20px; }
  .trd-feed__hint {
    display: block;
    padding: 0 20px 10px 0;
    text-align: right;
    line-height: 0;
    mix-blend-mode: multiply;
  }
  .trd-feed__grid,
  #allrecords .trd-feed__grid {
    display: flex;
    grid-template-columns: none;
    gap: 10px;
    padding: 10px 20px;
    overflow-x: auto;
    /* Без этого привязка к позициям съедает левое поле и первая карточка
       прилипает к краю экрана. */
    scroll-padding-left: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .trd-feed__item { flex: 0 0 33.5vw; max-width: 33.5vw; scroll-snap-align: start; }

  .trd-article { max-width: 680px; }
}

/* ─── до 640 ──────────────────────────────────────────────────────────────── */
@media screen and (max-width: 640px) {
  .trd-postbar { height: 50px; }
  .trd-postbar__title { font-size: 12px; }

  .trd-feed__item { flex-basis: 63.5vw; max-width: 63.5vw; }

  .trd-article { max-width: none; }
  .trd-article__title { font-size: 28px; }
  .trd-article__p,
  .trd-article__list,
  .trd-article__quote { font-size: 16px; }
  .trd-article__h2 { font-size: 26px; }
  .trd-article__h3 { font-size: 24px; }
  .trd-article__h4 { font-size: 18px; }
  .trd-article__cover { margin: 0 0 20px; }
  .trd-article__author-name { font-size: 12px; }
  .trd-article__tags { margin-top: 25px; }

  .trd-related__label { margin: 45px 0 35px; font-size: 18px; }
  .trd-related__img { flex-basis: 60px; width: 60px; margin-right: 10px; }
  .trd-related__item { margin-bottom: 20px; }
  .trd-related__title { font-size: 12px; line-height: 1.35; }
  .trd-related__descr { font-size: 12px; line-height: 1.55; }
}

/* ─── совсем узкие экраны ─────────────────────────────────────────────────── */
/* На ширине меньше 360 точек подпись полосы дотягивается до значка
   «поделиться». Разрешаем ей перенос — полоса становится на строку выше, зато
   ничто ни на что не налезает. Выше 360 точек ничего не меняется. */
@media screen and (max-width: 359px) {
  .trd-postbar__title { max-width: calc(100% - 216px); }
}

/* ─── до 480 ──────────────────────────────────────────────────────────────── */
@media screen and (max-width: 480px) {
  .trd-feed__item { flex-basis: 85vw; max-width: 85vw; }
  .trd-feed__title { font-size: 14px; }

  .trd-article { padding: 70px 20px; }
}
