/* Post carrossel por cima do feed (post_overlay.js / carouselViewerHtml()).
   Celular: a imagem ocupa a tela toda (borda a borda) e o texto fica POR CIMA
   dela, num degradê no rodapé; o "Read more" sobe como gaveta sobre a imagem
   (igual ao original do WaifuGame). PC (≥ 900px): janela centralizada, mídia
   à esquerda e texto à direita, como no Instagram. */
.pv-root { display: none; }
.pv-root.is-open { display: block; position: fixed; inset: 0; z-index: 1000; }
html.pv-locked, html.pv-locked body { overflow: hidden; }
.pv-backdrop { position: fixed; inset: 0; background: rgba(5,5,8,.88); }
.pv-spinner { position: fixed; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: pv-spin .8s linear infinite; }
@keyframes pv-spin { to { transform: rotate(360deg); } }

.pv { position: fixed; inset: 0; display: flex; flex-direction: column; background: #0b0b10; color: #ececf2; outline: none; }
.pv-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 26px; line-height: 38px; cursor: pointer; }
.pv-close:hover { background: rgba(0,0,0,.8); }

/* min-width:0 = a mídia nunca cresce pela largura do conteúdo (a caixa do 🔒
   empurrava a coluna de texto pra fora da janela no PC). */
.pv-media { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; background: #000; }
.pv-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pv-slide > img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
/* Item 🔒: só a miniatura minúscula, ampliada e borrada — nada do conteúdo. */
.pv-slide .pv-teaser { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; filter: blur(22px) brightness(.55); transform: scale(1.2); }
.pv-lock { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; text-align: center; }
.pv-lock-icon { font-size: 40px; }
.pv-lock strong { font-size: 17px; max-width: 320px; }
.pv-unlock { display: inline-block; padding: 12px 22px; border-radius: 999px; background: linear-gradient(135deg, #f5c542, #e8a317); color: #1a1200; font-weight: 800; text-decoration: none; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.pv-unlock:hover { filter: brightness(1.06); }
.pv-unlock.is-disabled { opacity: .6; }
.pv-recover { color: #c9c9d4; font-size: 12px; }

.pv-nav { position: absolute; top: 50%; z-index: 3; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 26px; line-height: 38px; cursor: pointer; }
.pv-prev { left: 10px; }
.pv-next { right: 10px; }
.pv-counter { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 12px; }
.pv-dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.pv-dots i.active { background: #fff; }
.pv-swipe { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 13px; font-weight: 700; white-space: nowrap; transition: opacity .3s; }
.pv-scrolled .pv-swipe { opacity: 0; }
.pv-price { position: absolute; top: 14px; left: 14px; z-index: 3; padding: 5px 11px; border-radius: 8px; background: #b8124f; color: #fff; font-size: 13px; font-weight: 800; }
.pv-price.is-owned { background: #1f8a4c; }

.pv-side { flex: 0 0 auto; max-height: 40vh; overflow-y: auto; padding: 12px 16px 18px; background: #111118; }
.pv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 6px; }
.pv-head .author-byline, .pv-head .nx-chat-inline { margin: 0; }

/* Som e pausa do vídeo da vez (post_overlay.js). */
.pv-vctl:not([hidden]) { position: absolute; right: 14px; bottom: 34px; z-index: 4; display: flex; gap: 6px; }
.pv-vctl button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 38px; cursor: pointer; }
.pv-vctl button:hover { background: rgba(230,41,80,.9); }
.pv-slide > video { cursor: pointer; }
.pv-title { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
.pv-caption { margin: 0 0 12px; color: #c9c9d4; font-size: 14px; line-height: 1.5; }
.pv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-btn { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #ececf2; font-size: 13px; cursor: pointer; }
.pv-btn:hover, .pv-btn.is-on { border-color: #e62950; color: #ff7a98; }
.pv-unlock-side { margin-top: 14px; display: block; text-align: center; }
.pv-missing { align-items: center; justify-content: center; text-align: center; padding: 40px; }

@media (min-width: 900px) {
  .pv { inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1180px, 94vw); height: min(860px, 90vh); flex-direction: row; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
  .pv-side { flex: 0 0 360px; max-height: none; padding: 20px; border-left: 1px solid rgba(255,255,255,.08); }
  .pv-title { font-size: 21px; margin-top: 30px; }
  .pv-close { top: 12px; right: 12px; }
}

/* Card no mosaico: quantos itens / quantos pagos. */
.feed-card-multi { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; }

/* Vídeo no carrossel (entrega 2). */
.pv-slide > video { max-width: 100%; max-height: 100%; display: block; background: #000; }

/* Painel "Read more" (texto longo do post — livre ou 🔒). */
.pv-more { margin: 4px 0 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: #16161e; }
.pv-more > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.pv-more > summary::-webkit-details-marker { display: none; }
.pv-more > summary::after { content: '⌃'; transform: rotate(180deg); transition: transform .2s; color: #9a9aad; }
.pv-more[open] > summary::after { transform: none; }
.pv-more-body { padding: 0 14px 12px; color: #d6d6de; font-size: 14px; line-height: 1.6; }
.pv-more-body p { margin: 0 0 10px; }
.pv-more-body a { color: #8fb8ff; word-break: break-all; }
.pv-more-body a.pv-unlock { color: #1a1200; word-break: normal; }
.pv-more-lock { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-top: 6px; }

/* ---------- Celular: texto por cima da imagem + gaveta do "Read more" ---------- */
@media (max-width: 899px) {
  .pv { display: block; background: #000; }
  .pv-media { position: absolute; inset: 0; }
  /* Borda a borda: largura da tela toda, altura proporcional. */
  .pv-slide > img, .pv-slide > video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
  .pv-nav { width: 34px; height: 34px; margin-top: -17px; font-size: 22px; line-height: 32px; background: rgba(0,0,0,.35); }
  .pv-prev { left: 6px; }
  .pv-next { right: 6px; }
  /* Topo em duas linhas: preço · contador · fechar; depois "Swipe" à esquerda
     e link / som-pausa à direita. As bolinhas saem (o contador já diz). */
  .pv-dots { display: none; }
  .pv-swipe { top: 60px; left: 14px; transform: none; padding: 5px 11px; font-size: 12px; }
  .pv-vctl:not([hidden]) { top: 58px; right: 12px; bottom: auto; }
  .pv-link ~ .pv-vctl:not([hidden]) { top: 100px; }

  /* Texto à esquerda, Like/Share numa coluna à direita (como o WaifuGame),
     desbloquear embaixo ocupando as duas. */
  .pv-side { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; max-height: none; overflow: visible;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: end;
    padding: 70px 12px calc(14px + env(safe-area-inset-bottom)) 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.55) 40%, rgba(0,0,0,.88));
    transition: opacity .25s, transform .25s; }
  .pv-info { min-width: 0; }
  .pv-head .author-byline img { width: 30px; height: 30px; }
  .pv-head .nx-chat-inline { padding: 5px 10px; font-size: 12px; }
  .pv-title { margin: 2px 0 4px; font-size: 17px; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
  .pv-class { margin: 0 0 4px; }
  .pv-caption { margin: 0 0 4px; color: #e4e4ea; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
  .pv-caption.is-expanded { -webkit-line-clamp: unset; display: block; }
  .pv-actions { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
  .pv-btn { min-width: 62px; padding: 7px 10px; background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.25); font-size: 12px; text-align: center; }
  .pv-unlock-side { grid-column: 1 / -1; margin-top: 12px; padding: 11px 18px; font-size: 15px; }
  /* No item 🔒 o botão já está no meio da imagem. */
  .pv-on-locked .pv-unlock-side { display: none; }
  /* Tocar na imagem esconde o texto pra ver a imagem inteira (e mostra de novo). */
  .pv-ui-hidden .pv-side { opacity: 0; transform: translateY(24px); pointer-events: none; }

  .pv-more { margin: 10px 0 0; border-color: rgba(255,255,255,.22); background: rgba(16,16,24,.78); }
  /* Fechado = um botão pequeno, não uma faixa da largura toda. */
  .pv-more:not([open]) { display: inline-block; margin-top: 6px; border-radius: 999px; }
  .pv-more:not([open]) > summary { gap: 10px; padding: 6px 13px; font-size: 13px; }
  .pv-more[open] { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; max-height: 78vh; display: flex; flex-direction: column;
    border: none; border-radius: 18px 18px 0 0; background: #14141c; box-shadow: 0 -12px 34px rgba(0,0,0,.65); animation: pv-sheet-up .25s ease-out; }
  .pv-more[open] > summary { flex: none; padding: 22px 18px 12px; position: relative; font-size: 15px; }
  .pv-more[open] > summary::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255,255,255,.3); }
  /* min-height:0 = o texto rola DENTRO da gaveta (sem isso, num flex, a gaveta
     cresce e nada rola). overscroll contido: o fim do texto não arrasta a página. */
  /* No Chrome o conteúdo do <details> fica num invólucro interno — o flex não
     alcança o texto. Por isso a altura máxima é explícita (gaveta 78vh menos a
     alça), e o invólucro novo (::details-content) também é ajustado. */
  .pv-more[open]::details-content { display: contents; }
  .pv-more[open] .pv-more-body { max-height: calc(78vh - 62px); flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: 0 18px calc(22px + env(safe-area-inset-bottom)); font-size: 15px; }
  .pv-more[open] > summary { touch-action: none; cursor: grab; }
  .pv-more.is-dragging { transition: none !important; animation: none; }
  .pv-more.is-settling { transition: transform .22s ease-out; }
  @keyframes pv-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
}

/* Painel rico ("Read more"): títulos, listas, citação, imagens e galeria. */
.pv-more-body h2 { font-size: 19px; margin: 16px 0 6px; line-height: 1.25; }
.pv-more-body h3 { font-size: 16px; margin: 14px 0 6px; }
.pv-more-body p { margin: 0 0 12px; }
.pv-more-body ul, .pv-more-body ol { margin: 0 0 12px; padding-left: 22px; }
.pv-more-body blockquote { margin: 10px 0; padding: 4px 0 4px 12px; border-left: 3px solid #e62950; color: #cfcfd8; font-style: italic; }
.pv-more-body img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 12px; margin: 10px 0; background: #0b0b10; }
/* Imagens seguidas: trilho que desliza pro lado (estilo Threads), com snap. */
.pv-gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin: 10px -18px 14px; padding: 0 18px; scrollbar-width: none; touch-action: pan-x pan-y; }
.pv-gallery::-webkit-scrollbar { display: none; }
.pv-gallery img { flex: 0 0 auto; width: auto; height: min(62vw, 340px); max-height: none; max-width: 82%; object-fit: cover; margin: 0; scroll-snap-align: start; border-radius: 12px; }
@media (min-width: 900px) { .pv-gallery { margin: 10px 0 14px; padding: 0; } .pv-gallery img { height: 300px; } }

/* Galeria no PC: setas e arrastar com o mouse (bindGallery em post_overlay.js). */
.pv-gal-wrap { position: relative; }
.pv-gal-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pv-gallery { cursor: grab; }
  .pv-gallery.is-grabbing { cursor: grabbing; scroll-snap-type: none; user-select: none; }
  .pv-gal-arrow { display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 38px; height: 38px; padding: 0 0 3px; border: 0; border-radius: 50%; background: rgba(10, 10, 14, .72); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); transition: opacity .15s, background .15s; }
  .pv-gal-arrow:hover { background: rgba(230, 41, 80, .9); }
  .pv-gal-prev { left: 6px; }
  .pv-gal-next { right: 6px; }
  .pv-gal-arrow.is-off { opacity: 0; pointer-events: none; }
}

/* Link do post pra outra página (canto da mídia, como o "View more" do WaifuGame). */
.pv-link { position: absolute; top: 14px; right: 14px; z-index: 4; max-width: 46%; padding: 6px 11px; border-radius: 999px; background: rgba(9, 9, 11, .72); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pv-link:hover { background: rgba(230, 41, 80, .92); }
@media (max-width: 899px) {
  .pv-link { top: 58px; right: 12px; max-width: 42%; }
  .pv-ui-hidden .pv-link { opacity: 0; pointer-events: none; }
}

.pv-class { margin: -4px 0 8px; }

/* Espiada do carrossel no card do feed: o próximo item desliza um pedacinho
   por cima da capa e volta (post_overlay.js, .is-peek), e fica à mostra no
   hover do PC. Discreto: uma vez ao aparecer, no máx. 2, um card por vez. */
.feed-card-post .feed-card-media { overflow: hidden; }
.feed-card-multi { z-index: 2; }
.feed-card-peek { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: #1a1a22 center / cover no-repeat; transform: translateX(100%); transition: transform .7s cubic-bezier(.22, .8, .25, 1); box-shadow: -10px 0 18px rgba(0, 0, 0, .55); pointer-events: none; }
.feed-card-peek::after { content: '›'; position: absolute; top: 50%; left: 7%; transform: translate(-50%, -50%); color: #fff; font-size: 26px; font-weight: 700; line-height: 1; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); opacity: .9; }
.feed-card-peek.is-locked::before { content: ''; position: absolute; inset: 0; background: inherit; filter: blur(10px) brightness(.75); transform: scale(1.15); }
.feed-card-peek.is-locked::after { content: '🔒'; font-size: 16px; }
.feed-card-post.is-peek .feed-card-peek { transform: translateX(84%); }
@media (hover: hover) and (pointer: fine) {
  .feed-card-post:hover .feed-card-peek { transform: translateX(86%); }
}
@media (prefers-reduced-motion: reduce) {
  .feed-card-peek { transition: none; }
}
