/* stylelint-disable scss/selector-no-redundant-nesting-selector */
:root {
	--section-spacing-top: 40px;
    --section-spacing-bottom: 40px;
	--first-section-spacing-top: 64px;
	--last-section-spacing-bottom: 120px;
	--section-border-spacing: var(--section-spacing-bottom);
	--section-spacing-add: 40px;
	--block-spacing: 32px;
	--header-height: 120px;

	/* Section widths */
	--w-regular: 992px;                                        /* middle width (Mittel) */
	--w-narrow: 736px;                                         /* text width (Schmal) */
	--w-narrow-inset: calc((var(--w-regular) - var(--w-narrow)) / 2); /* dynamic: 128px */
}

:is(#page-content, #flexible-content) .fcb-section {
    position: relative;
	transition: background-color 0.3s ease-in-out;
}

.fcb-section .fcb-columns {
	display: grid;
	grid-gap: 30px;
	grid-template-columns: repeat(1, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'] {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='1/3 2/3'] {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='1/3 2/3'] > .fcb-column:nth-child(2) {
	grid-column: 2 / span 2;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='2/3 1/3'] {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='2/3 1/3'] > .fcb-column:nth-child(1) {
	grid-column: 1 / span 2;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='1/4 3/4'] {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='1/4 3/4'] > .fcb-column:nth-child(2) {
	grid-column: 2 / span 3;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='3/4 1/4'] {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='3/4 1/4'] > .fcb-column:nth-child(1) {
	grid-column: 1 / span 3;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='3/5 2/5'] {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='3/5 2/5'] > .fcb-column:nth-child(1) {
    grid-column: 1 / span 3;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='3/5 2/5'] > .fcb-column:nth-child(2) {
    grid-column: 4 / span 2;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='2/5 3/5'] {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='2/5 3/5'] > .fcb-column:nth-child(1) {
    grid-column: 1 / span 2;
}
.fcb-section .fcb-columns[data-elements-count='2'][data-distribution='2/5 3/5'] > .fcb-column:nth-child(2) {
    grid-column: 3 / span 3;
}
.fcb-section .fcb-columns[data-elements-count='3'] {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='3'][data-distribution='1/5 3/5 1/5'] {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='3'][data-distribution='1/5 3/5 1/5'] > .fcb-column:nth-child(2) {
	grid-column: 2 / span 3;
}
.fcb-section .fcb-columns[data-elements-count='4'] {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fcb-section .fcb-columns[data-elements-count='5'] {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Additional settings styles */
.fcb-section[data-section-spacing-top] {
	padding-top: var(--section-spacing-top);
}

.fcb-section[data-section-spacing-bottom] {
	padding-bottom: var(--section-spacing-bottom);
}

.fcb-section[data-section-spacing-add_top] {
	padding-top: calc(var(--section-spacing-top) + var(--section-spacing-add));
}

.fcb-section[data-section-spacing-add_bottom] {
	padding-bottom: calc(var(--section-spacing-bottom) + var(--section-spacing-add));
}

#flexible-content .fcb-section:first-child,
#page-content .fcb-section:first-of-type {
	--section-spacing-top: var(--first-section-spacing-top);
}

.no-heroes ~ #flexible-content .fcb-section:first-child,
.no-heroes ~ #page-content .fcb-section:first-of-type,
.no-heroes ~ .fcb-section:first-of-type {
	--section-spacing-top: calc(var(--first-section-spacing-top) + var(--header-height));
}

.no-heroes ~ .blog-wrapper .single-blog-container {
	padding-top: calc(var(--first-section-spacing-top) + var(--header-height));
}

#flexible-content .fcb-section:last-child,
#page-content .fcb-section:last-of-type {
	--section-spacing-bottom: var(--last-section-spacing-bottom);
}

.fcb-column > :is(
	.links-block,
	.team-block,
	.standorte,
	.resource-listing,
	.brochure.queued-animation
):not(:last-child) {
	margin-bottom: var(--block-spacing);
}

.fcb-section[data-section-width="regular"] .container {
	box-sizing: border-box;
	max-width: var(--w-regular);
	padding-left: var(--w-narrow-inset);
	padding-right: var(--w-narrow-inset);
}

.fcb-section[data-section-width="wide"] .container {
	box-sizing: border-box;
	max-width: var(--w-regular);
}

@media (max-width: 1200px) {
	.fcb-section[data-section-width="regular"] .container,
	.fcb-section[data-section-width="wide"] .container {
		padding-left: 0;
		padding-right: 0;
	}
}

.fcb-section[data-section-width="full"] .container {
	width: min(100% - 2 * var(--page-margin), var(--page-max));
	padding: 0;
}

.fcb-section[data-section-width="padding-right"] .container {
	width: 100%;
	padding: 0 130px 0 0;
}

.fcb-section[data-section-width="padding-left"] .container {
	width: 100%;
	padding: 0 0 0 130px;
}

.fcb-section[data-section-layout-center-text] .fcb-columns {
	align-items: center;
}

.fcb-section[data-section-layout-border-bottom] > .container {
	border-bottom: 1px solid var(--color-main);
	padding-bottom: var(--section-border-spacing);
}

.fcb-section .fcb-columns[data-elements-count="1"] > .fcb-column:not(.deepest) > *:not(.fcb-subsection):last-child > p:last-child {
	margin-bottom: 0;
}

.fcb-section[data-section-width="full"] .container:not(.header-image) .row {
	margin: 0;
}

@media (min-width: 769px) {
	.fcb-section .fcb-column.deepest > *:last-child > *:last-child {
		margin-bottom: 0;
	}
}

@media (min-width:769px) and (max-width:1024px) {
	.fcb-section .fcb-columns[data-elements-count='4'] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fcb-section .fcb-columns[data-distribution='1/4 3/4'] .fcb-column {
		grid-column: auto !important;
	}
}

@media (max-width: 1200px) {
	:root {
		--header-height: 72px;
	}
}

@media (max-width: 1115px) {
	.fcb-section[data-section-width="full"] .container.header-image {
		padding: 0;
	}
	.fcb-section[data-section-width="full"] .container.header-image .row {
		margin: 0;
	}
	.container:not(.header-image) .row {
		margin: 0;
	}
}

@media (max-width: 1024px) {
	:root {
		--section-spacing-top: 40px;
		--section-spacing-bottom: 40px;
		--last-section-spacing-bottom: 80px;
		--section-spacing-add: 32px;
	}

	.fcb-section .fcb-columns[data-elements-count="3"] {
		grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
		column-gap: 0;
		/* grid-gap: 0; */
	}

	.fcb-section .fcb-columns[data-elements-count='3'][data-distribution='1/5 3/5 1/5'] > .fcb-column:nth-child(2) {
		grid-column: 1 / span 3;
	}

	.fcb-section .fcb-columns[data-elements-count="3"] .fcb-column.empty-column {
        display: none;
    }
}

@media (max-width: 768px) {
	:root {
		--section-spacing-top: 30px;
		--section-spacing-bottom: 30px;
		--last-section-spacing-bottom: 60px;
		--section-spacing-add: 24px;
	}

	.no-heroes ~ #flexible-content .fcb-section:first-child,
	.no-heroes ~ #page-content .fcb-section:first-of-type,
	.no-heroes ~ .fcb-section:first-of-type {
		--section-spacing-top: calc(30px + var(--header-height));
	}

	.fcb-section .fcb-columns {
		grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
		/* grid-gap: 0; */
	}
	.fcb-section .fcb-columns .fcb-column {
		grid-column: auto !important;
	}

	.fcb-section .fcb-column.deepest:last-child > *:last-child > *:last-child {
		margin-bottom: 0;
	}

	.fcb-columns:has(.mobile-reverse) .fcb-column:last-child {
		order: 1;
	}
	
	.fcb-columns:has(.mobile-reverse) .fcb-column:first-child {
		order: 2;
	}
	
	.fcb-column.empty-column {
        display: none;
    }
}