/**
 * Blog Section Styles
 * Стили секции "Блог" согласно дизайну Figma
 */

/* === ОСНОВНАЯ СЕКЦИЯ === */
.blog {
    margin-top: 150px;
    position: relative;
}

.blog__container {
    max-width: 1320px;
    margin: 0 auto;
    /* padding: 0 20px; */
    display: flex;
    flex-direction: column;
    gap: 70px;
}

/* === ЗАГОЛОВОЧНАЯ ОБЛАСТЬ === */
.blog__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    text-align: center;
}

/* --- Бейдж --- */
.blog__badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog__badge-icon {
    flex-shrink: 0;
    width: 23px;
    height: 20px;
}

.blog__badge-text {
    color: var(--berloga-text, #1a1a1a);
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Основной заголовок --- */
.blog__title {
    /* Используем стили из typography.css */
    margin: 0;
    color: var(--berloga-text, #1a1a1a);
    font-family: 'Nunito', sans-serif;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

/* --- Декоративные лапки --- */
.blog__decoration {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 72px;
    z-index: 1;
}

.blog__decoration--left {
    left: -150px;
    transform: translateY(-50%) rotate(150deg) scaleY(-1);
}

.blog__decoration--right {
    right: -150px;
    transform: translateY(-50%) rotate(30deg);
}

.blog__paw {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* === СЕТКА КАРТОЧЕК === */
.blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    max-width: 1320px;
    margin: 0 auto;
}

/* === КАРТОЧКА СТАТЬИ === */
.blog__card {
    background: var(--berloga-white, #ffffff);
    border-radius: 30px;
    box-shadow: 0px 5px 30px 0px rgba(19, 19, 19, 0.07);
    width: 100%;
    /* height: 534px; */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog__card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 10px 40px 0px rgba(19, 19, 19, 0.12);
}

/* --- Изображение карточки --- */
.blog__card-image {
    height: 270px;
    min-height: 270px;
    overflow: hidden;
    position: relative;
}

.blog__card-img {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.blog__card:hover .blog__card-img {
    transform: scale(1.05);
}

/* --- Контент карточки --- */
.blog__card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 32px;
    gap: 32px;
    justify-content: space-between;
}

.blog__card-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog__card-title {
    color: var(--berloga-text, #1a1a1a);
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.blog__card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* --- Кнопка карточки --- */
.blog .blog__card .blog__card-button {
    background: var(--berloga-cyan, #4eb3ca) !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    color: var(--berloga-white, #ffffff) !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    min-width: auto !important;
}

.blog .blog__card .blog__card-button:hover {
    background: var(--berloga-dark-blue, #395e88) !important;
    transform: translateY(-1px) !important;
    color: var(--berloga-white, #ffffff) !important;
}

.blog .blog__card .blog__card-button:active {
    transform: translateY(0) !important;
}

/* --- Звездочка --- */
.blog__card-star {
    position: absolute;
    left: 32px;
    top: 246px;
    width: 48px;
    height: 48px;
    z-index: 2;
}

.blog__star-icon {
    width: 100%;
    height: 100%;
}

/* === ЗАГЛУШКА ОТСУТСТВИЯ СТАТЕЙ === */
.blog__no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--berloga-text, #1a1a1a);
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 400;
}

/* === АДАПТИВНОСТЬ === */

/* Большие экраны - 4 карточки по 2 в ряд */
@media (min-width: 1241px) {
    .blog__grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(1, 1fr);
        gap: 50px;
    }

    .blog__card:nth-child(4) {
        display: none;
    }
}

/* До 1240px - 3 карточки в ряд */
@media (max-width: 1240px) {
    .blog__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 40px;
    }

    .blog__card:nth-child(4) {
        display: flex;
    }
}

@media (max-width: 1320px) {
    .blog__container {
        padding: 0 20px;
    }

    .blog__decoration--left {
        left: -80px;
    }

    .blog__decoration--right {
        right: -80px;
    }
}

@media (max-width: 1200px) {
    .blog__grid {
        gap: 30px;
    }

    .blog__card {
        height: 520px;
    }

    .blog__decoration {
        display: none;
    }

    .blog__title {
        font-size: 42px;
    }
}

@media (max-width: 1024px) {
    .blog__container {
        gap: 40px;
    }

    .blog__grid {
        gap: 20px;
    }

    .blog__card {
        height: 500px;
    }

    .blog__title {
        font-size: 36px;
    }

    .blog__badge-text {
        font-size: 18px;
    }
}

/* С 768px и меньше - 3 карточки в столбик */
@media (max-width: 768px) {
    .blog {
        margin-top: 40px;
    }

    .blog__container {
        padding: 0 20px;
        gap: 30px;
    }

    .blog__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .blog__card {
        width: 100%;
        height: auto;
    }

    .blog__card-content {
        padding: 32px;
        gap: 20px;
    }

    .blog__card-title {
        font-size: 20px;
    }

    .blog__card-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }

    .blog .blog__card .blog__card-button {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    .blog__title {
        font-size: 28px;
        white-space: normal;
    }

    .blog__badge-text {
        font-size: 16px;
    }

    .blog__card-star {
        left: 24px;
        top: 244px;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .blog__container {
        padding: 0 20px;
    }

    .blog__card-content {
        padding: 20px;
        gap: 20px;
    }

    .blog__title {
        font-size: 24px;
    }

    .blog .blog__card .blog__card-button {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

/* Дополнительно для WordPress generated images */
.blog__card .wp-post-image {
    margin: 0 !important;
    height: 100% !important;
    object-fit: cover !important;
}