/* Редизайн блога (/blog/, категории блога, сайдбар статьи) — отдельный файл, не трогает основной style.css */

/* --- заголовок секции + поиск --- */
.box_zag_blog {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}

.box_zag_blog h1 {
  flex: 0 0 auto;
}

.box_zag_tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.box_zag_tools .box_blog_cat {
  max-width: 100%;
  flex: 1 1 320px;
}

.box_blog_search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 240px;
}

.box_blog_search input[type="text"] {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 22px;
  background: #fff;
  padding: 0 44px 0 18px;
  font-size: 14px;
  color: #000;
  outline: none;
  transition: border-color .2s ease;
}

.box_blog_search input[type="text"]:focus {
  border-color: var(--main-color);
}

.box_blog_search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--main-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

[data-theme=dark_theme] .box_blog_search input[type="text"] {
  background: #1d1d1d;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 767px) {
  .box_zag_tools {
    justify-content: flex-start;
  }

  .box_blog_search {
    width: 100%;
  }
}

/* --- герой: топ-материал + список хэдлайнов --- */
.box_hero_blog {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.hero_main {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 460px;
  box-shadow: 0 4px 60px rgba(0, 0, 0, 0.08);
}

.hero_main_img {
  position: absolute;
  inset: 0;
}

.hero_main_img picture,
.hero_main_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero_main_img a {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hero_main_img::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
}

.hero_main_content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #fff;
  min-height: 460px;
  justify-content: flex-end;
}

.hero_main_content .box_badge {
  align-self: flex-start;
}

.hero_main_content h2 {
  font-size: 32px;
  line-height: 124%;
  color: #fff;
  margin: 0;
  max-width: 90%;
}

.hero_main_excerpt {
  margin: 0;
  max-width: 85%;
  font-size: 15px;
  line-height: 150%;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero_main_meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.hero_main_meta .box_date,
.hero_main_meta .box_readtime {
  color: inherit;
}

.hero_main_content .btn_more {
  align-self: flex-start;
}

.hero_list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero_list_item {
  position: relative;
  display: flex;
  gap: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.05);
  flex: 1 1 auto;
  transition: box-shadow .2s ease, transform .2s ease;
}

.hero_list_item:hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

[data-theme=dark_theme] .hero_list_item {
  background: #131313;
}

.hero_list_img {
  position: relative;
  width: 88px;
  flex: 0 0 88px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.hero_list_img picture,
.hero_list_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero_list_img a {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hero_list_content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hero_list_content a {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hero_list_cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--main-color);
  letter-spacing: .02em;
}

.hero_list_content p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 134%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero_list_content .box_date {
  font-size: 12px;
  opacity: .6;
}

@media (max-width: 991px) {
  .box_hero_blog {
    grid-template-columns: 1fr;
  }

  .hero_main,
  .hero_main_content {
    min-height: 360px;
  }

  .hero_main_content h2 {
    font-size: 24px;
    max-width: 100%;
  }

  .hero_main_excerpt {
    max-width: 100%;
  }
}

@media (max-width: 479px) {
  .hero_main_content {
    padding: 22px;
  }
}

/* --- модернизированная карточка статьи --- */
.card_article .card_inner {
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.05);
  transition: box-shadow .25s ease, transform .25s ease;
}

.card_article:hover .card_inner {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.card_article .article_img img {
  transition: transform .4s ease;
}

.card_article:hover .article_img img {
  transform: translate(-50%, -50%) scale(1.06);
}

.card_article .article_head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card_article .box_readtime {
  font-size: 12px;
  opacity: .55;
  position: relative;
  padding-left: 10px;
}

.card_article .box_readtime::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}

.card_article .article_excerpt {
  margin-top: 6px;
}

.card_article .article_excerpt p {
  margin: 0;
  font-size: 13px;
  line-height: 150%;
  opacity: .62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* в сайдбаре статьи (p_article) и в узких карточках хедлайнов карточка компактнее — без отрывка */
.p_article .col_right .card_article .article_excerpt,
.hero_list .article_excerpt {
  display: none;
}

/* --- карточная сетка: "Все статьи", поиск, "Читайте дальше" --- */
.box_cards {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px -30px;
}

.box_cards .card_article {
  width: 25%;
  margin-bottom: 30px;
}

@media (max-width: 1199px) {
  .box_cards .card_article {
    width: 33.33%;
  }
}

@media (max-width: 767px) {
  .box_cards .card_article {
    width: 50%;
  }
}

@media (max-width: 479px) {
  .box_cards .card_article {
    width: 100%;
  }
}

/* --- бесконечная подгрузка (вместо пагинации) --- */
.js_infinite_sentinel {
  height: 1px;
}

.js_infinite_loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px 0;
}

.js_infinite_loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--main-color);
  opacity: .4;
  animation: sm_dot_bounce 1s infinite ease-in-out;
}

.js_infinite_loader span:nth-child(2) { animation-delay: .15s; }
.js_infinite_loader span:nth-child(3) { animation-delay: .3s; }

@keyframes sm_dot_bounce {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

.js_infinite_end {
  display: none;
  text-align: center;
  padding: 24px 0 10px;
  font-size: 14px;
  opacity: .5;
}

/* --- "Читайте дальше" на странице статьи --- */
.s_read_next {
  margin-top: 10px;
}

/* --- облако тегов блога --- */
.s_tags .box_blog_cat li a {
  text-transform: none;
}
