/**
 * Smartphone und Tablet (unter 1024 px)
 *
 * Die Datei wird mit media="screen and (max-width: 1023px)" eingebunden
 * (page.typoscript), die Desktop-Ansicht bleibt damit unberührt. Sie
 * überschreibt die festen Breiten und absoluten Positionen des YAML-Layouts:
 * Die Navigation wird zur Leiste mit Menüknopf (Knöpfe setzt dafg.js), Inhalt
 * und Termine stehen untereinander, Raster und Module in voller Breite.
 *
 * Stufen: Tablet bis 1023 px, Smartphone bis 599 px.
 */

/* --- Grundlagen -------------------------------------------------------- */

/* Nur am body: Er überträgt sein overflow (mit overflow-y: scroll aus
   screen-PAGE-layout.css) auf das Fenster. Ein overflow am html machte
   body zum Scrollcontainer, dann bliebe die Navigation (position: sticky)
   nicht oben stehen. */
body {
	overflow-x: hidden;
}

body {
	overflow-y: auto;
	/* 14 statt 12 px Grundschrift; alle em-Maße wachsen mit */
	font-size: 87.5%;
}

img,
iframe,
video {
	max-width: 100%;
}

img {
	height: auto;
}

.ym-wrapper,
header,
.ym-column {
	min-width: 0;
	max-width: none;
	width: auto;
}

/* Navigation über dem Slider: Reihenfolge per Flexbox statt im Markup.
   Flex-Container ist .ym-wrapper, damit der Footer im selben Block liegt
   und die Navigation (sticky) bis zum Seitenende oben stehen bleibt. */
.ym-wrapper {
	display: flex;
	flex-direction: column;
}

.ym-wbox {
	display: contents;
}

/* --- Navigation -------------------------------------------------------- */

.nav-container {
	order: -1;
	position: sticky;
	top: 0;
	z-index: 1000;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	padding-inline: 1em .5em;
	width: auto;
	height: auto;
	background: #d3cac6;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Die beiden Raster lösen sich auf, ihre Spalten ordnet die Leiste:
   Logo und Menüknopf, aufgeklappt Suche, Hauptmenü, Service, Sprachen */
.nav-container .ym-grid {
	display: contents;
}

.nav-container .ym-grid > .ym-gl {
	display: none;
	flex: 0 0 100%;
	float: none;
	margin: 0 !important;
	width: 100%;
}

.nav-container .ym-grid > .logo {
	display: block;
	order: 1;
	flex: 1 1 auto;
	padding: .4em 0;
	width: auto;
	line-height: 0;
}

.nav-container .logo img {
	width: auto;
	height: 3.5em;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.nav-container.is-open .ym-grid > .ym-gl {
	display: block;
}

/* Suche */
.nav-container .ym-grid:first-child > .ym-gl:nth-child(3) {
	order: 3;
}

/* Hauptmenü */
.nav-container .ym-grid:nth-child(2) > .ym-gl:nth-child(2) {
	order: 4;
}

/* Service */
.nav-container .ym-grid:first-child > .ym-gl:nth-child(1) {
	order: 5;
}

/* Sprachen */
.nav-container .ym-grid:first-child > .ym-gl:nth-child(2) {
	order: 6;
}

.nav-toggle {
	display: block !important;
	order: 2;
	position: relative;
	margin: 0;
	padding: 0;
	width: 3.2em;
	height: 3.2em;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	position: absolute;
	left: .8em;
	width: 1.6em;
	height: 3px;
	border-radius: 2px;
	background: #B02D0A;
	transition: transform .2s, background .2s;
}

.nav-toggle span {
	top: 50%;
	margin-top: -1px;
}

.nav-toggle span::before,
.nav-toggle span::after {
	content: "";
	left: 0;
}

.nav-toggle span::before {
	top: -.5em;
}

.nav-toggle span::after {
	top: .5em;
}

.nav-container.is-open .nav-toggle span {
	background: transparent;
}

.nav-container.is-open .nav-toggle span::before {
	transform: translateY(.5em) rotate(45deg);
}

.nav-container.is-open .nav-toggle span::after {
	transform: translateY(-.5em) rotate(-45deg);
}

.nav-container .ym-searchform {
	display: none;
	flex: 0 0 100%;
	float: none;
	margin: 0;
	width: 100%;
}

.nav-container.is-open .mainNavi,
.nav-container.is-open .serviceNavi,
.nav-container.is-open #langNavi,
.nav-container.is-open .ym-searchform {
	display: block;
}

.nav-container .ym-searchform {
	display: block;
	float: none;
	position: relative;
	margin: .25em 0 .75em;
	margin-inline-end: .5em;
	/* Abstände aus den YAML-Stufen 740/480 px aufheben */
	padding: 0;
	width: auto;
	line-height: 1;
}

.nav-container .ym-searchform .ym-searchfield {
	box-sizing: border-box;
	padding: .6em .75em;
	padding-inline-end: 2.75em;
	width: 100%;
	height: auto;
	font-size: 1.1429em; /* 16 px, sonst zoomt iOS beim Tippen */
	line-height: 1.25;
}

.nav-container .ym-searchform input[type="image"] {
	position: absolute;
	top: 50%;
	inset-inline-end: .75em;
	transform: translateY(-50%);
}

.nav-container .mainNavi {
	font-size: 1.1429em;
	max-height: calc(100vh - 12em);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.nav-container .ym-hlist ul,
.nav-container .ym-hlist ul li {
	display: block;
	float: none;
	margin: 0;
	padding: 0;
	width: auto;
}

.nav-container .ym-hlist.mainNavi > ul {
	padding: 0;
	padding-inline-end: .5em;
	border-top: 1px solid rgba(0, 0, 0, .12);
}

.nav-container .mainNavi > ul > li {
	position: relative;
	border-bottom: 1px solid rgba(0, 0, 0, .12);
}

.nav-container .mainNavi > ul > li > a,
.nav-container .mainNavi > ul > li > strong {
	padding: .6em 0;
	padding-inline-end: 3em;
	line-height: 1.5em;
}

.subnav-toggle {
	display: block !important;
	position: absolute;
	top: 0;
	inset-inline-end: 0;
	margin: 0;
	padding: 0;
	width: 2.75em;
	height: 2.7em;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.subnav-toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -.45em 0 0 -.3em;
	width: .55em;
	height: .55em;
	border-right: 2px solid #B02D0A;
	border-bottom: 2px solid #B02D0A;
	transform: rotate(45deg);
	transition: transform .2s;
}

.mainNavi li.is-open > .subnav-toggle::after {
	margin-top: -.15em;
	transform: rotate(-135deg);
}

/* Untermenüs: im Fluss statt als Dropdown, per Knopf aufklappbar */
.nav-container .ym-hlist ul li ul,
.nav-container .ym-hlist ul li:hover ul {
	display: none;
	position: static;
	margin: 0;
	padding: 0 0 .5em !important;
	padding-inline-start: 1em !important;
	font-size: .875em;
	background: none;
}

.nav-container .ym-hlist ul li.is-open ul {
	display: block;
}

.nav-container .ym-hlist.mainNavi ul li ul li {
	padding: 0 !important;
	width: auto;
	height: auto;
	background: none;
}

.nav-container .ym-hlist ul li ul li.last {
	display: none;
}

.nav-container .ym-hlist ul li ul li a {
	padding: .45em 0;
	line-height: 1.4em;
}

.nav-container .serviceNavi {
	padding: .5em 0;
	font-weight: 600;
}

.nav-container .serviceNavi ul li {
	display: inline-block;
}

.nav-container .serviceNavi ul li a {
	padding: .4em 0;
	padding-inline-end: .75em;
	color: #000;
}

.nav-container #langNavi {
	padding: 0 0 .75em;
}

.nav-container #langNavi ul li {
	display: inline-block;
}

.nav-container #langNavi ul li a {
	padding: .4em 0;
	padding-inline-end: .75em;
	color: #000;
}

/* --- Kopf mit Slider ---------------------------------------------------- */

/* Bildverhältnis der Slider-Bilder 1024 x 372 */
header .news-latest-container {
	height: calc(100vw * 372 / 1024) !important;
	width: 100% !important;
}

header .news-latest-container .news-latest-item {
	width: 100% !important;
	height: 100% !important;
}

header .news-latest-container .news-latest-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

header .news-latest-container .text {
	top: auto;
	right: 1em;
	bottom: 1em;
	left: auto;
	padding: .75em 1em;
	width: 55%;
	height: auto;
	max-height: calc(100% - 2em);
	overflow: hidden;
	box-sizing: border-box;
}

header .news-latest-container .text p,
header .news-latest-container .text .more-link {
	display: none;
}

header .news-latest-container .text h2 {
	margin-bottom: 0;
	font-size: 1.5em;
}

/* Punkte mittig unter den Bildern statt auf dem Bild */
#slideshow-nav {
	position: static;
	display: flex;
	justify-content: center;
	padding-top: .75em;
}

/* --- Inhalt und Termine ------------------------------------------------- */

.ym-column {
	display: block;
	overflow: visible;
	margin-top: 1.5em;
	padding: 0;
}

.ym-col1,
.ym-col3 {
	float: none;
	margin: 0;
	width: auto;
}

.ym-col1 .ym-cbox,
.ym-col3 .ym-cbox {
	padding: 0 1em;
}

.content-element,
.news-single-item {
	padding: 1em 1.25em;
}

.content-element .more-padding {
	padding: 1em;
}

.csc-textpic-intext-left .csc-textpic-imagewrap {
	width: auto;
	max-width: 50%;
}

.csc-textpic-intext-right-nowrap .csc-textpic-text,
.csc-textpic-intext-left-nowrap .csc-textpic-text {
	margin-left: 0;
	margin-right: 0;
}

/* Tabellen im Text seitlich scrollbar statt breiter als die Seite */
.ym-col1 table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

.ym-col1 iframe {
	width: 100%;
}

/* Termine-Liste (DAFG-Termine, Externe Termine) */
.news-list-container.dates .news-list-item {
	padding: 1.25em 3.5em 1.25em 1.25em;
	height: auto;
}

.news-list-container.dates .news-list-item .more-link a {
	top: 50%;
	margin-top: -.8333em;
}

.gradient {
	display: none;
}

/* Bildergalerie der Einzelansicht: beide Pfeile in einer Zeile */
.news-single-img.first .lb-nav span.prev,
.news-single-img.first .lb-nav span.next {
	width: calc(50% - .5em);
}

/* Länderflaggen */
.flags .ym-gl {
	margin-right: 1em;
	width: calc((100% - 2em) / 3);
	height: auto;
}

.flags .ym-gl.last {
	margin-right: 0;
}

/* Google-Karte (Breite steht inline am Element) */
.cbQuickGoogleMap .inner_cbQuickGoogleMap {
	max-width: 100%;
	width: 100% !important;
}

/* Formulare (Anmeldung, Kontakt, Presse): Beschriftung über dem Feld,
   Felder in voller Breite */
.ym-form label,
.ym-form .ym-label {
	float: none;
	width: auto;
}

.ym-form .ym-gl label {
	float: left;
}

.ym-form label.privacy {
	width: calc(100% - 2.8333em);
}

.ym-form .ym-text {
	margin-top: 1.5em;
	width: auto;
}

.ym-form input[type=text],
.ym-form input[type=email],
.ym-form textarea {
	box-sizing: border-box;
	float: none;
	padding: .4em .5em;
	width: 100%;
	font-size: 1.1429em; /* 16 px, sonst zoomt iOS beim Tippen */
}

.ym-form input[type=submit],
.ym-form input[type=submit]:valid {
	height: 2.5em;
}

/* Terminsuche (Externe Termine): ohne feste Höhe, Felder untereinander in
   voller Breite. customSelect legt die unsichtbare Auswahlliste absolut über
   ihr Ersatzfeld; als Block stehen beide am Zeilenanfang übereinander, sonst
   liegt die zweite Liste neben dem Feld und Antippen geht ins Leere. */
.bb-form form {
	padding: 1.25em;
	height: auto;
}

.bb-form form .date-search {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
}

.bb-form form .date-search label.first {
	flex: 0 0 100%;
}

.bb-form form label {
	padding: 0;
}

.bb-form form input[type=text] {
	flex: 1 1 6em;
	margin: 0;
	padding: 0 .5em;
	min-width: 0;
	height: 2.5em;
	font-size: 16px;
}

.bb-form form .customSelect {
	display: block !important;
	box-sizing: border-box;
	padding-top: 0;
	width: 100% !important;
	height: 2.5em;
	line-height: 2.5em;
}

.bb-form form .customSelectInner {
	width: auto !important;
}

.bb-form form select.hasCustomSelect {
	width: 100% !important;
	height: 2.5em !important;
	font-size: 16px !important;
}

.ym-g43em,
.ym-g3em {
	float: none;
	width: auto;
}

.ym-g43em .ym-gbox,
.ym-g3em .ym-gbox {
	padding: 0;
}

.ym-g43em .ym-gbox {
	position: relative;
}

.bb-form input[type=submit] {
	padding: 0 1.5em;
	width: auto;
	height: 2.5em;
}

/* Lightbox: Rahmen in Bildbreite statt fest 653 px */
.lb-container,
.lb-data {
	box-sizing: border-box;
	width: auto;
}

.lb-container .lb-nav {
	margin-left: 0;
	width: 100%;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
	width: calc(50% - .5em);
}

.lb-container .news-single-img.last {
	line-height: 0;
}

/* --- Startseite --------------------------------------------------------- */

.three,
.three .news-list-item {
	height: auto;
}

.two {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25em;
}

.two .content-element {
	float: none;
	margin: 0 !important;
	width: calc(50% - .625em);
	height: auto;
	box-sizing: border-box;
}

.module-1 {
	width: auto;
}

.module-2 {
	position: static;
	margin: 0 -1em 1.6667em;
	height: auto;
	display: block;
	background: white;
	overflow-x: visible;
}

.module-2 .module-2-content {
	width: auto;
	background: none;
}

.module-2 .border-bottom {
	height: auto;
	background: none;
}

#uid-1 .module-2 .content-element {
	margin: 0;
	padding: 4.5em 1.25em 2em;
}

.module-2 .tip {
	top: .75em;
	left: 1em;
}

.module-2 .content-element .csc-textpic-imagewrap {
	float: left;
	margin: 0 1.5em 1em 0;
	max-width: 40%;
}

.module-2 .content-element .csc-textpic-text {
	margin-left: 0;
}

/* Abstand für das absolut gesetzte Modul 2 (lib.contentFront) entfällt */
.ym-col1 div[style*="margin-top: 37em"] {
	margin-top: 0 !important;
}

/* --- Footer ------------------------------------------------------------- */

footer {
	position: static;
}

footer .footer {
	box-sizing: border-box;
	padding: 3em 1.5em 2em;
	width: auto;
	background-position: center top;
}

footer .ym-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em 0;
}

footer .ym-grid > .ym-gl {
	float: none;
	margin: 0;
	width: 25%;
}

footer .ym-grid > .ym-gr {
	float: none;
	margin: 0 0 0 auto;
	width: auto;
}

footer address.ym-grid > .ym-gl {
	width: 100%;
}

footer address.ym-grid > .ym-gr {
	margin-left: 0;
	text-align: left;
}

/* --- Smartphone --------------------------------------------------------- */

@media screen and (max-width: 599px) {

	header .news-latest-container .text {
		display: none;
	}

	.ym-col1 .ym-cbox,
	.ym-col3 .ym-cbox {
		padding: 0 .75em;
	}

	.module-2 {
		margin-right: -.75em;
		margin-left: -.75em;
	}

	/* Bild über dem Text statt daneben */
	.news-list-item .ym-grid > .ym-gl,
	.csc-textpic-intext-left .csc-textpic-imagewrap,
	.module-2 .content-element .csc-textpic-imagewrap {
		float: none;
		margin: 0 0 1em;
		width: auto;
		max-width: none;
	}

	.news-list-item img {
		margin-right: 0;
	}

	.three .ym-grid > .ym-g33 {
		float: none;
		width: auto;
	}

	.three .news-list-item {
		margin-bottom: 1.25em;
		padding: 0 1.25em 1.25em;
		border: 0 !important;
		border-bottom: 1px dotted #000 !important;
	}

	.three .ym-g33:last-child .news-list-item {
		margin-bottom: 0;
		border-bottom: 0 !important;
	}

	.two .content-element {
		width: 100%;
	}

	.two .content-element img,
	.three .news-list-item img,
	.news-list-item .ym-grid > .ym-gl img,
	.module-2 .content-element .csc-textpic-imagewrap img {
		width: 100%;
		height: auto;
	}

	.flags .ym-gl {
		width: calc((100% - 1em) / 2);
	}

	.flags .ym-gl:nth-child(3n) {
		margin-right: 1em;
	}

	.flags .ym-gl:nth-child(2n) {
		margin-right: 0;
	}

	/* Footer-Menü einspaltig, in voller Breite; Inhalt links und rechts
	   auf einer Linie mit Logo und Menüknopf der Navigation */
	footer {
		padding: 0;
	}

	footer .footer {
		padding-inline: 1em 1.3em;
	}

	footer .ym-grid > .ym-gl {
		width: 100%;
	}

	/* Social-Icons mittig; Abstand per gap statt der Inline-Abstände,
	   damit sie auch im Arabischen mittig stehen */
	footer address.ym-grid > .ym-gr {
		width: 100%;
	}

	footer address .ym-gr p {
		display: flex;
		justify-content: center;
		gap: 12px;
	}

	footer address .ym-gr a {
		padding: 0 !important;
	}

	/* Terminsuche: "bis" in eigener Zeile zwischen den Datumsfeldern */
	.bb-form form .date-search label {
		flex: 0 0 100%;
	}
}
