/* components/blog_card/blog_card.css */

.blog-card {
    position: relative;
    background: #fff;
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0,0,0,.12);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.3s;
    box-sizing: border-box;
    text-decoration: none;
}

.blog-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.blog-card__media {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.blog-card__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.blog-card__title {
    display: block;
    min-height: 3.2em;
    color: #1a1a1a;
    line-height: 1.2;
    margin-top: auto; /* Прижимает заголовок ровно вниз, если картинки разной высоты */
}

.blog-card__title:hover { color: #167f2b; }

.title-mobile { display: none; }
.title-desktop { display: inline; }
.blog-card__mobile-side { display: none; }

/* Медиа правила для адаптива карточек */
@media (min-width: 601px) and (max-width: 1025px) {
    .blog-card {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .blog-card {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        align-items: flex-start;
        height: auto !important;
        min-height: auto !important;
    }

    /* На мобильных заголовок становится главным верхним блоком */
    .blog-card__title {
        order: 1;
        width: 100%;
        display: block;
        min-height: auto;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
        box-sizing: border-box;
        line-height: 1.2;
        margin-top: 0;
    }

    /* Левая фото-панель для мобильных */
    .blog-card__mobile-side {
        display: block;
        order: 2;
        width: 25%;
        height: 90px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .blog-card__media { display: none; }

    .title-desktop { display: none; }
    .title-mobile {
        display: inline;
        font-size: 14px;
        line-height: 1.2;
    }
}
