/* ======================================
   Grundfarben & Variablen
   ====================================== */
:root {
  --fg: #0b1020;
  --muted: #334155;
  --brand: #0369a1;
  --focus: #0ea5e9;
  --card-bg: rgba(255,255,255,0.75);
}

/* ======================================
   Grundlayout
   ====================================== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;  
  background: #f1f5f9 url('imagesX/Topbild/TB80.jpg') no-repeat center center;
  background-size: cover;
  color: var(--fg);
  line-height: 1.6;
}

header, nav, main, footer { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 1rem 0; 
}


header { 
  display: flex; 
  flex-wrap: wrap; 
  align-items: center; 
  justify-content: space-between; 
  background: var(--card-bg); 
  border-radius: 1rem 1rem 0 0; 
   position: relative;   /* NEU: Basis ist relative */

}



header img { 
  max-height: 70px; 
  padding-left: 20px;
  width: auto;
  height: auto;
  display: block;
  object-fit: cover; 
  border-radius: 0;
}

/* ======================================
   Navigation allgemein
   ====================================== */
nav ul { 
  display: flex; 
  flex-wrap: wrap; 
  list-style: none; 
  gap: .75rem; 
  padding: 0; 
  margin: 0; 
}

nav a { 
  text-decoration: none; 
  color: var(--fg); 
  font-weight: 600; 
  padding: .35rem .6rem; 
  border-radius: .5rem; 
}

nav a:hover, nav a:focus-visible { 
  background: var(--brand); 
  color: #fff; 
  outline: none; 
}

.nav-center {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ======================================
   Dropdown Navigation – Desktop
   ====================================== */
@media (min-width: 769px) {

  nav ul li.has-submenu {
    position: relative;
  }

  nav ul li ul.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    z-index: 1000;
    flex-direction: column;
    padding: 0;
    margin: 0;
  }

  nav ul li.has-submenu:hover > ul.submenu {
    display: flex;
  }

  nav ul li ul.submenu li a {
    display: block;
    padding: 8px 12px;
    color: #000;
    font-weight: normal;
  }

  nav ul li ul.submenu li a:hover {
    background: #ddd;
  }

  /* Menü-Buttons ausblenden */
  .menu-button,
  #menu-toggle,
  #menu-toggle-footer {
    display: none !important;
  }

  /* Footer-UL normal anzeigen */
  footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0;
    margin: 0;
  }
}

/* ======================================
   Dropdown Navigation – Mobile header
   ====================================== */
@media (max-width: 768px) {
  header {
    display: flex;
    flex-direction: row;       
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    padding: 1rem 1rem 1rem 0rem;

    position: fixed;  /* statt relative */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* bleibt über Content */
    
    /* Hintergrund transparent mit einstellbarer Deckung */
        background: rgba(255, 255, 255, 0.91); /* 0 = komplett transparent, 1 = komplett deckend */
        backdrop-filter: blur(5px); /* optional: Glas-Effekt */
  }

  main {
    margin-top: 105px; /* Höhe deines Headers, ggf. anpassen */
  }


  header a {
    flex-shrink: 0;
  }

  header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    flex: 1;
    position: relative;
  }

  .menu-button {
    display: inline-block;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--brand);
    color: white;
    border-radius: 0;
    font-size: 1rem;
    margin-left: auto;
    z-index: 10;
  }

  #menu-toggle {
    display: none;
  }

  /* Hauptmenü ausblenden */
  header nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.9); /*  Weiß weniger transparent */
    z-index: 5;
    padding: 0;
    margin: 0;
    
    
  
      flex-direction: column; /* sicherstellen */
    max-height: 95vh;       /* 80% der Bildschirmhöhe */
     overflow-y: auto;       /* vertikales Scrollen */
     -webkit-overflow-scrolling: touch; /* sanftes Scrollen auf iOS */
	
	
  }

 
  /* Menü nur sichtbar, wenn Checkbox aktiv */
  #menu-toggle:checked + .menu-button + ul {
    display: flex;
    
    
    flex-direction: column;  /* WICHTIG: untereinander */
      width: 100%;             /* volle Breite des Containers */
      max-height: 95vh;        /* vertikal scrollen, wenn zu lang */
      overflow-y: auto;
      -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
    
  }





  /* Hauptmenü-Links */
  nav ul li {
    display: block;
    margin: 0.1rem 0;
    position: relative; /* wichtig für Untermenü */
  }

  /* Untermenü */
  nav ul li ul.submenu {
    display: none;
    flex-direction: column;
    padding-left: 1rem;
    margin: 0.3rem 0 0 0;
    background: rgba(173, 216, 230, 1); /* hellblau */
    /*     background: rgba(255, 255, 255, 1);           Weiß, fast deckend */
    
  }

  /* Untermenü sichtbar, wenn li.open gesetzt wird */
  nav ul li.has-submenu.open > ul.submenu {
    display: flex;
  }

  /* Menü-Link Stil */
  nav ul li a {
    padding: 0.4rem 1rem;        /* etwas mehr Abstand */
    display: block;
    color: var(--fg);
    font-size: 1.05rem;           /* etwas größere Schrift */
    font-weight: 600;             /* fetter für bessere Lesbarkeit */
  }

  nav ul li ul.submenu li a {
    padding: 0.5rem 1rem;
    display: block;
    background: rgba(173, 216, 230, 1); /* hellblau */
    /*     background: rgba(255, 255, 255, 1);           Weiß, fast deckend */
    font-size: 1.05rem;              /* Untermenü leicht kleiner */
    font-weight: 500;
  }

  main,
  .hero,
  video,
  img {
    border-radius: 0;
  }
}




/* ======================================
   Dropdown Navigation – Mobile footer
   ====================================== */

@media (max-width: 768px) {
  footer {
    flex-direction: row;
    align-items: center;
    border-radius: 0;
  }

  footer nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  /* Menü-Button */
  .menu-button {
    display: inline-block;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--brand);
    color: white;
    border-radius: 0;
    font-size: 1rem;
    margin-left: auto;
  }

  /* Checkbox unsichtbar */
  #menu-toggle-footer {
    display: none;
  }

  /* Footer-UL ausblenden, nur bei geöffneter Checkbox sichtbar */
  footer .footer-links {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: .5rem;
    padding: 0;
  }

  #menu-toggle-footer:checked + .menu-button + .footer-links {
    display: flex;
  }

  /* Links als Block */
  footer .footer-links li {
    display: block;
    margin: 0.3rem 0;
  }

  footer .footer-links li a {
    padding: 0.5rem 1rem;
    display: block;
    color: var(--fg);
  }

  /* Footer-Menü-Button rechts */
  footer nav {
    justify-content: flex-end;
  }

  footer {
    border-radius: 0;
  }
}








/* ======================================
   Restliches Layout
   ====================================== */
main { 
  padding: 0; 
  background: var(--card-bg); 
  border-radius: 0 0 1rem 1rem;
}

h1, h2, h3 { line-height: 1.2; }

.headline { margin-top: 0; margin-bottom: 0; font-size: 24px; }
.subline { margin-top: 0; margin-bottom: 0; }

.hero { 
  text-align: center; 
  background: url("imagesX/Topbild/TB1.jpg") no-repeat center/cover; 
  padding: .9rem;
  border-radius: 0;
  color: #fff;
}

.section { margin: 1rem 2rem; } 

.grid {display: grid; gap: 1.5rem; }
@media (min-width: 768px) {
  .grid-4 {grid-template-columns: repeat(4, 1fr); align-items: start;}
  .grid-3 {grid-template-columns: repeat(3, 1fr); align-items: start;}
  .grid-2 { grid-template-columns: 1fr 1fr; } 
  .last-image {
    grid-column: 1 / -1;   
    justify-self: center; 
    max-width: 560px;     
  }
}

video, img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

video { max-width: 370px; border-radius: 1rem; }

a.btn { 
  display: inline-block; 
  margin-top: .5rem; 
  padding: .75rem 1rem; 
  background: var(--brand); 
  color: #FFF; 
  border-radius: .75rem; 
  font-weight: 600; 
  text-decoration: none; 
}

footer { 
  font-size: .9rem; 
  text-align: center; 
  color: var(--muted); 
  padding: 1rem 0; 
  background: var(--card-bg); 
  border-radius: 1rem 1rem 0 0; 
  margin: 0 auto; 
}

:focus-visible { 
  outline: 3px solid var(--focus); 
  outline-offset: 3px; 
}









/* ======================================
   Zeilenumbruch in mobiler Ansicht
   ====================================== */
@media (max-width: 768px) {
  .mobile-break {
    display: block; /* sorgt für Zeilenumbruch nur mobil */
  }
}

@media (min-width: 769px) {
  .mobile-break {
    display: inline; /* kein Zeilenumbruch auf Desktop */
  }
}







/* ======================================
   Cookie-Hinweis Popup
   ====================================== */

/* Overlay-Hintergrund */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  display: none; /* wird per JS ein-/ausgeblendet */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.cookie-overlay.is-visible { display: flex; }

/* Modal-Box */
.cookie-modal {
  width: min(600px, calc(100vw - 2rem));
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  color: var(--fg);
  overflow: hidden;
}

/* Kopfbereich */
.cookie-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,.1);
  background: rgba(0,0,0,.05);
}
.cookie-header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; 
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.cookie-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

/* Textbereich */
.cookie-body { padding: 1rem 1.25rem; }
.cookie-body p { margin: 0 0 .75rem; }
.cookie-body .detail { color: var(--muted); font-size: .95rem; }

/* Buttons */
.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem 1.25rem 1.25rem;
}
.cookie-actions a,
.cookie-actions button {
  appearance: none;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  color: var(--fg);
  border-radius: .5rem;
  padding: .6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.cookie-actions a:hover,
.cookie-actions button:hover {
  background: rgba(0,0,0,.05);
}
.cookie-actions button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cookie-actions button.primary:hover {
  filter: brightness(1.05);
}

/* Animation */
@media (prefers-reduced-motion: no-preference) {
  .cookie-modal { 
    animation: pop .18s ease-out; 
  }
  @keyframes pop {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
  }
}

/* ======================================
   Hintergrund-Slideshow mit Crossfade
   für 10 Bilder (100s Gesamtdauer)
   ====================================== */

.slideshow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: url('imagesX/Topbild/TB80.jpg') no-repeat center center / cover;
  --elapsed: 0s; /* Standardwert, wird per JS überschrieben */
}

.slideshow div {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: fade 100s linear infinite;
  animation-delay: calc(var(--base, 0s) + var(--elapsed));
  will-change: opacity;
}

.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Crossfade-Animation:
   - 0–5%   = Einblenden (~2s)
   - 5–15%  = Voll sichtbar (~6s)
   - 15–20% = Ausblenden (~2s)
   - 20–100% = unsichtbar
*/
@keyframes fade {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  15%  { opacity: 1; }
  20%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Per-Slide Offsets (10 Bilder → je 10s versetzt) */
.slideshow div:nth-child(1)  { --base: 0s; }
.slideshow div:nth-child(2)  { --base: 10s; }
.slideshow div:nth-child(3)  { --base: 20s; }
.slideshow div:nth-child(4)  { --base: 30s; }
.slideshow div:nth-child(5)  { --base: 40s; }
.slideshow div:nth-child(6)  { --base: 50s; }
.slideshow div:nth-child(7)  { --base: 60s; }
.slideshow div:nth-child(8)  { --base: 70s; }
.slideshow div:nth-child(9)  { --base: 80s; }
.slideshow div:nth-child(10) { --base: 90s; }















