.jnp-video-gallery {
  width: 100%;
}

.jnp-video-gallery *,
.jnp-video-gallery *::before,
.jnp-video-gallery *::after {
  box-sizing: border-box;
}

.jnp-video-gallery__search {
  position: relative;
  max-width: 640px;
  margin: 0 auto 32px;
}

.jnp-video-gallery__search-input {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 18px 12px 48px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.4;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.jnp-video-gallery__search-input:focus {
  border-color: currentColor;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.jnp-video-gallery__search-icon {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
  transform: translateY(-58%);
}

.jnp-video-gallery__search-icon::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: '';
  transform: rotate(45deg);
  transform-origin: left center;
}

.jnp-video-gallery__grid {
  display: grid;
  grid-template-columns: repeat(var(--jnp-video-columns, 3), minmax(0, 1fr));
  gap: 28px;
}

.jnp-video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
}

.jnp-video-card[hidden] {
  display: none !important;
}

.jnp-video-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

.jnp-video-card__media iframe,
.jnp-video-card__media video,
.jnp-video-card__media .wp-video,
.jnp-video-card__media .mejs-container,
.jnp-video-card__media > div:not(.jnp-video-card__error) {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
}

.jnp-video-card__media iframe,
.jnp-video-card__media video {
  display: block;
  border: 0;
  object-fit: cover;
}

.jnp-video-card__media .wp-video-shortcode {
  width: 100% !important;
  height: 100% !important;
}

.jnp-video-card__content {
  padding: 18px 20px 20px;
}

.jnp-video-card__title {
  margin: 0;
  color: inherit;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.35;
}

.jnp-video-card__description {
  margin: 10px 0 0;
  opacity: 0.75;
  line-height: 1.6;
}

.jnp-video-card__error {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 24px;
  place-items: center;
  color: #fff;
  text-align: center;
}

.jnp-video-gallery__empty,
.jnp-video-gallery__no-videos {
  margin: 28px 0 0;
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  text-align: center;
}

.jnp-video-gallery__empty[hidden] {
  display: none !important;
}

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

@media (max-width: 700px) {
  .jnp-video-gallery__grid,
  .jnp-video-gallery--columns-3 .jnp-video-gallery__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .jnp-video-gallery__search {
    margin-bottom: 24px;
  }
}
