main {
	display: grid;
	gap: 0;
	grid-template:
		"teaser" 50vh
		"sidebar" auto
		"content" auto / 100vw;

	&:not(:has(> #teaser)) {
		grid-template:
			"sidebar" auto
			"content" auto / 100vw;
	}
	&:not(:has(> #sidebar > *)) {
		grid-template:
			"teaser" 70vh
			"content" auto / 100vw;
	}
	&:not(:has(> #teaser)):not(:has(> #sidebar > *)) {
		grid-template:
			"content" auto / 100vw;
	}

	/* Headerbild */
	#teaser {
		grid-area: teaser;
		position: relative;
		padding-inline: 30px;
		--width: calc(100% + 60px);

		@media (min-width: 2400px) {
			main:not(:has(> #sidebar > *)) & {
				min-width: 1939px;
				max-width: 1939px;
				margin-inline: auto;
			}
		}

		> img {
			margin-inline: -30px;

			min-width: var(--width);
			max-width: var(--width);
			min-height: 100%;
			max-height: 100%;
			object-fit: cover;
		}

		> .overlay {
			margin-inline: -30px;

			position: absolute;
			width: calc(var(--width) - 60px);
			height: 100%;
			background-image: linear-gradient(70deg, #63358B40 0%, #63358B1C 100%);
			z-index: 1;
		}

		> h1 {
			--inline-padding: 20px;
			--bottom-padding: 30px;
			--width: calc(100% - var(--inline-padding) * 2);

			position: absolute;
			left: var(--inline-padding);
			bottom: var(--bottom-padding);
			width: var(--width);
			max-width: 1140px;
			left: max(var(--inline-padding), calc((100% - var(--width)) / 2));

			margin: 0;

			font-size: 50px;
			line-height: 63px;
			font-weight: 600;
			color: white;

			z-index: 2;

			main:not(:has(> #sidebar > *)) & {
				--inline-padding: 15px;
				--bottom-padding: 50px;

				font-size: 55px;
				line-height: 61px;
			}
		}
	}

	#sidebar {
		grid-area: sidebar;
		padding: 35px 20px;
		background-color: #f3f0f5;

		&:not(:has(> *)) {
			display: none;
		}

		> ul {
			list-style: none;
			padding: 0;
			display: flex;
			flex-direction: column;

			> li {
				display: flex;
				
				> a {
					width: 100%;
					border-bottom: 1px solid #2E1A46;
					padding-block-end: 5px;
					margin-block-end: 14px;
					font-size: 17px;
					line-height: 27px;
					transition: .3s;

					&:hover {
						color: #e40046;
						border-color: #e40046;
					}
				}
			}
		}
	}

	#content {
		grid-area: content;
	}

	@media (min-width: 768px) {
		grid-template:
			"teaser teaser" 50vh
			"sidebar content" auto / 1fr 2fr;
		
		&:not(:has(> #teaser)) {
			grid-template: "sidebar content" auto / 1fr 2fr;
		}
		&:not(:has(> #sidebar > *)) {
			grid-template:
				"teaser" min(72vh, 360px)
				"content" auto / 1fr;
		}
		&:not(:has(> #teaser)):not(:has(> #sidebar > *)) {
			grid-template: "content" auto / 1fr;
		}

		#teaser {
			min-height: 50vh;

			main:not(:has(> #sidebar > *)) & {
				max-height: min(72vh, 360px);
			}

			> img {
				object-position: top left;
			}

			> h1 {
				--inline-padding: 50px;
				--bottom-padding: 85px;

				font-size: 100px;
				line-height: 110px;

				main:not(:has(> #sidebar > *)) & {
					--inline-padding: 30px;
					--bottom-padding: 95px;

					--width: 88%;

					font-size: 60px;
					line-height: 65px;

					display: flex;
					justify-content: center;
				}
			}
		}

		#sidebar {
			align-self: start;
			position: sticky;
			top: 0;
			padding: 100px 80px 100px 0;
		
			> ul {
				align-items: end;

				> li > a {
					font-size: 22px;
					line-height: 34px;
					border-bottom: none;
				}
			}
		}
	}

	@media (min-width: 1025px) {
		&:not(:has(> #sidebar > *)) {
			grid-template:
				"teaser" max(72vh, 360px)
				"content" auto / 1fr;
		}

		#teaser {
			main:not(:has(> #sidebar > *)) & {
				min-height: max(72vh, 360px);
			}

			> h1 {
				--width: 1140px;

				main:not(:has(> #sidebar > *)) & {
					--inline-padding: 30px;
					--bottom-padding: 140px;

					--width: 72%;

					font-size: 100px;
					line-height: 110px;

					display: flex;
					justify-content: center;
				}
			}
		}

		#sidebar {
			top: 65px;

			width: 60%;
			margin-inline-start: auto;
		}
	}
}
