/* Allgemeines Styling */
body {
	margin: 0;
	padding: 0;
	font-family: 'Barlow', Arial, sans-serif;
}
#karte {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 100%;
}

/*Satelliten-/Kartenansicht-Umschalter*/
#style-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: white;
  color: black;
  border: 1px solid black;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}

#style-toggle:hover {
  background: black;
  color: white;
}

/*Legende*/
#legend {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  background: rgba(255,255,255,0.95);
  border: 1px solid black;
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#legend h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

#legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: background-color 0.15s ease;
}

#legend li:hover {
  background-color: rgba(0,0,0,0.08);
}

#legend li:last-child {
  margin-bottom: 0;
}

.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 2px;
}

.legend-swatch--fill {
  opacity: 0.6;
}

.legend-swatch--hatch {
  background-color: transparent;
  background-image: repeating-linear-gradient(45deg, #FF0000 0, #FF0000 3px, transparent 3px, transparent 6px);
  border: 1px solid #FF0000;
}

.legend-swatch--line {
  height: 4px;
  align-self: center;
  border-radius: 2px;
}

.legend-swatch--dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #FF6F00;
}

.legend-swatch--dot-large {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 1px #6A1B9A;
}

#legend-toggle {
  display: none;
}

/* Mobile Ansicht: Legende beginnt eingeklappt (nur quadratischer Toggle-Button
   links oben, wie der Burger-Button gestylt), lässt sich aufklappen; ein Klick
   auf einen Eintrag klappt sie wieder ein (siehe JS). Der Toggle-Button selbst
   behält dabei immer dieselbe feste Größe, unabhängig vom Öffnungszustand. */
@media (max-width: 768px) {
	#legend {
		padding: 0;
		border: none;
		box-shadow: none;
		background: transparent;
		width: 42px;
		height: 42px;
		overflow: visible;
	}

	#legend-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		background: white;
		border: 1px solid black;
		border-radius: 4px;
		font-size: 20px;
		cursor: pointer;
		box-sizing: border-box;
	}

	#legend-panel {
		display: none;
		position: absolute;
		top: 50px;
		left: 0;
		background: rgba(255,255,255,0.95);
		border: 1px solid black;
		border-radius: 4px;
		padding: 10px 14px;
		box-shadow: 0 2px 6px rgba(0,0,0,0.2);
		width: max-content;
		max-width: calc(100vw - 40px);
	}

	#legend.open #legend-panel {
		display: block;
	}
}

/*Burger-Menü mit Veranstalter-Logos*/
#burger-container {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}

#burger-btn {
  background: white;
  border: 1px solid black;
  border-radius: 4px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

#burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: black;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

#burger-container.open #burger-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#burger-container.open #burger-btn span:nth-child(2) {
  opacity: 0;
}

#burger-container.open #burger-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#burger-content {
  position: absolute;
  top: 50px;
  right: 0;
  background: #f9f9f9;
  border: 1px solid black;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease;
}

#burger-container.open #burger-content {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
}

#burger-content img {
  max-width: 180px;
  height: auto;
  display: block;
}

#burger-content a {
  transition: opacity 0.15s ease;
}

#burger-content a:hover {
  opacity: 0.8;
}

/*Footer*/
#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 5;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid black;
  box-sizing: border-box;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#footer-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}

#footer-logos img {
  height: 36px;
  width: auto;
  display: block;
}

#footer-links {
  display: flex;
  gap: 20px;
}

#footer-links a {
  color: black;
  text-decoration: none;
  font-size: 14px;
}

#footer-links a:hover {
  text-decoration: underline;
}

/* Mapbox-Steuerelemente (Zoom-Buttons, Logo, Attribution) über den Footer schieben */
.mapboxgl-ctrl-bottom-right,
.mapboxgl-ctrl-bottom-left {
	bottom: 56px;
}

/* Mobile Ansicht: alles (Logos + Links) in einer Zeile, nur enger/kleiner */
@media (max-width: 768px) {
	#site-footer {
		gap: 8px;
		padding: 6px 8px;
	}

	#footer-logos {
		gap: 8px;
	}

	#footer-logos img {
		height: 22px;
	}

	#footer-links {
		gap: 10px;
	}

	#footer-links a {
		font-size: 11px;
		white-space: nowrap;
	}

	.mapboxgl-ctrl-bottom-right,
	.mapboxgl-ctrl-bottom-left {
		bottom: 50px;
	}
}
