.public-video-gallery {
  width: 100%;
  margin: 2rem 0;
}

.prose-card:has(.public-video-gallery) {
  max-width: none;
  background: var(--nw-cream);
}

.public-video-gallery-page {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1.5rem;
}

.public-video-gallery-page[hidden] {
  display: none !important;
}

.public-video-gallery-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid rgb(8 127 85 / 18%);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgb(37 29 42 / 9%);
}

.public-video-gallery-card .public-video-frame {
  border-radius: 0;
}

.public-video-gallery-card figcaption {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: .55rem;
  padding: 1rem 1.1rem 1.2rem;
  color: var(--nw-text);
}

.public-video-gallery-card figcaption > strong {
  color: var(--nw-purple-dark);
  font-size: 1.08rem;
  line-height: 1.25;
}

.public-video-description,
.public-video-description p {
  margin: 0;
}

.public-video-description.is-collapsed .public-video-description-content {
  overflow: hidden;
  max-height: 6.4em;
}

.public-video-description-toggle {
  width: fit-content;
  margin-top: .6rem;
  padding: 0;
  border: 0;
  border-bottom: 2px solid currentColor;
  color: var(--nw-purple);
  background: transparent;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}

.public-video-description-toggle:hover,
.public-video-description-toggle:focus-visible {
  color: var(--nw-green-dark);
  outline: 2px solid rgb(216 166 61 / 45%);
  outline-offset: 4px;
}

.public-video-gallery-card .public-video-date,
.public-video-gallery-card .public-video-source {
  margin: 0;
  font-size: .78rem;
  line-height: 1.45;
}

.public-video-gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.public-video-gallery-direction,
.public-video-gallery-dots button {
  border: 2px solid var(--nw-purple);
  color: #fff;
  background: var(--nw-purple);
  cursor: pointer;
  transition: transform .2s, background-color .2s, border-color .2s;
}

.public-video-gallery-direction {
  min-width: 86px;
  min-height: 42px;
  padding: .55rem 1rem;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.public-video-gallery-dots {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.public-video-gallery-dots button {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.public-video-gallery-dots button[aria-current="page"] {
  border-color: var(--nw-green-dark);
  background: var(--nw-green-dark);
  transform: scale(1.22);
}

.public-video-gallery-direction:hover,
.public-video-gallery-direction:focus-visible,
.public-video-gallery-dots button:hover,
.public-video-gallery-dots button:focus-visible {
  border-color: var(--nw-green-dark);
  background: var(--nw-green-dark);
  transform: translateY(-2px);
  outline: 3px solid rgb(216 166 61 / 35%);
  outline-offset: 3px;
}

.public-video-gallery-empty {
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--nw-cream);
  color: var(--nw-text);
}

@media (max-width: 980px) {
  .public-video-gallery-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .public-video-gallery-page { grid-template-columns: 1fr; }
  .public-video-gallery-pagination { gap: .75rem; }
  .public-video-gallery-direction { min-width: 76px; padding-inline: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .public-video-gallery-direction,
  .public-video-gallery-dots button { transition: none; }
}
