.blog-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #f6f0ff 0%, #f5f3ff 100%);
}

.blog-section__header {
    max-width: 720px;
    margin: 0 auto 40px;
    text-align: center;
}

.blog-section__header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.blog-section__header p {
    font-size: 16px;
    line-height: 1.6;
    color: #4b4b4b;
}

/* Карусель */

.blog-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px; /* место для стрелок */
}

/* трек Swiper — обёртка для слайдов */
.blog-carousel .swiper-wrapper {
    padding: 8px 0 16px;
}

/* карточки внутри карусели */
.blog-carousel .blog-card {
    height: 100%;
}


/* Карточка (в списке и карусели) */

.blog-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(82, 59, 150, 0.08);
}

.blog-card__image-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-card__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    color: #222;
}

.blog-card__excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
    /* Ограничение текста (3 строки) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__more {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: #6b3df0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Страница списка блогов */

.blog-list {
    padding: 60px 0 100px;
}

.blog-list__header {
    margin-bottom: 48px;
    max-width: 600px;
}

.blog-list__header h1 {
    font-size: 40px;
    margin-bottom: 16px;
}

/* Сетка карточек */

.blog-list__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    row-gap: 40px;
}

/* Адаптивность для мобильных и планшетов */

@media (max-width: 1024px) {
    .blog-list__grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .blog-list {
        padding: 36px 0 56px;
    }

    .blog-list__header {
        padding: 0 16px;
        margin-bottom: 24px;
    }

    .blog-list__header h1 {
        font-size: 26px;
    }

    .blog-list__grid {
        grid-template-columns: 1fr;
        row-gap: 32px;
        padding: 0 16px;
    }

    .blog-carousel .blog-card,
    .blog-list__grid .blog-card {
        height: auto;
    }

    /* Увеличение картинок в карточках на мобильных */
    .blog-card__image-link {
        aspect-ratio: auto;
        height: 240px;
    }
}


/* Детальная страница статьи (Content Fixes) */

.blog-card__meta {
    font-size: 12px;
    color: #888;
    margin: 0 0 6px;
}

/* Блог: контент статьи — картинки/медиа не должны вылезать за экран */
.blog-detail__content img,
.blog-detail__content picture,
.blog-detail__content figure,
.blog-detail__content iframe,
.blog-detail__content video {
  max-width: 100%;
}

.blog-detail__content img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Обработка inline-размеров из редактора */
.blog-detail__content img[width],
.blog-detail__content img[height] {
  width: 100% !important;
  height: auto !important;
}

.blog-detail__hero {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 32px;
}

.blog-detail__hero-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

@media (max-width: 768px) {
  .blog-detail__hero-img {
    max-height: 55vh;
  }
}

/* Пагинация */

.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.pagination__link {
    text-decoration: none;
    color: #6b3df0;
    font-weight: 500;
}

.pagination__link:hover {
    text-decoration: underline;
}