/* Header CSS */

body, html {
  margin: 0;
  padding: 0;
}

.page-wrapper {
  margin-top: 0;
  padding-top: 0 !important;
}

.page-wrapper.no-verkehr {
  padding-top: 0 !important;
}

.top-slogan {
  background: #fff;                /* Weißer Hintergrund */
  text-align: center;
  padding: 0px 20px;
  font-size: 0.9rem;
  color: #333;
  border-bottom: 1px solid #ccc;   /* Dünne graue Trennlinie unten */
}

/* Verkehrsmeldung  – Slider */
.verkehrs-slider {
  background-color: #ffffff; /* #28a745 */
  color: #0d7826; /* #fff */
  padding: 0 20px 40px 20px;
  padding-right: 3rem;
  font-family: Arial, sans-serif; /* Fest auf Arial*/
  font-size: 0.95rem;
  border-bottom: 2px solid #1e7e34;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
  animation: slideDown 0.5s ease-out;
  border-bottom: none;
}

/* Slide Animation */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Einzelne Slides */
.verkehrs-slider .slide {
  display: none;
}
.verkehrs-slider .slide:first-child {
  display: block;
}

/* Inhalt im Slider */

.verkehrs-info {
  display: flex;
  flex-direction: column;
}

.verkehrs-info strong {
  margin-bottom: 5px;
  font-size: 1rem;
}

/* Text- und Linkfarben */
.verkehrs-info a {
  color: #0d7826; /* #fff */
  font-weight: bold;
  text-decoration: underline;
}

.verkehrs-info a:hover {
  text-decoration: none;
}

/* Icon-Styling */

.verkehrs-icon {
  color: #0d7826; /* fff */
  font-size: 1.5rem;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

.verkehrs-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verkehrs-info a {
  color: #0d7826; /* #fff */
  font-weight: bold;
  text-decoration: underline;
}

.verkehrs-info a:hover {
  text-decoration: none;
}

.verkehrs-slider .slide {
  display: none;
}

.verkehrs-slider .slide:first-child {
  display: block;
}

.verkehrs-slider {
  animation: slideDown 0.5s ease-out;
  border-bottom: 1px solid #e0e0e0;
}


/* Warnhinweis-Optik (umleitung) */
/* Gesamt-Slider bei Umleitung */
.verkehrs-slider.umleitung {
  background-color: #ffffff; /* #fbe9e9 */
  color: #7a1e1e;
  border-bottom: 1px solid #e0e0e0 !important;
}

.verkehrs-slider.umleitung .verkehrs-icon {
  color: #d1001c;
}

.verkehrs-slider.umleitung a {
  color: #7a1e1e;
}

/* Einzelne Slide (umleitung) */
.verkehrs-slider .slide.umleitung {
  background-color: #ffffff; /* #fbe9e9 */
  color: #7a1e1e;
}

.verkehrs-slider .slide.umleitung .verkehrs-icon {
  color: #d1001c;
}

.verkehrs-slider .slide.umleitung a {
  color: #7a1e1e;
  text-decoration: underline;
}

.verkehrs-slider.umleitung .close-button {
  color: #7a1e1e;
}

.verkehrs-slider.umleitung .close-button:hover {
  color: #d1001c;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.verkehrs-info {
  display: flex;
  flex-direction: column;
}

.verkehrs-info strong {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 1rem;
}

/*.verkehrs-icon[title="Umleitung"] {
  color: #ffffff;
}

.verkehrs-icon[title="Info"] {
  color: #0d7826;
}*/

/* Schließen-Button (X oben rechts) */
.close-button {
  background: none;
  border: none;
  color: ingerit;
  font-size: 1.5rem;
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
}

/* Grüne Verkehrsmeldung: Close-Button */
.verkehrs-slider:not(.umleitung) .close-button {
  color: #0d7826;
}

.verkehrs-slider:not(.umleitung) .close-button:hover {
  color: #28a745;
}

/* Wieder einblenden-Button (mobil/desktop) */
.verkehrsinfo-reset-btn {
  position: absolute;
  top: 0.7em;
  right: 1em;
  background-color: #fff;
  border: 1px solid #28a745;
  color: #28a745;
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 3px rgba(0,0,0,0.1);
  transition: background-color 0.2s, color 0.2s;
}

.verkehrsinfo-reset-btn:hover {
  background-color: #28a745;
  color: #fff;
}

.verkehrsinfo-reset-btn i {
  margin-right: 0.3em;
}

/* Verkehrsmeldung */

.topbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  position: relative;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo img {
  height: 40px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background-color: #229954;
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.main-nav .arrow {
  font-size: 0.7rem;
  margin-left: 4px;
}

.has-submenu {
  position: relative;
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
  animation: fadeIn 0.3s ease-in-out;
  z-index: 1000;
  min-width: 220px;
}

.submenu.open {
  display: block !important;
}

.nav-toggle {
  display: none;
}

/* Wrapper für Link + Pfeil: Flexbox sorgt für nebeneinander */
.submenu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem; /* Abstand zwischen Link und Pfeil */
}

/* Link soll möglichst viel Platz bekommen, kein Zeilenumbruch */
.submenu-header > a {
  flex-grow: 1;
  white-space: nowrap;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

/* Der Button mit Pfeil wird schön ausgerichtet */
.submenu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  display: flex;
  align-items: center;
}

/* Der Pfeil */
.submenu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  display: flex;
  align-items: center;
}

/* Der Pfeil selbst */
.submenu-toggle .arrow {
  font-size: 0.7rem;
  color: #229954;
  display: inline-block;
  transition: transform 0.3s ease;
}

/* Wenn offen → Pfeil nach unten oder nach rechts gedreht */
.submenu-toggle[aria-expanded="true"] .arrow {
  transform: rotate(90deg); /* Oder 180deg, je nach gewünschter Richtung */
}

/* Optional: Wenn geschlossen → zurückdrehen */
.submenu-toggle[aria-expanded="false"] .arrow {
  transform: rotate(0deg);
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  display: block;
}

.submenu > li.has-submenu:hover > .submenu-header {
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
}

.submenu li {
  padding: 0;
  margin: 0;
}

.submenu li a {
  display: block;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  color: #333;
  font-weight: normal;
}

.submenu li a:hover {
  background: #f0f0f0;
}

.has-submenu .submenu .has-submenu {
  position: relative;
}

.has-submenu .submenu .submenu {
  top: 0;
  left: 100%;
  margin-left: 0;
}

.submenu .submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: #fff;
  border: 1px solid #ddd;
  min-width: 220px;
  z-index: 1001;
}

.submenu li.has-submenu:hover > .submenu {
  display: block;
}

.submenu li.has-submenu > a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  white-space: nowrap;
}

.submenu li.has-submenu > a::after {
  content: "▶";
  font-size: 0.7rem;
  margin-left: 4px; 
  color: #229954;
  flex-shrink: 0;
}

.main-nav .arrow {
  font-size: 0.7rem;
  margin-left: 4px;
  color: #229954;
}

.fahrplan-button {
  padding: 1.2rem 0 1.5rem;
}

.fahrplan-button a {
  background: #229954;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s;
}

.fahrplan-button a:hover {
  background: #1a7e43;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-nav ul .submenu {
  display: none !important;
}

.main-nav ul li.has-submenu:hover > .submenu {
  display: block !important;
}

/* Auf Desktop nicht anzeigen */
  @media (min-width: 769px) {
    .submenu-toggle {
      display: inline-flex;
    }
  }


/* Mobile Styles */
@media (max-width: 768px) {
  .logo img {
    height: 40px;
  }

  .verkehrs-slider.umleitung {
    border-bottom: none !important;
  }

  .verkehrs-slider {
    border-bottom: none !important;
  }

  .verkehrsinfo-reset-btn {
    position: static;
    display: block;
    margin: 1em auto 0 auto;
    margin-bottom: 15px;
    text-align: center;
  }

  .top-slogan {
    border-bottom: none;
  }

  .fahrplan-button {
    width: 100%;
    text-align: center;
    border-top: 1px solid #ccc;
    padding: 1.2rem 0 1.5rem;
  }

  .fahrplan-button a {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .nav-toggle .burger {
    height: 3px;
    background: #000;
    width: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .nav-toggle.active .burger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active .burger:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .burger:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .main-nav {
    display: none;
    width: 100%;
    background: #fff;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    margin: 0;
    padding: 2rem 0 0 0;
  }

  .main-nav li {
    border-bottom: 1px solid #eee;
  }

  .menu-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
  }

  .menu-parent > a {
    flex-grow: 1;
    text-decoration: none;
    color: #333;
    font-weight: bold;
  }

  .submenu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.2rem;
    font-size: 1rem;
  }

  /* Standard-Pfeil-Style */
  .submenu-toggle .arrow {
    transition: transform 0.3s ease;
    display: inline-block; /* sehr wichtig für Rotation! */
  }

  /* Pfeil rotieren bei aria-expanded=true */
  .submenu-toggle[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
  }

  /* Wenn offen, dann anzeigen */
  .submenu.open {
    display: block !important;
  }

  .submenu {
    display: none;
  }
   
  .has-submenu {
    position: relative;
  }

  .has-submenu > .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 0;
  }

  .has-submenu .submenu .submenu {
    left: auto;
    right: 100%;
    top: 0;
    margin: 0;
    padding: 0;
  }

  /* 2. Ebene */
  .submenu > li {
    padding-left: 1rem;
    font-weight: bold;
  }
 
  .submenu > li > a::after {
    content: none !important;
  }

  /* 2. Ebene: Pfeile ausblenden */
  .submenu > li > .submenu-header > .submenu-toggle {
    display: none;
  }

  /* 2. Ebene Links fett */
  .submenu > li > .submenu-header > a {
    font-weight: bold;
  }

  /* 3. Ebene: alle li mit level-3 Klasse unterhalb von submenu */
  .submenu li.level-3 {
    padding-left: 2rem;
    font-weight: normal;
  }

  /* Optional: 4. Ebene falls vorhanden */
  .submenu li.level-3 li.level-4 {
    padding-left: 3rem;
  }
}

.main-nav ul li.has-submenu > .submenu.open,
.main-nav ul li.has-submenu > ul.submenu.open {
  display: block !important;
}
