/* Course list (aufundab/kursliste) */
.aufundab-kursliste {
	display: grid;
	gap: 3rem;
}

.aufundab-kurs {
	display: grid;
	gap: 1.5rem 2.5rem;
	padding-top: 2rem;
	border-top: 4px solid var(--wp--preset--color--creme);
}

@media (min-width: 720px) {
	.aufundab-kurs {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	}

	.aufundab-kurs:not(:has(.aufundab-kurs__bild)) .aufundab-kurs__inhalt {
		grid-column: 2;
	}
}

.aufundab-kurs:first-child {
	padding-top: 0;
	border-top: 0;
}

.aufundab-kurs__bild {
	margin: 0;
}

.aufundab-kurs__bild > img,
.aufundab-karussell__bilder img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.aufundab-kurs__bild img[hidden] {
	display: none;
}

/* Course images with thumbnails (assets/karussell.js) */
.aufundab-karussell__bilder {
	position: relative;
}

.aufundab-karussell__pfeil {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 85%);
	box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
	transform: translateY(-50%);
}

.aufundab-karussell__pfeil:hover {
	background: var(--wp--preset--color--background);
}

/* With a mouse the arrows appear on hover (or keyboard focus); on touch screens they stay visible. */
@media (hover: hover) and (pointer: fine) {
	.aufundab-karussell__pfeil {
		opacity: 0;
		transition: opacity 0.2s;
	}

	.aufundab-karussell__bilder:is(:hover, :focus-within) .aufundab-karussell__pfeil {
		opacity: 1;
	}
}

.aufundab-karussell__pfeil[hidden],
.aufundab-karussell__vorschau[hidden] {
	display: none;
}

.aufundab-karussell__pfeil--zurueck {
	left: 0.5rem;
}

.aufundab-karussell__pfeil--weiter {
	right: 0.5rem;
}

.aufundab-karussell__vorschau {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.aufundab-karussell__vorschau button {
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	opacity: 0.7;
}

.aufundab-karussell__vorschau button:hover,
.aufundab-karussell__vorschau button[aria-current] {
	opacity: 1;
}

.aufundab-karussell__vorschau button[aria-current] img {
	outline: 3px solid var(--wp--preset--color--orange);
	outline-offset: -3px;
}

.aufundab-karussell__vorschau img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.aufundab-kurs__inhalt > :first-child {
	margin-top: 0;
}

.aufundab-kurs__inhalt h2 {
	margin-bottom: 1rem;
	font-size: clamp(1.5rem, 2.5vw, 1.875rem);
}

.aufundab-kurs__daten {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25rem 1.25rem;
	margin: 1.5rem 0;
}

.aufundab-kurs__daten dt {
	font-weight: 600;
}

.aufundab-kurs__daten dd {
	margin: 0;
}

.aufundab-kurs__anmeldung {
	margin-bottom: 0;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--creme);
}

.aufundab-kurs__anmeldung a {
	color: inherit;
}

/* Event banner (aufundab/banner) on the home page, directly under the header */
.wp-site-blocks > .aufundab-banner {
	margin-block-start: 0;
}

.aufundab-banner {
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--foreground);
	padding: 1rem var(--wp--custom--spacing--outer);
}

.aufundab-banner[hidden] {
	display: none;
}

.aufundab-banner__inhalt {
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
}

.aufundab-banner__inhalt p {
	flex: 1;
	margin: 0;
}

.aufundab-banner a {
	color: inherit;
	font-weight: 600;
}

.aufundab-banner__schliessen {
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.aufundab-banner__schliessen:hover {
	background: rgb(0 0 0 / 8%);
}

/* Footer (aufundab/fusszeile): one item per line on phones */
@media (max-width: 599px) {
	.wp-block-aufundab-fusszeile {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
		text-align: left;
	}

	.aufundab-fusszeile__trenner {
		display: none;
	}
}
