/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Grundlayout */
body {
  font-family: Arial, sans-serif;
  background: #fff;
  color: #003366;
  line-height: 1.6;
}

/* Header */
header {
  background-color: #33649E;
  color: white;
  padding: 2em 1em 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
  text-align: center;
}

header h1 {
  font-size: 2.5em;
  font-weight: normal;
}

header img {
  height: 60px;
  vertical-align: middle;
}

/* Navigation Grundstruktur */
nav {
  background-color: #33649E;
  border-top: 4px solid white;
}

nav ul.mainmenu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

nav ul.mainmenu > li {
  position: relative;
}

nav ul.mainmenu > li > a {
  color: white;
  text-decoration: none;
  padding: 1em 1.5em;
  display: block;
  transition: all 0.2s ease-in-out;
}

nav ul.mainmenu > li > a.active {
  background-color: white;
  color: #33649E;
  
}

/* Hover-Effekte */
nav ul.mainmenu > li > a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  
}

nav ul.mainmenu > li > a.active:hover {
  background-color: rgba(255, 255, 255, 0.5);
  color: #33649E;
  
}

/* Submenu */
nav ul.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #33649E;
  min-width: 180px;
  z-index: 10;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul.submenu li a {
  padding: 0.8em 1em;
  display: block;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
}

nav ul.submenu li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

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

/* Hauptinhalt */
main {
  max-width: 960px;
  margin: 2em auto;
  padding: 0 1em;
}

h2 {
  font-size: 1.8em;
  color: #33649E;
  margin-bottom: 1em;
}

h3 {
  font-size: 1.4em;
  color: #33649E;
  margin-top: 2em;
  margin-bottom: 1em;
}

p, li {
  margin-bottom: 1em;
  color: #003366;
}

.highlight {
  font-weight: bold;
  color: #33649E;
}

/* Tabelle für Zeiten */
table.zeiten-tabelle {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
}

table.zeiten-tabelle th,
table.zeiten-tabelle td {
  border: 1px solid #ccc;
  padding: 0.8em;
  text-align: left;
}

table.zeiten-tabelle th {
  background-color: #33649E;
  color: white;
}
table.info-table th {
  background-color: #33649E;
  color: white;
  padding: 0.6em;
  text-align: left; /* ← stellt sicher, dass die Überschrift linksbündig ist */
}

.arbeitseinsatz-bilder {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;              /* Abstand zwischen den Bildern */
  margin: 1rem 0;
}

.arbeitseinsatz-bild {
  flex: 1 1 calc(50% - 5px);
  max-width: calc(50% - 5px);
  height: auto;
  display: block;
}

/* Mobil: Bilder untereinander, volle Breite */
@media (max-width: 600px) {
  .arbeitseinsatz-bild {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Footer */
footer {
  background: #33649E;
  padding: 1em 2em;
  text-align: center;
  font-size: 0.9em;
  color: white;
}

footer p {
  color: white;
  margin: 0.5em 0;
}

footer a {
  color: white;
  text-decoration: none;
  font-size: 0.9em;
  display: inline-block;
  margin-top: 0.5em;
}
#cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #33649E;
  color: white;
  text-align: center;
  padding: 1em;
  z-index: 9999;
  font-size: 0.9em;
  border-top: 2px solid white;
}

#cookie-banner .cookie-text {
  display: inline-block;
  margin-right: 1em;
}

#cookie-banner button {
  background-color: white;
  color: #33649E;
  border: none;
  padding: 0.5em 1em;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}
#cookie-banner a {
  color: white;
  text-decoration: underline;
  font-weight: normal;
}
/* Responsive Menü – Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2em;
  color: white;
  padding: 1em;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    margin: 0 auto;
  }

  nav ul.mainmenu {
    flex-direction: column;
    display: none;
    text-align: center;
    width: 100%;
  }

  nav ul.mainmenu.show {
    display: flex;
  }

  nav ul.mainmenu > li > a {
    padding: 1em;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  nav ul.submenu {
    position: static;
  }

  nav li.has-submenu:hover .submenu {
    display: none;
  }

  nav li.has-submenu:focus-within .submenu,
  nav li.has-submenu:active .submenu {
    display: block;
  }
}
/* -------- Mobile Enhancements (added by optimizer) -------- */

/* Typography scales responsively */
:root{
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-size: 16px;
  line-height: 1.7;
}

/* Fluid headings */
header h1 { font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.2vw + 1rem, 1.8rem); }
h3 { font-size: clamp(1.1rem, 1vw + 0.9rem, 1.4rem); }

/* Make content images scale */
main img, .content-image, .responsive-img { 
  max-width: 100%;
  height: auto;
}

/* Improve main spacing on small screens */
@media (max-width: 480px){
  main { padding: 0 var(--space-2); }
  nav ul.mainmenu > li > a { padding: 0.9em 1.1em; }
}

/* Mobile submenu support */
nav li.has-submenu.open .submenu { display: block; }
nav li.has-submenu > a::after{
  content: "▾";
  margin-left: 0.35em;
  font-size: 0.9em;
}

/* Prevent hover-only behavior on touch devices */
@media (hover: none){
  nav li.has-submenu:hover .submenu { display: none; }
}

/* Make info/zeiten tables scrollable on small screens */
table.zeiten-tabelle,
table.info-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

/* Improve footer readability */
footer { font-size: 0.95em; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; }
}

/* Better focus styles for accessibility */
a:focus-visible, button:focus-visible {
  outline: 3px solid #99c2ff;
  outline-offset: 2px;
}

/* Make the cookie banner buttons larger on touch */
#cookie-banner button { padding: 0.7em 1.1em; border-radius: 8px; }

/* -------- Enhancements Pack 2: Sticky Header, Scroll-to-Top, Dark Mode -------- */

/* Sticky header */
header, .site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(1.2) blur(6px);
}

/* If header has a solid background, ensure it's not fully transparent */
header { background: rgba(255,255,255,0.9); }
@media (prefers-color-scheme: dark){
  header { background: rgba(20,24,28,0.85); }
}

/* Prevent content from being hidden under sticky header when scrolling to anchors */
[id] { scroll-margin-top: 90px; }

/* Scroll-to-top button */
.scroll-top{
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.scroll-top.is-visible{ display: inline-flex; }
.scroll-top:focus-visible{ outline: 3px solid #99c2ff; outline-offset: 2px; }

/* Light/Dark theme tokens */
:root{
  --bg: #ffffff;
  --text: #101418;
  --muted: #505b66;
  --surface: #f6f7f9;
  --primary: #33649E;
  --link: #1d4ed8;
  --border: #e5e7eb;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f141a;
    --text: #e7ecf2;
    --muted: #9aa7b3;
    --surface: #151b22;
    --primary: #5ba1ff;
    --link: #8ab6ff;
    --border: #253040;
  }
}

/* Apply tokens */
html, body { background: var(--bg); color: var(--text); }
a { color: var(--link); }
nav, footer, .card, .box, .panel { background: var(--surface); }
hr, .divider { border-color: var(--border); }

/* Tables in dark mode */
@media (prefers-color-scheme: dark){
  table, th, td { border-color: var(--border); }
  table tr:nth-child(even){ background: rgba(255,255,255,0.03); }
}

/* Buttons use primary color */
button, .button, input[type="submit"], input[type="button"] {
  background: var(--primary);
  color: #fff;
}

/* Smooth scroll for better UX */
html { scroll-behavior: smooth; }


/* ---- Back to Menu link ---- */
.back-to-menu-wrap{
  margin: 2rem 0 0;
  display: flex;
  justify-content: flex-end;
}
.back-to-menu{
  display: inline-block;
  padding: 0.7em 1.0em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.back-to-menu:hover{
  transform: translateY(-1px);
}
.back-to-menu:active{
  transform: translateY(0);
}
@media (max-width: 480px){
  .back-to-menu{ padding: 0.8em 1.1em; font-size: 1rem; }
}

/* ---- Responsive container: keep desktop style, adapt to any monitor ---- */
header, nav, main, footer {
  width: min(1200px, 100% - 2rem);
  margin-left: auto;
  margin-right: auto;
}

/* Allow wider view on very large monitors while keeping margins */
@media (min-width: 1600px){
  header, nav, main, footer {
    width: min(1400px, 100% - 4rem);
  }
}

/* Optional: hero/banner or full-width sections can opt-out by adding .full-bleed */
.full-bleed { width: 100% !important; margin: 0 !important; }

/* Make header/logo row align nicely at any width */
header > * { max-width: 100%; }

/* ---- Force desktop look & white background ---- */
html, body { background: #fff !important; color: #003366 !important; }

/* Keep original nav/footer colors from desktop */
nav { background-color: #33649E !important; }
footer { background: #33649E !important; color: #fff !important; }
footer p, footer a { color: #fff !important; }

/* Ensure submenu behavior works across devices */
nav ul.submenu { display: none; }
nav li.has-submenu.open > ul.submenu { display: block; }


/* ---- Mobile menu toggle & header color fix ---- */

/* Solid white header (no blur/grey) */
header, .site-header {
  background: #ffffff !important;
  backdrop-filter: none !important;
}

/* Toggle button styling */
.menu-toggle{
  display: none;
  margin: 0.5rem 0 0.5rem auto;
  padding: 0.6em 0.9em;
  border-radius: 8px;
  border: 1px solid #cfd6de;
  background: #ffffff;
  font-weight: 600;
}

/* Mobile behavior */
@media (max-width: 768px){
  .menu-toggle{ display: inline-block; }
  nav ul.mainmenu{ display: none; }
  nav ul.mainmenu.show{ display: block; }
  nav ul.mainmenu > li { margin: 0.25rem 0; }
}


/* ---- Fixes: header color + robust submenu behavior ---- */

/* Restore desktop header color (no grey) */
header, .site-header {
  background-color: #33649E !important;
  color: #ffffff !important;
  backdrop-filter: none !important;
}

/* Ensure submenu positioning */
nav ul.mainmenu { position: relative; }
nav li.has-submenu { position: relative; }
nav li.has-submenu > a::after {
  content: " ▾";
  font-size: 0.9em;
}

/* Desktop: open submenu on hover */
@media (min-width: 769px){
  nav ul.mainmenu { display: flex; }
  nav li.has-submenu:hover > ul.submenu { display: block; }
}

/* Mobile: open submenu when parent has .open (toggled by JS) */
@media (max-width: 768px){
  nav li.has-submenu.open > ul.submenu { display: block !important; }
}


/* ---- Final menu fixes: place toggle inside nav, restore desktop header ---- */

/* Remove sticky/rgba behavior from earlier pass */
header { position: static !important; background-color: #33649E !important; color: #fff !important; }
@media (prefers-color-scheme: dark){
  header { background-color: #33649E !important; }
}

/* Nav bar look stays like desktop */
nav { background-color: #33649E !important; }
nav a { color: #fff; }

/* Toggle styling inside nav */
.menu-toggle{
  display: none;
  margin: 0.5rem 0.5rem 0.5rem auto;
  padding: 0.6em 0.9em;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: #fff;
  font-weight: 600;
}

/* Layout rules for mobile */
@media (max-width: 768px){
  .menu-toggle{ display: inline-block; }
  nav ul.mainmenu{ display: none; flex-direction: column; width: 100%; }
  nav ul.mainmenu.show{ display: flex; }
  nav ul.mainmenu > li { border-top: 1px solid rgba(255,255,255,0.25); }
}


/* ---- Desktop full-width override ---- */
@media (min-width: 1024px){
  header, nav, main, footer {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* ---- Centered content: main + footer centered with max-width, header/nav full-width ---- */
@media (min-width: 1024px){
  /* Keep header & nav full width */
  header, nav { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }

  /* Center the content area */
  main, footer {
    width: min(1200px, 100% - 2rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Images and media adapt to content width */
main img, main video, main iframe {
  max-width: 100%;
  height: auto;
  display: block;
}


/* ---- Footer full-width (blue, centered text) ---- */
footer {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background-color: #33649E !important;
  color: #fff !important;
  text-align: center !important;
}
