/* Grid layout for tips */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 2rem;
  justify-items: center;
  align-items: start;
}

.tip-image {
  width: 100%;
  max-width: 120px;
  height: auto;
  cursor: pointer;
  filter: grayscale(100%);
  transition: filter 0.3s ease, transform 0.3s ease;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.tip-image:hover {
  filter: none;
}

/* Overlay styling */
#tips-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  padding: 2rem;
  justify-content: center;
  align-items: center;
  display: flex;
}

#overlay-container {
  display: flex;
  gap: 3rem;
  align-items: center;
  max-width: 90vw;
  flex-wrap: nowrap;
}

#overlay-image {
  max-width: 45vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#overlay-text-container {
  max-width: 40vw;
}

#overlay-text {
  color: white;
  font-size: 2rem;
  line-height: 1.6;
  font-family: Rockwell;
}

#overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}
.overlay-nav {
  background: transparent;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 1rem;
  user-select: none;
  transition: transform 0.2s ease;
}

.overlay-nav:hover {
  transform: scale(1.2);
}

#overlay-prev {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

#overlay-next {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

#overlay-counter {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.2rem;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  z-index: 10000;
  font-family: Rockwell;
}

/* Desktop: verstecke mobilen Pfeil-Bereich */
#overlay-bottom-bar {
  display: none;
}

/* Mobile layout */
@media (max-width: 768px) {
  .tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto auto;
    padding: 1rem;
    gap: 1rem;
  }

  .tips-grid > img:nth-child(5) {
    grid-column: 1 / span 2;
    justify-self: center;
  }

  .tip-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  #overlay-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  #overlay-image {
    max-width: 80vw;
    max-height: 50vh;
  }

  #overlay-text-container {
    max-width: 90vw;
  }

  #overlay-text {
    font-size: 1.2rem;
    color: white;
  }

  #overlay-container > #overlay-prev,
  #overlay-container > #overlay-next {
    display: none;
  }

  #overlay-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: absolute;
    bottom: 1rem;
    left: 0;
    padding: 0 1.5rem;
    color: white;
    font-size: 1rem;
  }

  #mobile-prev,
  #mobile-next {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
  }

  #mobile-counter {
    color: white;
    font-size: 1rem;
  }

  #overlay-counter {
    display: none;
  }
}


/* Bild-Fade-In */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

#overlay-image.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Text-Fade-In */
#overlay-text.fade-in {
  animation: fadeIn 0.3s ease;
}

#tips-footer-text {
  margin-top: 2rem;
  padding: 2rem;
  text-align: center;
  color: #040000fa;
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-family: Rockwell;
}

#tips-footer-text a {
  color: #0b20e1;
  text-decoration: underline;
}

#tips-footer-text a:hover {
  text-decoration: none;
}