/*
 * Eigene Ergänzungen zum Theme (green.css).
 * Ersetzt, was früher jQuery-Plugins per JavaScript erledigt haben.
 */

/* ---------- Weiches Scrollen zu Sprungmarken (z. B. "Über Uns") ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

#ueberuns {
  scroll-margin-top: 30px;
}

/* ---------- Mobiles Menü ---------- */
@media (max-width: 991px) {
  .header-area .main-nav .nav.open {
    display: block;
  }
}

/* ---------- Bilder füllen ihren Rahmen und werden mittig zugeschnitten ---------- */
.about-image img,
.home-img img,
.blog-post-thumb .img img,
.page-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.home-img {
  overflow: hidden;
}

/* Leichter Zoom beim Überfahren mit der Maus */
.about-image:hover img,
.home-img:hover img,
.page-gallery:hover img {
  transform: scale(1.1);
}

/* ---------- Hintergrundbilder mit leichtem Parallax-Effekt ---------- */
/* Das Bild wird von js/site.js eingesetzt und beim Scrollen verschoben.
   Es ist 60 % höher als der Abschnitt, damit dabei kein Rand sichtbar wird. */
.parallax-bg {
  position: absolute;
  top: -30%;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 160%;
  object-fit: cover;
  pointer-events: none;
  will-change: transform;
}

/* ---------- Ladeanimation ausblenden ---------- */
#preloader {
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

/* ---------- Bildergalerie (Großansicht) ---------- */
html.lightbox-open {
  overflow: hidden;
}

.page-gallery {
  cursor: zoom-in;
}

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(11, 11, 11, 0.85);
}

.lightbox-image {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 90px);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.lightbox button {
  position: absolute;
  width: 54px;
  height: 54px;
  padding: 0;
  color: #fff;
  font-size: 36px;
  line-height: 54px;
  background: none;
  border: 0;
  opacity: 0.7;
  cursor: pointer;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  opacity: 1;
}

.lightbox-close {
  top: 8px;
  right: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  margin-top: -27px;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

.lightbox-counter {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  color: #ccc;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 600px) {
  .lightbox-image {
    max-width: 100vw;
  }
}
