.poster-collection {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--bg);
}

.poster-collection-panel {
  flex: 1;
  padding: clamp(1rem, 5vw - 0.5rem, 2rem);
  padding-top: 0.8rem;
  color: var(--text-dark);
  background: #f5f0e8;
  border: 7px solid var(--accent);
  border-radius: 1rem;
}

.poster-collection h1 {
  margin: clamp(0.2em, 3vw, 0.67em) 0 clamp(1rem, 3vw, 2rem);
  font-size: clamp(1.5rem, 5vw + 0.5rem, 2rem);
  line-height: 1.2;
}

.poster-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 5vw - 0.5rem, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.poster-gallery a {
  display: block;
  box-shadow: 0 0.4rem 1.1rem rgba(66, 63, 56, 0.13);
}

.poster-gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.poster-gallery a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

body:has(.poster-preview[open]) {
  overflow: hidden;
}

.poster-preview:not([open]) {
  display: none;
}

.poster-preview {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  box-sizing: border-box;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
}

.poster-preview::backdrop {
  background: rgb(0 0 0 / 80%);
}

.poster-preview .lightbox-nav {
  margin-bottom: 0.5rem;
}

.poster-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  max-height: calc(100dvh - 6rem);
  width: auto;
  height: auto;
  margin-inline: auto;
}

@media (min-width: 600px),
       (min-width: 400px) and (max-height: 600px) {
  .poster-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px),
       (min-width: 800px) and (max-height: 600px) {
  .poster-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1600px),
       (min-width: 1200px) and (max-height: 600px) {
  .poster-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
