/* Карточки преимуществ отеля (HAC) */

.hac-cards {
	display: flex;
	width: 100%;
	max-width: 1440px; /* 4 * 360px */
	margin: 0 auto;
	padding: 0;
	gap: 0;
	overflow: hidden;
	height: 280px;
}

.hac-card {
	position: relative;
	display: block;
	height: 280px;
	flex-basis: 0;
	flex-grow: 1;
	min-width: 0;

	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;

	text-decoration: none;

	/* Анимации включены только на десктопе через media query ниже */
	transition: flex-grow 320ms ease, max-width 320ms ease, filter 320ms ease;
}

/* Доступность: видимый фокус */
.hac-card:focus,
.hac-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.hac-card__overlay {
	position: absolute;
	left: 0;
	right: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 250ms ease;
}

.hac-card__overlay--top {
	top: 0;
	height: 50%;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
}

.hac-card__overlay--bottom {
	bottom: 0;
	height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
	opacity: 1; /* затемнение под заголовком всегда */
}

.hac-card__title {
	text-transform: uppercase;
	text-align: right;
	position: absolute;
	right: 14px;
	bottom: 12px;
	max-width: 200px;
	color: #fff;
	font-size: 16pt;
	line-height: 1.2;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.hac-card__excerpt {
	position: absolute;
	left: 14px;
	top: 12px;
	max-width: 80%;
	color: #fff;
	font-size: 14px;
	line-height: 1.35;
	font-weight: 500;

	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 250ms ease, transform 250ms ease;
	text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Десктоп: hover-эффект включаем только там, где hover реально существует */
@media (hover: hover) and (pointer: fine) {
	.hac-cards:hover .hac-card {
		flex-grow: 1;
		max-width: 360px;
		filter: saturate(0.95);
	}

	.hac-cards:hover .hac-card:hover {
		flex-grow: 3; /* 720px vs 240px (соотношение 3:1) */
		max-width: 720px;
		filter: saturate(1.05);
	}

	.hac-cards:hover .hac-card:hover .hac-card__excerpt,
	.hac-cards:hover .hac-card:hover .hac-card__overlay--top {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Мобильные/тач: карточки строго друг под другом, без анимаций и hover-логики */
@media (max-width: 767px), (hover: none), (pointer: coarse) {
	.hac-cards {
		display: block;
		max-width: 100%;
		height: auto;
		overflow: visible;
	}

	.hac-card {
		width: 100%;
		max-width: 100%;
		height: 280px;
		margin: 0;
		transition: none; /* на мобильных анимации отключены */
	}

	/* Краткое описание на мобильных по умолчанию не показываем */
	.hac-card__excerpt,
	.hac-card__overlay--top {
		display: none;
	}
}
