/* Modern Gallery Styles - Minimalistisch */

/* Gallery Container */
.container.gallery, 
.gallery-container {
  max-width: 1600px !important;
  margin: 0 auto !important;
  padding: 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Gallery Header */
.gallery-header {
  margin-bottom: 1.5rem !important;
  text-align: center !important;
  position: relative !important;
  display: block !important;
  width: 100% !important;
  visibility: visible !important;
}

.gallery-header h1 {
  font-size: 1.8rem !important;
  font-weight: 500 !important;
  color: #333 !important;
  margin-bottom: 1rem !important;
  display: block !important;
  visibility: visible !important;
}

/* Gallery Grid */
.gallery-show {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  grid-auto-rows: 220px !important;
  grid-gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

/* Gallery Items - Minimalistisch ohne Rahmen */
.gallery-item {
  cursor: pointer !important;
  overflow: hidden !important;
  background-color: transparent !important; /* Transparenter Hintergrund */
  box-shadow: none !important; /* Keinen Schatten */
  border-radius: 0 !important; /* Keine abgerundeten Ecken */
}

.gallery-item:hover {
  transform: none !important; /* Keine Transformation beim Hover */
  box-shadow: none !important; /* Kein Schatten beim Hover */
}

.gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.3s ease !important;
  display: block !important;
}

.gallery-item:hover img {
  transform: scale(1.02) !important; /* Nur ein leichtes Skalieren beim Hover */
}

/* Item Sizing */
.landscape {
  grid-column: span 2 !important;
}

.portrait {
  grid-row: span 2 !important;
}

.square {
  grid-column: span 1 !important;
  grid-row: span 1 !important;
}

/* Image Overlay */
#overlay-image-section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.9) !important; /* Etwas dunklerer Hintergrund */
  z-index: 1000 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
  overflow: auto !important;
}

#overlay-image-section.active {
  opacity: 1 !important;
  visibility: visible !important;
}

#overlay-show-img {
  max-height: 85vh !important;
  max-width: 90vw !important;
  object-fit: contain !important;
  box-shadow: none !important; /* Kein Schatten */
  border-radius: 0 !important; /* Keine abgerundeten Ecken */
}

#gallery-text-overlay {
  max-width: 600px !important;
  color: white !important;
  font-size: 0.85rem !important;
  margin-top: 0.7rem !important;
  padding: 0.3rem 0.7rem !important;
  border-radius: 0 !important; /* Keine abgerundeten Ecken */
  text-align: center !important;
}

/* Verbesserter Close-Button */
#closebtn-gallery {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  color: white !important;
  font-size: 1.5rem !important;
  cursor: pointer !important;
  z-index: 1001 !important;
  background: transparent !important; /* Transparenter Hintergrund */
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important; /* Keine abgerundeten Ecken */
  transition: opacity 0.2s ease !important; /* Nur Transparenz-Übergang, keine Rotation */
  opacity: 0.7 !important; /* Etwas transparenter */
}

#closebtn-gallery:hover {
  background: transparent !important; /* Kein Hintergrund beim Hover */
  transform: none !important; /* Keine Drehung beim Hover */
  opacity: 1 !important; /* Vollständig sichtbar beim Hover */
}

#overlay-image-section svg {
  width: 18px !important; /* Etwas größer */
  height: 18px !important;
}

#cross-burger-gallery .cross_st0 {
  stroke: white !important;
  stroke-width: 2 !important;
}

/* Empty Gallery Message */
.empty-gallery-message {
  text-align: center !important;
  padding: 30px 20px !important;
  background-color: #f9f9f9 !important;
  border-radius: 0 !important; /* Keine abgerundeten Ecken */
  margin: 15px 0 !important;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .gallery-show {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    grid-auto-rows: 180px !important;
  }
}

@media (max-width: 992px) {
  .gallery-header h1 {
    font-size: 1.6rem !important;
  }
}

@media (max-width: 768px) {
  .gallery-show {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    grid-auto-rows: 150px !important;
    gap: 10px !important;
  }
  
  .gallery-show .portrait, 
  .gallery-show .landscape {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
}

@media (max-width: 576px) {
  .gallery-show {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    grid-auto-rows: 130px !important;
    gap: 8px !important;
  }
  
  .gallery-header h1 {
    font-size: 1.4rem !important;
  }
  
  #gallery-text-overlay {
    font-size: 0.8rem !important;
    padding: 0.2rem 0.5rem !important;
  }
  
  #closebtn-gallery {
    top: 15px !important;
    right: 15px !important;
  }
}

@media (max-width: 480px) {
  .gallery-show {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    grid-auto-rows: 100px !important;
    gap: 6px !important;
  }
  
  .container.gallery {
    padding: 10px !important;
  }
}