/* =====================================================================
   TAGpilot - Responsive Layer
   ---------------------------------------------------------------------
   Ergaenzt template.css / template_ltr.css und muss als LETZTES
   Stylesheet eingebunden werden (gewinnt dadurch die Kaskade).
   Ausserhalb der Media Queries stehen nur Schutzregeln gegen
   ueberlaufende Medien.

   Breakpoints:  >= 1025px  Navigation gedeckelt
                 <= 1024px  Tablet quer / kleine Notebooks
                 <=  780px  Tablet hoch / Mobil (Umbruch auf 1 Spalte)
                 <=  480px  Smartphone
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Globale Schutzregeln - nichts darf breiter werden als der Viewport
   --------------------------------------------------------------------- */

html, body { overflow-x: hidden; }

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

#maincontent img, .item img, .item_dark img, .item-page img {
	height: auto !important;
}

/* Videos und Karten im festen Seitenverhaeltnis, skalieren mit der Spalte */
.video-embed, .map-embed {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	overflow: hidden;
	margin-bottom: 1.143em;
}
.map-embed { max-width: 800px; padding-bottom: 42%; }
.video-embed iframe, .video-embed object, .video-embed embed,
.map-embed iframe, .map-embed object, .map-embed embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Lange Worte / URLs duerfen umbrechen statt zu ueberlaufen */
#maincontent p, #maincontent li, .footer_text { overflow-wrap: break-word; word-wrap: break-word; }

/* Menue-Button: auf dem Desktop unsichtbar, wird per js/responsive.js erzeugt */
.nav-toggle { display: none; }

/* Pfeil-Buttons auf den Slider-Bildern ausblenden (flexslider.css Zeile 36) */
.flex-direction-nav { display: none !important; }


/* ---------------------------------------------------------------------
   2. Desktop-Navigation etwas kleiner
   template_ltr.css rechnet mit 3.2vw - das ergibt auf breiten Monitoren
   ueber 60px Schriftgroesse. Hier gedeckelt.
   --------------------------------------------------------------------- */

@media screen and (min-width: 1025px) {

	#nav ul li a {
		font-size: 2.2vw;
		font-size: clamp(17px, 2.2vw, 31px);
		padding: 1.1vw;
	}
	#nav ul li.active a, #nav ul li a:hover,
	#nav ul li:hover a, #nav ul li.sfHover a {
		font-size: 2.4vw;
		font-size: clamp(18px, 2.4vw, 34px);
		padding: 1.1vw;
	}
}


/* Fusszeilen-Menue (24/7 Hotline, Beratung, Impressum, Kontakt) in der
   normalen Ansicht kleiner - template.css setzt hier feste 20px */
@media screen and (min-width: 781px) {

	.footer_text, .footer_text:hover { font-size: 15px; line-height: 1.35em; }
}


/* ---------------------------------------------------------------------
   3. <= 1024px - Spalten werden breiter, Navigation kompakter
   --------------------------------------------------------------------- */

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

	.base .fivecol, .base .sixcol, .base .sevencol,
	.base .eightcol { width: 97.5%; margin-left: 1.1%; margin-right: 1.1%; float: none; }

	.base .fourcol { width: 47.8%; padding-left: 0; }

	#logo_header img { max-width: 130%; }

	/* template_ltr.css zieht die Navigation mit -14px nach rechts aus dem
	   Raster heraus - unterhalb von ~1000px reicht der Platz dafuer nicht */
	#nav { margin-right: 0; }

	#nav ul li a,
	#nav ul li.active a, #nav ul li a:hover,
	#nav ul li:hover a, #nav ul li.sfHover a { font-size: 2.2vw; padding: 1.1vw; }

	.item, .blog-featured, .items-leading, .item-page { margin-left: 4%; margin-right: 4%; }
	.item_dark { margin-left: 3.5%; margin-right: 3.5%; }
}


/* ---------------------------------------------------------------------
   4. <= 780px - alles einspaltig, Navigation als Mobilmenue
   --------------------------------------------------------------------- */

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

	/* --- Grid: jede Spalte volle Breite --- */
	.base .onecol, .base .twocol, .base .threecol, .base .fourcol,
	.base .fivecol, .base .sixcol, .base .sevencol, .base .eightcol,
	.base .ninecol, .base .tencol, .base .elevencol, .base .twelvecol {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
		padding-left: 0;
		padding-right: 0;
		float: none;
	}

	/* --- Kopfbereich --- */
	#header { margin-top: 0; margin-bottom: 0; }

	/* .base hat width:100% - Innenabstand darf die Breite nicht vergroessern */
	.base {
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
		padding-left: 12px;
		padding-right: 12px;
	}
	/* Slider und Kopfbereich randlos ueber die volle Breite */
	#showwrap .base,
	#headersite .base { padding-left: 0; padding-right: 0; }

	/* Logo wie in der Desktop-Ansicht ueber das Bild darunter gelegt:
	   aus dem Textfluss genommen und direkt unter die Menueleiste gesetzt */
	#headersite { position: relative; z-index: 60; }
	#logo_header, #logo {
		position: absolute;
		top: 100%;
		left: 8px;
		z-index: 60;
		width: auto;
		height: auto;
		margin: 8px 0 0;
		padding: 0;
		text-align: left;
	}
	/* Deckkraft wie in der Desktop-Ansicht: dezent, beim Darueberfahren voll
	   (opacity kommt aus template.css, hier bewusst nicht ueberschrieben) */
	#logo_header img, #logo img {
		display: block;
		width: 165px;
		max-width: 100%;
		height: auto;
		margin: 0;
		/* eckig wie die uebrigen Elemente - border-radius steht inline im HTML */
		border-radius: 0 !important;
	}

	/* --- Menue-Button --- */
	.nav-toggle {
		display: -webkit-box;
		display: flex;
		-webkit-box-align: center;
		align-items: center;
		width: 100%;
		margin: 5px 0 0;
		padding: 6px 14px;
		border: 1px solid #d0ccc5;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
		/* template.css legt auf button einen hellen Verlauf - der muss weg */
		background-image: none;
		background-color: #e4e1db;
		box-shadow: none;
		color: #4a4a4a;
		font-family: inherit;
		font-size: .78rem;
		font-weight: bold;
		letter-spacing: .1em;
		text-transform: uppercase;
		text-align: left;
		cursor: pointer;
		-webkit-transition: background-color .18s linear;
		transition: background-color .18s linear;
	}
	.nav-toggle:hover, .nav-toggle:focus {
		background-image: none;
		background-color: #dbd7d0;
		outline: 0;
	}
	/* geoeffnet: unten buendig an die Liste angeschlossen */
	.nav-toggle[aria-expanded="true"] {
		background-color: #dbd7d0;
		border-bottom-color: #d0ccc5;
	}

	/* Drei Striche, die sich beim Oeffnen zum X drehen */
	.nav-toggle .nav-toggle-icon {
		position: relative;
		display: block;
		width: 17px;
		height: 2px;
		margin: 0 12px 0 0;
		border: 0;
		border-radius: 2px;
		background-color: #6a6a6a;
		-webkit-transition: background-color .18s linear;
		transition: background-color .18s linear;
		-webkit-box-flex: 0;
		flex: 0 0 auto;
	}
	.nav-toggle .nav-toggle-icon:before,
	.nav-toggle .nav-toggle-icon:after {
		content: "";
		position: absolute;
		left: 0;
		width: 17px;
		height: 2px;
		border-radius: 2px;
		background-color: #6a6a6a;
		-webkit-transition: -webkit-transform .22s ease;
		transition: transform .22s ease;
	}
	.nav-toggle .nav-toggle-icon:before { top: -5px; }
	.nav-toggle .nav-toggle-icon:after  { top:  5px; }

	.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background-color: transparent; }
	.nav-toggle[aria-expanded="true"] .nav-toggle-icon:before {
		-webkit-transform: translateY(5px) rotate(45deg);
		transform: translateY(5px) rotate(45deg);
	}
	.nav-toggle[aria-expanded="true"] .nav-toggle-icon:after {
		-webkit-transform: translateY(-5px) rotate(-45deg);
		transform: translateY(-5px) rotate(-45deg);
	}

	/* --- Navigation: gestapelte Liste, per Button ein-/ausklappbar --- */
	#nav {
		float: none;
		height: auto;
		margin: 0;
		padding: 0;
	}
	#nav.is-collapsed { display: none; }

	#nav .moduletable { margin: 0; overflow: visible; }
	#nav ul {
		float: none;
		margin: 0;
		padding: 0;
		border: 0;
		border-bottom: 1px solid #d0ccc5;
		border-radius: 0;
		overflow: hidden;
	}
	/* keine Luecken zwischen den Punkten: das li bringt aus dem alten
	   Template 7px Innenabstand und eine feste Hoehe mit */
	#nav .moduletable .menu li,
	#nav ul li {
		float: none;
		width: 100%;
		height: auto;
		margin: 0;
		padding: 0;
		border: 0;
		border-top: 1px solid #dcd8d1;
	}
	#nav ul li:first-child { border-top: 0; }

	#nav ul li a,
	#nav ul li.active a, #nav ul li a:hover,
	#nav ul li:hover a, #nav ul li.sfHover a {
		display: block;
		margin: 0;
		padding: 5px 16px;
		font-size: .82rem;
		font-weight: bold;
		line-height: 1.3;
		color: #4a4a4a;
		background-color: #eeece7;
		-webkit-transition: background-color .18s linear;
		transition: background-color .18s linear;
	}
	#nav ul li a:hover, #nav ul li:hover a,
	#nav ul li.active a { background-color: #e2dfd8; color: #2f2f2f; }

	/* Untermenues aufklappen statt Hover-Flyout */
	#nav li ul, #nav li ul ul {
		position: static;
		left: auto;
		width: 100%;
		margin: 0;
	}
	#nav li li { width: 100%; height: auto; }
	#nav li li a, #nav li li.active a, #nav li li a:hover {
		font-size: .78rem;
		line-height: 1.3;
		padding-left: 30px;
	}

	/* --- Inhalt --- */
	#showwrap { margin-bottom: 20px; }

	.item, .blog, .blog-featured, .items-leading, .item-page {
		margin-left: 3%;
		margin-right: 3%;
	}
	.item_dark {
		margin-left: 3%;
		margin-right: 3%;
		padding-left: 4%;
		padding-right: 4%;
		padding-bottom: 20px;
		/* fuer die Reihenfolge der Inhalte, siehe naechste Regel */
		display: -webkit-box;
		display: flex;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		flex-direction: column;
	}
	/* Bilder im schwarzen Block stehen im Quelltext vor dem Text, weil sie
	   in der normalen Ansicht rechts umflossen werden. Einspaltig gehoeren
	   sie hinter den Text - aber weiterhin in den schwarzen Bereich. */
	.item_dark > .brands-img,
	.item_dark > .image_site {
		-webkit-box-ordinal-group: 11;
		order: 10;
		margin: 18px 0 0 0;
		text-align: center;
	}
	.item_dark > .brands-img img,
	.item_dark > .image_site img {
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/* Eingebettete Floats (Bilder, Karten) untereinander statt nebeneinander */
	#maincontent [style*="float"],
	#maincontent img, #maincontent iframe {
		float: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	#maincontent img {
		display: block;
		width: auto !important;
		/* schlaegt Inline-Angaben wie style="min-width:80%;max-width:120%" */
		min-width: 0 !important;
		max-width: 100% !important;
		margin-top: 12px !important;
		margin-bottom: 12px !important;
	}

	/* Bildkasten mit negativem Aussenabstand (template.css .image_site) */
	.image_site {
		float: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/* --- Typografie --- */
	h1 { font-size: 1.75em; line-height: 1.25em; margin-top: 1.1em; }
	h2, .blog h2.title, .blog-featured h2.title,
	.item h2.title, .item-page h2.title { font-size: 1.3em; line-height: 1.3em; }
	h3 { font-size: 1.15em; }
	#advert p.hello { font-size: 2em; }
	#intro p { font-size: 1.05em; }

	/* --- Slider --- */
	.flex-caption {
		left: 0;
		right: 0;
		max-width: 100%;
		padding: 8px 12px;
		font-size: .85rem;
	}

	/* --- Fussbereich: vier Menuepunkte mit gleichem Abstand --- */
	/* 9px Aussenabstand + 7px Innenabstand je Punkt ergibt oben wie unten
	   16px und zwischen den Punkten gleichmaessig 14px */
	#copyrightwrap .base { position: relative; padding-top: 9px; padding-bottom: 9px; }
	/* Leerabsatz, &nbsp;-Platzhalter und die leere Restliste aus dem
	   Quelltext ausblenden - sie erzeugen sonst ungleiche Abstaende.
	   Hinweis: die Platzhalter haben class="01"; ein Klassenselektor darf
	   nicht mit einer Ziffer beginnen, daher der Attributselektor. */
	#copyrightwrap > .base > p { display: none; }
	#copyrightwrap .article_anywhere > [class="01"] { display: none; }
	#copyrightwrap ul { display: none; }
	#copyrightwrap .moduletable { margin: 0; }
	#copyrightwrap .twelvecol { margin-bottom: 0; }

	#top4, #top5 { margin-top: 0; margin-bottom: 0; }
	#top4, #top5 { text-align: center; }
	.footer_text, .footer_text:hover { font-size: .9rem; line-height: 1.2em; }
	/* Innenabstand statt Aussenabstand: dadurch bleiben die Abstaende auch
	   dann gleich, wenn der Quelltext leere Absaetze enthaelt */
	#copyrightwrap .footer_text p { margin: 0; padding: 7px 0; }
	#copyrightwrap .footer_text p:empty { display: none; }

	/* schwebt sonst unter dem letzten Menuepunkt und vergroessert den
	   unteren Rand - aus dem Textfluss nehmen */
	#backtotop {
		position: absolute;
		right: 12px;
		bottom: 10px;
		float: none;
		margin: 0;
	}

	/* --- Formulare --- */
	.formelm label, .formelm-area label, .contact-form label,
	.login-fields label, .profile-edit label, .registration label,
	.remind label, .reset label, .finder label {
		float: none;
		width: 100%;
		margin-bottom: 4px;
	}
	.formelm input, .formelm-area input, .formelm select, .formelm-area select,
	.contact-form input, .contact-form select, .login-fields input, .login-fields select,
	.profile-edit input, .profile-edit select, .registration input, .registration select,
	.remind input, .reset input, .finder input, .search input, .search select,
	textarea {
		width: 100%;
		max-width: 100%;
	}
}


/* ---------------------------------------------------------------------
   5. <= 480px - Smartphone
   --------------------------------------------------------------------- */

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

	body { font-size: 14px; }

	#logo_header img, #logo img { width: 145px; }

	.item, .blog, .blog-featured, .items-leading, .item-page {
		margin-left: 4%;
		margin-right: 4%;
	}
	.item_dark { margin-left: 4%; margin-right: 4%; }

	h1 { font-size: 1.45em; }
	h2, .item h2.title, .item-page h2.title { font-size: 1.2em; }

	#maincontent ul { padding: 0; }

	.flex-caption { font-size: .78rem; padding: 6px 10px; }

	.map-embed { padding-bottom: 75%; }
}