.news-detail-gallery-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.news-detail-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  background-color: #f5f5f5;
}

.gallery-slide.is-image-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  animation: gallery-loading-shimmer 1.2s infinite;
}

.gallery-slide.is-image-loading::after {
  content: "Bild wird geladen...";
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #333;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 8px;
  border-radius: 999px;
}

@keyframes gallery-loading-shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.5em;
  border-radius: 5px;
  z-index: 10;
}

.gallery-control.prev {
  left: 10px;
}

.gallery-control.next {
  right: 10px;
}

.gallery-control:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.news-detail-page .container {
  display: block;
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 2.5rem;
  align-items: start;
}

#news-detail-container {
  max-width: 100%;
}

.news-sidebar {
  max-width: 100%;
  margin-left: 0;
  padding-left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#related-news {
  max-width: 100%;
  margin-left: 0;
  padding-left: 0;
  box-sizing: border-box;
}

.more-news {
  flex: 1;
  max-width: 100%;
  margin-top: 0;
}

.more-news h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
}

.related-news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.related-news-item {
  border-radius: 10px;
  background-color: #fff;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-news-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.related-news-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  flex-direction: row;
  align-items: center;
  padding: 10px;
}

.related-news-thumb img {
  width: 150px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 15px;
}

.related-news-text {
  flex: 1;
}

.related-news-text h3 {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.related-news-text p {
  margin: 0;
  color: #666;
}

section.container {
  padding-right: 20px;
}

.news-detail-main {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#news-detail-container {
  width: 100%;
  max-width: 800px;
}

.related-news-tags {
  margin-top: 0.5em;
}

.related-news-tags .tag {
  display: inline-block;
  background-color: #f0f0f0;
  color: #333;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 5px;
}

@media (max-width: 768px) {
  .news-layout {
    grid-template-columns: 1fr;
  }

  #news-detail-container {
    width: 100%;
    max-width: 100%;
  }

  .news-sidebar {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding-left: 0;
  }

  #related-news {
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow: hidden;
  }


  .share-widget,
  .more-news {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .related-news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .related-news-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .related-news-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .related-news-thumb img {
    width: 100%;
    height: auto;
    margin: 0 0 10px 0;
  }

  .related-news-text {
    padding: 0 10px;
  }

  .news-detail-gallery-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
  }

  .lightbox img {
    max-width: 95%;
    max-height: 80%;
  }

  .lightbox button {
    font-size: 1.5rem;
    padding: 0.3rem 0.8rem;
  }
}

.news-search {
  width: 90%;
  max-width: 600px;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  display: block;
}

.filter-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.year-filter {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 180px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='M2 0L0 2h4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.65rem auto;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.year-filter:hover {
  border-color: #e0a800;
}

.year-filter:focus {
  outline: none;
  border-color: #e0a800;
  box-shadow: 0 0 5px rgba(0, 119, 204, 0.5);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

html.lightbox-open,
body.lightbox-open {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  transition: transform 0.3s ease;
  cursor: zoom-in;
  border-radius: 8px;
}

.lightbox.zoomed img {
  transform: scale(2);
  cursor: zoom-out;
}

.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  z-index: 10000;
  transition: background 0.3s ease;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox .close-btn {
  top: 20px;
  right: 30px;
}

.lightbox .prev-btn {
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .next-btn {
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
}

#news-detail-container h1:first-child,
#news-detail-container h2:first-child {
  margin-top: 0.5rem;
}

#news-detail-container p{
  margin-top: 15px;
}

.news-break {
  grid-column: 1 / -1;
  height: 0;
}

.news-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.news-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-content h3 {
  font-size: 1.3rem;
  color: #222;
}

.news-item img.news-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.news-item h3 {
  margin-top: 0;
  color: #333;
}

.news-meta {
  font-size: 0.9rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-meta i {
  color: #ccc;
}

.news-date {
  margin-right: 0.5rem;
}

.news-item p {
  margin-bottom: 1rem;
  color: #555;
}

.news-page .container {
  max-width: 960px;
  margin: 20px auto;
  padding: 20px;
}

.news-page h1 {
  color: #ffc107;
  margin-bottom: 20px;
  text-align: center;
}

.news-detail-gallery {
  position: relative;
  max-width: 600px;
  max-height: 400px;
  margin: 0 auto 15px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: scale-down;
  transition: opacity 0.3s ease-in-out;
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease-in-out;
  z-index: 10;
}

.gallery-control.prev {
  left: 10px;
}

.gallery-control.next {
  right: 10px;
}

.news-detail-gallery:hover .gallery-control {
  opacity: 1;
}

.news-detail-gallery:hover .gallery-control:hover {
  background: rgba(0, 0, 0, 0.7);
}

#news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}