.pg-resource-preview {
  position: relative;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,250,241,.94));
  border: 1px solid rgba(23, 50, 77, .08);
  box-shadow: 0 20px 54px rgba(23, 50, 77, .08);
}

.pg-resource-preview h2 {
  margin: 0 0 10px;
  color: var(--pg-navy);
  font-size: clamp(28px, 2.8vw, 38px);
  letter-spacing: -0.03em;
}

.pg-resource-preview > p {
  margin: 0 0 20px;
  color: var(--pg-muted);
  max-width: 64ch;
}

.pg-resource-preview__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.pg-resource-preview__zoom-btn,
.pg-resource-preview__control,
.pg-resource-preview__dot,
.pg-preview-modal button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pg-resource-preview__zoom-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--pg-coral);
  color: #fff;
  font-weight: 800;
}

.pg-resource-preview__stage {
  position: relative;
  min-height: 420px;
}

.pg-resource-preview__item {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #fffaf1);
  border: 1px solid rgba(23, 50, 77, .08);
  box-shadow: 0 18px 44px rgba(23, 50, 77, .08);
}

.pg-resource-preview__item picture,
.pg-resource-preview__item img {
  display: block;
  width: 100%;
}

.pg-resource-preview__item img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.pg-resource-preview__meta {
  display: grid;
  gap: 6px;
  padding: 16px 18px 18px;
}

.pg-resource-preview__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(244, 124, 91, .12);
  color: var(--pg-coral-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pg-resource-preview__page {
  font-size: .9rem;
  color: var(--pg-muted);
  font-weight: 700;
}

.pg-resource-preview__meta figcaption {
  color: var(--pg-navy);
  font-size: 1rem;
  line-height: 1.55;
}

.pg-resource-preview__nav,
.pg-preview-modal__toolbar,
.pg-preview-modal__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-resource-preview__nav {
  margin-top: 18px;
}

.pg-resource-preview__control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--pg-navy);
  color: #fff;
  font-weight: 800;
}

.pg-resource-preview__control:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.pg-resource-preview__dots {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pg-resource-preview__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 50, 77, .08);
  color: var(--pg-navy);
  font-weight: 800;
}

.pg-resource-preview__dot.is-active {
  background: var(--pg-coral);
  color: #fff;
}

.pg-resource-preview__placeholder {
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fffaf1, #fff);
  color: #637587;
}

.pg-resource-preview__noscript figure + figure {
  margin-top: 16px;
}

.pg-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.pg-preview-modal[hidden] {
  display: none !important;
}

.pg-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 29, .72);
}

.pg-preview-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 18px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  display: grid;
  gap: 14px;
}

.pg-preview-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(23, 50, 77, .08);
  color: var(--pg-navy);
  font-size: 26px;
  line-height: 1;
}

.pg-preview-modal__toolbar button,
.pg-preview-modal__footer button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--pg-navy);
  color: #fff;
  font-weight: 800;
}

.pg-preview-modal__counter {
  color: var(--pg-muted);
  font-weight: 700;
}

.pg-preview-modal__stage {
  display: grid;
  place-items: center;
  min-height: min(72vh, 780px);
  overflow: auto;
  background: #f7f3eb;
  border-radius: 22px;
  padding: 10px;
}

.pg-preview-modal__stage img {
  max-width: none;
  transform-origin: center center;
  transition: transform .15s ease;
  box-shadow: 0 12px 28px rgba(23, 50, 77, .12);
  border-radius: 18px;
}

body.pg-preview-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .pg-resource-preview {
    padding: 20px;
  }
  .pg-resource-preview__stage {
    min-height: 320px;
  }
  .pg-preview-modal__dialog {
    width: calc(100vw - 16px);
    margin: 8px auto;
    padding: 14px;
  }
}
