/* ==========================================================================
   Avezz Snaps — Full-Viewport Vertical Snap Scroll (Image & Post)
   1:1 Fidelity with UI/image scroll.html + Text-Only Post Big Quote Stage
   ========================================================================== */

body.scroll-body {
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: #0f1115;
  -webkit-tap-highlight-color: transparent;
}

.snap-frame {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: #000000;
  overflow: hidden;
  overflow: clip;
}

/* Simplified 6-Icon Nav + Desktop Sub-Nav Stack */
.snap-nav-stack {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

.snap-nav-stack .sub-nav,
.snap-nav-stack .search-bar {
  display: none;
}

.snap-icon-nav {
  position: relative;
  height: 54px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  color: #ffffff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
}

.snap-icon-nav--mobile {
  grid-template-columns: repeat(5, 1fr);
}

.snap-icon-nav--desktop {
  display: none;
}

.snap-icon-nav-btn {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.snap-icon-nav-btn .icon {
  width: 22px;
  height: 22px;
}

.snap-icon-nav-btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.snap-icon-nav-btn[aria-current="page"] {
  color: #ffffff;
}

.snap-icon-nav-btn[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.snap-nav-avatar {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.snap-nav-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Vertical Snap Feed */
.snap-feed {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.snap-feed::-webkit-scrollbar {
  display: none;
}

.snap-slide {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #000000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
}

/* Media Stage */
.snap-media-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0e13;
  overflow: hidden;
}

.snap-media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snap-media-embed {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  padding: 64px 16px 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snap-media-embed iframe,
.snap-media-embed video {
  width: 100%;
  max-height: 70dvh;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #000000;
}

.snap-media-embed audio {
  width: 100%;
  max-width: 460px;
}

/* Text-Only Post Big Quote Stage */
.snap-quote-stage {
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.22), transparent 52%),
    radial-gradient(circle at 80% 78%, rgba(168, 85, 247, 0.2), transparent 55%),
    linear-gradient(155deg, #0f172a 0%, #171c2b 52%, #0c0f17 100%);
  padding: 76px 28px 180px;
}

.snap-quote-box {
  position: relative;
  z-index: 6;
  max-width: min(680px, 88%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.snap-quote-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 4.75rem);
  line-height: 0.7;
  color: rgba(255, 255, 255, 0.24);
  user-select: none;
}

.snap-quote-text {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.55rem, 3.6vw, 2.75rem);
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: -0.01em;
  color: #f8fafc;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  word-break: break-word;
}

.snap-quote-text--long {
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  line-height: 1.48;
}

.snap-quote-text a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.snap-quote-author {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(248, 250, 252, 0.65);
}

.snap-grad-top,
.snap-grad-bottom {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.snap-grad-top {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 28%);
}

.snap-grad-bottom {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.35) 36%, transparent 62%);
}

/* Right Panel / Mobile Overlay */
.snap-panel {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.snap-mobile-spacer {
  flex: 1;
}

.snap-panel-scroll {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px calc(18px + env(safe-area-inset-bottom, 0px)) 14px;
  pointer-events: auto;
}

/* Meta */
.snap-meta {
  flex: 1;
  min-width: 0;
  color: #ffffff;
}

.snap-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.snap-author-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.snap-author-link:hover {
  text-decoration: none;
  opacity: 0.9;
}

.snap-author-av {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  overflow: hidden;
}

.snap-author-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snap-author-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.snap-author-sub {
  font-size: 12px;
  opacity: 0.78;
}

.snap-follow-btn {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.snap-follow-btn:hover {
  background: rgba(255, 255, 255, 0.34);
}

.snap-follow-btn.following {
  background: rgba(255, 255, 255, 0.12);
}

.snap-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 6px;
}

.snap-desc {
  font-size: 13.5px;
  line-height: 1.48;
  opacity: 0.92;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.snap-desc a {
  color: inherit;
  text-decoration: underline;
}

.snap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.snap-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.snap-tag:hover {
  text-decoration: none;
  opacity: 0.88;
}

.snap-usages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Mobile Right Action Rail */
.snap-mobile-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.snap-mobile-rail form,
.snap-desk-actions form {
  display: contents;
}

.snap-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}

.snap-rail-btn:active {
  transform: scale(0.92);
}

.snap-rail-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.snap-rail-circle .icon,
.snap-rail-circle .action-icon {
  width: 22px;
  height: 22px;
}

.snap-rail-btn.like.active .snap-rail-circle { color: #4f46e5; }
.snap-rail-btn.deslike.active .snap-rail-circle { color: var(--negative, #ef4444); }
.snap-rail-btn.share.active .snap-rail-circle { color: #f43f5e; }

.snap-rail-count {
  font-size: 11.5px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Desktop Action Bar (UI/image scroll.html layout & 22px sizing + Post Card icon + label style) */
.snap-desk-actions {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.snap-desk-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.snap-desk-btn {
  flex-direction: column;
  gap: 3px;
  color: var(--text-tertiary);
}

.snap-desk-btn .action-label {
  font-size: 9px;
}

.snap-desk-btn .action-badge {
  top: -6px;
  right: -7px;
}

.snap-desk-btn .action-icon,
.snap-desk-btn .icon {
  width: 22px;
  height: 22px;
}

.snap-desk-actions .snap-pop-menu {
  top: calc(100% + 8px);
  bottom: auto;
}

/* Dropdown Menu inside Snaps */
.snap-menu-wrap {
  position: relative;
}

.snap-pop-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 170px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.snap-pop-menu.open {
  display: flex;
}

.snap-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.snap-pop-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.snap-pop-item .icon {
  width: 16px;
  height: 16px;
}

.snap-pop-item:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.snap-pop-item.is-saved {
  color: var(--accent);
}

.snap-pop-item--danger {
  color: var(--negative, #ef4444);
}

.snap-menu-status {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Desktop Inline Comments */
.snap-desk-comments {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  flex: 1;
}

.snap-comments-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.snap-comments-heading span {
  font-weight: 500;
  color: var(--text-muted);
}

.snap-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.snap-comments-list .disc-tree,
.snap-sheet-list .disc-tree {
  width: 100%;
}

.snap-comments-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Desktop Input Bar */
.snap-desk-input-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.snap-comment-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  outline: 0;
}

.snap-comment-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.snap-send-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.snap-send-btn:hover {
  filter: brightness(1.06);
}

/* Mobile Comments Bottom Sheet */
.snap-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.snap-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.snap-mobile-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  background: var(--surface);
  color: var(--text);
  border-radius: 18px 18px 0 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.28s;
}

.snap-mobile-sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}

.snap-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
}

.snap-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.snap-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.snap-sheet-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Edit Modal Overlay inside Snaps */
.snap-edit-drawer {
  padding: 16px;
}

/* Empty State */
.snap-empty {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #f8fafc;
  text-align: center;
  padding: 24px;
}

/* ==========================================================================
   Desktop Split View (>= 768px) — 1:1 with UI/image scroll.html desktop mode
   ========================================================================== */
@media (min-width: 768px) {
  body.scroll-body {
    --primary-h: 54px;
  }

  .snap-nav-stack {
    left: auto;
    width: 420px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .snap-icon-nav {
    color: var(--text-muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .snap-icon-nav--mobile {
    display: none;
  }

  .snap-icon-nav--desktop {
    display: grid;
  }

  .snap-nav-stack .sub-nav {
    display: flex;
    padding: 4px 8px 6px;
  }

  .snap-nav-stack .sub-nav.hidden {
    display: none;
  }

  .snap-nav-stack .search-bar.open {
    display: flex;
  }

  .snap-icon-nav-btn[aria-current="page"] {
    color: var(--accent);
  }

  .snap-slide {
    flex-direction: row;
  }

  .snap-media-stage {
    flex: 1;
    width: auto;
  }

  .snap-media-img {
    object-fit: contain;
  }

  .snap-media-embed {
    padding: 32px;
  }

  .snap-quote-stage {
    padding: 48px 56px;
  }

  .snap-grad-top,
  .snap-grad-bottom {
    display: none;
  }

  .snap-panel {
    position: relative;
    inset: auto;
    width: 420px;
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    pointer-events: auto;
    padding-top: 104px;
  }

  .snap-mobile-spacer {
    display: none;
  }

  .snap-panel-scroll {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1;
    overflow-y: auto;
    padding: 0;
    gap: 0;
  }

  .snap-meta {
    flex: 0 0 auto;
    color: var(--text);
    padding: 14px 16px 12px;
  }

  .snap-author-av {
    border-color: var(--border);
  }

  .snap-follow-btn {
    background: var(--accent);
    color: #ffffff;
  }

  .snap-follow-btn:hover {
    background: var(--accent);
    filter: brightness(1.06);
  }

  .snap-follow-btn.following {
    background: var(--surface-alt);
    color: var(--text);
  }

  .snap-title {
    font-size: 18px;
  }

  .snap-desc {
    display: block;
    -webkit-line-clamp: unset;
    color: var(--text-muted);
    opacity: 1;
  }

  .snap-tag {
    background: var(--surface-alt);
    color: var(--text-muted);
    backdrop-filter: none;
  }

  .snap-mobile-rail {
    display: none;
  }

  .snap-desk-actions {
    display: flex;
  }

  .snap-pop-menu {
    top: calc(100% + 6px);
    bottom: auto;
  }

  .snap-desk-comments {
    display: flex;
  }

  .snap-desk-input-bar {
    display: flex;
  }
}
