/*
 * Kaarten (shortcode gsf_cards; was "Keuzekaarten").
 *
 * Selectors start with .gsf-block.gsf-cards so they win over Avada's content rules such as
 * `.post-content h2` (headings, lists and links inside the content area).
 */
.gsf-block.gsf-cards {
	--gsf-cards-gap: 0.75rem;
}

/* Content within the site width, with the same vertical spacing as every full-width block. */
.gsf-block.gsf-cards .gsf-cards__inner {
	max-width: var(--gsf-content-outer);
	margin-inline: auto;
	padding: var(--gsf-space-section) var(--gsf-space-gutter);
}


/* No own background: the title takes the site's colour for its heading style. */
.gsf-block.gsf-block.gsf-cards .gsf-head__title {
	--gsf-head-title-color: var(--gsf-head-style-color);
}

/* Head: heading on the left, intro on the right when there is room. The heading itself is
   styled by core/base.css (.gsf-head__*); only its placement is set here. */
.gsf-block.gsf-cards .gsf-cards__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--gsf-space-4);
	margin: 0 0 var(--gsf-space-5);
}

.gsf-block.gsf-block.gsf-cards .gsf-cards__head .gsf-head__intro {
	max-width: 38ch;
	margin: 0;
}

@container (min-width: 880px) {
	.gsf-block.gsf-block.gsf-cards .gsf-cards__head .gsf-head__intro {
		margin-left: auto;
	}
}

/*
 * Narrow (< 520px): the shared mobile slider (.gsf-slider in core/base.css).
 * Wider: a grid of 2 or 3 columns; four cards stay 2 x 2.
 */
.gsf-block.gsf-cards .gsf-cards__grid {
	list-style: none;
}

@container (min-width: 520px) {
	.gsf-block.gsf-cards .gsf-cards__grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--gsf-cards-gap);
		margin: 0;
		padding: 0;
	}
}

@container (min-width: 880px) {
	.gsf-block.gsf-cards .gsf-cards__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Two or four cards: two columns, so no row ends with an empty column. */
	.gsf-block.gsf-cards .gsf-cards__grid:has(> :nth-child(2):last-child),
	.gsf-block.gsf-cards .gsf-cards__grid:has(> :nth-child(4):last-child) {
		grid-template-columns: repeat(2, 1fr);
	}
}

/*
 * Card colours: alternate through the site's colours unless a card has its own.
 * Order primary, accent, secondary, dark: on most GSF sites color1 and color2 are related
 * tints (GPS two yellows, Goois Lyceum two oranges), so they should not sit side by side.
 */
.gsf-block.gsf-cards .gsf-cards__card:nth-child(4n + 1) {
	--gsf-card-auto-bg: var(--gsf-color-primary);
	--gsf-card-auto-on: var(--gsf-on-color-primary);
}

.gsf-block.gsf-cards .gsf-cards__card:nth-child(4n + 2) {
	--gsf-card-auto-bg: var(--gsf-color-accent);
	--gsf-card-auto-on: var(--gsf-on-color-accent);
}

.gsf-block.gsf-cards .gsf-cards__card:nth-child(4n + 3) {
	--gsf-card-auto-bg: var(--gsf-color-secondary);
	--gsf-card-auto-on: var(--gsf-on-color-secondary);
}

.gsf-block.gsf-cards .gsf-cards__card:nth-child(4n + 4) {
	--gsf-card-auto-bg: var(--gsf-color-surface-dark);
	--gsf-card-auto-on: var(--gsf-on-color-surface-dark);
}

.gsf-block.gsf-cards .gsf-cards__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow-wrap: break-word;
	margin: 0;
	overflow: hidden;
	border-radius: var(--gsf-radius);
	background: var(--gsf-card-bg, var(--gsf-card-auto-bg));
	color: var(--gsf-card-on, var(--gsf-card-auto-on));
	transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.2s ease;
}

/* Card content; the photo (optional) sits above it, edge to edge. */
.gsf-block.gsf-cards .gsf-cards__body {
	flex: 1;
	padding: var(--gsf-space-4) var(--gsf-space-4) calc(var(--gsf-space-4) - 2px);
}

/* With a link text, the cue sits at the bottom, so cues in a row line up. */
.gsf-block.gsf-cards .gsf-cards__body:has(> .gsf-cue) {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.gsf-block.gsf-cards .gsf-cards__body > .gsf-cue {
	margin-top: auto;
	padding-top: var(--gsf-space-3);
}

.gsf-block.gsf-cards .gsf-cards__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--gsf-color-surface-dark);
}

.gsf-block.gsf-cards .gsf-cards__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gsf-block.gsf-cards .gsf-cards__card--link:hover .gsf-cards__img {
	transform: scale(1.05);
}

/* Icon (cards without a photo): decorative, in the card's text colour on colour cards. */
.gsf-block.gsf-cards .gsf-cards__icon {
	display: block;
	margin-bottom: var(--gsf-space-3);
	font-size: 2.25rem;
	line-height: 1;
}

/* The tag uses the card's text colour as background, so it is black on light cards
   (as in the design) and white on dark ones; its text is the inverse of that. */
.gsf-block.gsf-cards .gsf-cards__tag {
	display: inline-block;
	padding: 0.45em 0.75em 0.4em;
	font-family: var(--gsf-font-body);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: var(--gsf-card-on, var(--gsf-card-auto-on));
	color: #ffffff;
	color: rgb(from var(--gsf-card-on, var(--gsf-card-auto-on)) calc(255 - r) calc(255 - g) calc(255 - b));
	margin-bottom: var(--gsf-space-3);
	font-size: 0.68rem;
	transform: rotate(-1.2deg);
}

.gsf-block.gsf-cards .gsf-cards__card-title {
	hyphens: auto;
	margin: 0 0 var(--gsf-space-2);
	color: inherit;
	font-family: var(--gsf-font-heading);
	font-weight: 400;
	font-size: var(--gsf-text-h3);
	line-height: 1.15;
	letter-spacing: var(--gsf-text-h3-letter-spacing);
	text-transform: none;
}

.gsf-block.gsf-cards .gsf-cards__card-title sup {
	font-size: 0.46em;
	line-height: 0;
	vertical-align: 0.62em;
	letter-spacing: 0.03em;
}

.gsf-block.gsf-cards .gsf-cards__card-title a {
	color: inherit;
	text-decoration: none;
}

/* The whole card is the link target. */
.gsf-block.gsf-cards .gsf-cards__card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.gsf-block.gsf-cards .gsf-cards__text {
	margin: 0;
	font-size: calc(var(--gsf-text-body) * 0.9);
	line-height: 1.5;
}

.gsf-block.gsf-cards .gsf-cards__card--link:hover,
.gsf-block.gsf-cards .gsf-cards__card--link:has(a:focus-visible) {
	transform: translateY(-4px);
	box-shadow: 0 18px 50px -24px rgb(0 0 0 / 0.45);
}

.gsf-block.gsf-cards .gsf-cards__card--link:hover .gsf-cue svg {
	transform: translateX(5px);
}

.gsf-block.gsf-cards .gsf-cards__card--link:hover .gsf-cards__card-title a {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Focus ring on the card instead of the (stretched) link text. */
.gsf-block.gsf-cards .gsf-cards__card-title a:focus-visible {
	outline: none;
}

.gsf-block.gsf-cards .gsf-cards__card--link:has(a:focus-visible) {
	outline: 3px solid var(--gsf-color-text);
	outline-offset: 3px;
}

/*
 * Card style "Licht" (card_style=light): white cards with a thin line instead of colour fields,
 * for calmer content such as reasons or contact. Text in the text colour; the tag stays the
 * inverse of the text; icons in the dark surface colour (always dark enough on white).
 */
/* Doubled class: as heavy as the :nth-child colour rules above, and later, so it wins. */
.gsf-block.gsf-cards--card-style-light .gsf-cards__card.gsf-cards__card {
	--gsf-card-auto-bg: var(--gsf-color-tint);
	--gsf-card-auto-on: var(--gsf-color-text);
}

.gsf-block.gsf-cards--card-style-light .gsf-cards__card--link:hover,
.gsf-block.gsf-cards--card-style-light .gsf-cards__card--link:has(a:focus-visible) {
	box-shadow: 0 18px 50px -24px rgb(0 0 0 / 0.35);
}

/* Light cards: titles in the site's H3 colour; icons as in "Open" (beside the text, below). */
.gsf-block.gsf-cards--card-style-light .gsf-cards__card-title {
	color: var(--gsf-color-heading-3);
}



/*
 * Icons in "Licht" and "Open": beside the title and text, in the house colour, in a fixed
 * column (no circle). Rules below are shared by both styles.
 *
 * Card style "Open" (card_style=open): no field, no circle. A line in the house colour on top,
 * the icon beside the title and text; reads as a list of reasons rather than a row of tiles.
 * A photo (if any) stays above the text, without rounding.
 */
.gsf-block.gsf-cards--card-style-open .gsf-cards__card.gsf-cards__card {
	overflow: visible;
	border-top: 3px solid var(--gsf-color-primary);
	border-radius: 0;
	background: transparent;
	color: var(--gsf-color-text);
}

.gsf-block.gsf-cards--card-style-open .gsf-cards__body {
	padding: var(--gsf-space-4) 0 0;
}

.gsf-block.gsf-cards--card-style-light .gsf-cards__body:has(> .gsf-cards__icon),
.gsf-block.gsf-cards--card-style-open .gsf-cards__body:has(> .gsf-cards__icon) {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: var(--gsf-space-3);
	align-content: start;
}

.gsf-block.gsf-cards--card-style-light .gsf-cards__body:has(> .gsf-cards__icon) > *,
.gsf-block.gsf-cards--card-style-open .gsf-cards__body:has(> .gsf-cards__icon) > * {
	grid-column: 2;
}

.gsf-block.gsf-cards--card-style-light .gsf-cards__body > .gsf-cards__icon,
.gsf-block.gsf-cards--card-style-open .gsf-cards__body > .gsf-cards__icon {
	grid-column: 1;
	grid-row: 1 / span 6;
	width: 1.25em; /* fixed column, so text starts at the same place whatever the icon's width */
	margin: 0.15em 0 0;
	text-align: center;
	color: var(--gsf-color-primary);
	font-size: 2rem;
	line-height: 1;
}

.gsf-block.gsf-cards--card-style-open .gsf-cards__card-title {
	color: var(--gsf-color-heading-3);
}

.gsf-block.gsf-cards--card-style-open .gsf-cards__media {
	border-radius: 0;
}

/* Links: no lift and shadow (there is no card to lift); the title underlines. */
.gsf-block.gsf-cards--card-style-open .gsf-cards__card--link:hover,
.gsf-block.gsf-cards--card-style-open .gsf-cards__card--link:has(a:focus-visible) {
	transform: none;
	box-shadow: none;
}

@container (min-width: 520px) {
	.gsf-block.gsf-cards--card-style-open .gsf-cards__grid {
		column-gap: var(--gsf-space-5);
		row-gap: var(--gsf-space-5);
	}
}

/* On the tint of "Licht" the house colour can be too light for the icon; use the dark one. */
.gsf-block.gsf-cards--card-style-light .gsf-cards__body > .gsf-cards__icon {
	color: var(--gsf-color-surface-dark);
}

/* Own icon images (line icons): larger than an icon font glyph, same column. */
.gsf-block.gsf-cards .gsf-cards__icon:has(> .gsf-icon-img) {
	width: 3.5rem;
	height: 3.5rem;
	font-size: 0;
}

.gsf-block.gsf-cards--card-style-light .gsf-cards__body > .gsf-cards__icon:has(> .gsf-icon-img),
.gsf-block.gsf-cards--card-style-open .gsf-cards__body > .gsf-cards__icon:has(> .gsf-icon-img) {
	width: 3.5rem;
	margin-top: 0;
}

