/* ==========================================================================
   HOMEPAGE BLOG PREVIEW SECTION
   ========================================================================== */

/* --- НОВЫЙ КОНТЕЙНЕР (управляем шириной) --- */
.hp-blog-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

@media screen and (max-width: 767px) {
  .hp-blog-container {
    padding: 0 10px;
  }
}

.hp-blog-section {
  padding-top: 100px;
  padding-bottom: 120px;
  background-color: transparent;
}

/* --- Заголовок секции --- */
.hp-section-header {
  display: flex;
  align-items: baseline;
  gap: 40px;
  margin-bottom: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
}

.hp-header-subtitle {
  font-family: "Polaris", "Lato", sans-serif;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
  min-width: 150px;
}

.hp-header-title {
  font-family: "Polaris", "Lato", sans-serif;
  font-size: 42px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
}

/* --- Сетка карточек --- */
.hp-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* --- Карточка статьи --- */
.hp-blog-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s ease;
}

.hp-blog-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(192, 17, 1, 0.3);
  transform: translateY(-5px);
}

/* Картинка */
.hp-blog-img-wrapper {
  display: block;
  width: 100%;
  height: 240px;
  overflow: hidden;
  position: relative;
  background-color: #111;
}

.hp-blog-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hp-blog-card:hover .hp-blog-img {
  transform: scale(1.05);
}

/* Контент внутри карточки */
.hp-blog-content {
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hp-blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-family: "Lato", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
}

.hp-blog-date {
  color: #888;
}

.hp-blog-tag {
  color: #c01101;
  font-weight: 700;
  letter-spacing: 1px;
}

.hp-blog-title-link {
  text-decoration: none;
  margin-bottom: 15px;
}

.hp-blog-title {
  font-family: "Lato", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
  transition: color 0.3s ease;
}

.hp-blog-card:hover .hp-blog-title {
  color: #c01101;
}

.hp-blog-excerpt {
  font-family: "Lato", sans-serif;
  font-size: 14px;
  color: #a0a0a0;
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
}

/* Ссылка "Читать" */
.hp-blog-read-more {
  display: inline-block;
  font-family: "Polaris", "Lato", sans-serif;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  align-self: flex-start;
}

.hp-blog-read-more::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: #c01101;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.hp-blog-card:hover .hp-blog-read-more::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Контейнер для кнопки */
.hp-blog-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 0px;
}

/* ==========================================================================
   RESPONSIVE (АДАПТИВНОСТЬ)
   ========================================================================== */

@media screen and (max-width: 991px) {
  .hp-section-header {
    flex-direction: column;
    gap: 10px;
  }
  .hp-header-title {
    font-size: 32px;
  }
  .hp-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .hp-blog-section {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .hp-header-title {
    font-size: 26px;
  }
  .hp-blog-grid {
    grid-template-columns: 1fr;
  }
  .hp-blog-btn-wrapper a {
    width: 100%; /* На мобилке кнопка на всю ширину */
  }
}

@media screen and (max-width: 767px) {
    /* Делаем контейнер фильтров гибким и разрешаем скролл */
    .blog-filters {
        display: flex !important;
        justify-content: flex-start !important; /* ИСПРАВЛЯЕТ ЗАЛИПАНИЕ СЛЕВА */
        overflow-x: auto !important;
        white-space: nowrap !important;
        
        /* Добавляем боковые отступы, чтобы кнопки не липли к краям экрана */
        padding-left: 20px !important; 
        padding-right: 20px !important;
        padding-bottom: 12px !important;
        gap: 10px !important;
        
        /* Скрываем полосу прокрутки */
        -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
    }
    .blog-filters::-webkit-scrollbar {
        display: none !important; /* скрываем скроллбар */
    }
    
    /* Кнопки фильтра не сжимаются */
    .filter-btn {
        flex: 0 0 auto !important;
    }
}