/* ==========================================================================
   БЛОГ АТМОСФЕРА — Современный журнальный листинг (Bento 3 колонки)
   ========================================================================== */

.blog_page {
  background-color: #ffffff;
  padding: 28px 0 60px;
  color: #0f172a;
}

.blog_container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- 1. Шапка блога --- */
.blog_hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .blog_hero {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
  }
}

.blog_title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

@media (min-width: 992px) {
  .blog_title {
    font-size: 40px;
  }
}

.blog_subtitle {
  font-size: 16px;
  line-height: 1.5;
  color: #475569;
  margin: 0;
  max-width: 640px;
}

/* Поле быстрого поиска по статьям */
.blog_search_wrap {
  position: relative;
  /* width: 100%;
  max-width: 300px;
  flex-shrink: 0; */
}

.blog_search_input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background-color: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.blog_search_input::placeholder {
  color: #94a3b8;
}

.blog_search_input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #1d70b8;
  box-shadow: 0 0 0 3px rgba(29, 112, 184, 0.12);
}

.blog_search_icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* --- 2. Навигация по категориям (табы-пилюли) --- */
.blog_categories_nav {
  margin-bottom: 30px;
}

.blog_categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog_cat_pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  border-radius: 999px;
  background-color: #f1f5f9;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.blog_cat_pill span {
  font-weight: 500;
  opacity: 0.8;
}

.blog_cat_pill:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.blog_cat_pill.active {
  background-color: #8cc63f;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(140, 198, 63, 0.28);
}

.blog_cat_pill.active span {
  opacity: 0.95;
}

/* --- 3. Bento-сетка (3 колонки на десктопе) --- */
.blog_grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (min-width: 680px) {
  .blog_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog_grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}

/* --- 4. Карточка статьи (базовая) --- */
.blog_card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  position: relative;
}

.blog_card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.blog_card[hidden] {
  display: none;
}

/* Обложка 16:9 */
.blog_card_media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f1f5f9;
  flex-shrink: 0;
}

.blog_card_media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.blog_card:hover .blog_card_media img {
  transform: scale(1.04);
}

/* Тело карточки */
.blog_card_body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 20px 22px 22px;
}

/* Мета-строка (бейдж категории + время чтения) */
.blog_card_meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.blog_badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s ease;
  position: relative;
  z-index: 2;
}

.blog_badge:hover {
  opacity: 0.85;
}

.badge-green {
  background-color: #ecfccb;
  color: #3f6212;
}

.badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

.blog_read_time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

/* Заголовок статьи (кликабельна вся карточка через ::after) */
.blog_card_title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
  margin: 0 0 10px 0;
  color: #0f172a;
}

.blog_card_title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog_card_title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.blog_card:hover .blog_card_title a {
  color: #1d70b8;
}

/* Анонс (строго до 3 строк, без обрывов слов) */
.blog_card_excerpt {
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 18px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Подвал карточки */
.blog_card_footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blog_read_more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  color: #65a30d;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog_read_more span {
  transition: transform 0.2s ease;
}

.blog_card.theme-blue .blog_read_more {
  color: #1d70b8;
}

.blog_card:hover .blog_read_more span {
  transform: translateX(4px);
}

.blog_card_date {
  font-size: 12px;
  color: #94a3b8;
}

/* --- 5. Флагманская (первая) карточка на 2 колонки (десктоп) --- */
@media (min-width: 1024px) {
  .blog_card--featured {
    grid-column: span 2;
    flex-direction: row;
  }

  .blog_card--featured .blog_card_media {
    width: 52%;
    aspect-ratio: auto;
    min-height: 310px;
  }

  .blog_card--featured .blog_card_body {
    width: 48%;
    padding: 26px 28px;
    justify-content: center;
  }

  .blog_card--featured .blog_card_title {
    font-size: 23px;
    line-height: 1.28;
    margin-bottom: 12px;
  }

  .blog_card--featured .blog_card_excerpt {
    -webkit-line-clamp: 4;
    font-size: 15px;
  }
}

/* --- 6. Типографическая карточка (когда у статьи нет фото) --- */
.blog_card--typographic {
  border-color: transparent;
}

.blog_card--typographic.theme-blue {
  background: linear-gradient(160deg, #f0f7ff 0%, #e6f0fd 100%);
  border-color: #dbeafe;
}

.blog_card--typographic.theme-green {
  background: linear-gradient(160deg, #f4faeb 0%, #eaf6d8 100%);
  border-color: #dcfce7;
}

.blog_card_icon_box {
  padding: 22px 22px 0;
  display: flex;
  align-items: center;
}

.blog_card--typographic.theme-blue .blog_card_icon_box {
  color: #1d70b8;
}

.blog_card--typographic.theme-green .blog_card_icon_box {
  color: #65a30d;
}

.blog_card--typographic .blog_card_body {
  padding-top: 14px;
}

.blog_card--typographic .blog_card_title {
  font-size: 21px;
  line-height: 1.3;
}

/* --- 7. Нативный блок вызова инженера внутри сетки --- */
.blog_cta_card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #8cc63f 0%, #6ea825 100%);
  border-radius: 16px;
  padding: 24px 22px 0;
  color: #ffffff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px rgba(140, 198, 63, 0.25);
}

.blog_cta_content {
  position: relative;
  z-index: 2;
}

.blog_cta_tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.blog_cta_title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.28;
  margin: 0 0 10px 0;
  color: #ffffff;
}

.blog_cta_desc {
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 18px 0;
  color: rgba(255, 255, 255, 0.92);
}

.blog_cta_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: #1e293b;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.blog_cta_btn:hover {
  background-color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.blog_cta_img {
  width: 140px;
  height: auto;
  align-self: flex-end;
  margin-top: -12px;
  margin-right: -8px;
  pointer-events: none;
  user-select: none;
}

/* --- 8. Пустой результат поиска --- */
.blog_empty_search {
  text-align: center;
  padding: 48px 20px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  margin-top: 20px;
}

.blog_empty_search[hidden] {
  display: none;
}

.blog_empty_search p {
  font-size: 16px;
  color: #475569;
  margin: 0 0 16px 0;
}

.blog_reset_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background-color: #1d70b8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.blog_reset_btn:hover {
  background-color: #165994;
}
