/* =====================================================================
   ShotGram v92 — the public page a shared link opens for signed-out
   visitors. Phone-first, one column, safe areas respected.
   ===================================================================== */
body.public-view { background: var(--ink, #06070f); }
.pub-page { min-height: 100dvh; display: flex; flex-direction: column; color: #fff; }
.pub-page .grow { flex: 1; }

.pub-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
  background: rgba(6, 7, 15, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, .09));
}
.pub-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.pub-brand b {
  font-size: 19px; font-weight: 800; letter-spacing: -.3px;
  background: linear-gradient(90deg, var(--cyan, #00d8ff), var(--violet, #8b5cff), var(--magenta, #ff2ed1)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.pub-main {
  width: 100%; max-width: 520px; margin: 0 auto;
  padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.pub-loading { display: grid; place-items: center; min-height: 50dvh; }

.pub-card { background: var(--surface, #0e0f1d); border-block: 1px solid var(--line, rgba(255,255,255,.09)); }
@media (min-width: 560px) { .pub-card { border: 1px solid var(--line, rgba(255,255,255,.09)); border-radius: 18px; overflow: hidden; } }

.pub-author { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pub-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.pub-initial { display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--violet, #8b5cff), var(--cyan, #00d8ff)); }
.pub-name { display: inline-flex; align-items: center; gap: 4px; }
.pub-sub { display: block; font-size: 12.5px; color: var(--muted, #9498bd); }

.pub-media { position: relative; background: #000; }
.pub-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pub-track::-webkit-scrollbar { display: none; }
.pub-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; max-height: 80dvh; overflow: hidden; }
.pub-slide img { width: 100%; height: auto; max-height: 80dvh; object-fit: contain; display: block; }
.pub-media.is-reel .pub-slide { aspect-ratio: 9 / 16; max-height: 78dvh; }
.pub-video-wrap { position: relative; }
.pub-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.pub-media.is-reel .pub-video { object-fit: cover; }
.pub-sound {
  position: absolute; inset-inline-end: 10px; bottom: 10px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; border: 0;
}
.pub-sound svg { width: 18px; height: 18px; }
.pub-video-fail {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center;
  background: rgba(6, 7, 15, .82); padding: 20px;
}
.pub-video-fail[hidden] { display: none; }
.pub-count {
  position: absolute; top: 10px; inset-inline-end: 10px; padding: 3px 9px; border-radius: 99px;
  background: rgba(0, 0, 0, .6); font-size: 12px; font-weight: 700;
}

.pub-actions { display: flex; align-items: center; gap: 4px; padding: 6px 6px 0; }
.pub-act { width: 42px; height: 42px; display: grid; place-items: center; background: none; border: 0; color: #fff; }
.pub-act svg { width: 26px; height: 26px; }
.pub-likes { padding: 2px 14px; font-weight: 700; font-size: 14px; }
.pub-caption, .pub-comment { margin: 6px 14px 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pub-comment { color: #d6d8e8; }
.pub-more { display: block; margin: 6px 14px 0; padding: 0; background: none; border: 0; color: var(--muted, #9498bd); font-size: 14px; }
.pub-when { margin: 8px 14px 14px; font-size: 11.5px; color: var(--muted, #9498bd); text-transform: uppercase; letter-spacing: .3px; }

.pub-join {
  margin: 18px 14px 0; padding: 22px 18px; border-radius: 20px; text-align: center;
  display: grid; gap: 10px; justify-items: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(var(--violet-rgb, 139, 92, 255), .22), transparent 70%), var(--surface, #0e0f1d);
  border: 1px solid rgba(var(--violet-rgb, 139, 92, 255), .3);
}
.pub-join h2 { margin: 4px 0 0; font-size: 19px; }
.pub-join p { margin: 0 0 6px; color: #c9cce8; font-size: 14px; }

.pub-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 60px 24px; }
.pub-empty svg { width: 44px; height: 44px; color: var(--muted, #9498bd); }
.pub-empty h2 { margin: 0; font-size: 19px; }
.pub-empty p { margin: 0 0 8px; color: var(--muted, #9498bd); }

/* the "log in to like this" sheet */
.pub-gate-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55); animation: pubFade .16s ease;
}
.pub-gate {
  width: 100%; max-width: 440px; display: grid; gap: 10px; justify-items: center; text-align: center;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: var(--surface, #0e0f1d); border-radius: 22px 22px 0 0;
  border: 1px solid var(--line, rgba(255,255,255,.09)); border-bottom: 0;
  animation: pubUp .22s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 560px) { .pub-gate-backdrop { align-items: center; } .pub-gate { border-radius: 22px; border-bottom: 1px solid var(--line); } }
.pub-gate-grip { width: 40px; height: 4px; border-radius: 99px; background: var(--line-strong, rgba(255,255,255,.2)); margin-bottom: 6px; }
.pub-gate .pub-avatar { width: 64px; height: 64px; }
.pub-gate h3 { margin: 2px 0 0; font-size: 18px; }
.pub-gate p { margin: 0 0 6px; color: #c9cce8; font-size: 14px; }
.pub-gate-later { background: none; border: 0; color: var(--muted, #9498bd); padding: 8px; font-size: 14px; }
@keyframes pubFade { from { opacity: 0; } }
@keyframes pubUp { from { transform: translateY(30px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .pub-gate, .pub-gate-backdrop { animation: none; } }
