/* =========================================================
   ЛЕНТА ЗАПИСЕЙ (МАКЕТ ASTRA BLOG LAYOUT 5)
   ========================================================= */
.ast-blog-layout-5-grid {
	margin-top: 50px !important;
}

.ast-blog-layout-5-grid .post {
	margin-top: 0 !important;
}

/* 1. Настраиваем Grid-сетку для контейнера */
.ast-blog-layout-5-grid .ast-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    align-items: stretch;
    margin: 0;
}

.ast-blog-layout-5-grid .ast-grid-common-col {
	border-radius: 10px;
    background: #fff;
}

/* Отключаем дефолтные флоаты Astra */
.ast-blog-layout-5-grid .ast-row::before,
.ast-blog-layout-5-grid .ast-row::after { 
    display: none !important; 
}

/* 2. Сбрасываем колонки Astra (она пыталась делить фото и текст 50/50) */
.ast-blog-layout-5-grid .ast-blog-featured-section,
.ast-blog-layout-5-grid .post-content {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

/* 3. Оформляем саму карточку */
.ast-blog-layout-5-grid .ast-article-inner {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0 !important;
}

.ast-blog-layout-5-grid .ast-article-inner:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* 4. Картинка (одинаковая высота + зум при наведении) */
.ast-blog-layout-5-grid .ast-blog-featured-section {
    height: 220px;
    overflow: hidden;
    margin: 0 !important;
}

.ast-blog-layout-5-grid .ast-blog-featured-section img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Обрезает фото под размер без искажений */
    transition: transform 0.5s ease;
    display: block;
	transform: scale(0.9);
}

.ast-blog-layout-5-grid .ast-article-inner:hover .ast-blog-featured-section img {
    transform: scale(1);
}

/* 5. Текстовая часть карточки */
.ast-blog-layout-5-grid .post-content {
    padding: 25px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Растягивает блок, выравнивая низ карточек */
}

/* Заголовок */
.ast-blog-layout-5-grid .post-content .entry-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.ast-blog-layout-5-grid .post-content .entry-title a {
    color: var(--ink-2);
    text-decoration: none;
    box-shadow: none;
    transition: color 0.2s;
}

.ast-blog-layout-5-grid .post-content .entry-title a:hover {
    color: var(--teal-dark);
}

/* Описание (Excerpt) */
.ast-blog-layout-5-grid .ast-excerpt-container {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.2;
    margin-bottom: 20px;
    flex-grow: 1; /* Отталкивает теги в самый низ */
}

.ast-blog-layout-5-grid .ast-excerpt-container p {
    margin: 0;
}

/* Теги (Метки) */
.ast-blog-layout-5-grid .ast-taxonomy-container.tags-links {
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.ast-blog-layout-5-grid .ast-taxonomy-container.tags-links a {
    color: #00b4a6;
    text-decoration: none;
    margin-right: 5px;
}

.ast-blog-layout-5-grid .ast-taxonomy-container.tags-links a:hover {
    text-decoration: underline;
}

/* Пагинация */
.ast-blog-layout-5-grid .ast-pagination {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 1. Жестко убиваем дефолтные отступы Astra у карточек, чтобы gap заработал по вертикали */
.ast-blog-layout-5-grid .ast-article-post {
    margin-bottom: 0 !important;
}

/* 2. Исправляем порядок элементов внутри карточки (чтобы картинка была строго сверху, а текст снизу) */
.ast-blog-layout-5-grid .ast-article-inner {
    display: flex !important;
    flex-direction: column !important;
}

/* Картинка первая */
.ast-blog-layout-5-grid .ast-blog-featured-section {
    order: 1 !important;
}

/* Текстовый блок второй */
.ast-blog-layout-5-grid .post-content {
    order: 2 !important;
}

@media (max-width: 720px) {
	.site .ast-blog-layout-5-grid .ast-row {
		grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	}
}	
	
	