/* Small helpers for markup generated by the Sthapit Society theme. */
.sx-abs { position: absolute; }

/* Welcome popup: only one picture (a poster), shown whole and never stretched */
.welcome-card--image { width: min(820px, 100%); padding: 14px; }
.welcome-card--image img { width: 100%; height: auto; max-height: 82vh; margin: 0; object-fit: contain; border-radius: 14px; }
.welcome-card--image .popup-close { top: 24px; right: 24px; background: rgba(255, 255, 255, 0.92); }

/* Pala stories (blog posts) */
.sx-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); }
.sx-pagination { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.sx-pagination .page-numbers { min-width: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--navy); font-weight: 700; text-align: center; text-decoration: none; }
.sx-pagination .page-numbers.current { border-color: var(--navy); background: var(--navy); color: var(--white); }
.sx-post { max-width: 820px; margin: 0 auto; }
.sx-post-meta { margin-bottom: 18px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.sx-post .entry-content { font-size: 1.06rem; line-height: 1.85; }
.sx-post .entry-content p { margin-bottom: 1.2em; }
.sx-post .entry-content h2, .sx-post .entry-content h3 { margin: 1.8em 0 0.6em; }
.sx-post .entry-content img { max-width: 100%; height: auto; margin: 1.4em 0; border-radius: 12px; }
.sx-post .entry-content ul, .sx-post .entry-content ol { margin: 0 0 1.2em 1.4em; list-style: revert; }
.sx-post-back { margin-top: 36px; }

/* Real QR pictures (uploaded in Sthapit Settings → QR codes) */
.donation-qr-placeholder img, .membership-qr-placeholder img { display: block; width: 100%; height: auto; }

/* Gallery: how pictures sit in their boxes (Pages → Gallery → Page settings) */
.gallery-fit-fill .gallery-item img,
.gallery-fit-whole .gallery-item img { width: 100%; height: 100%; }
.gallery-fit-fill .gallery-item img { object-fit: cover; }
.gallery-fit-whole .gallery-item { background: #eef2f6; }
.gallery-fit-whole .gallery-item img { object-fit: contain; }
@media (min-width: 681px) {
  .masonry.gallery-fit-fill, .masonry.gallery-fit-whole { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
  .gallery-fit-fill .gallery-item, .gallery-fit-whole .gallery-item { aspect-ratio: 4 / 3; margin: 0; }
}

/* A story's PDF: "Read the PDF" and "Download PDF" side by side (like the Souvenir page), stacked on a phone */
.sx-post-pdf { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 0; }
.sx-post-pdf .btn small { font-weight: 400; opacity: 0.75; }

/* A whole story card is one big link (picture, title and button all open the story, or its PDF) */
.post-card .text-link::after { content: ""; position: absolute; inset: 0; }

/* On a phone the two PDF buttons are big and full-width */
@media (max-width: 760px) {
  .sx-post-pdf .btn { display: flex; justify-content: center; width: 100%; padding-top: 16px; padding-bottom: 16px; text-align: center; }
}
