/* Anpassung der Website an die Anzeigebreite.
   Wird nach style.css und dem jeweiligen Farbschema geladen. */

img {
	max-width: 100%;
	height: auto;
}

div.content {
	overflow-wrap: break-word;
}

#burger {
	display: block;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

#burger img {
	display: block;
	width: 32px;
	height: 22px;
	margin: 11px auto;
	background: transparent;
}

/* Desktop (ab 1000px): Hauptbereich als Grid-Layout.
   Spalten: Menü | Inhalt | rechte Spalte.
   Darunter wird das alte Float-Layout (siehe style.css) weiter genutzt. */
@media (min-width: 1000px) {
	div.global {
		display: grid;
		grid-template-columns: max-content minmax(0, 1fr) max-content;
		column-gap: 40px;
		row-gap: 0;
		align-items: start;
	}

	header {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	div.navigation {
		grid-column: 1;
		grid-row: 2;
		float: none;
		margin: 10px 0 0 0;
	}

	main {
		grid-column: 2;
		grid-row: 2;
	}

	div#rechts {
		grid-column: 3;
		grid-row: 2;
		float: none;
		width: auto;
		margin: 40px 0 0 0;
	}

	div.content {
		margin: 40px 0 0 0;
	}

	footer {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	/* Sicherheitsnetz: sollte ein Inhalt einen Link direkt in .global
	   einschleusen, darf dieser nicht die erste Spalte schrumpfen. */
	div.global > a {
		grid-column: 1 / -1;
	}

	/* Eingeklapptes Menü: nur die Einträge werden ausgeblendet,
	   Burger und Farbauswahl bleiben im Menü sichtbar. */
	body.menu-closed .menu-items {
		display: none;
	}

	body.menu-closed .nav-buttons {
		border-bottom: solid 1px var(--boxBorder);
		border-radius: var(--radius);
	}

	body.menu-closed div.navigation {
		width: auto;
	}

	body.menu-closed div.global {
		grid-template-columns: auto minmax(0, 1fr) max-content;
	}

	body.menu-closed div.content {
		margin-left: 0;
	}
}

/* Zwischen 1000px und 1200px: rechte Spalte ausgeblendet, nur zwei Spalten. */
@media (min-width: 1000px) and (max-width: 1199.98px) {
	div.global {
		grid-template-columns: max-content minmax(0, 1fr);
	}

	body.menu-closed div.global {
		grid-template-columns: auto minmax(0, 1fr);
	}

	div.content {
		margin-right: 0;
	}
}

/* Unter 1200px: rechte Spalte ausblenden, Inhalt nutzt die Breite. */
@media (max-width: 1199.98px) {
	div.rechts {
		display: none;
	}
}

/* Unter 1000px: Die Sticky-Leiste ist das Menü-Panel (volle Breite, Theme-Farbe),
   die Einträge klappen darunter auf. */
@media (max-width: 999.98px) {
	div.global {
		width: 100%;
	}


	div.nav-buttons {
		border: solid 1px var(--boxBorder);
		border: var(--radius);
	}

	div.navigation {
		float: none;
		width: 100%;
		margin: 0;
		padding: 0;
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		z-index: 30;
		background: transparent;
		box-sizing: border-box;
	}

	#menu {
		position: relative;
		width: 100%;
		margin-top: 0;
		border-radius: var(--radius);
	}

	.menu-items {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		max-height: calc(100vh - 70px);
		overflow-y: auto;
		background: var(--menuBackground);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
		z-index: 32;
	}

	body.menu-open .menu-items {
		display: block;
	}

	#menu {
		box-sizing: border-box;
	}

	body.menu-closed .nav-buttons {
		border: solid 1px var(--boxBorder);
		border-radius: var(--radius);		
	}

	div.content {
		margin: 10px;
	}

	div.rechts {
		display: none;
	}

	img.banner {
		width: 55%;
	}

	table {
		width: 100%;
	}
}

/* Unter 700px: breite Fahrzeugtabellen untereinander darstellen. */
@media (max-width: 699.98px) {
	table.fahrzeuge,
	table.fahrzeuge tbody,
	table.fahrzeuge tr,
	table.fahrzeuge td {
		display: block;
		width: 100%;
	}

	table.fahrzeuge {
		border: none;
	}

	table.fahrzeuge tr {
		border: solid 1px var(--tableBorder);
		margin-bottom: 10px;
	}

	table.fahrzeuge td {
		border: none;
		border-bottom: solid 1px var(--tableCellBorder);
		padding: 6px;
	}

	table.fahrzeuge tr td:last-child {
		border-bottom: none;
	}
}

/* Unter 600px: kompaktere Abstände und Schrift. */
@media (max-width: 599.98px) {
	img.banner {
		width: 75%;
	}

	div.content {
		margin: 5px;
		padding-left: 10px;
		padding-right: 10px;
	}

	h1 {
		font-size: 1.5em;
	}

	table.einsaetze td:first-of-type {
		width: auto;
	}

	td, th {
		padding-left: 4px;
		padding-right: 4px;
	}
}
