/* Responsive Gallery Layout (legacy .pm2-gallery kept for compatibility) */
.pm2-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.pm2-gallery img {
  cursor: pointer;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform 0.2s ease;
  object-fit: contain;
}
.pm2-gallery img:hover { transform: scale(1.02); }

/* Fullscreen overlay (lightbox) */
.pm2-lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}
.pm2-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Legacy mobile layout */
@media (max-width: 768px) {
  .pm2-gallery { flex-direction: column; align-items: center; }
  .pm2-gallery img { width: 100%; height: auto; margin-bottom: 10px; }
}

/* QR code (unchanged) */
.pm2-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.qr-container { text-align: center; margin-top: 40px; }
.qr-box { margin: 0 auto 20px; }
.qr-actions { margin-top: 20px; }
.qr-actions button { margin: 5px; padding: 10px 20px; font-size: 16px; }
.qr-return { margin-top: 40px; text-align: right; padding-right: 20px; }

/* ===========================
 PartyMem – UX uplift (warm pastel)
 =========================== */

/* Page container */
.pm2-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px 96px;
  background: #fff;
}

/* Header */
.pm2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
}
.pm2-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #1f2937;
}

/* Usage progress */
.pm2-usage {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}
.pm2-progress {
  background: #f1f5f9;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.pm2-progress__bar {
  --used: 0%;
  width: var(--used);
  height: 100%;
  background: linear-gradient(90deg, #fcd34d, #fbbf24);
  transition: width 220ms ease;
}
.pm2-progress__bar.is-warn   { background: linear-gradient(90deg, #fb923c, #f97316); }
.pm2-progress__bar.is-danger { background: linear-gradient(90deg, #fda4af, #fb7185); }
.pm2-usage__label { font-size: 0.85rem; color: #6b7280; white-space: nowrap; }

/* Sticky bottom action (mobile) */
.pm2-sticky {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 250px));
  z-index: 9990;
}
.pm2-sticky__wrap {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.pm2-sticky__btn {
  background: #ef4444;
  border: none;
  color: #ffffff;
  border-radius: 50px;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.2px;
  width: 100%;
  text-align: center;
  box-shadow: 0px 0px 10px 0px #808080
}
/* Hide sticky on desktop */
@media (min-width: 1024px) { .pm2-sticky { display: none; } }

/* Grid gallery */
.pm2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
/* Force single column on mobile */
@media (max-width: 768px) {
  .pm2-grid { grid-template-columns: 1fr; }
  .pm2-tile img { width: 100%; height: auto; aspect-ratio: auto; }
}

/* Tile & image */
.pm2-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff1f2;
  border: 1px solid #ffe4e6;
}
.pm2-tile img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  transition: transform 0.15s ease-out;
}
.pm2-tile:hover img { transform: scale(1.01); }

/* Pending badge */
.pm2-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(31, 41, 55, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* Inline moderation buttons */
.pm2-actions-inline { display: flex; gap: 6px; margin-top: 6px; }
.pm2-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.pm2-btn--primary { background: #86efac; border-color: #4ade80; color: #065f46; }
.pm2-btn--danger  { background: #fecaca; border-color: #fda4af; color: #7f1d1d; }

/* Toasts */
.pm2-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9991;
  background: #1f2937;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  max-width: min(90vw, 720px);
  font-size: 14px;
}
.pm2-toast--success { background: #065f46; }
.pm2-toast--error   { background: #7f1d1d; }
.pm2-toast--info    { background: #374151; }

/* Focus states */
.pm2-btn:focus, .pm2-sticky__btn:focus,
.pm2-upload-btn:focus, .pm2-upload-submit:focus {
  outline: 3px solid rgba(59,130,246,.6);
  outline-offset: 2px;
}

/* Desktop-only upload section */
.pm2-upload-desktop { margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1024px) { .pm2-upload-desktop { display: none; } }
.pm2-upload-row { display: flex; align-items: center; gap: 12px; }
.pm2-upload-btn {
  background: linear-gradient(90deg, #fdba74, #fb923c);
  border: 1px solid #f59e0b;
  color: #111827;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.pm2-upload-btn:hover { filter: brightness(0.97); }
.pm2-upload-filename {
  font-size: 14px;
  color: #374151;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.pm2-upload-submit {
  background: #86efac;
  border: 1px solid #4ade80;
  color: #065f46;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  align-self: flex-start;
}
.pm2-upload-submit:hover { filter: brightness(0.97); }

/* Dashicons alignment */
.pm2-upload-btn .dashicons,
.pm2-upload-submit .dashicons,
.pm2-sticky__btn .dashicons,
.pm2-actions-inline .pm2-btn .dashicons,
.pm2-account-form .dashicons {
  font-size: 28px;
  line-height: 1;
  margin-right: 6px;
  transform: translateY(1px);
}
.pm2-actions-inline .pm2-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pm2-sticky__btn .dashicons { margin-right: 8px; }

/* NEW: guest-page overrides (no inline <style> anymore) */
.pm2-guest-page h1.wp-block-post-title:not(.pm2-own-title) { display: none !important; }
.pm2-guest-page nav.wp-block-navigation,
.pm2-guest-page .wp-block-navigation__responsive-container-open,
.pm2-guest-page .wp-block-navigation__responsive-container {
  display: none !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}