div.cards-grid {
	--cg-text: #ffffff;
	--cg-columns: 4;
	--cg-gap: 20px;
	--cg-radius: 6px;
	--cg-ratio: 0.75 / 1;

	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

div.cards-grid *,
div.cards-grid *::before,
div.cards-grid *::after {
	box-sizing: border-box;
}

div.cards-grid .cards-grid__list {
	display: grid;
	grid-template-columns: repeat(var(--cg-columns), minmax(0, 1fr));
	gap: var(--cg-gap);
	width: 100%;
	align-items: stretch;
}

div.cards-grid .cards-grid__card {
	position: relative;
	min-width: 0;
	width: 100%;
	aspect-ratio: var(--cg-ratio);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--cg-radius);
	overflow: hidden;
	background-color: #1a1a1a;
	background-image: var(--card-bg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

div.cards-grid .cards-grid__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.72) 0%,
		rgba(0, 0, 0, 0.28) 45%,
		rgba(0, 0, 0, 0.12) 100%
	);
	pointer-events: none;
}

div.cards-grid .cards-grid__number {
	position: absolute;
	top: 22px;
	left: 22px;
	z-index: 2;
	font-family: "TikTok Sans", sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.04em;
	color: var(--cg-text);
	pointer-events: none;
}

div.cards-grid .cards-grid__footer {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	padding: 22px 20px 20px;
	pointer-events: none;
}

div.cards-grid .cards-grid__title {
	margin: 0;
	font-family: Ahellya, Georgia, "Times New Roman", serif;
	font-size: 24px;
	font-weight: 400;
	font-style: italic;
	line-height: 1.15;
	color: var(--cg-text);
	word-break: break-word;
}

/* Карточки «В распоряжении гостей» на странице яхты Leopard 47. */
@media (hover: hover) and (pointer: fine) {
	body.postid-5555 div.cards-grid .cards-grid__card {
		background-image: none;
	}

	body.postid-5555 div.cards-grid .cards-grid__card::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 0;
		background-image: var(--card-bg);
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
		transform: scale(1);
		transition: transform 600ms ease-out;
	}

	body.postid-5555 div.cards-grid .cards-grid__overlay {
		z-index: 1;
	}

	body.postid-5555 div.cards-grid .cards-grid__card:hover::before {
		transform: scale(1.075);
	}
}

@media (max-width: 1199px) {
	div.cards-grid {
		--cg-columns: 2;
	}
}

@media (max-width: 767px) {
	div.cards-grid {
		--cg-columns: 1;
		--cg-gap: 19px;
		--cg-ratio: 1 / 0.66;
		width: calc(100vw - 40px);
		max-width: calc(100vw - 40px);
	}

	div.cards-grid .cards-grid__list {
		grid-template-columns: 1fr;
		width: 100%;
	}

	div.cards-grid .cards-grid__card {
		width: calc(100vw - 40px);
		max-width: calc(100vw - 40px);
	}

	div.cards-grid .cards-grid__number {
		top: 16px;
		left: 16px;
	}

	div.cards-grid .cards-grid__footer {
		padding: 18px 14px 18px;
	}

	div.cards-grid .cards-grid__title {
		font-size: 18px;
	}
}
