/*
 * CRELALA Modern – front page layout (0.7.0).
 * Loaded only on the front page. Header, navigation and footer are untouched;
 * the content stays as it is, only its arrangement changes. Surfaces use the
 * existing card colour – no extra shadows, gradients or accent borders.
 */

body.crelala-start {
	--hm-gap: 64px;
	--hm-line: rgba(255, 255, 255, 0.1);
}


/* ---------- Sections: even rhythm ---------- */
body.crelala-start #content > * {
	margin-top: var(--hm-gap);
}
body.crelala-start #content > :first-child,
body.crelala-start #content > :empty {
	margin-top: 0;
}
/* a row of tiles follows its heading row directly */
body.crelala-start #content > .is-style-crelala-columns + .is-style-crelala-columns {
	margin-top: 24px;
}

body.crelala-start #content h2.wp-block-heading {
	margin: 0 0 24px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---------- One content width: the full-width slider lines up with the rest ---------- */
body.crelala-start #content > .sqrallwaysfullwidth,
body.crelala-start #content > .is-style-crelala-columns {
	max-width: 1500px;
	margin-inline: auto;
	padding-inline: 30px;
	box-sizing: border-box;
}
body.crelala-start #content > .is-style-crelala-columns .sqrallwaysboxed,
body.crelala-start #content > .is-style-crelala-columns .sqrdesktopboxed,
body.crelala-start #content > .is-style-crelala-columns .sqrmobilefullwidth {
	max-width: none;
	margin-inline: 0;
	padding-inline: 0;
}
body.crelala-start #content > .sqrallwaysboxed + .sqrallwaysfullwidth {
	margin-top: 0;
}
body.crelala-start #content > .sqrallwaysfullwidth .wp-block-crelala-slider {
	padding-inline: 0;
}

/* ---------- "Haben Sie Ihr Lieblingsstück …": plain card ---------- */
/* heading + text in one card; the card sits on the content line (inside the 30px side padding) */
body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2)) {
	position: relative;
	isolation: isolate;
	padding-block: 28px;
}
body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2))::before {
	content: "";
	position: absolute;
	inset: 0 30px;
	background: var(--cm-card);
	border-radius: var(--cm-radius);
	z-index: -1;
}
body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2)) > * {
	padding-inline: 32px !important;
}
body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2)) .wp-block-group {
	padding: 0;
	background: none !important;
}
body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2)) h3 {
	margin: 0 0 12px;
	font-size: 20px;
}

/* ---------- News + Neue Künstlerin: use the full width ---------- */
/* the second column is empty */
body.crelala-start #content .sqrcolumncontainer2_default > .wp-block-group:not(:has(*)) {
	display: none;
}
body.crelala-start #content .sqrcolumncontainer2_default > .wp-block-group:has(*) {
	flex: 1 1 100%;
	max-width: none;
	width: 100%;
}
body.crelala-start #content .sqrcolumncontainer2_default .wp-block-media-text {
	grid-template-columns: 1fr 40% !important;
	gap: 40px;
	align-items: center;
}
body.crelala-start #content .sqrcolumncontainer2_default .wp-block-media-text__content {
	padding-left: 0 !important;
	line-height: 1.7;
}
body.crelala-start #content > .is-style-crelala-columns:has(.sqrcolumncontainer2_default) + .is-style-crelala-columns:has(.sqrcolumncontainer2_default) {
	margin-top: 32px;
}
/* 0.7.4: the news are one row in the content now (.crelala-news, was two rows joined by home.js) and the two empty spacer
   rows before it are gone – same gap as before (then: the rule above „band + band“ = 24 px after the hidden spacers) */
body.crelala-start #content > .crelala-news {
	margin-top: 24px;
}

/* spacer rows without any content (they only carry a bottom margin) */
body.crelala-start #content > .is-style-crelala-columns:not(:has(img, h1, h2, h3, h4, p, a, figure, iframe, ul)) {
	display: none;
}

/* News side by side (home.js moves the second item next to the first):
   two compact cards, picture left filling the card height, text right */
body.crelala-start #content > .crelala-news > .sqrcolumncontainer2_default {
	display: flex;
	gap: 30px;
}
body.crelala-start #content > .crelala-news > .sqrcolumncontainer2_default > .wp-block-group {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}
body.crelala-start #content > .crelala-news .sqrmobilefullwidth {
	position: relative;
	display: grid;
	grid-template-columns: 40% 1fr;
	grid-template-rows: auto 1fr;
	height: 100%;
	min-height: 240px;
	margin: 0;
	padding: 0;
	background: var(--cm-card);
	border-radius: var(--cm-radius);
	overflow: hidden;
}
body.crelala-start #content > .crelala-news .sqrmobilefullwidth > a.ngpar {
	position: absolute;
}
body.crelala-start #content > .crelala-news .sqrmobilefullwidth > .paragraph,
body.crelala-start #content > .crelala-news .wp-block-media-text {
	display: contents;
}
body.crelala-start #content > .crelala-news .wp-block-media-text__media {
	position: relative;
	grid-column: 1;
	grid-row: 1 / span 2;
	width: auto !important;
	min-height: 240px !important;
	height: 100% !important;
	margin: 0;
}
body.crelala-start #content > .crelala-news .wp-block-media-text__media img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: 50% 30% !important;
	border-radius: 0;
}
body.crelala-start #content > .crelala-news .sqrmobilefullwidth h2.wp-block-heading {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	padding: 24px 26px 10px;
	font-size: 18px;
	letter-spacing: 0.01em;
	text-transform: none;
}
body.crelala-start #content > .crelala-news .sqrmobilefullwidth h2.wp-block-heading::after {
	display: none;
}
body.crelala-start #content > .crelala-news .wp-block-media-text__content {
	grid-column: 2;
	grid-row: 2;
	width: auto !important;
	margin: 0 !important;
	padding: 0 26px 24px !important;
}
body.crelala-start #content > .crelala-news .wp-block-media-text__content * {
	margin-inline: 0 !important;
	padding: 0 !important;
	max-width: none !important;
	font-size: 15px !important;
	line-height: 1.6 !important;
}
body.crelala-start #content > .crelala-news .wp-block-media-text__content p {
	margin: 0 0 8px !important;
}


/* ---------- Theme tiles: tighter rows ---------- */
body.crelala-start #content > .is-style-crelala-columns .columncontainer_default .paragraph {
	margin-bottom: 0 !important;
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	body.crelala-start { --hm-gap: 44px; }
	body.crelala-start #content > .crelala-news > .sqrcolumncontainer2_default {
		flex-direction: column;
	}
	body.crelala-start #content > .crelala-news .sqrmobilefullwidth {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}
	body.crelala-start #content > .crelala-news .wp-block-media-text__media {
		grid-row: auto;
		min-height: 220px !important;
	}
	body.crelala-start #content > .crelala-news .sqrmobilefullwidth h2.wp-block-heading,
	body.crelala-start #content > .crelala-news .wp-block-media-text__content {
		grid-column: 1;
		grid-row: auto;
	}
	body.crelala-start #content > .sqrallwaysfullwidth {
		padding-inline: 0;
	}
	body.crelala-start #content > .is-style-crelala-columns {
		padding-inline: 15px;
	}
	body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2)) > * {
		padding-inline: 20px !important;
	}
	body.crelala-start #content > .sqrallwaysboxed:has(h3):not(:has(h2))::before {
		inset: 0 15px;
	}
	body.crelala-start #content .sqrcolumncontainer2_default .wp-block-media-text {
		grid-template-columns: 1fr !important;
		gap: 20px;
	}
}

/* ---------- Header picture slider: no arrows on the front page (it changes by itself) ---------- */
body.crelala-start #header .ngparaflowsliderprev,
body.crelala-start #header .ngparaflowslidernext {
	display: none !important;
}

/* ---------- "Kunst vor Ort" slider: whole cards, no cut-off card at the edge ---------- */
body.crelala-start #content > .sqrallwaysfullwidth .wp-block-crelala-slider {
	--cs-peek: 0 !important;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide {
	flex-direction: column;
	background: var(--cm-card);
	border-radius: var(--cm-radius);
	overflow: hidden;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-featured-image {
	margin: 0;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-featured-image img {
	border-radius: 0 !important;
	box-shadow: none !important;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-title {
	min-height: calc(3 * 1.4em);
	margin: 18px 20px 10px !important;
	font-size: 16px;
	line-height: 1.4;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-excerpt {
	display: flex;
	flex-direction: column;
	flex: 1;
	margin: 0 20px 20px !important;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-excerpt__excerpt {
	margin: 0 0 14px;
}
body.crelala-start #content > .sqrallwaysfullwidth .crelala-slider__slide .wp-block-post-excerpt__more-text {
	margin: auto 0 0;
}

/* ================= 0.7.0: top of the page content (native blocks, editable in Seiten → Startseite) =================
   group .crelala-welcome  = list .crelala-welcome__facts (4 items: <strong>title</strong> line) + buttons .crelala-welcome__actions
   group .crelala-about    = heading .crelala-about__lead + paragraph .crelala-about__sub + columns .crelala-about__cols
   The icons belong to the position (1st … 4th item) and come from this file. */
body.crelala-start #header > .sqrallwaysboxed {
	margin-top: 4px;
}
body.crelala-start #header > .sqrallwaysboxed > h1 {
	margin: 0 0 20px;
}
/* less space between the header picture and the heading */
body.crelala-start #header .sqrmobilefullwidth > .paragraph:has(.ngparaflowsliderstage) {
	margin-bottom: 24px !important;
}
/* the parent theme puts loose blocks in its content frame (.sqrallwaysboxed > .paragraph) – that frame follows the
   heading directly; the introduction keeps some air below the buttons */
body.crelala-start #content > .sqrallwaysboxed:has(> .paragraph > .crelala-welcome:first-child) {
	margin-top: 0;
}
body.crelala-start #content .crelala-welcome + .crelala-about {
	margin-top: 44px;
}

/* facts: four items between two thin lines, icon left of the text */
body.crelala-start #content .crelala-welcome__facts {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin: 0;
	padding: 20px 0;
	list-style: none;
	border-block: 1px solid var(--hm-line);
}
body.crelala-start #content .crelala-welcome__facts li {
	display: grid;
	grid-template-columns: auto auto;
	justify-content: center;
	align-items: center;
	column-gap: 14px;
	margin: 0;
	padding: 0 20px;
	border-left: 1px solid var(--hm-line);
	font-size: 15px;
	line-height: 1.5;
	color: #c4c4c4;
}
body.crelala-start #content .crelala-welcome__facts li:first-child {
	border-left: 0;
}
body.crelala-start #content .crelala-welcome__facts li::before {
	content: "";
	grid-row: 1 / span 2;
	width: 28px;
	height: 28px;
	background: #d6d6d6;
	-webkit-mask: var(--hm-icon) center / contain no-repeat;
	mask: var(--hm-icon) center / contain no-repeat;
}
body.crelala-start #content .crelala-welcome__facts li:nth-child(4n + 1) { --hm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4.5l5 5-7.2 7.2-5-5z'/%3E%3Cpath d='M7.3 11.7c-2 .3-3.3 1.8-3.3 4 0 1.5-.5 2.6-1.5 3.3 3.6.6 6.9-.6 8-3.3'/%3E%3C/svg%3E"); }
body.crelala-start #content .crelala-welcome__facts li:nth-child(4n + 2) { --hm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 7.5L12 3.5l8.5 4v9L12 20.5l-8.5-4z'/%3E%3Cpath d='M3.5 7.5L12 11.5l8.5-4M12 11.5v9'/%3E%3C/svg%3E"); }
body.crelala-start #content .crelala-welcome__facts li:nth-child(4n + 3) { --hm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='0.5'/%3E%3Crect x='6.5' y='7.5' width='11' height='9'/%3E%3Cpath d='M6.5 14.5l3-3 2.5 2.5 2-2 3.5 3.5'/%3E%3C/svg%3E"); }
body.crelala-start #content .crelala-welcome__facts li:nth-child(4n + 4) { --hm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h16v10H10l-4 3.5v-3.5H4z'/%3E%3C/svg%3E"); }
body.crelala-start #content .crelala-welcome__facts strong {
	display: block;
	color: #fff;
	font-size: 18px;
	font-weight: 400;
}

/* buttons: red + outlined, centred */
body.crelala-start #content .crelala-welcome__actions {
	gap: 16px;
	margin-top: 26px;
}
body.crelala-start #content .crelala-welcome__actions .wp-block-button__link {
	padding: 11px 26px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: var(--cm-radius-sm);
	background: transparent;
	color: #fff !important;
	font-size: 15px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background-color var(--cm-ease), border-color var(--cm-ease);
}
body.crelala-start #content .crelala-welcome__actions .wp-block-button__link:hover,
body.crelala-start #content .crelala-welcome__actions .wp-block-button__link:focus-visible {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.08);
}
body.crelala-start #content .crelala-welcome__actions .crelala-btn-primary .wp-block-button__link {
	border-color: var(--cm-red);
	background: var(--cm-red);
}
body.crelala-start #content .crelala-welcome__actions .crelala-btn-primary .wp-block-button__link:hover,
body.crelala-start #content .crelala-welcome__actions .crelala-btn-primary .wp-block-button__link:focus-visible {
	border-color: var(--cm-red-dark);
	background: var(--cm-red-dark);
}

/* introduction: lead, sub line, two columns */
body.crelala-start #content h2.wp-block-heading.crelala-about__lead {
	margin: 0 0 6px;
	padding: 0;
	font-size: 22px;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}
body.crelala-start #content h2.wp-block-heading.crelala-about__lead::after {
	display: none;
}
body.crelala-start #content .crelala-about__sub {
	margin: 0 0 22px;
	font-size: 18px;
	line-height: 1.65;
	color: #ebebeb;
}
body.crelala-start #content .crelala-about__cols {
	gap: 56px;
	margin: 0;
	font-size: 18px;
	line-height: 1.65;
	color: #ebebeb;
}
body.crelala-start #content .crelala-about__cols > .wp-block-column + .wp-block-column {
	padding-left: 56px;
	margin-left: -1px;
	border-left: 1px solid var(--hm-line);
}
body.crelala-start #content .crelala-about__cols p {
	margin: 0 0 14px;
}
body.crelala-start #content .crelala-about__cols p:last-child {
	margin-bottom: 0;
}

/* tablets: facts 2 × 2 */
@media (max-width: 1100px) {
	body.crelala-start #content .crelala-welcome__facts {
		grid-template-columns: 1fr 1fr;
		row-gap: 14px;
	}
	body.crelala-start #content .crelala-welcome__facts li {
		justify-content: start;
		padding: 0 16px;
	}
	body.crelala-start #content .crelala-welcome__facts li:nth-child(odd) {
		border-left: 0;
	}
}
/* phones: columns below each other (WordPress stacks them), buttons full width, icon above the text */
@media (max-width: 781px) {
	body.crelala-start #content .crelala-welcome + .crelala-about {
		margin-top: 30px;
	}
	body.crelala-start #content .crelala-about__cols {
		gap: 0;
	}
	body.crelala-start #content .crelala-about__cols > .wp-block-column + .wp-block-column {
		padding: 14px 0 0;
		margin: 0;
		border-left: 0;
	}
	body.crelala-start #content .crelala-welcome__actions .wp-block-button {
		flex: 1 1 100%;
	}
	body.crelala-start #content .crelala-welcome__actions .wp-block-button__link {
		display: block;
		text-align: center;
	}
}
@media (max-width: 560px) {
	body.crelala-start #content .crelala-welcome__facts li {
		display: block;
		padding: 0 6px;
		text-align: center;
		font-size: 14px;
	}
	body.crelala-start #content .crelala-welcome__facts li::before {
		display: block;
		margin: 0 auto 6px;
	}
	body.crelala-start #content .crelala-welcome__facts strong {
		font-size: 16px;
	}
}

body.crelala-start #content .crelala-welcome__actions .wp-block-button__link {
	font-weight: 400;
}

/* Orte texts were imported with justified text – same left alignment as the front page */
body.crelala-start #content .crelala-about__cols .has-text-align-justify {
	text-align: left;
}

/* Orte pages (posts) have a narrower content frame (1240px) – same width as the front page */
body.crelala-start #content > .sqrallwaysboxed {
	max-width: 1500px;
}

/* imported Orte texts carry a smaller preset size (has-klein-font-size, !important in WordPress) – same text size as the front page */
body.crelala-start #content .crelala-about__cols :is(p, li, span) {
	font-size: 18px !important;
	line-height: 1.65;
}
