/**
 * Cards Styles
 * Глобальные стили для карточек записей (items_wrap и item_wrap)
 * Используется во всех модулях сайта
 */

 .blog_bg {
	display: flex;
	justify-content: space-between;
	gap: 20px;
}
/* ===================================
 Базовые стили для контейнера карточек
 =================================== */

 .items_wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 40px;
}

/* ===================================
 Базовые стили для карточки
 =================================== */

.item_wrap {
	background-color: #101b32;
	box-shadow: 0 0 15px 0 rgba(7, 16, 39, 0.4);
	border-radius: 6px;
	transition: transform 0.2s cubic-bezier(.4,0,.2,1), 
							box-shadow 0.2s cubic-bezier(.4,0,.2,1), 
							background-color 0.2s cubic-bezier(.4,0,.2,1);
	position: relative;
}

/* ===================================
 Размеры карточек по умолчанию
 =================================== */

/* 3 колонки по умолчанию */
.item_wrap {
	width: calc(33.333% - 14px);
}

/* 2 колонки для некоторых модулей */
.items_wrap.two-columns .item_wrap {
	width: calc(50% - 10px);
}

/* 3 колонки для authors */
.items_wrap.three-columns .item_wrap {
	width: calc(33.333% - 14px);
}

/* 4 колонки для tag.php */
.items_wrap.four-columns .item_wrap {
	width: calc(25% - 15px);
}

/* ===================================
 Hover эффекты
 =================================== */

.item_wrap:hover {
	background-color: #192844;
	transform: translateY(-8px) scale(1.03);
	box-shadow: 0 8px 32px 0 rgba(64,243,247,0.18), 
							0 0 15px 0 rgba(7, 16, 39, 0.4);
}

/* ===================================
 Внутренняя структура карточки
 =================================== */

.item_wrap .item {
	padding: 20px;
	width: 100%!important;
	height: 100%!important;
	box-sizing: border-box;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
}

/* ===================================
 Изображение карточки
 =================================== */

.item_wrap .item .item_img {
	margin: -20px -20px 10px -20px;
	overflow: hidden;
	border-radius: 6px 6px 0 0;
}

.item_wrap .item .item_img img {
	width: 100%;
	height: auto;
	object-fit: cover;
	overflow: hidden;
}

/* ===================================
 Заголовок карточки
 =================================== */

.item_wrap .item .item_title {
	color: #fff;
	font-weight: 700;
	line-height: 22px;
	font-size: 16px;
}

/* ===================================
 Описание карточки
 =================================== */

.item_wrap .item .item_text {
	font-size: 12px;
	line-height: 20px;
	color: #babbbf;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	text-overflow: ellipsis;
	max-height: 60px;
}

/* ===================================
 Футер карточки
 =================================== */

.item_wrap .item .item_footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
}

.item_wrap .item .item_footer .item_cat {
	font-size: 14px;
	padding: 2px 8px;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.5);
}

/* ===================================
 Ссылка на карточку
 =================================== */

.item_wrap .item-link {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	text-decoration: none;
}

.item_wrap .item_footer {
	position: relative;
	z-index: 2;
}

/* ===================================
 Специальный режим: первая карточка большая
 =================================== */

/* Контейнер с featured режимом */
.items_wrap.featured-first {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 40px;
}

/* Featured блок для первых 3 карточек */
.items_wrap.featured-first .featured-block {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: auto auto;
	gap: 20px;
	width: 100%;
	margin-bottom: 20px;
}

/* Первая карточка (большая) */
.items_wrap.featured-first .featured-block .item_wrap:first-child,
.items_wrap.featured-first .featured-block .item_wrap.featured-main {
	grid-row: 1 / 3;
	width: 100%;
}
.items_wrap.featured-first .featured-block .item_wrap.featured-main .item_img img{
	height: 260px;
}
/* Вторая и третья карточки (компактные) */
.items_wrap.featured-first .featured-block .item_wrap:nth-child(2) {
	grid-row: 1;
	width: 100%;
}

.items_wrap.featured-first .featured-block .item_wrap:nth-child(3) {
	grid-row: 2;
	width: 100%;
}

/* Остальные карточки (стандартные) - возвращаем к flexbox */
.items_wrap.featured-first .item_wrap:nth-child(n+4) {
	width: calc(33.333% - 14px);
}

/* ===================================
 Компактные карточки (без изображений)
 =================================== */

.item_wrap.compact .item .item_img {
	display: none;
}

/* ===================================
 Адаптивные стили
 =================================== */

/* Планшеты */
@media (max-width: 1024px) {
	.item_wrap {
			width: calc(50% - 10px);
	}
	
	.items_wrap {
			gap: 15px;
	}
	
	.items_wrap.two-columns .item_wrap {
			width: calc(50% - 7.5px);
	}
	
	.items_wrap.four-columns .item_wrap {
			width: calc(50% - 7.5px);
	}
	
	.items_wrap.three-columns .item_wrap {
			width: calc(50% - 7.5px);
	}

	/* Адаптивные стили для featured режима */
	.items_wrap.featured-first .featured-block {
			grid-template-columns: 1fr;
			grid-template-rows: auto;
			gap: 15px;
	}
	
	.items_wrap.featured-first .featured-block .item_wrap:first-child {
			grid-row: auto;
			width: 100%;
	}
	
	.items_wrap.featured-first .featured-block .item_wrap:nth-child(2),
	.items_wrap.featured-first .featured-block .item_wrap:nth-child(3) {
			grid-row: auto;
			width: 100%;
	}
	
	.items_wrap.featured-first .item_wrap:nth-child(n+4) {
			width: calc(50% - 7.5px);
	}
}

/* Средние планшеты */
@media (max-width: 900px) {
	.items_wrap.four-columns .item_wrap {
			width: calc(50% - 7.5px);
	}
	
	.items_wrap.four-columns {
			gap: 15px;
	}
}

/* Малые планшеты */
@media (max-width: 768px) {
	.item_wrap {
			width: 100%;
	}
	
	.items_wrap {
			gap: 15px;
	}
	
	.items_wrap.two-columns .item_wrap {
			width: 100%;
	}

	/* Адаптивные стили для featured режима */
	.items_wrap.featured-first .item_wrap:nth-child(n+4) {
			width: 100%;
	}
	
	/* Four-columns на мобильных */
	.items_wrap.four-columns .item_wrap {
			width: 100%;
	}
	
	.items_wrap.four-columns {
			gap: 12px;
	}
}

/* Средние мобильные */
@media (max-width: 600px) {
	.items_wrap.four-columns {
			gap: 10px;
	}
	
	.item_wrap .item {
			padding: 18px;
	}
}

/* Мобильные устройства */
@media (max-width: 480px) {
	.item_wrap .item {
			padding: 15px;
	}
	
	.item_wrap .item .item_img img {
			height: 140px;
	}
	
	.item_wrap .item .item_title {
			font-size: 14px;
			line-height: 18px;
	}
	
	.item_wrap .item .item_text {
			font-size: 11px;
			line-height: 16px;
			max-height: 48px;
	}
	
	.item_wrap .item .item_footer .item_cat {
			font-size: 12px;
			padding: 1px 6px;
	}

	/* Адаптивные стили для featured режима */
	.item_wrap.compact .item {
			padding: 12px;
	}
	
	.item_wrap.compact .item .item_title {
			font-size: 13px;
			line-height: 16px;
	}
	
	.item_wrap.compact .item .item_text {
			font-size: 10px;
			line-height: 14px;
			max-height: 42px;
	}
	
	/* Four-columns на маленьких экранах */
	.items_wrap.four-columns {
			gap: 8px;
	}
	
	.items_wrap.four-columns .item_wrap .item {
			padding: 12px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_img img {
			height: 120px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_title {
			font-size: 13px;
			line-height: 16px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_text {
			font-size: 10px;
			line-height: 14px;
			max-height: 42px;
	}
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
	.items_wrap.four-columns {
			gap: 6px;
	}
	
	.items_wrap.four-columns .item_wrap .item {
			padding: 10px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_img img {
			height: 100px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_title {
			font-size: 12px;
			line-height: 14px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_text {
			font-size: 9px;
			line-height: 12px;
			max-height: 36px;
	}
	
	.items_wrap.four-columns .item_wrap .item .item_footer .item_cat {
			font-size: 10px;
			padding: 1px 4px;
	}
} 

.author-container {
    .item_wrap .item .item_img {
        margin: -0.9375rem -0.9375rem 0 -0.9375rem;

        @media (min-width: 768px) {
            margin: -1.25rem -1.25rem 0.625rem -1.25rem;
        }
        
        img {
            height: auto;
        }
    } 
}