/**
 * Карточки, которые встречаются больше чем на одной странице.
 *
 * Пока карточка жила только на своём экране, её стили лежали рядом с ним
 * (pages/article.css, pages/projects.css). Теперь те же карточки собирают
 * блоки главной, поэтому правила переехали сюда и подключаются везде.
 *
 * Секции вокруг карточек (сетка, заголовок, кнопка) остаются в своих файлах —
 * они у каждой страницы свои.
 */

/* ───────────────  Карточка статьи  ─────────────── */

.article-card {
	display: block;
	overflow: hidden;
	border: 1px solid rgba(34, 31, 28, .16);
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: .18s;
}

.article-card:hover {
	box-shadow: 0 16px 36px rgba(34, 31, 28, .12);
	color: inherit;
}

.article-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.article-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: .5s;
}

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

.article-card__body {
	padding: 24px 26px;
}

.article-card__title {
	margin: 0 0 10px;
	font-family: var(--t-font-display);
	font-weight: 700;
	font-size: 19px;
	line-height: 1.28;
}

.article-card__excerpt {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--t-muted);
}

.article-card__date {
	font-family: var(--t-font-display);
	font-weight: 600;
	font-size: 13px;
	color: var(--t-accent);
}

/* ───────────────  Карточка объекта  ─────────────── */

.obj-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(34, 31, 28, .14);
	border-radius: var(--t-radius-lg);
	background: #fff;
	transition: .18s;
}

.obj-card:hover {
	box-shadow: 0 18px 40px rgba(34, 31, 28, .12);
}

.obj-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #241C14;
}

.obj-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity .25s;
}

.obj-card__img.is-active {
	opacity: 1;
}

.obj-card__badge {
	position: absolute;
	left: 16px;
	top: 16px;
	padding: 7px 13px;
	border-radius: 999px;
	background: rgba(28, 21, 15, .6);
	font-family: var(--t-font-display);
	font-weight: 600;
	font-size: 12.5px;
	color: #fff;
}

.obj-card__nav {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	gap: 8px;
}

.obj-card__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 11px;
	background: var(--t-accent);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
	transition: .15s;
}

.obj-card__arrow:hover {
	background: var(--t-accent-dark);
}

.obj-card__play {
	position: absolute;
	right: 16px;
	top: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .95);
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

.obj-card__play svg {
	width: 20px;
	height: 20px;
	margin-left: 2px;
}

.obj-card__dots {
	position: absolute;
	left: 16px;
	bottom: 16px;
	display: flex;
	gap: 6px;
}

.obj-card__dot {
	width: 7px;
	height: 7px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .5);
	cursor: pointer;
	transition: .2s;
}

.obj-card__dot.is-active {
	width: 18px;
	border-radius: 4px;
	background: #fff;
}

.obj-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px 24px 22px;
}

.obj-card__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 14px;
}

.obj-card__title {
	margin: 0;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 21px;
	line-height: 1.2;
}

.obj-card__price {
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 19px;
	white-space: nowrap;
}

/* Прижимаем к низу карточки; браузерный margin у <dl> снизу убираем. */
.obj-card__facts {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 22px;
	margin: auto 0 0;
}

.obj-card__fact {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.obj-card__fact dt {
	font-size: 12.5px;
	color: var(--t-muted);
}

.obj-card__fact dd {
	margin: 0;
	font-family: var(--t-font-display);
	font-weight: 700;
	font-size: 15px;
}

.obj-card__more {
	margin-left: auto;
	padding: 11px 20px;
	font-size: 14px;
}

/* ───────────────  Лайтбокс объекта  ─────────────── */
/* Разметку строит assets/js/pages/projects.js, поэтому стили нужны везде,
 * где стоят карточки объектов. */

.obj-lightbox {
	position: fixed;
	inset: 0;
	z-index: 600;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(28, 21, 15, .9);
}

.obj-lightbox.is-open {
	display: flex;
}

.obj-lightbox__inner {
	position: relative;
	width: 100%;
	max-width: 900px;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
}

.obj-lightbox__close {
	position: absolute;
	right: 16px;
	top: 14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	font-size: 22px;
	cursor: pointer;
}

.obj-lightbox__media {
	display: block;
	width: 100%;
	max-height: 74vh;
	background: #000;
}

.obj-lightbox__caption {
	padding: 14px 18px;
	background: var(--t-paper);
	font-family: var(--t-font-display);
	font-weight: 700;
	color: var(--t-ink);
}


/* ───────────────  Адаптив  ─────────────── */

@media (max-width: 640px) {
	.obj-card__body {
		padding: 18px 18px 20px;
	}

	.obj-card__more {
		margin-left: 0;
	}
}
