/* ===== Блог: список и статья =====
   Дизайн по референсу offix-roz.tilda.ws/blog.
   Шрифт Onest подключён в шапке сайта. */

.blog-wrap,
.blog-article {
  font-family: "Onest", "Roboto", Arial, sans-serif;
  color: #111111;
}

/* ---------- список ---------- */
.blog-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 80px;
}

.blog-title {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  color: #111111;
  margin: 0 0 30px;
  padding: 0;
}

/* рубрикатор (категории) — чипсы как на Тильде */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.blog-filter__item {
  display: inline-block;
  padding: 7px 14px;
  background: #f2f2f2;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #333333;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.blog-filter__item:hover {
  background: #e3e3e3;
}

.blog-filter__item.is-active {
  background: #0047ab;
  color: #ffffff;
}

/* сетка карточек */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 40px;
}

.blog-card {
  display: block;
  text-decoration: none;
  color: #111111;
}

.blog-card__img {
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 4px;
}

.blog-card__img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card__img img {
  transform: scale(1.03);
}

/* заглушка, если обложки нет */
.blog-card__noimg {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f0f0f0;
}

/* бейджи категорий поверх картинки */
.blog-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-card__badge {
  display: inline-block;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.blog-card__date {
  font-size: 13px;
  color: #999999;
  margin-bottom: 8px;
}

.blog-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.blog-card:hover .blog-card__title {
  color: #f31014;
}

.blog-card__descr {
  font-size: 15px;
  line-height: 1.55;
  color: #777777;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.blog-card__descr p {
  margin: 0;
}

/* кнопка «Читать полностью» */
.blog-card__more {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid #111111;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111111;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.blog-card__more-arrow {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-card__more {
  background: #111111;
  color: #ffffff;
}

.blog-card:hover .blog-card__more-arrow {
  transform: translateX(4px);
}

.blog-empty {
  padding: 60px 0;
  text-align: center;
  color: #777777;
}

/* пагинация */
.blog-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 60px;
}

.blog-pager__item {
  display: inline-block;
  min-width: 40px;
  padding: 9px 0;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 15px;
  color: #333333;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.blog-pager__item:hover {
  border-color: #f31014;
  color: #f31014;
}

.blog-pager__item.is-active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

/* ---------- страница статьи ---------- */
.blog-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 13px;
}

.blog-article__date {
  color: #999999;
}

.blog-article__cat {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f31014;
  text-decoration: none;
}

.blog-article__cat:hover {
  text-decoration: underline;
}

.blog-article__title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 30px;
}

.blog-article__cover {
  margin-bottom: 36px;
}

.blog-article__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* типографика текста статьи */
.blog-article__content {
  font-size: 18px;
  line-height: 1.6;
  color: #333333;
}

.blog-article__content p {
  margin: 0 0 24px;
}

.blog-article__content h2,
.blog-article__content h3,
.blog-article__content h4 {
  color: #111111;
  font-weight: 700;
  line-height: 1.3;
  margin: 40px 0 20px;
}

.blog-article__content h2 {
  font-size: 26px;
}
.blog-article__content h3 {
  font-size: 22px;
}
.blog-article__content h4 {
  font-size: 19px;
}

.blog-article__content ul,
.blog-article__content ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.blog-article__content li {
  margin-bottom: 12px;
}

.blog-article__content a {
  color: #0047ab;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 71, 171, 0.35);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.blog-article__content a:hover {
  color: #f31014;
  border-bottom-color: rgba(243, 16, 20, 0.5);
}

.blog-article__content hr {
  border: 0;
  border-top: 1px solid #e5e5e5;
  margin: 40px 0;
}

.blog-article__content blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid #f31014;
  font-size: 19px;
  font-weight: 500;
  color: #111111;
}

.blog-article__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
}

.blog-article__content th,
.blog-article__content td {
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  text-align: left;
}

.blog-article__content th {
  background: #f7f7f7;
  font-weight: 600;
}

/* картинки внутри текста (конвертер даёт .t-figure / .t-caption) */
.blog-article__content .t-figure {
  margin: 32px 0;
}

.blog-article__content .t-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.blog-article__content .t-caption {
  margin-top: 10px;
  font-size: 14px;
  color: #999999;
}

.blog-article__content .t-preface {
  font-size: 20px;
  font-weight: 500;
  color: #111111;
  margin: 0 0 28px;
}

.blog-article__back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}

.blog-article__back a {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-article__back a:hover {
  color: #f31014;
}

.blog-404 p {
  font-size: 16px;
  color: #555555;
}

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-article__title {
    font-size: 26px;
  }

  .blog-article__content {
    font-size: 16px;
  }
}
