:root {
  color-scheme: only light;
  --silver: #596b85;
  --silver-mid: #8a97a9;
  --silver-light: #eef0f2;
  --silver-light-hover: #cdd2da;
  --red: #aa0000;
  --red-mid: #d47f7f;
  --red-light: #f6e5e5;
  --blue: #3f51b5;
  --green: #008a00;
  --bg: #f4f5f2;
  --panel: #ffffff;
  --fg: #1d2420;
}
* {
  font-family: "Ubuntu";
}
h1,
h2 {
  font-family: "Ubuntu" !important;
  font-weight: bold !important;
  margin: 0 !important;
  margin-block-start: 0;
  margin-block-end: 0;
  line-height: 1.2;
  background: linear-gradient(163deg, var(--red-mid) 10%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback */
}
h1 {
  font-size: 4.2rem !important;
}
h2 {
  font-size: 1.2rem !important;
}
@media (max-width: 460px) {
  h1 {
    font-size: 2.1rem !important;
  }
  h2 {
    font-size: 1rem !important;
  }
}

hr {
  border-top: 1px solid var(--silver-light) !important;
  margin: 4px 0 !important;
}

/* ----- Seiten-Layout -----*/

.page-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
}
.header-container {
  flex: none;
  width: 100%;
  text-align: center;
  padding: 0.2rem;
  background-image: url("assets/header.png");
  background-repeat: no-repeat;
  background-position-x: center;
  background-position-y: center;
  background-size: cover;
}
.header-container {
  position: relative;
}
.header-container::before,
.header-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  z-index: 1;
}
.header-container::before {
  left: 0;
  background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}
.header-container::after {
  right: 0;
  background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
}
@media (max-width: 1280px) {
  .header-container::before,
  .header-container::after {
    display: none;
  }
}
.header-container > * {
  position: relative;
  z-index: 2;
}
.events-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ----- Header -----*/
.button {
  text-decoration: none;
  line-height: normal;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.55);
}
.button:hover {
  background-color: #fff;
}
.button-active {
  text-decoration: none;
  line-height: normal;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  background: linear-gradient(163deg, var(--red-mid) 20%, var(--red) 100%);
  color: #fff;
  border: 0;
}
.logo-container {
  position: relative;
  isolation: isolate;
  width: fit-content;
  margin: auto;
}
.logo-container::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -35px -80px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.75) 35%,
    rgba(255, 255, 255, 0.3) 65%,
    transparent 100%
  );
  filter: blur(18px);
  pointer-events: none;
}
.lang-toggle {
  position: absolute;
  top: 3px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}
.lang-toggle button {
  width: 36px;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  cursor: pointer;
}
.lang-toggle button:hover {
  background: #fff;
}
.lang-toggle button.active {
  background: linear-gradient(163deg, var(--red-mid) 20%, var(--red) 100%);
  color: #fff;
  border: 0;
}
.header-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}
@media (max-width: 630px) {
  .header-menu {
    margin: 0 auto;
    max-width: 290px;
  }
}

/* ----- Main-Content -----*/
.main-content {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main-content::before,
.main-content::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  z-index: 1;
}
.main-content::before {
  left: 0;
  background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}
.main-content::after {
  right: 0;
  background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

/* ----- Map-Layout -----*/
.map-container {
  /* Wrapper um Karte + Legende */
  flex: 1; /* füllt den Rest, egal wie hoch der Header ist */
  min-height: 320px; /* Untergrenze für niedrige Fenster */
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.map-container #map {
  position: absolute;
  inset: 0;
}

/* ----- Events -----*/
.eventliste {
  padding-top: 0.5rem;
}
.layout {
  display: grid;
  grid-template-columns: auto 570px auto;
  gap: 16px;
  justify-content: center;
  align-items: start;
}
.filter-mobile {
  display: none;
}
.filterbar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.filterbar button {
  text-align: left;
}
.mobileSpacer {
  background: var(--silver-light-hover);
  width: 2px;
  margin: 5px;
}
.yt-embed {
  display: block;
  width: 100%;
  max-width: 523px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
}

@media (max-width: 830px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    margin: 0 4px;
    gap: 0;
  }
  .filter-mobile {
    display: block;
    margin: 8px 4px 0 4px;
  }
  .filter-mobile summary {
    padding: 10px 12px;
    background: #eee;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
  }
  .filter-mobile-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  .filterbar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .filterbar > * {
    display: none;
  }
  .filterbar hr {
    flex: 0 0 100%; /* belegt eine ganze Zeile, trennt die Gruppen */
    margin: 4px 0;
    border: 0;
    border-top: 1px solid #ddd;
  }
}

.accordion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 4px;
  border-top: 1px solid #ddd;
}
.accordion:first-of-type {
  border-top: none;
}
.accordion-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}
.accordion-icon.open {
  transform: rotate(90deg);
}
.month-container {
  border: solid 1px var(--red-mid);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: white;
}
.month-header {
  font-size: 1.2rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(163deg, var(--red-mid) 20%, var(--red) 100%);
  color: white;
}
.icon {
  color: white;
  border-radius: 50%;
  height: 2rem;
  width: 2rem !important;
  display: flex !important;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
}
.event-type + .event-type {
  border-left: 1px solid #ddd;
}
.event-link {
  border-radius: 8px;
  padding: 2px 6px;
  border: 1px solid #ccc;
  font-size: 0.8rem;
}
.event-link:hover {
  background: #ddd;
}
.event-link a {
  text-decoration: none;
}
.chip {
  font-size: 0.8rem;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
  border: none;
  background: var(--silver-light);
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}

.chip:hover {
  background: var(--silver-light-hover);
}

.chip[aria-pressed="true"] {
  background: linear-gradient(163deg, var(--red-mid) 20%, var(--red) 100%);
  color: white;
}

#scrollTopBtn {
  position: fixed;
  right: 3rem;
  bottom: 4rem;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: var(--red-mid);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.25s,
    transform 0.25s,
    visibility 0.25s;
  z-index: 1000;
}

#scrollTopBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  background: var(--red);
}
#scrollTopBtn:focus-visible {
  outline: 3px solid var(--silver);
  outline-offset: 2px;
}
