/* =========================
   Font Definitions
   ========================= */
/* Local LibreBaskerville fonts for GDPR compliance */

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/LibreBaskerville-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/LibreBaskerville-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/LibreBaskerville-Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* =========================
   Universelle Lightbox Styles
   ========================= */
/* Styles for the universal lightbox, including transitions, responsiveness, and close button design. */

#lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
  padding: 1rem;
}

#lightbox-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

#lightbox-modal img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 0.5rem;
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: opacity;
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 100000;
}

#lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

@media (max-width: 600px) {
  #lightbox-modal {
    padding: 0.5rem;
  }
  
  #lightbox-modal img {
    max-width: 96vw;
    max-height: 80vh;
  }
  
  #lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* =========================
   Variables & Base Styles
   ========================= */
/* Define CSS variables for primary colors and base styles for the website. */

:root {
  --primary: #004e9e;
  --secondary: #00b4d8;
  --text: #1a1a1a;
  --text-light: #666666;
  --background: #ffffff;
  --background-alt: #f8f9fa;
}

html {
  scroll-behavior: smooth;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Headings with Libre Baskerville font */
h1, h2, h3, h4, h5, h6,
.text-3xl, .text-4xl, .text-5xl, .text-2xl, .text-xl {
  font-family: 'Libre Baskerville', serif;
}

/* =========================
   Sektionen & Layout
   ========================= */
/* Textbox leicht überlappend auf Bild für Sektionen */
.section-overlap-box {
  position: relative;
  z-index: 2;
  margin-left: -80px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 32px 0 #004e9e22, 0 2px 8px 0 #0002;
}
@media (max-width: 900px) {
  .section-overlap-box {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .overflow-hidden.rounded-2xl.shadow-xl.border.border-gray-100.animate-fadein img {
    width: 100% !important;
    height: 320px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }
}

/* =========================
   Galerie Slider für Eindrücke
   ========================= */
/* Styles for the gallery slider, ensuring only the active image is visible and responsive design is maintained. */

/* Eindrücke Galerie: Nur das aktive Bild ist sichtbar */
.gallery-img, .gallery-img-muehle, .gallery-img-fuehrung {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.5rem !important;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.gallery-img.active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* Eindrücke gallery container: make height responsive and let images center */
#gallery-slider {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  box-sizing: border-box;
  background: #f8f9fa;
  border-radius: 1.5rem;
}
@media (max-width: 900px) {
  #gallery-slider {
    min-width: 0 !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .gallery-img {
    min-width: 90vw !important;
    width: 90vw !important;
    max-width: 98vw !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
  .gallery-img.active {
    transform: translate(-50%, -50%) scale(1.05) !important;
  }
  .gallery-img.left {
    transform: translate(-120%, -50%) scale(0.95) !important;
  }
  .gallery-img.right {
    transform: translate(20%, -50%) scale(0.95) !important;
  }
}

/* =========================
   Carousel Styles
   ========================= */
/* Gallery Carousel: Remove border and make images larger */
.carousel-img-preview {
  border: none !important;
  max-height: 420px;
  width: auto;
  max-width: 100%;
  border-radius: 1.5rem !important;
  box-shadow: 0 8px 32px 0 #004e9e22, 0 2px 8px 0 #0002;
  transition: box-shadow 0.3s, transform 0.3s;
}

/* =========================
   Parallax & Background Effects
   ========================= */
/* Parallax background for hero: smooth effect */
/* Styles for the parallax background effect in the hero section. */
.parallax-bg {
  will-change: transform;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

/* =========================
   Animation & Transition Styles
   ========================= */
/* Portfolio and Timeline animations */
/* Keyframes and animations for portfolio cards and timeline entries. */
.animate-fadein {
  animation: fadein 1.2s cubic-bezier(.4,0,.2,1);
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Portfolio Grid Animation */
.portfolio-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(.4,0,.2,1);
}

@media (min-width: 768px) {
  .portfolio-card[data-animate] {
    opacity: 0;
    transform: translateY(2rem);
  }
  
  .portfolio-card:nth-child(1) { transition-delay: 0.1s; }
  .portfolio-card:nth-child(2) { transition-delay: 0.2s; }
  .portfolio-card:nth-child(3) { transition-delay: 0.3s; }
  .portfolio-card:nth-child(4) { transition-delay: 0.4s; }
}

/* =========================
   Hero Section Styles
   ========================= */
/* Hero background */
/* Styles for the hero section background, including fixed and responsive adjustments. */
.hero-bg {
  z-index: -1;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@supports (-webkit-touch-callout: none) {
  /* CSS specific to iOS devices */
  .hero-bg {
    position: absolute !important;
    background-attachment: scroll !important;
  }
}

/* Ensure all content sections hide the fixed background */
main section {
  position: relative;
  z-index: 1;
}

/* Make sure gradient backgrounds are fully opaque */
.from-white, .from-gray-50, .to-white, .to-gray-50 {
  --tw-gradient-from: rgba(255, 255, 255, 1) !important;
  --tw-gradient-to: rgba(249, 250, 251, 1) !important;
}

/* Ensure solid backgrounds are fully opaque */
.bg-white {
  --tw-bg-opacity: 1 !important;
}

.bg-gray-50 {
  --tw-bg-opacity: 1 !important;
}

.bg-gray-100 {
  --tw-bg-opacity: 1 !important;
}

/* Header fade in/out */
#main-header.opacity-0 {
  opacity: 0;
  pointer-events: none;
}
#main-header.opacity-100 {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   Feature Boxes & Section Spacing
   ========================= */
/* Feature boxes section spacing */
section.relative.z-20 {
  margin-top: -4rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  section.relative.z-20 {
    margin-top: -2rem;
    margin-bottom: 2rem;
  }
}

/* =========================
   Farbvariablen
   ========================= */
:root {
  --primary: #004e9e;
}

/* =========================
   Scroll Progress Bar
   ========================= */
/* Scroll Progress Bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #00b4d8, #004e9e, #00b4d8);
  width: 0%;
  min-width: 40px;
  z-index: 10000;
  transition: width 0.2s ease-out;
  opacity: 1 !important;
  display: block !important;
}

/* =========================
   Hero Image & Floating Shapes
   ========================= */
/* Hero */
.hero {
  position: relative;
}
.hero-overlay {
  max-width: 90%;
}
.hero-feature {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-feature:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Floating Shapes */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite alternate;
  z-index: 1;
}
.shape1 { width: 60px; height: 60px; background: var(--primary); top: 20%; left: 10%; }
.shape2 { width: 80px; height: 80px; background: var(--primary); top: 50%; right: 15%; }
.shape3 { width: 50px; height: 50px; background: var(--primary); bottom: 20%; left: 30%; }

@keyframes float {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-20px); }
}

/* =========================
   Timeline Styles
   ========================= */
/* Timeline Linie nur hinter Timeline-Einträge, nicht Überschrift */
/* Styles for the timeline line, ensuring it appears only behind entries and not the heading. */
#geschichte .container {
  position: relative;
  padding-top: 0; /* Abstand Überschrift */
}
#geschichte .timeline-line {
  content: "";
  position: absolute;
  left: 50%;
  top: 4rem; /* Abstand von Überschrift */
  transform: translateX(-50%);
  width: 2px;
  height: calc(100% - 4rem);
  background: var(--primary);
  z-index: 0;
}

/* Boxen innerhalb Timeline & allgemein */
.bg-white {
  background: rgba(255,255,255,0.95);
  border-radius: 0.5rem;
  padding: 0rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition:  0.3s ease, box-shadow 0.3s ease;
}
.bg-white:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

/* =========================
   Footer Styles
   ========================= */
/* Footer */
footer p {
  font-size: 0.9rem;
}

/* =========================
   Links & Interactivity
   ========================= */
/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}

/* =========================
   Carousel Eindrücke
   ========================= */
/* Carousel Eindrücke */
#eindruecke .container {
  position: relative;
}
#carousel {
  display: flex;
  align-items: center;
  transition: transform 0.7s ease;
  will-change: transform;
}
#carousel img {
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
  margin: 0 8px;
  transition: transform 0.5s ease, opacity 0.5s ease;
  cursor: grab;
  width: auto; /* Bildgröße flexibel */
  max-height: 400px; /* Optional, damit es nicht zu groß wird */
}
#carousel img.scale-100 {
  transform: scale(1);
  opacity: 1;
  z-index: 10;
}
#carousel img.scale-90 {
  transform: scale(0.9);
  opacity: 0.8;
  z-index: 5;
}
#carousel img.scale-75 {
  transform: scale(0.75);
  opacity: 0.6;
  z-index: 1;
}

/* Carousel Container */
#eindruecke .container .overflow-visible {
  overflow: visible; /* Sneak Previews */
}

/* Pfeile */
#prev, #next {
  background-color: var(--primary);
  color: white;
  border-radius: 9999px;
  padding: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}
#prev:hover, #next:hover {
  background-color: #003b7a;
  transform: scale(1.1);
}

/* Dots */
#dots span {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: gray;
  transition: background 0.3s ease;
}
#dots span.bg-\[\#004e9e\] {
  background: var(--primary);
}

.accordion-panel.is-open {
  display: block !important;
}

/* =========================
   Timeline image size control and Lightbox
   ========================= */
/* Timeline image size control and Lightbox */
.timeline-img {
  transition: transform 0.3s ease;
}

/* Timeline image style */
.timeline-img {
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  will-change: transform;
}

.timeline-img:hover {
  transform: scale(1.05);
}

.timeline-img:active {
  transform: scale(0.95);
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .timeline-img {
    width: 48px !important;
    height: 48px !important;
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }

  /* Universal Lightbox styles for mobile */
  #lightbox-modal {
    padding: 1rem !important;
  }
  
  #lightbox-modal img {
    max-width: 92vw !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    transform: none !important;
    opacity: 1 !important;
    border-radius: 1rem !important;
  }

  #lightbox-modal.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  #lightbox-modal {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
  }
  
  #lightbox-close {
    top: 0.5rem !important;
    right: 0.5rem !important;
    width: 3rem !important;
    height: 3rem !important;
    font-size: 1.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    z-index: 100000 !important;
  }
}