/* ============================================
   Oldtimer Galerie – Stil (Polaroid Lightbox)
   Version 2.5 – bereinigt
   ============================================ */

/* Galerie-Grid */
.oldtimer-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin: 30px auto;
  width: 100%;
  max-width: 1600px;
}

/* Karten */
.oldtimer-card {
  display: block; /* Sicherstellen, dass Karten sichtbar sind */
  background: #fdfaf4;
  border: 2px solid #c2a661;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(10px);
  transition: transform 0.4s ease, box-shadow 0.25s ease, opacity 0.4s ease;
  opacity: 0;
  font-family: "Georgia", serif;
}
.oldtimer-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.oldtimer-card.hidden {
  display: none; /* bleibt unsichtbar */
  opacity: 0;
}

.oldtimer-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Galerie-Bilder */
img.oldtimer-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-bottom: 2px solid #c2a661;
  filter: sepia(20%) contrast(95%) saturate(120%) brightness(95%);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.oldtimer-card:hover img.oldtimer-card-image {
  filter: sepia(30%) contrast(100%) saturate(130%) brightness(100%);
  transform: scale(1.03);
}

/* Textbereich */
.oldtimer-card-body {
  padding: 14px 16px;
  color: #3b2f2f;
  background: repeating-linear-gradient(
    45deg,
    #fdfaf4,
    #fdfaf4 10px,
    #f8f4ec 10px,
    #f8f4ec 20px
  );
  background-blend-mode: multiply;
}
.oldtimer-card-body p {
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.5;
}
.oldtimer-card-body strong {
  color: #7a5c2e;
  font-weight: bold;
}

/* Lightbox Overlay */
.oldtimer-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.oldtimer-lightbox.open {
  display: flex;
}

/* Polaroid-Container */
.oldtimer-lightbox-photo {
  background: #fff;
  padding: 6px 6px 12px 6px;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Bild */
.oldtimer-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 4px;
}

/* Caption */
.oldtimer-lightbox-caption {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-family: "Georgia", serif;
  font-size: 15px;
  color: #3b2f2f;
  text-align: center;
}
@media (max-width: 600px) {
  .oldtimer-lightbox-caption {
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
  }
}

/* Buttons */
.oldtimer-lightbox-close,
.oldtimer-lightbox-prev,
.oldtimer-lightbox-next {
  background: rgba(0, 0, 0, 0.4);
  color: #c2a661;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.oldtimer-lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 32px;
  line-height: 1;
}
.oldtimer-lightbox-prev,
.oldtimer-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  padding: 10px;
  z-index: 100000;
}
.oldtimer-lightbox-prev { left: 20px; }
.oldtimer-lightbox-next { right: 20px; }
.oldtimer-lightbox-close:hover,
.oldtimer-lightbox-prev:hover,
.oldtimer-lightbox-next:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

/* Filterbereich inkl. Suchfeld */
.oldtimer-filters {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  align-items: center;
  font-family: "Georgia", serif;
}
.oldtimer-filters label {
  font-weight: bold;
  color: #3b2f2f;
}
.oldtimer-filters select,
#filter-search {
  padding: 6px 10px;
  border: 1px solid #c2a661;
  border-radius: 4px;
  background: #fdfaf4;
  font-family: inherit;
  font-size: 15px;
  color: #3b2f2f;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.oldtimer-filters select:focus,
#filter-search:focus {
  outline: none;
  border-color: #7a5c2e;
  box-shadow: 0 0 4px rgba(194, 166, 97, 0.6);
}
#filter-search {
  min-width: 220px;
}

/* Reset-Button */
#filter-reset {
  padding: 6px 12px;
  margin-left: 10px;
  border: 1px solid #c2a661;
  border-radius: 4px;
  background: #fdfaf4;
  color: #3b2f2f;
  cursor: pointer;
  font-family: "Georgia", serif;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}
#filter-reset:hover {
  background: #c2a661;
  color: #fff;
}

.filter-count {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid #c2a661;
  background: #fdfaf4;
  color: #3b2f2f;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  font-family: "Georgia", serif;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .filter-count {
    margin-left: 0;
    margin-top: 8px;
  }
}

@keyframes pulse {
  0%   { transform: scale(1);   background-color: #c2a661; }
  50%  { transform: scale(1.15); background-color: #e0c27a; }
  100% { transform: scale(1);   background-color: #c2a661; }
}

.filter-count.animate {
  animation: pulse 0.4s ease;
}



/* Mobile Optimierung */
@media (max-width: 600px) {
  .oldtimer-filters {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  #filter-search {
    width: 100%;
  }
  #filter-reset {
    margin-left: 0;
  }
}