/* Homepage event map (/de/karte.html, /en/map.html). Colours follow the homepage theme. */

.em-shell {
  height: calc(100dvh - 4rem); /* below the fixed 4rem header */
  min-height: 420px;
}

.em-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.em-chips {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.em-chips::-webkit-scrollbar { display: none; }

/* Phones: buttons on top, the chips get a full-width row of their own below them. */
@media (max-width: 639px) {
  .em-toolbar { flex-wrap: wrap; row-gap: 0.375rem; }
  .em-toolbar > :not(.em-chips) { order: 1; }
  .em-toolbar > #em-filter-btn { margin-right: auto; }
  .em-chips { order: 2; flex-basis: 100%; }
}

.em-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 0.75rem;
  border: 1px solid #c1c7d3;
  border-radius: 999px;
  background: #fff;
  color: #1a1c1c;
  font: 500 0.875rem/1 Inter, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.em-chip:hover { background: #f3f3f3; }
.em-chip--active { background: #005dac; border-color: #005dac; color: #fff; }
.em-chip--active:hover { background: #004786; }
.em-chip__icon { font-size: 18px !important; }

.em-tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 40px;
  padding: 0 0.625rem;
  border: 1px solid #005dac;
  border-radius: 999px;
  background: #fff;
  color: #005dac;
  font: 700 0.875rem/1 Inter, sans-serif;
  cursor: pointer;
}
.em-tool-btn[aria-pressed="true"] { background: #005dac; color: #fff; }
.em-tool-btn .material-symbols-outlined { font-size: 20px; }
.em-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ba1a1a;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.em-segment-tools { display: inline-flex; gap: 0.25rem; }

.em-body { position: relative; flex: 1; min-height: 0; }
#em-map { position: absolute; inset: 0; background: #eef0f2; }
#em-list { position: absolute; inset: 0; overflow-y: auto; background: #f9f9f9; z-index: 1050; }

.em-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1150;
  background: linear-gradient(90deg, transparent, #005dac, transparent);
  background-size: 50% 100%;
  animation: em-progress 1.1s linear infinite;
}
@keyframes em-progress { from { background-position: -50% 0; } to { background-position: 150% 0; } }

.em-overlay {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: min(92%, 30rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  pointer-events: none;
}
.em-overlay > * { pointer-events: auto; }
.em-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font: 500 0.875rem/1.4 Inter, sans-serif;
}
.em-pill .material-symbols-outlined { font-size: 18px; }
.em-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font: 400 0.875rem/1.4 Inter, sans-serif;
}
.em-banner--warn { background: #fff3cd; }

.em-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;
  width: min(90%, 22rem);
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.em-link {
  min-height: 36px;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: #005dac;
  font: 700 0.875rem/1 Inter, sans-serif;
  cursor: pointer;
}
.em-link:hover { text-decoration: underline; }
.em-link:disabled { color: #9aa0a6; cursor: default; text-decoration: none; }

.em-near-me {
  position: absolute;
  right: 10px;
  bottom: calc(110px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #005dac;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.em-near-me.em-busy { opacity: 0.6; cursor: progress; }

.em-legend {
  position: absolute;
  left: 10px;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 1000;
  max-width: 17rem;
}
.em-fab-small {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 36px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font: 500 0.875rem/1 Inter, sans-serif;
  cursor: pointer;
}
.em-fab-small .material-symbols-outlined { font-size: 20px; }
.em-legend__list {
  margin-top: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  list-style: none;
  font: 400 0.875rem/1.3 Inter, sans-serif;
}
.em-legend__list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.em-legend__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
}
.em-legend__dot .material-symbols-outlined { font-size: 16px; }
.em-legend__sym { width: 24px; text-align: center; color: #5f6368; }

/* Markers: shape and colour, never colour alone (NFR-A11Y-2) */
.em-pin-wrapper { background: transparent; border: 0; }
.em-pin {
  position: relative;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.em-pin .material-symbols-outlined { font-size: 20px; }
.em-pin--approx { border-style: dashed; opacity: 0.85; }
.em-pin__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #212121;
  color: #fff;
  font: 700 11px/18px Inter, sans-serif;
  text-align: center;
}
.em-pin__badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  padding: 2px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #455a64;
  font-size: 14px !important;
}

/* Selection card (FR-POP) */
.em-selection {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1100;
  width: min(96%, 32rem);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.em-selection__head { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.375rem 0.375rem 1rem; border-bottom: 1px solid #e0e0e0; }
.em-selection__list { max-height: 45vh; overflow-y: auto; }
.em-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.em-icon-btn:hover { background: #f1f1f1; }

/* List items (also used in the selection card) */
.em-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.em-item:hover, .em-item:focus-visible { background: #f3f6fb; }
.em-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
}
.em-item__icon .material-symbols-outlined { font-size: 20px; }
.em-item__body { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.em-item__title { font: 700 0.9375rem/1.3 Inter, sans-serif; color: #1a1c1c; }
.em-item__meta { font: 400 0.8125rem/1.3 Inter, sans-serif; color: #5f6368; }
.em-item__badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.em-item__chevron { color: #9aa0a6; }
.em-badge {
  padding: 0.0625rem 0.375rem;
  border: 1px solid #c1c7d3;
  border-radius: 0.25rem;
  font: 500 0.75rem/1.4 Inter, sans-serif;
  color: #414752;
}
.em-badge--pink { background: #d81b60; border-color: #d81b60; color: #fff; }
.em-badge--slate { background: #546e7a; border-color: #546e7a; color: #fff; }
.em-badge--grey { background: #616161; border-color: #616161; color: #fff; }
.em-badge--orange { background: #e65100; border-color: #e65100; color: #fff; }
.em-badge--amber { background: #a35b00; border-color: #a35b00; color: #fff; }

.em-list-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; background: #fff; border-bottom: 1px solid #e0e0e0; position: sticky; top: 0; z-index: 1; }
.em-muted { font: 400 0.8125rem/1.3 Inter, sans-serif; color: #5f6368; }
.em-sort, .em-segment { display: inline-flex; border: 1px solid #c1c7d3; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.em-sort button, .em-segment button {
  min-height: 36px;
  padding: 0 0.75rem;
  border: 0;
  background: #fff;
  font: 500 0.8125rem/1 Inter, sans-serif;
  cursor: pointer;
}
.em-sort button[aria-pressed="true"], .em-segment button[aria-pressed="true"] { background: #005dac; color: #fff; }
.em-more { display: block; width: 100%; padding: 1rem; border: 0; background: none; color: #005dac; font: 700 0.875rem/1 Inter, sans-serif; cursor: pointer; }

/* Filter dialog */
.em-filter-dialog {
  width: min(100%, 38rem);
  max-height: min(90dvh, 52rem);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 1rem 1rem 0 0;
}
@media (min-width: 768px) {
  .em-filter-dialog { margin: auto; border-radius: 1rem; }
}
.em-filter-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.em-dialog { display: flex; flex-direction: column; max-height: inherit; }
.em-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0.75rem 0.25rem 1.25rem; }
.em-dialog__body { padding: 0 1.25rem 1rem; overflow-y: auto; }
.em-dialog__foot { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom)); border-top: 1px solid #e0e0e0; }
.em-label { display: block; margin: 1rem 0 0.375rem; font: 700 0.75rem/1 Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #414752; }
.em-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #c1c7d3; border-radius: 0.5rem; background: #fff; font: 400 1rem/1.4 Inter, sans-serif; }
.em-chipset { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.em-place-results { display: flex; flex-direction: column; }
.em-place { padding: 0.5rem 0.75rem; border: 0; border-bottom: 1px solid #eee; background: #fff; text-align: left; font: 400 0.9375rem/1.3 Inter, sans-serif; cursor: pointer; }
.em-place:hover { background: #f3f6fb; }
.em-primary { min-height: 44px; padding: 0 1.5rem; border: 0; border-radius: 999px; background: #005dac; color: #fff; font: 700 0.9375rem/1 Inter, sans-serif; cursor: pointer; }

.em-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(94%, 30rem);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #303030;
  color: #fff;
  font: 400 0.875rem/1.4 Inter, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.em-toast-action { border: 0; background: none; color: #a5c8ff; font-weight: 700; cursor: pointer; }

/* Leaflet controls and attribution stay above the safe area and visible (FR-MAP-12) */
.em-body .leaflet-bottom { bottom: env(safe-area-inset-bottom); }

@media (prefers-reduced-motion: reduce) {
  .em-progress { animation: none; }
}
