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

.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;
}

.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;
  }
}
