.poster-gallery {
  display: grid;
  /* --- Änderung: statt auto-fill auf feste Breakpoints umstellen --- */
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Ab Tablet: 2 Spalten */
@media (min-width: 768px) {
  .poster-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Ab Desktop: 3 Spalten (Do | Fr | Sa) */
@media (min-width: 1024px) {
  .poster-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}


.poster-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}

.poster-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
}

.poster-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.poster-title {
  padding: 12px 14px;
  font-family: 'Poppins', Arial, sans-serif;
  text-align: left;
}

.poster-title-big {
  font-size: 1.125rem;
  font-weight: 700;
  display:block;
  line-height:1.1;
}

.poster-title-small {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top:6px;
}

.poster-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 28px;
  text-decoration:none;
}

/* Container für die Paginierung */
.poster-pagination {
    margin-top: 40px;
    width: 100%;
}

/* Entfernt Listen-Punkte und setzt Flexbox */
.poster-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center; /* Zahlen in der Mitte */
    position: relative;      /* Wichtig für die absoluten Pfeile */
    align-items: center;
}

/* Allgemeines Styling für alle Links/Zahlen */
.poster-pagination ul li {
    display: inline-block;
    margin: 0 5px;
}

.poster-pagination ul li a,
.poster-pagination ul li span.current {
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd; /* Optional: Rahmen */
    color: #333;
}

.poster-pagination ul li span.current {
    background-color: #333;
    color: #fff;
    font-weight: bold;
}

/* --- Hier passiert die Magie für die Pfeile außen --- */

/* Der "Zurück"-Pfeil */
.poster-pagination ul li:first-child {
    position: absolute;
    left: 0;
}

/* Der "Weiter"-Pfeil */
.poster-pagination ul li:last-child {
    position: absolute;
    right: 0;
}

/* Mobile Anpassung: Auf kleinen Screens Pfeile nicht absolut positionieren, 
   da sie sonst über den Zahlen liegen könnten */
@media (max-width: 600px) {
    .poster-pagination ul {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .poster-pagination ul li:first-child,
    .poster-pagination ul li:last-child {
        position: static; /* Reset absolute positioning */
    }
}

/* Container sicherstellen, dass er Platz hat */
.poster-pagination {
    width: 100%;
    margin-top: 30px;
    position: relative; /* Wichtig für die Pfeile */
    height: 40px; /* Feste Höhe verhindert Springen */
}

/* Die Liste selbst resetten (Punkte weg, Flexbox an) */
.poster-pagination ul.page-numbers {
    display: flex;
    justify-content: center; /* Zahlen mittig */
    align-items: center;
    list-style: none !important; /* Erzwingt Entfernung der Bulletpoints */
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Alle Elemente in der Leiste */
.poster-pagination ul.page-numbers li {
    display: inline-block;
    margin: 0 5px;
}

/* Styling der Zahlen und Buttons */
.poster-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 4px; /* Optional: leicht abgerundet */
    transition: all 0.2s ease;
}

/* Hover Effekt und aktive Seite */
.poster-pagination a.page-numbers:hover {
    background-color: #f0f0f0;
}
.poster-pagination .page-numbers.current {
    background-color: #000;
    color: #fff;
}

/* --- SPEZIAL: Pfeile nach ganz außen schieben --- */

/* Zurück-Pfeil (immer das erste Element der Liste) */
.poster-pagination ul.page-numbers li:first-child {
    position: absolute;
    left: 0;
    top: 0;
}

/* Weiter-Pfeil (immer das letzte Element der Liste) */
.poster-pagination ul.page-numbers li:last-child {
    position: absolute;
    right: 0;
    top: 0;
}
