@import url('https://fonts.googleapis.com/css2?family=Blinker:wght@100;200;300;400;600;700;800;900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:wght@100;300;400;500;700;900&display=swap');
@import url(formular.css);

*,
::before,
::after {
	box-sizing: border-box;
}

html {
	height: 100%;
	font-size: 100%;
	scroll-behavior: smooth;
}

body {
	background: white;
	margin: 0;
	padding: 0;
	height: 100%;
	display: grid;
	justify-items: center;
	grid-template-rows: 1fr auto;
	grid-template-columns: 1fr;
	background: url(../img/bg.png) repeat-x left top / auto 12rem;
	gap: 0;
}

/* #region TYPOGRAPHY */

h1 {
	font: 300 2.8rem/1 "Blinker", sans-serif;
	text-align: left;
	color: dimgray;
	margin: 0;
	padding: 0;
}

h2 {
	font: 300 2rem/1 "Blinker", sans-serif;
	text-align: left;
	color: rgb(64, 64, 64);
	margin: 0;
	padding: 0;
}

p {
	font: 300 1rem/1.3 "Roboto", sans-serif;
	text-align: left;
	color: dimgray;
	margin: 0;
	padding: 0;
}

.trennlinie {
	border-bottom: 1px solid rgb(222, 221, 221);
	margin-bottom: .5rem;
}

/* #endregion */

/* #region header */

header {
	position: fixed;
	display: grid;
	place-items: center;
	z-index: 50;
	top: 0;
	width: 100%;
	height: 9rem;
	background-color: transparent;
	transition: background-color .3s ease, height .4s ease-out;
}

header a {
	text-decoration: none;
}

header hgroup {
	height: min-content;
}

header hgroup h1 {
	grid-row: 1;
	font: 300 2.2rem/1 "Blinker", sans-serif;
	text-align: center;
	white-space: nowrap;
	color: white;
	width: min-content;
	margin-bottom: .25rem;
	padding: 0 .5rem;
	transition: all .2s ease-in-out;
}

header hgroup h1:hover {
	color: orangered;
	cursor: pointer;
}

header hgroup p {
	grid-row: 2;
	font: 300 .85rem/1 "Roboto", sans-serif;
	text-align: center;
	white-space: nowrap;
	color: white;
}

header.sticky {
	height: 4rem;
	background: rgba(0, 0, 0, 0.8);
	padding-bottom: 1rem;
}

header.sticky hgroup h1 {
	font: 300 2rem/1 "Blinker", sans-serif;
}

@media (max-width: 768px) {
	header {
		/* Mobil ist ein starrer 9rem Header zu wuchtig */
		height: auto;
	}
}

/* #endregion */

main {
	grid-row: 1;
	display: grid;
	/* Sidebar 250px, Content den Rest, max 1200px breit */
	grid-template-columns: 250px minmax(0, 1fr);
	grid-template-rows: 1fr;
	max-width: 1200px;
	/* Puffer zum Bildschirmrand */
	width: 95%;
	margin: 9rem auto .5rem auto;
	box-shadow: rgba(31, 31, 31, 0.1) 0px 1px 1px 0px;
	gap: 0;
}

/* #region main section nav */

main section {
	grid-column: 1;
	grid-row: 1;
	background: #f0f0f0;
}

main section nav {
	position: sticky;
	/* Etwas mehr Puffer als 4rem, damit es nicht am Header "klebt" */
	top: 5rem;
	z-index: 10;
	align-self: start;
	height: auto;
	/* Verhindert, dass die Nav länger als der Screen wird */
	max-height: calc(100vh - 6rem);
	/* Scrollbar für Nav, falls sie zu lang wird */
	overflow-y: auto;
}

main section nav ul {
	list-style: none;
	padding: 0 .5rem;
	margin: .5rem 0 .5rem .5rem;
}

main section nav ul li {
	text-align: left;
	border-bottom: 1px solid rgb(228, 228, 228);
}

main section nav ul li a {
	font: 300 1rem/1.2 "Roboto", sans-serif;
	color: black;
	/* Unterstreichung global entfernen */
	text-decoration: none;
	display: flex;
	align-items: center;
	/* Etwas Klickfläche schaffen */
	padding: 0.3rem 0;
}

main section nav ul li a::before {
	content: "–";
	margin-right: 0.5rem;
	display: inline-block;
	color: dimgray;
	/* Unterstreichung hier verbieten */
	text-decoration: none !important;
}

/* NUR den Text im Span unterstreichen */
main section nav ul li a:hover span {
	text-decoration: underline;
	display: inline-block;
}

/* Besuchte Links: Nur die Farbe des Spans ändern */
main section nav ul li a:visited span {
	color: dimgray;
}

/* Unterliste initial verstecken */
.submenu {
	list-style: none;
	/* Stärkere Einrückung */
	padding-left: 1.5rem;
	margin: 0;
	/* Wird später per JS aktiviert */
	display: none;
	max-height: 60vh;
	/* Scrollbalken nur innerhalb des Menüs, wenn nötig */
	overflow-y: auto;
}

main section nav ul .submenu li a::before {
	content: "›";
	margin-right: 0.6rem;
}

/* untere Linie bei Unterpunkten entfernen */
main section nav ul .submenu li {
	border-bottom: none;
}

/* Hauptpunkte mit Untermenü */
.has-submenu::after {
	content: "+";
	font-size: 0.8rem;
	/* Schiebt das Plus nach ganz rechts */
	margin-left: auto;
	padding-right: 0.5rem;
	color: dimgray;
}

/* Falls Klasse is-active vorhanden ist, Menü sofort zeigen */
.has-submenu.is-active+.submenu {
	/* Stellt sicher, dass es beim Laden da ist */
	display: block;
	/* Großer Wert, damit es offen ist */
	max-height: 1000px;
}

main section button {
	display: grid;
	place-items: center;
	height: 3rem;
	cursor: pointer;
	width: 100%;
	border: none;
	background: #4b96a7;
	color: #FFF;
	font-size: 1rem;
}

main section button a {
	font: 300 1rem/1.2 "Roboto", sans-serif;
	color: white;
	/* Unterstreichung global entfernen */
	text-decoration: none;
	align-items: center;
}

main section button:hover {
	background: #f54303;
	transition: background-color 0.3s ease-in-out;
}

/* #endregion */

/* #region main article */

main article {
	grid-column: 2;
	grid-row: 1;
	padding: 1rem;
	background: #fbfbfb;
}

main article h1 {
	padding: .5rem 0 1.5rem 0;
}

main article h2 {
	padding: 1rem 0 .25rem 0;
}

main article p {
	padding: 0;
}

main article p a {
	color: dimgray;
	text-decoration: none;
}

main article p a:hover {
	text-decoration: underline;
}

/* AJAX Transitions */
main article {
	transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

main article.fade-out {
	opacity: 0;
	transform: translateY(10px);
}

main article.fade-in {
	animation: fadeIn 0.5s ease-in-out forwards;
}

.content-section {
	opacity: 0;
	display: none;
	/* Schafft Platz für den fixierten Header beim Hinspringen */
	scroll-margin-top: 10rem;
}

.content-section.is-visible {
	display: block;
	animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	/* Ganz leichter Slide-Effekt nach oben */
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 768px) {
	main {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto;
		margin: 5rem auto .5rem auto;
	}

	main section {
		grid-column: 1;
		grid-row: 2;
	}

	main section nav {
		/* Sticky mobil deaktivieren, wenn es unter/über dem Content steht */
		position: static;
		width: 100%;
		max-height: none;
	}

	main article {
		grid-column: 1;
		grid-row: 1;
		width: 100%;
		height: min-content;
		margin: 0;
		padding: 1.5rem;
	}
}

/* #endregion */

/* #region footer */

footer {
	grid-row: 2;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	max-width: 1200px;
	width: 95%;
	background: rgb(73, 83, 90);
	box-shadow: rgba(31, 31, 31, 0.1) 0px 1px 1px 0px;
	padding: 0 .5rem;
	margin: 0;
	gap: 0;
}

footer>div {
	grid-column: 2 / 3;
	grid-row: 1;
	padding: .5rem;
}

footer>div>p {
	font: 300 .8rem/1.3 "Roboto", sans-serif;
	color: white;
}

footer>section {
	grid-column: 1 / 3;
	grid-row: 1;
	padding: .5rem;
}

footer>section>p {
	color: white;
}

/* #endregion */