/* Новости проекта на главной — шаблон Prime
   Первая новость большая слева, остальные списком справа. */

/* ---------- Заголовок блока ---------- */
.nav.hn-head {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.hn-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 10px;
	border: 1px solid var(--divider);
	background: var(--hover);
	color: var(--text-dim);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s, border-color .2s, background .2s;
}

.hn-all span { transition: transform .2s; }

.hn-all:hover {
	color: var(--accent);
	border-color: rgba(0, 158, 255, .4);
	background: rgba(0, 158, 255, .08);
	text-decoration: none;
}

.hn-all:hover span { transform: translateX(3px); }

/* ---------- Сетка ---------- */
.hn-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	grid-auto-rows: auto;
	gap: 12px;
	margin-top: 15px;
}

/* большая карточка занимает по высоте все строки списка справа */
.hn-grid > .hn-card:first-child { grid-row: span 3; }
.hn-grid:has(> .hn-card:nth-child(2):last-child) > .hn-card:first-child { grid-row: span 1; }
.hn-grid:has(> .hn-card:nth-child(3):last-child) > .hn-card:first-child { grid-row: span 2; }
.hn-grid:has(> .hn-card:nth-child(5):last-child) > .hn-card:first-child { grid-row: span 4; }
.hn-grid:has(> .hn-card:nth-child(6):last-child) > .hn-card:first-child { grid-row: span 5; }
.hn-grid:has(> .hn-card:nth-child(7):last-child) > .hn-card:first-child { grid-row: span 6; }
.hn-grid > .hn-card:only-child { grid-column: 1 / -1; }
.hn-grid > .empty-element { grid-column: 1 / -1; color: var(--text-second); }

/* ---------- Общая карточка ---------- */
.hn-card {
	position: relative;
	display: flex;
	gap: 16px;
	padding: 12px;
	min-width: 0;
	border-radius: 15px;
	border: 1px solid var(--divider);
	background: var(--hover);
	cursor: pointer;
	overflow: hidden;
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

/* обводка и свечение — только при наведении, одинаково для всех новостей */
.hn-card:hover {
	border-color: rgba(0, 158, 255, .6);
	transform: translateY(-2px);
	box-shadow: 0 0 0 1px rgba(0, 158, 255, .12), 0 18px 50px -20px rgba(0, 158, 255, .45);
}

.hn-img {
	position: relative;
	flex-shrink: 0;
	width: 150px;
	height: 96px;
	border-radius: 11px;
	overflow: hidden;
	background: var(--main-bg);
}

.hn-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.hn-card:hover .hn-img img { transform: scale(1.05); }

.hn-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.hn-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	font-size: 11px;
	font-weight: 500;
	color: var(--text-second);
}

.hn-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 7px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--accent);
	background: rgba(0, 158, 255, .12);
	border: 1px solid rgba(0, 158, 255, .25);
}

.hn-badge:empty { display: none; }
.hn-badge--img { display: none; }

.hn-views {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.hn-views svg { width: 12px; height: 12px; }

.hn-title {
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--text-white);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color .2s;
}

.hn-card:hover .hn-title { color: var(--accent); }

.hn-short {
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--text-dim);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hn-short p { margin: 0; display: inline; }

/* ---------- Главная (первая) новость ---------- */
.hn-grid > .hn-card:first-child {
	flex-direction: column;
	gap: 0;
	padding: 0;
}

.hn-grid > .hn-card:first-child .hn-img {
	width: 100%;
	height: auto;
	flex: 1;
	min-height: 220px;
	border-radius: 0;
}

/* лёгкое затемнение снизу картинки */
.hn-grid > .hn-card:first-child .hn-img::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .35));
	pointer-events: none;
}

.hn-grid > .hn-card:first-child .hn-badge--img {
	display: inline-block;
	position: absolute;
	z-index: 1;
	top: 14px;
	left: 14px;
	color: #fff;
	background: var(--accent);
	border-color: var(--accent);
	box-shadow: 0 6px 18px rgba(0, 158, 255, .35);
}

.hn-grid > .hn-card:first-child .hn-badge--img:empty { display: none; }
.hn-grid > .hn-card:first-child .hn-meta .hn-badge { display: none; }

.hn-grid > .hn-card:first-child .hn-body {
	flex: 0 0 auto;
	gap: 8px;
	padding: 18px 22px 22px;
}

.hn-grid > .hn-card:first-child .hn-title {
	font-size: 22px;
	line-height: 1.3;
}

.hn-grid > .hn-card:first-child .hn-short {
	font-size: 13px;
	-webkit-line-clamp: 3;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.hn-grid { grid-template-columns: 1fr; }
	.hn-grid > .hn-card:first-child { grid-row: auto !important; }
	.hn-grid > .hn-card:first-child .hn-img { flex: none; min-height: 0; aspect-ratio: 16 / 8; }
}

@media (max-width: 560px) {
	.hn-card { gap: 12px; padding: 10px; }
	.hn-img { width: 104px; height: 72px; border-radius: 9px; }
	.hn-title { font-size: 13.5px; }
	.hn-short { display: none; }
	.hn-grid > .hn-card:first-child .hn-short { display: -webkit-box; }
	.hn-grid > .hn-card:first-child .hn-title { font-size: 17px; }
	.hn-grid > .hn-card:first-child .hn-body { padding: 14px 16px 16px; }
	.hn-all { padding: 6px 10px; }
}
