.pg-page {
  padding: 4.5rem 1.25rem 5.5rem;
  background: var(--bg-secondary);
}

@media (max-width: 640px) {
  .pg-page {
    padding: 3.5rem 0.6rem 3rem;
  }
}

.pg-hero {
  max-width: 40rem;
  margin: 0 auto 2.2rem;
  text-align: center;
}

.pg-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Ray', 'AzarMehr', Tahoma, Arial, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.3;
}

.pg-hero p {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 2;
}

.pg-hero-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

.pg-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 64rem;
  margin: 0 auto 0.85rem;
}

.pg-filter {
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
}

.pg-filter.is-on {
  border-color: var(--brand);
  background: var(--brand-bg);
  color: var(--brand-text);
}

.pg-board {
  width: min(100%, 76rem);
  margin: 1.4rem auto 0;
  columns: 240px;
  column-gap: 0.9rem;
}

@media (max-width: 640px) {
  .pg-board {
    columns: 2;
    column-gap: 0.6rem;
  }
  .pg-card {
    margin: 0 0 0.6rem;
  }
  .pg-card-media {
    border-radius: 0.85rem;
  }
}

@media (max-width: 380px) {
  .pg-board {
    columns: 2;
    column-gap: 0.5rem;
  }
}

.pg-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 0.9rem;
  padding: 0;
  break-inside: avoid;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: start;
}

.pg-card-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 1.05rem;
  background: var(--bg-primary);
  line-height: 0;
}

.pg-card img,
.pg-card video {
  display: block;
  width: 100%;
  height: auto;
}

.pg-card-count {
  position: absolute;
  top: 0.55rem;
  inset-inline-start: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.62);
  color: #fff;
  font-size: 0.75rem;
}

.pg-empty {
  margin: 2rem auto 0;
  max-width: 28rem;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.9;
}

.pg-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(0 0 0 / 0.55);
}

.pg-dialog {
  width: min(100%, 58rem);
  max-height: min(88vh, 46rem);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
  background: var(--bg-primary);
  border-radius: 1.2rem;
}

.pg-dialog img,
.pg-dialog video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
  background: var(--bg-secondary);
}

.pg-dialog-copy {
  padding: 1.25rem 1.25rem 1.4rem;
}

.pg-dialog-copy h2 {
  margin: 0;
  font-family: 'Ray', 'AzarMehr', Tahoma, Arial, sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
}

.pg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
}

.pg-tags span {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.pg-prompt {
  margin: 0.9rem 0 0;
  max-height: 16rem;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.pg-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.pg-close {
  margin-top: 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 800px) {
  .pg-dialog {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }

  .pg-dialog img,
  .pg-dialog video {
    max-height: 46vh;
  }
}

.pg-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.pg-play svg {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding-inline-start: 2px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
  border: 1px solid rgb(255 255 255 / 0.18);
}
.pg-badge {
  position: absolute;
  bottom: 0.5rem;
  inset-inline-end: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.62);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.4;
  pointer-events: none;
}
.pg-dialog-media-wrap {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--bg-secondary);
  overflow: hidden;
}
.pg-dialog-media-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
  background: var(--bg-secondary);
}
.pg-dialog-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.pg-dialog-play svg {
  width: 3.5rem;
  height: 3.5rem;
  padding-inline-start: 3px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.4);
  border: 1px solid rgb(255 255 255 / 0.2);
}
@media (max-width: 800px) {
  .pg-dialog-media-wrap img {
    max-height: 46vh;
  }
}

/* Video thumbnail placeholder - no network request, just styled box */
.pg-video-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: inherit;
  position: relative;
  overflow: hidden;
}
.pg-video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 50%);
}
.pg-video-thumb-icon {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0;
}
.pg-dialog-video-placeholder {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 280px;
  padding: 2rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.pg-dialog-video-placeholder-icon {
  font-size: 2rem;
  color: rgba(255,255,255,0.4);
}
.pg-dialog-video-placeholder-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}
.pg-dialog-media-wrap--video {
  min-height: 280px;
}

