/* ==============================
   Global
============================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: white;
  color: black;
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  background-color: #000; /* tiefschwarz */
  color: #f0f0f0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==============================
   Header / Navigation
============================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
  background-color: var(--bg-color, transparent);
  z-index: 50;
  transition: background-color 0.3s;
  box-sizing: border-box;
}

header h1 {
  margin: 0;
}

header h1 a {
  color: inherit;
  text-decoration: none;
  font-size: 1em;
  padding: 3px 8px;
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s;
}

header h1 a:hover {
  background-color: #ddd;
}

body.dark-mode header h1 a:hover {
  background-color: #111;
}

/* Navigation rechts */
#main-nav {
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s, opacity 0.3s;
}

#main-nav.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* Dark Mode Button */
button#toggle-darkmode {
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  font-size: 0.9em;
  background-color: #000;
  color: #fff;
  transition: background-color 0.3s, color 0.3s, transform 0.2s ease;
}

button#toggle-darkmode:hover {
  background-color: #333;
  transform: scale(1.05);
}

body.dark-mode button#toggle-darkmode {
  background-color: #ddd;
  color: #000;
}

body.dark-mode button#toggle-darkmode:hover {
  background-color: #bbb;
}

/* Header Dark Mode Fix */
body.dark-mode header {
  background-color: #000;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.1);
}

body.dark-mode header h1 a,
body.dark-mode nav a {
  color: #f0f0f0;
}

body.dark-mode nav a:hover {
  color: #fff;
}

/* ==============================
   Slideshow
============================== */
.slideshow {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: white;
  transition: background-color 0.3s;
}

body.dark-mode .slideshow {
  background-color: #000;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
}

.slide.active {
  display: flex;
}

.slide img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: auto;
  transition: transform 0.5s ease;
}

/* Slideshow-Pfeile */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3em;
  cursor: pointer;
  padding: 0 10px;
  z-index: 10;
  transition: color 0.3s, opacity 0.3s;
  opacity: 0.7;
}

.prev:hover, .next:hover { opacity: 1; }

.prev { left: 10px; }
.next { right: 10px; }

body.dark-mode .prev,
body.dark-mode .next { color: white; }
body:not(.dark-mode) .prev,
body:not(.dark-mode) .next { color: black; }

/* ==============================
   Galerie
============================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  padding: 20px;
  margin-top: 100px;
}

.thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.3s;
}

.thumbnail:hover { transform: scale(1.05); }
body.dark-mode .thumbnail { border: 2px solid #222; }

/* ==============================
   Lightbox
============================== */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0,0,0,0.9);
  z-index: 100;
  cursor: pointer;
  transition: background-color 0.3s;
}

#lightbox.hidden { display: none; }

#lightbox-img {
  max-width: 90%;
  max-height: 90%;
  display: block;
  margin: auto;
}

#close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2em;
  color: white;
  cursor: pointer;
}

/* ==============================
   About / Impressum Bild
============================== */
.about-image {
  float: right;
  margin-left: 20px;
  max-width: 40%;
  max-height: 80vh;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-mode .about-image img {
  box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

/* ==============================
   Sections
============================== */
main { padding: 20px; margin-top: 80px; }
section h2 { margin-top: 0; }

/* ==============================
   Responsive
============================== */
@media (max-width:700px){
  header { flex-direction: column; align-items: flex-start; padding:10px 20px; }
  #main-nav { flex-wrap: wrap; gap: 10px; margin-top: 5px; }
  button#toggle-darkmode { padding: 5px 10px; font-size:0.85em; }

  .slideshow { height:auto; padding:60px 10px; }
  .slide img { max-width:100%; max-height:60vh; }

  .about-image { float:none; display:block; margin:20px auto; max-width:80%; max-height:50vh; }
  .about-image img { width:100%; height:auto; }

  main { padding:15px; margin-top:80px; }
}

/* Slideshow Captions dynamische Größe */
.slide-caption {
  font-size: clamp(1.5em, 4vw, 4em); /* Minimum 1.5em, Maximum 4em, dynamisch je nach Bildschirmbreite */
  color: #444;
  text-align: center;
  margin-top: 10px;
}

body.dark-mode .slide-caption {
  color: #ccc;
}

/* Mobile Slideshow: Bild oben, Text darunter */
@media (max-width: 700px) {
  .slide {
    flex-direction: column !important; /* Bild oben, Caption darunter */
    justify-content: center;
    align-items: center;
  }

  .slide-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 1.2em; /* kleiner, passt auf Handy */
  }

  .slide img {
    max-width: 90%;   /* passt in den Bildschirm */
    max-height: auto;
    height: auto;
    margin: 0 auto;
  }

  /* Navigation-Pfeile anpassen */
  .prev, .next {
    font-size: 2em;
    padding: 0 5px;
  }
}

/* Blog post header - always visible */
.blog-post-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd; /* Light mode */
}

.dark-mode .blog-post-header {
  border-bottom-color: #444; /* Dark mode */
}

/* Content that expands/collapses */
.blog-post-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.blog-post.expanded .blog-post-content {
  max-height: 1000px; /* Adjust based on your content */
}

/* Image styling (only shown when expanded) */
.blog-post-image {
  max-width: 30%;
  height: auto;
  margin-top: 1rem;
}

/* Post body text (only shown when expanded) */
.post-body {
  margin-top: 1rem;
}

/* Expand icon styling */
.expand-icon {
  transition: transform 0.3s ease;
}

.blog-post.expanded .expand-icon {
  transform: rotate(180deg);
}
