/* Responsive Ansicht bis 1239 px (ersetzt das fruehere Joomla-Mobiltemplate "cargomandomobil").
   Ab 1240 px greift nichts davon: die Desktop-Ansicht bleibt unveraendert. */

.mobil-menue-knopf, .mobil-telefon, .mobil-schleier { display: none; }

@media (max-width: 1239px) {
	html, body { overflow-x: hidden; }

	#main_wrapper { width: auto; padding: 0 10px; }

	/* Kopf wie im Mobiltemplate: Menueknopf links, Logo mittig, Telefon rechts */
	#header {
		position: relative;
		height: auto;
		padding: 10px 0;
		text-align: center;
	}
	#header #logo { float: none; display: inline-block; vertical-align: middle; max-width: calc(100vw - 130px); height: auto; }
	#header #slogans { display: none; }
	.mobil-menue-knopf, .mobil-telefon {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid #ccc;
		border-radius: 5px;
		background: #f6f6f6;
		box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
		cursor: pointer;
	}
	.mobil-menue-knopf { left: 0; }
	.mobil-telefon { right: 0; }
	.mobil-menue-knopf img, .mobil-telefon img { height: 18px; width: auto; }
	.mobil-menue-knopf:focus-visible, .mobil-telefon:focus-visible { outline: 2px solid #1c978c; outline-offset: 2px; }

	/* Inhaltsseiten: Menue als ausklappende Leiste von links (Kacheln werden zur Textliste) */
	#wrapper #mainmenu {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 1000;
		float: none;
		width: 280px;
		max-width: 85vw;
		padding: 25px 15px 25px 10px;
		box-sizing: border-box;
		overflow-y: auto;
		background: #f0f0f0;
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform .25s ease, visibility 0s linear .25s;
	}
	body.menue-offen #wrapper #mainmenu {
		transform: none;
		visibility: visible;
		transition: transform .25s ease;
		box-shadow: 0 0 25px rgba(0, 0, 0, .4);
	}
	body.menue-offen .mobil-schleier {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999;
		background: rgba(0, 0, 0, .4);
	}
	#wrapper #mainmenu ul.menu { width: auto; }
	#wrapper #mainmenu ul.menu > li,
	#wrapper #mainmenu ul.menu > li.active.deeper,
	#wrapper #mainmenu ul.menu > li.current {
		float: none;
		width: auto;
		margin: 0 0 22px 0;
		padding-left: 25px;
		border: 0;
		box-shadow: none !important;
		background: url(/images/teaser_arrows.png) no-repeat 0 6px;
	}
	#wrapper #mainmenu ul.menu li a { width: auto; height: auto; background: none !important; }
	#wrapper #mainmenu ul.menu li a img { display: none; }
	#wrapper #mainmenu ul.menu li .image-title,
	#wrapper #mainmenu ul.menu li.active.deeper .image-title,
	#wrapper #mainmenu ul.menu > li.current .image-title {
		position: static;
		width: auto;
		height: auto;
		padding: 0;
		font-size: 17px;
		line-height: 24px;
		color: #333;
		text-shadow: none;
		background: none !important;
	}
	#wrapper #mainmenu ul.menu > li.active .image-title { color: #99aa39; }
	#wrapper #mainmenu ul.menu li ul {
		float: none;
		width: auto;
		padding: 12px 0 0 0;
		background: none;
	}
	#wrapper #mainmenu ul.menu li ul li { width: auto; margin: 0 0 10px 10px; }

	#content {
		float: none;
		width: auto;
		min-height: 0;
		margin: 0 0 30px 0;
	}
	.item-page, .bfFormDiv { padding: 25px 20px; }
	h1 { float: none; margin-bottom: 25px; }
	.item-page img { max-width: 100%; height: auto; }
	.item-page a { overflow-wrap: anywhere; }
	.item-page table { max-width: 100%; }
	.item-page iframe { max-width: 100%; }

	/* Inhaltsspalten und Banner aus den Editor-Stilen */
	.content_table { width: calc(100% + 40px); margin-left: -40px; }
	.content_table td { padding-left: 40px; }
	h1 { width: auto; }
	#contact_box { margin-bottom: 15px; }

	/* Startseite: Kacheln bleiben das Menue, in umbrechendem Raster */
	#main_wrapper > #mainmenu ul.menu {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 30px;
		margin: 30px 0 40px 0;
	}
	#main_wrapper > #mainmenu ul.menu li { float: none; margin: 0; }
	#main_wrapper > #mainmenu ul.menu li a { width: 315px; max-width: calc(100vw - 22px); height: auto; }
	#main_wrapper > #mainmenu ul.menu li a img { display: block; width: 100%; height: auto; }
	#main_wrapper > #mainmenu ul.menu li .image-title {
		position: relative;
		top: auto;
		margin-top: -70px;
		width: auto;
		box-sizing: border-box;
	}
	#main_wrapper > .clear, #mainmenu > .clear { clear: both; }

	/* Fuss: Links umbrechen, mittig */
	#footer {
		width: auto;
		height: auto;
		padding: 8px 10px;
		text-align: center;
	}
	#footer_left_content, #footer_right_content { float: none; width: auto; }
	#footer_right_content ul { display: flex; flex-wrap: wrap; justify-content: center; }
	#footer_right_content ul li { float: none; padding: 4px 12px; border-left: 0; }
}

@media (max-width: 899px) {
	/* Banner: Bild und dunkler Kasten untereinander, volle Breite */
	.banner_wrapper .banner { float: none; display: block; width: 100%; height: auto; }
	.banner_wrapper div.introtext { float: none; width: auto; height: auto; padding: 25px; }
	/* Kontaktseite (de/en): zwei Spalten mit fester Breite im Inhalt untereinander */
	.item-page div[style*="width: 430px"], .item-page div[style*="width: 370px"] {
		float: none !important; width: auto !important; border-right: 0 !important; padding-right: 0 !important; margin-bottom: 25px;
	}
}

@media (max-width: 759px) {
	#contact_box { display: none; }
	.content_table { width: 100%; margin-left: 0; }
	.content_table td { padding-left: 0; }
	h1 { font-size: 24px; line-height: 30px; }
	h2 { font-size: 18px; }
	.item-page { font-size: 14px; line-height: 25px; }
	/* Zweispaltige Tabellen im Inhalt untereinander */
	.item-page table, .item-page tbody, .item-page tr, .item-page td { display: block; width: auto !important; }
	.item-page td { padding-left: 0 !important; padding-right: 0 !important; }
	#main_wrapper > #mainmenu ul.menu { gap: 20px; }
	#main_wrapper > #mainmenu ul.menu li .image-title { font-size: 22px; padding-left: 55px; }
}

@media (prefers-reduced-motion: reduce) {
	#wrapper #mainmenu, body.menue-offen #wrapper #mainmenu { transition: none; }
}
