/*
 * Basiskonfiguration und globale Stile
 */
* {
    box-sizing: border-box; 
}

body {
    padding: 0; 
    background-color: #f9fafb;
    height: auto;
    width: 100%; 
    overflow-x: hidden; 
    margin: 0;
    font-family: sans-serif;
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

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

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #1f2937;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preloader-text {
    margin-top: 1rem;
    color: #4b5563;
    font-size: 0.875rem;
}

/* Scroll Sentinel Container */
#scroll-sentinel {
    width: 100%;
}

/* Unsichtbare Panels, die den Scroll-Raum definieren */
.scroll-panel {
    height: 100vh;
    width: 100%;
    opacity: 0; 
    pointer-events: none;
}

/* Der Galerie-Container wird FIXIERT */
.gallery-3d-container {
    position: fixed; 
    top: 0;
    left: 0;
    height: 100vh; 
    width: 100%; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vignette Overlay für 3D-Tunnel Effekt */
.vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.15) 100%
    );
    z-index: 998;
}

/* 3D Szene: Muss die Perspektive halten */
.gallery-scene {
    perspective: 2500px;
    position: relative;
    height: 100%;
    width: 100%;
    display: flex; 
    align-items: center;
    justify-content: center;
}

/* Das Bildpaar (Snap-Container) */
.gallery-pair {
    position: absolute; 
    height: 70vh; 
    width: 80vw; 
    display: grid;
    grid-template-columns: 10vw 1fr 15vw 1fr 10vw; 
    align-items: center;
    transform: none; 
    left: auto; 
    top: auto; 
    transition: transform 300ms ease-out, filter 300ms ease-out, opacity 300ms ease-out;
    transform-style: preserve-3d;
    outline: none;
    pointer-events: none;
}

/* Focus State für Accessibility */
.gallery-pair:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 8px;
    border-radius: 0.5rem;
}

.gallery-pair:focus:not(:focus-visible) {
    outline: none;
}

/* Image Wrapper Divs */
.image-wrapper {
    width: 100%;
    display: block;
    pointer-events: initial;
}

.image-wrapper a {
    display: block;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.image-wrapper a:hover {
    opacity: 0.9;
}

.image-wrapper a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 4px;
    border-radius: 0.5rem;
}

.image-wrapper a:focus:not(:focus-visible) {
    outline: none;
}

/* Bilder innerhalb des Paares */
.gallery-pair img {
    width: 100%;
    display: block;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: none;
}

/* Platzierung der Bilder im Grid */
.image-wrapper.image-left {
    grid-column: 2 / 3;
}

.image-wrapper.image-right {
    grid-column: 4 / 5;
}

/* Indikator-Bereich */
.indicator-area {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 999;
}

.indicator-text {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.indicator-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.indicator-dot {
    height: 0.25rem;
    border-radius: 9999px;
    transition: all 300ms;
    cursor: pointer;
}

.indicator-dot:hover {
    background-color: #6b7280;
}

.indicator-dot:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.indicator-dot:focus:not(:focus-visible) {
    outline: none;
}

.indicator-dot-inactive {
    width: 0.25rem;
    background-color: #9ca3af;
}

.indicator-dot-active {
    width: 2rem;
    background-color: #1f2937;
}

/* Responsive Design für Mobile */
@media (max-width: 768px) {
    .gallery-pair {
        width: 95vw;
        height: 60vh;
        grid-template-columns: 5vw 1fr 8vw 1fr 5vw;
    }
    
    .indicator-area {
        bottom: 1rem;
    }
    
    .indicator-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .gallery-pair {
        grid-template-columns: 2vw 1fr 5vw 1fr 2vw;
    }
}

/* Reduced Motion für Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-pair {
        transition: opacity 300ms ease-out;
    }
    
    .gallery-pair img {
        transition: none;
    }
    
    .preloader-spinner {
        animation: none;
        border-top-color: transparent;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* -----------------------------------
Hover titel effekt
----------------------------------- */ 
/* =======================================
   MOBILE TYPOGRAFIE — bis 768px
======================================= */
@media (max-width: 768px) {

  /* Grundschrift kleiner */
  body {
    font-size: 14px;
    line-height: 1.4;
  }

  /* Allgemeine Text-Elemente */
  p, li, a, span, .indicator-text {
    font-size: 0.85rem !important;  /* ca. 13–14px */
  }

  /* Preloader */
  .preloader-text {
    font-size: 0.75rem !important;
  }

  /* Indikatoren */
  .indicator-text {
    font-size: 0.75rem !important;
  }

  /* Headings */
  h1 {
    font-size: 1.6rem !important; /* ~26px */
  }
  h2 {
    font-size: 1.3rem !important; /* ~21px */
  }
  h3 {
    font-size: 1.1rem !important; /* ~18px */
  }

  /* Button-ähnliche Elemente / Interaktion */
  .indicator-dot-active {
    width: 1.6rem;
  }
  .indicator-dot-inactive {
    width: 0.25rem;
  }
}


/* =======================================
   EXTRA SMALL — bis 480px
======================================= */
@media (max-width: 480px) {

  /* Grundschrift sehr kompakt */
  body {
    font-size: 12px;
    line-height: 1.35;
  }

  /* Standard-Text */
  p, li, a, span, .indicator-text {
    font-size: 0.8rem !important; /* ~12–13px */
  }

  /* Preloader */
  .preloader-text {
    font-size: 0.7rem !important;
  }

  /* Headings */
  h1 {
    font-size: 1.3rem !important; /* ~21px */
  }
  h2 {
    font-size: 1.1rem !important; /* ~18px */
  }
  h3 {
    font-size: 1rem !important;   /* ~16px */
  }

  /* Indikatoren */
  .indicator-dot-active {
    width: 1.3rem;
  }
  .indicator-dot-inactive {
    width: 0.2rem;
  }
}
