/* =========================================================================
   OPTIMIERTE FOTOSTORIES STYLES - Mäxx Foto Website
   ========================================================================= */

/* =========================================================================
   STORY IMAGE LAZY LOADING & PERFORMANCE
   ========================================================================= */

/* Story Gallery Container */
.story-gallery {
  flex: 1.2;
  min-width: 300px;
  position: relative;
  height: 450px;
}

.story-img {
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  position: absolute;
  transition: transform var(--transition-fast);
  height: 300px;
  object-fit: cover;
  /* Performance Optimierungen */
  will-change: transform;
  backface-visibility: hidden;
  /* Bessere Bildschärfe */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Immer vollständig sichtbar - ALLE ZUSTÄNDE */
  opacity: 1 !important;
  filter: none !important;
  visibility: visible !important;
}

/* Absolut alle Bildklassen sofort sichtbar */
.story-img,
.story-img.loading,
.story-img.loaded,
.offset-img-1,
.offset-img-2, 
.main-img,
picture .story-img,
picture img {
  opacity: 1 !important;
  filter: none !important;
  visibility: visible !important;
  transition: transform var(--transition-fast) !important;
}

/* Spezifische Anpassungen für Bildformate */
.story-img.portrait {
  width: auto;
  max-width: 45%;
}

.story-img.landscape {
  width: auto;
  max-width: 65%;
}

/* Bildpositionierung - KRITISCH für Layout */
.main-img {
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 320px;
}

.offset-img-1 {
  z-index: 2;
  left: 10%;
  top: 15%;
}

.offset-img-2 {
  z-index: 1;
  right: 10%;
  bottom: 15%;
}

.story-img:hover {
  transform: scale(1.03);
  z-index: 4;
}

.main-img:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

/* Lazy Loading Placeholder - Deaktiviert für bessere UX */
.story-img.loading {
  filter: none;
  opacity: 1;
}

.story-img.loaded {
  filter: none;
  opacity: 1;
}

/* =========================================================================
   ERWEITERTE LIGHTBOX FUNKTIONEN
   ========================================================================= */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  padding: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-info {
  background: rgba(255,255,255,0.1);
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

.lightbox-title {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.lightbox-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* =========================================================================
   ANIMIERTE STORY TAGS
   ========================================================================= */

.story-tag {
  background: rgba(40, 40, 40, 0.9);
  color: #ffffff !important;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(201, 113, 72, 0.5);
}

.story-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

.story-tag:hover::before {
  left: 100%;
}

.story-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 113, 72, 0.4);
}

/* =========================================================================
   VERBESSERTE KUNDE QUOTES
   ========================================================================= */

.customer-quote {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  padding: 2rem;
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
  font-style: italic;
  position: relative;
  backdrop-filter: blur(5px);
}

.customer-quote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary-color);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.customer-quote p {
  margin-bottom: var(--spacing-sm);
  font-size: 1.1rem;
  line-height: 1.7;
}

.customer-quote cite {
  display: block;
  font-style: normal;
  text-align: right;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 1rem;
}

.customer-quote cite::before {
  content: '— ';
}

/* =========================================================================
   PROGRESSIVE IMAGE LOADING
   ========================================================================= */

.story-img-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.story-img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  background-size: 400% 400%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* =========================================================================
   STORY NAVIGATION
   ========================================================================= */

.story-navigation {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.story-nav-dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

.story-nav-dot:hover {
  background: rgba(255,255,255,0.6);
}

/* Tooltip für Navigation */
.story-nav-dot::after {
  content: attr(data-title);
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.story-nav-dot:hover::after {
  opacity: 1;
}

/* =========================================================================
   SCROLL PROGRESS INDICATOR
   ========================================================================= */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  z-index: 1001;
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  transition: width 0.1s ease;
}

/* =========================================================================
   ENHANCED MOBILE EXPERIENCE
   ========================================================================= */

@media (max-width: 768px) {
  .story-navigation {
    right: 1rem;
    gap: 0.3rem;
  }
  
  .story-nav-dot {
    width: 10px;
    height: 10px;
  }
  
  .lightbox-info {
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
  }
  
  .lightbox-title {
    font-size: 1rem;
  }
  
  .lightbox-description {
    font-size: 0.8rem;
  }
  
  .customer-quote::before {
    font-size: 2.5rem;
    top: -5px;
    left: 15px;
  }
}

/* =========================================================================
   STORY CATEGORIES FILTER
   ========================================================================= */

.story-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  color: var(--text-secondary);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: var(--text-primary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* =========================================================================
   STORY STATS & METADATA
   ========================================================================= */

.story-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* =========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================= */

/* Desktop-spezifische Bildregeln - vollständige Sichtbarkeit ohne Blur - KORRIGIERT */
@media (min-width: 769px) {
  .story-img,
  .story-img.loading,
  .story-img.loaded,
  .story-img:not(.visible),
  .story-img.visible,
  .offset-img-1,
  .offset-img-2,
  .main-img,
  picture .story-img,
  picture img,
  img.story-img,
  .story .story-img,
  .story-gallery .story-img {
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
    /* KEIN transform: none - Positionierung muss funktionieren! */
    transition: transform var(--transition-fast) !important;
  }
  
  /* Zusätzliche ultra-spezifische Regeln für Desktop */
  .story-gallery img.story-img.offset-img-1,
  .story-gallery img.story-img.offset-img-2,
  .story-gallery img.story-img.main-img {
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
  }
  
  /* Explizite Positionierungs-Fixes */
  .main-img {
    transform: translate(-50%, -50%) !important;
  }
}

.story-img:focus,
.lightbox-nav button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .story-img,
  .story-tag,
  .lightbox {
    transition: none;
  }
  
  .story-img-placeholder {
    animation: none;
  }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  .story-tag {
    background: var(--primary-color);
    border: 2px solid white;
    color: #ffffff !important;
  }
  
  .customer-quote {
    border: 2px solid var(--primary-color);
  }
}

/* =========================================================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ========================================================================= */

@media (max-width: 768px) {
  .story-content, 
  .story-content.reverse {
    flex-direction: column;
  }
  
  .story-gallery {
    height: 400px;
    width: 100%;
    margin-top: var(--spacing-lg);
  }
  
  /* Responsive Bildanpassungen */
  .story-img.portrait {
    max-width: 40%;
  }
  
  .story-img.landscape {
    max-width: 60%;
  }
  
  .main-img {
    height: 260px;
  }
  
  .offset-img-1,
  .offset-img-2 {
    height: 240px;
  }
  
  .story-meta {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .story-container {
    gap: var(--spacing-xxl);
  }
  
  .story-gallery {
    height: 350px;
  }
  
  /* Kleinere Bilder für kleine Bildschirme */
  .main-img {
    height: 220px;
  }
  
  .offset-img-1,
  .offset-img-2 {
    height: 200px;
  }
}
