/* Clean, validated stylesheet with subtle UI improvements */

/* Base */
body {
  margin: 0;
  font-family: 'Lato', 'Segoe UI', Arial, sans-serif;
  background: #f5f6fa;
  color: #222;
  line-height: 1.45;
}

/* Typography refinements */
h1, .hero-title { font-family: 'Montserrat', 'Lato', sans-serif; font-weight: 700; }
h2 { font-family: 'Montserrat', 'Lato', sans-serif; font-weight: 600; }
p, li, address { font-family: 'Lato', Arial, sans-serif; }

/* Scroll reveal utilities */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 560ms cubic-bezier(.2,.9,.2,1), transform 520ms cubic-bezier(.2,.9,.2,1); will-change: opacity, transform; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Slight variant for slide-in from left */
.reveal-left { opacity: 0; transform: translateX(-18px); transition: opacity 560ms cubic-bezier(.2,.9,.2,1), transform 520ms cubic-bezier(.2,.9,.2,1); }
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

/* Banner */
.banner {
  width: 100%;
  height: 320px;
  background-image: url('../Pictures/BMW 1er unbearbeitet.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.12));
}
.banner-text {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 16px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.32);
  padding: 0.9rem 2.2rem;
  border-radius: 12px;
  z-index: 1;
  line-height: 1.05;
}

/* Hero variant: large, full-bleed visual similar to BMW/Tesla */
.banner.hero {
  height: clamp(420px, 60vh, 760px);
  display: grid;
  align-items: center;
  background-size: cover;
  background-position: center center;
}
.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  text-align: left;
  color: #fff;
}
.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  margin: 0 0 0.5rem 0;
  line-height: 1.02;
  text-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 70ch;
  margin: 0 0 1.25rem 0;
  color: rgba(255,255,255,0.9);
}
.btn-cta {
  background: linear-gradient(90deg, #00aaff, #4fc3ff);
  color: #00121a;
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

@media (max-width: 760px) {
  .hero-content { text-align: center; }
  .hero-sub { max-width: 42ch; margin-left: auto; margin-right: auto; }
  .banner.hero { background-position: top center; }
}

/* Navigation */
.main-nav {
  background: #222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem;
}
.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0 auto; /* center the list inside the flex nav */
  padding: 0;
  order: 1;
}
.main-nav .nav-toggle { display: none; }
.main-nav .hamburger { display: none; }
.main-nav .nav-close { display: none; }
.main-nav li { margin: 0 1.5rem; }
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.8rem 0.6rem;
  display: block;
  transition: color 0.2s;
}
.main-nav a:hover { color: #00aaff; }

/* ordering for controls (theme button and nav toggle) */
.theme-toggle { order: 2; }
.main-nav .nav-toggle { order: 3; }

/* Layout */
main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
section { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 2rem; padding: 2rem; }
h1 { font-size: 1.8rem; margin: 0 0 0.6rem 0; }
h2 { margin-top: 0; color: #00aaff; }

.to-top { position: fixed; right: 2rem; bottom: 2rem; background: #00aaff; color: #fff; border: none; border-radius: 50%; width: 48px; height: 48px; font-size: 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); cursor: pointer; transition: background 0.2s; z-index: 100; }
.to-top:hover { background: #0077cc; }

.footer {
  /* Dark, compact footer matching screenshot */
  background-color: #222; /* near-black bar */
  color: #fff;
  padding: 1rem 1rem;
  border-top: 4px solid rgba(255,255,255,0.03);
  margin-top: 2rem;
  font-size: 0.95rem;
}

/* Footer grid layout (desktop: 4 columns; mobile: stacked) */
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
  padding: 1rem 1rem;
}
.footer-col h3 { margin: 0 0 0.5rem 0; font-size: 0.95rem; color: rgba(255,255,255,0.9); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.35rem 0; }
.footer-col a { color: rgba(255,255,255,0.85); text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.social-list { display: flex; gap: 0.6rem; align-items: center; }
.footer-contact address { font-style: normal; color: rgba(255,255,255,0.85); }
.footer-copy { text-align: right; }

/* ensure the social list in footer-copy is right-aligned on larger viewports */
.footer-copy .social-list { justify-content: flex-end; }
.footer-col.footer-social .social-list { justify-content: flex-start; }

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-copy { text-align: left; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .footer-copy { text-align: left; }
  .main-nav .nav-close { top: 10px; right: 10px; }
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center; /* center copyright & impressum */
  gap: 1rem;
  flex-wrap: nowrap;
}

.footer-text { margin: 0; text-align: center; flex: 1 1 auto; }
.footer-social-inline { margin: 0; flex: 0 0 auto; }
.footer .social-icon { width: 20px; height: 20px; display: block; }

/* Social bar above footer (right aligned, like bmw.de) */
.social-bar { display: flex; justify-content: flex-end; align-items: center; padding: 0.5rem 1rem; background: transparent; }
.footer-social { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; text-decoration: none; }
.footer-social svg { width: 28px; height: 28px; fill: #fff; display: block; }
.footer-social img { width: 34px; height: 34px; display: block; object-fit: contain; }
.footer-social:focus { outline: 3px solid rgba(255,255,255,0.12); outline-offset: 3px; }
.footer-social img { width: 34px; height: 34px; display: block; object-fit: contain; }

@media (max-width: 600px) {
  .banner-text { font-size: 1.2rem; padding: 0.5rem 1rem; }
  main { padding: 0; }
  section { padding: 1rem; }
  /* Mobile nav: hide the list by default and show burger */
  .main-nav { position: relative; }
  .main-nav .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: none; color: inherit; margin-left: auto; cursor: pointer; }
  /* hamburger lines use theme variable so they contrast in both modes */
  .main-nav .hamburger { width: 22px; height: 2px; background: var(--nav-icon); display: block; position: relative; }
  .main-nav .hamburger::before, .main-nav .hamburger::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; background: var(--nav-icon); }
  .main-nav .hamburger::before { top: -6px; }
  .main-nav .hamburger::after { bottom: -6px; }

  /* Slide-in panel from the right for mobile */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 85vw);
    transform: translateX(100%); /* hidden by default */
    background: var(--section-bg);
    margin: 0;
    padding: 2.4rem 1rem;
    box-shadow: -18px 0 40px rgba(0,0,0,0.25);
    border-radius: 0 0 0 8px;
    z-index: 1200;
    gap: 0.6rem;
    align-items: flex-start;
    transition: transform 320ms cubic-bezier(.2,.9,.2,1);
    overflow-y: auto;
  }
  /* ensure links inside the slide-in panel are visible on dark and light themes */
  .main-nav ul a { color: var(--text); }
  .main-nav ul a:focus, .main-nav ul a:hover { color: var(--accent); }
  .main-nav li { margin: 0.6rem 0; }
  .main-nav[data-open="true"] ul { transform: translateX(0); }

  /* page overlay shown when nav is open */
  .nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .nav-overlay.visible { opacity: 1; pointer-events: auto; }

  /* close button inside slide-in panel */
  .main-nav .nav-close {
    display: inline-flex;
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    color: var(--nav-close-color); /* theme-aware close button color */
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
  }
  .main-nav .nav-close:focus { outline: 3px solid rgba(79,195,255,0.22); }
}

/* Hamburger -> Cross animation */
.main-nav .hamburger,
.main-nav .hamburger::before,
.main-nav .hamburger::after {
  transition: transform 220ms cubic-bezier(.25,.8,.25,1), opacity 180ms ease;
  transform-origin: center;
}
.main-nav .hamburger { background: var(--nav-icon); }
.main-nav[data-open="true"] .hamburger { background: transparent; }
.main-nav[data-open="true"] .hamburger::before { transform: translateY(6px) rotate(45deg); }
.main-nav[data-open="true"] .hamburger::after { transform: translateY(-6px) rotate(-45deg); }
.main-nav[data-open="true"] .hamburger::before,
.main-nav[data-open="true"] .hamburger::after { background: var(--nav-icon); }

/* when nav is open, allow applying a different color to the close button */
.main-nav[data-open="true"] .nav-close { color: var(--nav-close-open-color); }

@media (prefers-reduced-motion: reduce) {
  .main-nav .hamburger,
  .main-nav .hamburger::before,
  .main-nav .hamburger::after {
    transition: none !important;
  }
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; align-items: start; padding: 0; margin: 0; }
.gallery a { 
  display: block; 
  text-decoration: none; 
  transition: opacity 260ms ease; 
  will-change: opacity; 
  opacity: 0; 
  animation: fadeInUp 360ms ease forwards; 
}
.gallery a:focus, .gallery a:hover { 
  opacity: 0.8; 
  outline: none; 
}
.gallery a:focus-visible { 
  outline: 2px solid var(--accent); 
  outline-offset: 2px; 
}
.gallery img { 
  width: 100%; 
  height: 220px; 
  object-fit: cover; 
  display: block; 
  aspect-ratio: 16 / 9; 
  border-radius: 8px; 
  transition: transform 260ms ease;
}
.gallery a:hover img, .gallery a:focus-within img { 
  transform: scale(1.02); 
}
.gallery .caption { 
  font-size: 0.9rem; 
  color: var(--text); 
  padding: 0.5rem 0; 
  text-align: center; 
  margin-top: 0.5rem; 
  display: block; 
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.gallery a:nth-child(1) { animation-delay: 80ms; }
.gallery a:nth-child(2) { animation-delay: 160ms; }
.gallery a:nth-child(3) { animation-delay: 240ms; }
.gallery a:nth-child(4) { animation-delay: 320ms; }

/* Social Media Call-to-Action Section */
.social-cta {
  background: linear-gradient(135deg, var(--section-bg) 0%, color-mix(in srgb, var(--section-bg) 95%, var(--accent) 5%) 100%);
  padding: 3rem 1.5rem;
  margin: 3rem 0 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.social-cta-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.social-cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.social-intro {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.social-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.social-feature {
  text-align: center;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.social-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.social-feature h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.social-feature p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.social-links-cta {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2.5rem;
}

.cta-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.social-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 300ms ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 200px;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.instagram-btn:hover {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  border-color: rgba(255, 255, 255, 0.3);
}

.tiktok-btn:hover {
  background: linear-gradient(135deg, #ff0050 0%, #000000 100%);
  border-color: rgba(255, 255, 255, 0.3);
}

.social-btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
}

.social-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  color: var(--text);
  transition: color 300ms ease;
}

.social-btn-text strong {
  font-size: 1.1rem;
  font-weight: 600;
  color: inherit;
}

.social-btn-text small {
  font-size: 0.85rem;
  opacity: 0.85;
  color: inherit;
}

/* Hover-Zustand: Weiße Schrift bei farbigen Hintergründen */
.social-btn:hover .social-btn-text,
.social-btn:hover .social-btn-text strong,
.social-btn:hover .social-btn-text small {
  color: #fff;
}

@media (max-width: 768px) {
  .social-cta {
    padding: 2rem 1rem;
    margin: 2rem 0 1rem;
  }
  
  .social-cta h2 {
    font-size: 1.6rem;
  }
  
  .social-features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .social-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .social-btn {
    min-width: 250px;
  }
}

/* Cards for Angebote page */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 1rem; }
.card { background: var(--section-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 22px rgba(0,0,0,0.08); display: flex; flex-direction: column; transition: transform 200ms ease, box-shadow 200ms ease; }
.card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1 1 auto; }
.card-title { margin: 0; font-size: 1.1rem; color: var(--text); }
.card-desc { margin: 0; color: color-mix(in srgb, var(--text) 85%, rgba(34,34,34,0.7) 15%); flex: 1 1 auto; }
.card .btn { align-self: start; margin-top: 0.4rem; }
.card:focus-within, .card:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(0,0,0,0.12); }
.card:focus-within { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none !important; transform: none !important; }
}

/* Image preload spinner */
.img-wrap { position: relative; display: inline-block; background: var(--card-bg); }
.img-wrap .spinner {
  position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.02));
}
.img-wrap .spinner::after {
  content: '';
  width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: rgba(255,255,255,0.6);
  animation: spin 900ms linear infinite;
}
.img-wrap.loading img { opacity: 0.0; }
.img-wrap.loaded .spinner { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .img-wrap .spinner::after { animation: none; }
}

/* Accessibility */
a:focus-visible, button:focus-visible { outline: 3px solid rgba(79,195,255,0.22); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .gallery a { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; } }

/* Lightbox styles - Compact layout with background visible */
.lightbox-overlay { 
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  background: rgba(0,0,0,0.7); /* More transparent to see background */
  z-index: 9999; 
  padding: 20px; 
}
.lightbox-overlay[aria-hidden="false"] { 
  display: flex; 
}

/* Support both lightbox structures */
.lightbox-main { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  max-width: 70vw; /* Smaller maximum width */
  max-height: 80vh; /* Smaller maximum height */
}

.lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 70vw; /* Smaller maximum width */
  max-height: 80vh; /* Smaller maximum height */
}

.lightbox-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}

.lightbox-image-container { 
  position: relative; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-bottom: 20px;
}

.lightbox-image, 
#lightbox-img { 
  display: block; 
  max-width: 60vw; /* Much smaller image size */
  max-height: 50vh; /* Much smaller image height */
  object-fit: contain; 
  border-radius: 8px; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.lightbox-close { 
  position: absolute; 
  top: 10px; 
  right: 10px; 
  background: var(--accent); 
  color: #fff; 
  border: none; 
  padding: 6px 10px; 
  border-radius: 50%; 
  cursor: pointer; 
  font-size: 16px; 
  z-index: 10; 
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.lightbox-close:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

.lightbox-prev, .lightbox-next { 
  position: absolute; 
  top: 50%; 
  transform: translateY(-50%); 
  background: rgba(0,0,0,0.7); 
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 12px; 
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 18px; 
  z-index: 5; 
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}
.lightbox-prev:hover, .lightbox-next:hover { 
  background: rgba(0,0,0,0.9); 
  border-color: rgba(255,255,255,0.5);
}
.lightbox-prev { 
  left: 10px; 
} 
.lightbox-next { 
  right: 10px; 
}
.lightbox-thumbs { 
  display: flex; 
  gap: 8px; 
  overflow-x: auto; 
  padding: 8px; 
  max-width: 60vw; 
  justify-content: center; 
  background: rgba(255,255,255,0.1); 
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  margin-top: 15px;
  backdrop-filter: blur(5px);
}
/* Hide thumbnail bar when there are only 1-2 images */
.lightbox-thumbs:has(img:nth-child(1):last-child),
.lightbox-thumbs:has(img:nth-child(2):last-child) {
  display: none;
}
.lightbox-thumbs img { 
  width: 60px; 
  height: 45px; 
  object-fit: cover; 
  border-radius: 4px; 
  cursor: pointer; 
  opacity: 0.6; 
  border: 2px solid transparent; 
  transition: all 0.2s ease;
}
.lightbox-thumbs img:hover { 
  opacity: 0.8; 
  transform: scale(1.05); 
}
.lightbox-thumbs img.active { 
  opacity: 1; 
  border-color: var(--accent); 
  transform: scale(1.1); 
}

/* Mobile responsiveness for compact lightbox */
@media (max-width: 768px) {
  .lightbox-content,
  .lightbox-main {
    max-width: 90vw;
    max-height: 90vh;
  }
  
  .lightbox-frame {
    padding: 15px;
  }
  
  .lightbox-image,
  #lightbox-img { 
    max-width: 80vw; 
    max-height: 60vh; 
  }
  
  .lightbox-prev, .lightbox-next { 
    padding: 6px 10px; 
    font-size: 16px; 
  }
  
  .lightbox-prev { 
    left: 5px; 
  } 
  
  .lightbox-next { 
    right: 5px; 
  }
  .lightbox-thumbs { 
    max-width: 95vw; 
    gap: 6px; 
  }
  .lightbox-thumbs img { 
    width: 60px; 
    height: 45px; 
  }
  .lightbox-close { 
    top: 10px; 
    right: 10px; 
    padding: 6px 10px; 
    font-size: 16px; 
  }
}

/* Theme variables and dark mode support */
:root { --bg: #f5f6fa; --text: #222; --nav-bg: #222; --accent: #00aaff; --section-bg: #fff; --banner-text-color: #fff; --banner-bg: rgba(0,0,0,0.3); --card-bg: rgba(255,255,255,0.02); --thumb-active-border: #fff; --to-top-bg: #00aaff; }
/* caption color variable so captions are readable in both themes */
:root { --bg: #f5f6fa; --text: #222; --nav-bg: #222; --accent: #00aaff; --section-bg: #fff; --banner-text-color: #fff; --banner-bg: rgba(0,0,0,0.3); --card-bg: rgba(255,255,255,0.02); --thumb-active-border: #fff; --to-top-bg: #00aaff; --caption: rgba(34,34,34,0.75); }
[data-theme="dark"] {
  --bg: #0b0d10;
  --text: #e6eef6;
  --nav-bg: #071423;
  --accent: #4fc3ff;
  --section-bg: #07101a;
  --banner-text-color: #fff;
  --banner-bg: rgba(0,0,0,0.45);
  --card-bg: rgba(255,255,255,0.02);
  --thumb-active-border: #fff;
  --to-top-bg: #4fc3ff;
  --caption: rgba(230,238,246,0.78);
}

/* Theme-aware nav icon colors: default (light) and overrides for dark theme */
:root { --nav-icon: #fff; --nav-close-color: #fff; /* when open, use page text color so it contrasts with section background */ --nav-close-open-color: var(--text); }
[data-theme="dark"] { --nav-icon: #fff; --nav-close-color: #fff; --nav-close-open-color: var(--text); }

/* Apply variables and smooth transitions */
html, body, .main-nav, section, .gallery a, .lightbox-frame, footer { transition: background-color 240ms ease, color 240ms ease, box-shadow 240ms ease; }
body { background: var(--bg); color: var(--text); }
.main-nav { background: var(--nav-bg); }
h2 { color: var(--accent); }
section { background: var(--section-bg); }
.banner-text { color: var(--banner-text-color); background: var(--banner-bg); }
.gallery a { background: var(--card-bg); }
.lightbox-thumbs img.active { border-color: var(--thumb-active-border); }
.to-top { background: var(--to-top-bg); }

.theme-toggle { margin-left: 1rem; background: transparent; color: inherit; border: none; cursor: pointer; font-size: 1.1rem; padding: 0.4rem 0.6rem; border-radius: 8px; }
.theme-toggle:hover { background: rgba(255,255,255,0.03); }

.btn { display: inline-block; background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }

/* Über uns / Mission section */
.section-mission { background: transparent; padding: 2.4rem 0; }
.section-mission .container { max-width: 1000px; margin: 0 auto; padding: 0 1rem; }
.section-mission h2 { color: var(--accent); margin-bottom: 0.6rem; }
.section-mission p { color: color-mix(in srgb, var(--text) 90%, rgba(0,0,0,0.02) 10%); max-width: 70ch; }
.section-mission .muted { color: color-mix(in srgb, var(--text) 55%, rgba(0,0,0,0.02) 45%); font-weight: 700; margin-top: 0.6rem; }

/* Microinteractions: subtle hover/active states */
.btn:active { transform: translateY(-1px) scale(0.995); }
.btn { will-change: transform, box-shadow; }

/* Gallery image hover: already defined in main gallery styles */

/* Nav link subtle underline animation */
.main-nav a { position: relative; }
.main-nav a::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%) scaleX(0); bottom: 6px; height: 2px; width: 60%; background: var(--accent); transform-origin: center; transition: transform 220ms cubic-bezier(.2,.8,.2,1); opacity: 0.95; }
.main-nav a:hover::after, .main-nav a:focus::after { transform: translateX(-50%) scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .btn, .gallery a img, .main-nav a::after { transition: none !important; }
  .gallery a:hover img, .gallery a:focus-within img { transform: none !important; }
}

/* Footer link styling: keep footer links white to match the copyright text */
footer a { color: #fff; text-decoration: underline; }
footer a:hover, footer a:focus { color: #fff; text-decoration: underline; }

/* Mailto links: use the site's standard text color, keep emphasis (bold + underline) */
a[href^="mailto:"] { color: var(--text) !important; font-weight: 700; text-decoration: underline; }


.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  z-index: 3;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-thumbs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px;
  width: 100%;
  justify-content: center;
}

.lightbox-thumbs img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.8;
  border: 2px solid transparent;
}

.lightbox-thumbs img.active {
  opacity: 1;
  border-color: #fff;
}

/* Theme variables and dark mode support */
:root {
  --bg: #f5f6fa;
  --text: #222;
  --nav-bg: #222;
  --accent: #00aaff;
  --section-bg: #fff;
  --banner-text-color: #fff;
  --banner-bg: rgba(0,0,0,0.3);
  --card-bg: rgba(255,255,255,0.02);
  --thumb-active-border: #fff;
  --to-top-bg: #00aaff;
}

[data-theme="dark"] {
  --bg: #0b0d10;
  --text: #e6eef6;
  --nav-bg: #071423;
  --accent: #4fc3ff;
  --section-bg: #07101a;
  --banner-text-color: #fff;
  --banner-bg: rgba(0,0,0,0.45);
  --card-bg: rgba(255,255,255,0.02);
  --thumb-active-border: #fff;
  --to-top-bg: #4fc3ff;
}

/* Apply variables and smooth transitions */
html, body, .main-nav, section, .gallery a, .lightbox-frame, footer {
  transition: background-color 240ms ease, color 240ms ease, box-shadow 240ms ease;
}

body { background: var(--bg); color: var(--text); }
.main-nav { background: var(--nav-bg); }
h2 { color: var(--accent); }
section { background: var(--section-bg); }
.banner-text { color: var(--banner-text-color); background: var(--banner-bg); }
.gallery a { background: var(--card-bg); }
.lightbox-thumbs img.active { border-color: var(--thumb-active-border); }
.to-top { background: var(--to-top-bg); }

/* Theme toggle button small styles */
.theme-toggle {
  margin-left: 1rem;
  background: transparent;
  color: inherit;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.03); }

/* Simple button style used for internal links */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }

.social-link {
  display: inline-block;
  margin-left: 10px; /* Abstand zum Text */
}

.social-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.footer-copy .social-list { justify-content: flex-end; }
.footer-col.footer-social .social-list { justify-content: flex-start; }

/* Cookie Notification */
.cookie-notification {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 3px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 9999;
  padding: 1.5rem;
  display: none;
  animation: slideUp 0.3s ease-out;
}

.cookie-notification[aria-hidden="false"] {
  display: block;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
}

.cookie-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
  min-width: 300px;
}

.cookie-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--hover-bg);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mobile responsiveness for cookie notification */
@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .cookie-content p {
    min-width: auto;
  }
  
  .cookie-actions {
    justify-content: center;
    width: 100%;
  }
}

/* Subtle links for legal pages (impressum, datenschutz) */
.legal-link {
  color: var(--text);
  text-decoration: underline;
  font-weight: 600;
}

.legal-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Gallery page specific styles */
.gallery-intro {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-filter {
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.filter-btn {
  background: var(--hover-bg);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.filter-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.gallery-category {
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.gallery-category h2 {
  margin-bottom: 0.5rem;
}

.gallery-category p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-style: italic;
}

.weekly-highlights {
  background: var(--hover-bg);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 1rem;
}

.weekly-highlights h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.weekly-highlights p.muted {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.weekly-info {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.weekly-item {
  position: relative;
}

.weekly-item::after {
  content: "🌟";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 15px;
  font-size: 0.8rem;
  z-index: 2;
}

/* Mobile responsiveness for gallery filters */
@media (max-width: 768px) {
  .filter-buttons {
    justify-content: center;
  }
  
  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .gallery-category {
    padding: 0 0.5rem;
  }
  
  .weekly-highlights {
    margin: 2rem 0.5rem;
    padding: 1.5rem;
  }
}

/* Highlights Container for Homepage */
.highlights-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

.highlight-category {
  text-align: center;
}

.highlight-category h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.highlight-category .gallery {
  margin-bottom: 1rem;
}

.highlight-update {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.weekly-highlight {
  position: relative;
}

.weekly-highlight::after {
  content: "★";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 50%;
  font-size: 0.8rem;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Mobile responsiveness for highlights */
@media (max-width: 768px) {
  .highlights-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }
  
  .highlight-category h3 {
    font-size: 1.1rem;
  }
}
