.ypg-gallery {
  width: 100%;
}

.ypg-gallery__player {
  margin-bottom: 1rem;
}

.ypg-gallery__player-frame {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background-color: #000;
}

.ypg-gallery__iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ypg-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.ypg-gallery__thumb {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0.25rem;
  border: 2px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ypg-gallery__thumb:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ypg-gallery__thumb.is-active {
  border-color: currentColor;
}

.ypg-gallery__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ypg-gallery__title {
  font-size: 0.9em;
  line-height: 1.3;
}

.ypg-gallery__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.ypg-gallery__page {
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ypg-gallery__page:disabled {
  opacity: 0.4;
  cursor: default;
}

.ypg-gallery__page:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ypg-gallery__page-status {
  font-size: 0.9em;
}

.ypg-gallery__thumb[hidden] {
  display: none;
}

@media (max-width: 1024px) {
  .ypg-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ypg-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
