/* =========================================
   RESET & BASIS
========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Montserrat, sans-serif;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--header-height, 80px);
  padding-bottom: 40px; /* Abstand für Footer */
}

/* =========================================
   HINTERGRUNDBILD
========================================= */
.background {
  position: fixed;
  top: var(--header-height, 80px);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height, 80px));
  background: url("pics/back.jpg") no-repeat center center;
  background-size: cover;
  background-position: center calc(50% + var(--background-offset, 0px));
  z-index: -1;
  transition: height 0.5s ease, background-position 0.5s ease;
}

/* =========================================
   HEADER & NAVIGATION
========================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  position: relative;
}

/* Navigation Desktop */
nav {
  display: flex;
}

nav ul {
  list-style: none;
  display: flex;
  gap: clamp(30px, 4vw, 120px);
  justify-content: center;
}

nav ul li a {
  text-decoration: none;
  color: black;
  font-weight: lighter;
  font-size: clamp(1.0rem, 1.5vw, 1.35rem);
  transition: color 0.3s, text-decoration 0.3s;
  white-space: nowrap;
}

nav ul li a:hover {
  color: #555;
}

nav ul li a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

/* =========================================
   BURGER-MENÜ (MOBILE)
========================================= */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: black;
  font-size: 2rem;
  cursor: pointer;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
}

/* Mobile Menü */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    z-index: 2000;
    transition: none;
  }

  nav.active {
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
  }

  nav.closing {
    transform: translateX(100%);
    transition: transform 0.6s ease-in-out;
  }

  nav ul {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  nav ul li a {
    font-size: 1.5rem;
    white-space: normal;
  }

  /* Einblenden der Menüpunkte nacheinander */
  nav.active ul li a {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.3s forwards;
  }

  nav.active ul li:nth-child(1) a { animation-delay: 0.1s; }
  nav.active ul li:nth-child(2) a { animation-delay: 0.2s; }
  nav.active ul li:nth-child(3) a { animation-delay: 0.3s; }
  nav.active ul li:nth-child(4) a { animation-delay: 0.4s; }
  nav.active ul li:nth-child(5) a { animation-delay: 0.5s; }
  nav.active ul li:nth-child(6) a { animation-delay: 0.6s; }

  /* Hintergrundbild auf mobilen Geräten etwas kleiner */
  .background {
    height: calc(80vh - var(--header-height, 80px));
    background-position: center calc(50% + var(--background-offset, 0px));
  }
}

/* Animation */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Anpassung nach Seitenverhältnis */
@media (max-aspect-ratio: 3/4) {
  .background {
    --background-offset: 5vh;
  }
}

@media (min-aspect-ratio: 16/9) {
  .background {
    --background-offset: 10vh;
  }
}

/* =========================================
   MAIN-BEREICH
========================================= */
.content-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.image-container {
  flex: 1 1 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-container img {
  width: 100%;
  height: auto;
  max-width: 400px;
  border-radius: 12px;
 /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);*/
}

/* Container für vertikale Anordnung */
.content-section-buecher {
  display: flex;
  flex-direction: column; /* immer untereinander */
  align-items: center;    /* horizontal zentrieren */
  gap: 40px;              /* Abstand zwischen den Bildern */
  padding: 20px;
  max-width: 1000px;       /* optional: maximale Breite des gesamten Blocks */
  margin: 0 auto;         /* zentriert den Container */
}

/* Bilder responsive */
.image-container-buecher img {
  width: 100%;      /* skaliert auf die Containerbreite */
  max-width: 1000px; /* optional: maximale Bildbreite */
  height: auto;     /* proportional bleiben */
  border-radius: 8px; /* optional: abgerundete Ecken */
 /* box-shadow: 0 4px 10px rgba(0,0,0,0.1);  optional */
}

/* Container für vertikale Anordnung */
.content-section-skizzenseite {
  display: flex;
  flex-direction: column; /* immer untereinander */
  align-items: center;    /* horizontal zentrieren */
  gap: 40px;              /* Abstand zwischen den Bildern */
  padding: 20px;
  max-width: 1000px;       /* optional: maximale Breite des gesamten Blocks */
  margin: 0 auto;         /* zentriert den Container */
}

/* Bilder responsive */
.image-container-skizzenseite img {
  width: 100%;      /* skaliert auf die Containerbreite */
  max-width: 1000px; /* optional: maximale Bildbreite */
  height: auto;     /* proportional bleiben */
  border-radius: 8px; /* optional: abgerundete Ecken */
 /* box-shadow: 0 4px 10px rgba(0,0,0,0.1);  optional */
}

.text-container {
  flex: 1 1 400px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #222;
}

.text-container h2 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

.text-container h3 {
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  font-weight: 600;
}

/* --- MOBILE OPTIMIERUNG --- */
@media (max-width: 768px) {

  /* Hauptcontainer enger machen */
  .content-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px; /* kleiner Abstand zwischen Bild und Text */
    padding: 20px 15px;
    margin-bottom: 0; /* kein zusätzlicher Außenabstand */
  }

  /* Textcontainer enger zusammenrücken */
  .text-container {
    margin: 0;
    padding: 0;
  }

  /* Standard-Abstände von Überschriften und Absätzen verringern */
  .text-container h2,
  .text-container h3 {
    margin-top: 0.6em;
    margin-bottom: 0.4em;
  }

  .text-container p {
    margin-top: 0.2em;
    margin-bottom: 0.4em;
    line-height: 1.4; /* etwas kompakter */
  }

  /* Wenn mehrere Textcontainer übereinander stehen */
  .text-container + .text-container {
    margin-top: 10px; /* kleiner, gleichmäßiger Abstand */
  }
}



/* =========================================
   PORTFOLIO / MASONRY-GALERIE
========================================= */
.portfolio-gallery {
  max-width: 1200px;
  margin: 80px auto 80px;
  padding: 0 20px;
}

.masonry-gallery {
  column-count: 3;
  column-gap: 20px;
}

.masonry-gallery a {
  display: block;
  margin-bottom: 20px;
  break-inside: avoid;
  position: relative;
  border-radius: 8px;
  overflow: visible;
  z-index: 1;
  transition: transform 0.3s ease;
}

.masonry-gallery img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  border-radius: 8px;
}

.masonry-gallery a:hover {
  z-index: 10;
}

.masonry-gallery a:hover img {
  transform: scale(1.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Responsive Anpassungen */
@media (max-width: 1024px) {
  .masonry-gallery {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .masonry-gallery {
    column-count: 1;
  }
}

/* =========================================
   FOOTER
========================================= */
footer {
  position: sticky;
  bottom: 0;
  right: 0;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: black;
  background: rgba(255, 255, 255, 0.85);
  z-index: 10;
  text-align: right;
}
