/*
 * Grid-Layout, Karten-Styles
 * Autor: RESULT GmbH
 */

/* ------------------------------------------------------------------ *
 * Grundgeruest
 * ------------------------------------------------------------------ */

.ksm-home-grid {
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 620px;
	margin-inline: auto;
}

/* Theme-Margins neutralisieren */
.ksm-home-grid > *,
.ksm-home-grid .ksm-col,
.ksm-home-grid .ksm-card {
	margin: 0;
}

/* Spalten-Wrapper aufloesen */
.ksm-home-grid .ksm-col {
	display: contents;
}

.ksm-home-grid .ksm-card {
	overflow: hidden;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ *
 * Medien-Karten
 * ------------------------------------------------------------------ */

.ksm-home-grid .ksm-card--video .wp-block-video,
.ksm-home-grid .ksm-card--highlight .wp-block-image {
	margin: 0;
	height: 100%;
}

.ksm-home-grid .ksm-card--video video,
.ksm-home-grid .ksm-card--highlight img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ksm-home-grid .ksm-card--highlight a {
	display: block;
	height: 100%;
}

/* Slides fuellen Karte */
@media (min-width: 768px) {
	.ksm-home-grid .ksm-card--slider .ksm-slider-wrap,
	.ksm-home-grid .ksm-card--slider .ksm-slider.wp-block-gallery {
		height: 100%;
		margin: 0;
	}

	.ksm-home-grid .ksm-card--slider .ksm-slider figure.wp-block-image {
		height: 100%;
	}

	.ksm-home-grid .ksm-card--slider .ksm-slider figure.wp-block-image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

/* Slider-Pfeile mit Kontrast */
.ksm-home-grid .ksm-card--slider .ksm-slider-prev,
.ksm-home-grid .ksm-card--slider .ksm-slider-next {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 2.25rem;
	height: 2.25rem;
	background-color: rgba(0, 0, 0, 0.55);
	border: 2px solid #ffffff;
	color: #ffffff;
	font-size: 1.25rem;
	opacity: 0.9;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ksm-home-grid .ksm-card--slider .ksm-slider-prev:hover,
.ksm-home-grid .ksm-card--slider .ksm-slider-next:hover,
.ksm-home-grid .ksm-card--slider .ksm-slider-prev:focus-visible,
.ksm-home-grid .ksm-card--slider .ksm-slider-next:focus-visible {
	background-color: rgba(0, 0, 0, 0.75);
	opacity: 1;
}

.ksm-home-grid .ksm-card--slider .ksm-slider.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex: 0 0 100%;
	width: 100%;
	opacity: 1;
}

.ksm-home-grid .ksm-card--slider .ksm-slider.wp-block-gallery.has-nested-images::before,
.ksm-home-grid .ksm-card--slider .ksm-slider.wp-block-gallery.has-nested-images::after {
	content: none;
}

/* ------------------------------------------------------------------ *
 * Event-Karte
 * ------------------------------------------------------------------ */

/* Abdunklung fuer Kontrast */
.ksm-home-grid .ksm-card--event {
	display: flex;
	flex-direction: column;
	background-color: #945A1A;
	background-image:
		linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 130px, rgba(0, 0, 0, 0) 280px),
		url(../img/startseite-event.jpg);
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
	color: #ffffff;
}

/* Details unten verankert */
.ksm-next-event {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
	padding: 30px 28px;
	box-sizing: border-box;
	-webkit-hyphens: none;
	hyphens: none;
	overflow-wrap: break-word;
}

/* Kopfzeile in Versalien */
.ksm-next-event__label {
	margin: 0;
	color: inherit;
	font-family: "PlakW02-BlackCondensed";
	font-size: 46px;
	line-height: 0.92;
	letter-spacing: 1px;
	text-transform: uppercase;
	/* Hoehe zweier Zeilen */
	min-height: calc(2 * 0.92em);
}

/* Zeilen mit Kaesten */
.ksm-next-event__type,
.ksm-next-event__title,
.ksm-next-event__date,
.ksm-next-event__time,
.ksm-next-event__more {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
}

/* Fett: eigene Font-Family */
.ksm-next-event__type,
.ksm-next-event__title,
.ksm-next-event__more {
	font-family: "Santral W02 Bold";
}

/* Leerzeile, Umbruch ausgleichen */
.ksm-next-event__more {
	margin-top: 28px;
	text-wrap: balance;
}

.ksm-next-event__box {
	padding: 0 6px;
	background-color: #ffffff;
	color: #111111;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* Pink, Reihenfolge wichtig */
.ksm-next-event__type .ksm-next-event__box,
.ksm-next-event__link {
	color: #b03d6f;
}

/* Theme-Linkstil ueberschreiben */
#content .ksm-next-event__link {
	text-decoration: none;
}

#content .ksm-next-event__link:hover,
#content .ksm-next-event__link:focus-visible {
	color: #b03d6f;
	text-decoration: underline 2px dotted;
}

/* ------------------------------------------------------------------ *
 * Willkommen-Karte
 * ------------------------------------------------------------------ */

.ksm-home-grid .ksm-card--visit {
	background-color: #3F675E;
	background-image: url(../img/startseite-welcome.jpg);
	background-size: cover;
	background-position: center bottom;
	background-repeat: no-repeat;
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	padding: 40px;
	/* Keine Silbentrennung */
	-webkit-hyphens: none;
	hyphens: none;
}

.ksm-home-grid .ksm-card--visit h1,
.ksm-home-grid .ksm-card--visit h2,
.ksm-home-grid .ksm-card--visit p {
	margin: 0;
	color: #ffffff;
	align-self: stretch; /* volle Breite */
}

/* Ueberschrift in Versalien */
.ksm-home-grid .ksm-card--visit h1,
.ksm-home-grid .ksm-card--visit h2 {
	font-size: 56px;
	line-height: 0.85;
	text-transform: uppercase;
}

/* Fett: breiter Plak-Schnitt */
.ksm-home-grid .ksm-card--visit h1 strong,
.ksm-home-grid .ksm-card--visit h2 strong {
	font-family: "Plak W02 Black";
	font-weight: inherit;
}

/* Kreis als Puffer */
.ksm-home-grid .ksm-card--visit .wp-block-image {
	margin: 0;
	width: 225px;
	height: 225px;
	min-height: 140px;
}

.ksm-home-grid .ksm-card--visit .wp-block-image a {
	display: block;
	height: 100%;
	aspect-ratio: 1;
}

/* Breite statt Hoehe */
.ksm-home-grid .ksm-card--visit .wp-block-image img {
	display: block;
	width: 100%;
	max-width: none;
	border-radius: 50%;
	transform: rotate(-8deg);
}

.ksm-home-grid .ksm-card--visit .wp-block-image a:hover img {
	opacity: 0.9;
}

/* ------------------------------------------------------------------ *
 * Video-Karte
 * ------------------------------------------------------------------ */

.ksm-home-grid .ksm-card--video {
	position: relative;
}

/* Pause-Umschalter (WCAG 2.2.2) */
.ksm-video-toggle {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	padding: 6px 14px;
	border: 0;
	border-radius: 4px;
	background-color: #111111;
	color: #ffffff;
	font: inherit;
	cursor: pointer;
}

.ksm-video-toggle:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Oeffnungszeiten-Karte
 * ------------------------------------------------------------------ */

/* Auf ksm-live-oeffnungszeiten abgestimmt */
.ksm-home-grid .ksm-card--hours {
	border: 1px solid #111111;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ksm-home-grid .ksm-card--hours .museum-status__heading {
	font-size: 20px;
	line-height: 1.2;
	margin: 0 0 8px;
}

.ksm-home-grid .ksm-card--hours .museum-status__row {
	margin: 0 0 6px;
}

.ksm-home-grid .ksm-card--hours .museum-status__row:last-child {
	margin-bottom: 0;
}

.ksm-home-grid .ksm-card--hours .museum-status__day,
.ksm-home-grid .ksm-card--hours .museum-status__time {
	font-size: 15px;
	line-height: 1.35;
}

.ksm-home-grid .ksm-card--hours .museum-status__more {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.35;
}

/* ==================================================================== *
 * Breakpoints: nicht umsortieren
 * ==================================================================== */

/* ---- Unter Desktop (<1280px) ---- */
@media (max-width: 1279.98px) {
	/* Video 16:9 */
	.ksm-home-grid .ksm-card--video video {
		height: auto;
		aspect-ratio: 16 / 9;
	}
}

/* ---- Mobil (<768px) ---- */
@media (max-width: 767.98px) {
	.ksm-home-grid .ksm-card--visit     { order: 1; }
	.ksm-home-grid .ksm-card--hours     { order: 2; }
	.ksm-home-grid .ksm-card--event     { order: 3; }
	.ksm-home-grid .ksm-card--slider    { order: 4; }
	.ksm-home-grid .ksm-card--highlight { order: 5; }
	.ksm-home-grid .ksm-card--video     { order: 6; }

	.ksm-home-grid .ksm-card--highlight img {
		height: auto;
	}

	.ksm-home-grid .ksm-card--visit {
		min-height: 480px;
	}

	/* Willkommen kleiner */
	.ksm-home-grid .ksm-card--visit h1,
	.ksm-home-grid .ksm-card--visit h2 {
		font-size: 44px;
	}

	.ksm-home-grid .ksm-card--visit .wp-block-image {
		width: 180px;
		height: 180px;
		min-height: 120px;
	}
}

/* ---- Sehr schmal (<360px) ---- */
@media (max-width: 359.98px) {
	/* Kopfzeile kleiner */
	.ksm-next-event__label {
		font-size: 40px;
	}

	/* Ueberschrift kleiner */
	.ksm-home-grid .ksm-card--visit h1,
	.ksm-home-grid .ksm-card--visit h2 {
		font-size: 36px;
	}
}

/* ---- Tablet (768-1279px) ---- */
@media (min-width: 768px) and (max-width: 1279.98px) {
	.ksm-home-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"visit hours"
			"visit event"
			"highlight slider"
			"highlight2 slider"
			"video video";
		max-width: 900px;
	}

	.ksm-home-grid .ksm-card--video     { grid-area: video; }
	.ksm-home-grid .ksm-card--hours     { grid-area: hours; }
	.ksm-home-grid .ksm-card--event     { grid-area: event; }
	.ksm-home-grid .ksm-card--slider    { grid-area: slider; }
	.ksm-home-grid .ksm-card--visit     { grid-area: visit; }
	.ksm-home-grid .ksm-card--highlight { grid-area: highlight; }
	/* Zweites Highlight */
	.ksm-home-grid .ksm-card--highlight ~ .ksm-card--highlight { grid-area: highlight2; }

	/* Mindesthoehen */
	.ksm-home-grid .ksm-card--highlight { min-height: 220px; }
	.ksm-home-grid .ksm-card--slider    { min-height: 420px; }
	.ksm-home-grid .ksm-card--visit     { min-height: 480px; }
	.ksm-home-grid .ksm-card--hours     { min-height: 260px; }
}

/* ---- Desktop (ab 1280px) ---- */
@media (min-width: 1280px) {
	.ksm-home-grid {
		flex-direction: row;
		align-items: flex-start;
		justify-content: center;
		max-width: 1260px;
	}

	.ksm-home-grid .ksm-col {
		display: flex;
		flex-direction: column;
		gap: 20px;
		flex: 0 0 auto;
	}

	.ksm-home-grid .ksm-col--1 { width: 620px; }
	.ksm-home-grid .ksm-col--2,
	.ksm-home-grid .ksm-col--3 { width: 300px; }

	/* Willkommen vor Video */
	.ksm-home-grid .ksm-col--1 .ksm-card--visit { order: 1; }
	.ksm-home-grid .ksm-col--1 .ksm-card--video { order: 2; }

	/* Medien-Karten fix */
	.ksm-home-grid .ksm-card--video     { height: 345px; }
	.ksm-home-grid .ksm-card--slider    { height: 490px; }
	/* Highlights halbiert */
	.ksm-home-grid .ksm-card--highlight { height: 315px; }

	/* Willkommen: feste Hoehe */
	.ksm-home-grid .ksm-card--visit { height: 634px; }

	/* Ueberschrift laut Entwurf */
	.ksm-home-grid .ksm-card--visit h1,
	.ksm-home-grid .ksm-card--visit h2 { font-size: 60px; }
	.ksm-home-grid .ksm-card--event { min-height: 491px; }
	/* Spalte 3 buendig */
	.ksm-home-grid .ksm-card--hours { min-height: 330px; }
}
