/**
 * Block: Cards (dhukr/cards).
 * Depends on tokens.css, global.css (.dh-pretitle, .dh-heading-*, .dh-section--bg-dark, .dh-btn)
 * and the shared slider (slider.css) for the "Mobile slider" option.
 */

.dh-cards__intro {
	display: flex;
	flex-direction: column;
	gap: var(--dh-space-12);
	margin-bottom: var(--dh-space-48);
}

.dh-cards__title,
.dh-cards__card-title {
	color: var(--dh-color-heading);
	text-transform: uppercase;
}

.dh-cards__text {
	color: var(--dh-color-text);
	font-size: var(--dh-fs-body-18);
	line-height: var(--dh-lh-body);
}

.dh-cards__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(var(--dh-card-min), 100%), 1fr));
	gap: var(--dh-space-24);
}

.dh-cards__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--dh-space-16);
	padding: var(--dh-space-32);
	border-radius: var(--dh-radius-card);
}

.dh-cards__card--cream {
	background-color: var(--dh-color-bg-alt);
}

/* --dark also has .dh-section--bg-dark (background + text tokens). */

.dh-cards__icon {
	width: var(--dh-icon-card);
	height: var(--dh-icon-card);
	object-fit: contain;
}

.dh-cards__card .dh-pretitle {
	margin-bottom: calc(var(--dh-space-8) * -1);
}

.dh-cards__card-content {
	color: var(--dh-color-text);
	font-size: var(--dh-fs-body-16);
	line-height: var(--dh-lh-body);
}

.dh-cards__card-content > * + * {
	margin-top: var(--dh-space-12);
}

.dh-cards__card-content :where(ul, ol) {
	padding-left: 1.25em;
}

.dh-cards__card-content :where(li + li) {
	margin-top: var(--dh-space-8);
}

/* ==========================================================================
   Card with image: image bleeds to the card edges at the top
   ========================================================================== */

.dh-cards__card--has-image {
	overflow: hidden;
	padding: 0 var(--dh-space-24) var(--dh-space-48);
}

.dh-cards__image {
	display: block;
	width: calc(100% + var(--dh-space-24) * 2);
	max-width: none;
	height: auto;
	aspect-ratio: 464 / 301;
	margin-inline: calc(var(--dh-space-24) * -1);
	margin-bottom: var(--dh-space-32);
	object-fit: cover;
}

.dh-cards__card--has-image .dh-cards__card-content {
	font-size: var(--dh-fs-body-18);
}

/* ==========================================================================
   Mobile slider: grid on tablet and desktop, shared slider on mobile only.
   ========================================================================== */

@media only screen and (min-width: 769px) {
	.dh-cards__slider .dh-cards__list.dh-slider__track {
		display: grid;
		overflow: visible;
		scroll-snap-type: none;
	}

	.dh-cards__slider .dh-slider__controls {
		display: none;
	}
}

@media only screen and (max-width: 768px) {
	/* A part of the next card stays visible, so the row reads as swipeable. */
	.dh-cards__slider {
		--dh-slider-per-view: 1.15;
	}

	/* .dh-cards__list sets display: grid and loads after slider.css,
	 * so the slider track layout is restored here. */
	.dh-cards__slider .dh-cards__list.dh-slider__track {
		display: flex;
	}
}

/* ==========================================================================
   Buttons under the cards
   ========================================================================== */

.dh-cards__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--dh-space-24);
	margin-top: var(--dh-space-64);
}

@media only screen and (max-width: 768px) {
	.dh-cards__actions {
		margin-top: var(--dh-space-48);
	}
}