/* TigoMeNote · posts.css — posts (composer, tiles, viewer, naka-pilang uploads)
   Ginagamit ng: gallery.html (composer), profile.html, explore.html
   JS: components/post-composer.js, components/post-viewer.js, post-queue.js */

/* ---------- Composer ---------- */
.pc { display: grid; gap: 16px; }
.pc .field { display: grid; gap: 6px; }
.pc-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pc-thumb { position: relative; flex: none; width: 92px; height: 92px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-dur { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 2px 7px 2px 4px; border-radius: var(--r-full); }
.pc-prog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.pc-prog span { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.pc-warn { display: flex; align-items: center; gap: 6px; color: var(--text-2); margin-top: -6px; }
.pc textarea { width: 100%; resize: vertical; min-height: 84px; padding: 10px 12px; font: inherit; line-height: 1.45; }
.pc-count { justify-self: end; display: inline-flex; align-items: center; gap: 6px; }
.pc .segmented { display: flex; width: 100%; }
.pc .segmented button { flex: 1; justify-content: center; padding: 0 8px; }
.pc .segmented button:disabled { opacity: .6; }
.pc-date { margin-top: 4px; }
.pc-net { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-soft); color: var(--text-2); }
.pc-net.off { background: var(--accent-soft); color: var(--text); }
.pc-status { color: var(--text-2); }
.pc-status.err { color: var(--danger); }
.modal-composer .modal-foot .btn-primary { min-width: 110px; }
/* Desktop: 2 column (media sa kaliwa, form sa kanan) */
@media (min-width: 900px) {
  .modal-composer { max-width: 920px; }
  .pc { grid-template-columns: 320px minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .pc > * { grid-column: 2; }
  .pc > .pc-strip { grid-column: 1; grid-row: 1 / span 8; display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; align-self: start; }
  .pc > .pc-strip .pc-thumb { width: auto; height: auto; aspect-ratio: 1; }
  .pc > .pc-strip .pc-thumb:only-child { grid-column: span 2; }
  .pc > .pc-warn { margin-top: 0; }
}

/* ---------- Post tiles (grid) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r-lg); overflow: hidden; }
.pt { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--surface-2); overflow: hidden; cursor: pointer; display: block; color: #fff; }
.pt img, .pt video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.pt:hover img, .pt:hover video { transform: scale(1.04); }
.pt.is-sched img, .pt.is-sched video { filter: saturate(.6) brightness(.8); }
.pt-missing { width: 100%; height: 100%; display: grid; place-items: center; gap: 6px; color: var(--text-3); align-content: center; }
.pt-top { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.pt-corner { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.5); padding: 3px 6px; border-radius: var(--r-full); }
.pt-badges { position: absolute; left: 6px; top: 6px; right: 48px; display: flex; gap: 4px; flex-wrap: wrap; }
.pt-badge.pin { background: #fe2c55; color: #fff; font-weight: 700; }
.pt-stats { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 18px 8px 6px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.5)); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pt-stats span { display: inline-flex; align-items: center; gap: 3px; }
.pt-stats .ic { width: 13px; height: 13px; }
.pt-stats span[title="Views"] .ic { fill: currentColor; stroke: none; }
.pt:has(.pt-author) .pt-stats { padding-bottom: 24px; }
.pt-badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.6); padding: 3px 7px; border-radius: var(--r-full); }
.pt-badge.sched { background: var(--accent); }
.badge-pin { background: #fe2c55; color: #fff; }
.pt-author { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; text-align: left; font-size: 12px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .2s; }
.pt:hover .pt-author, .pt:focus-visible .pt-author { opacity: 1; }
@media (hover: none) { .pt-author { opacity: 1; } }
@media (min-width: 900px) { .post-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }

/* ---------- Viewer ---------- */
.modal-post { background: #0b0b0d; color: #f2f2f3; overflow: hidden; }
.modal-post .modal-head, .modal-post .modal-head .icon-btn { color: #f2f2f3; }
.modal-post .modal-head .icon-btn:hover { background: rgba(255,255,255,.1); }
.modal-post .modal-body { padding: 0; flex: 1; min-height: 0; }
.pv { flex: 1; display: block; }
.pv-stage { position: relative; display: grid; place-items: center; background: #000; }
.pv-media { position: relative; width: 100%; display: grid; place-items: center; }
.pv-media img, .pv-media video { width: 100%; height: auto; max-height: 78dvh; object-fit: contain; display: block; }
.pv-play { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; pointer-events: none; }
.pv-play svg { width: 26px; height: 26px; fill: currentColor; }
.pv-media .pt-missing { color: #aaa; }
.modal-post .vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.modal-post .vw-nav:hover { background: rgba(255,255,255,.24); }
.modal-post .vw-nav.prev { left: 12px; } .modal-post .vw-nav.next { right: 12px; }
.modal-post .vw-nav:disabled { opacity: .25; cursor: default; }
.pv-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pv-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.pv-dots span.on { background: #fff; }
.pv-info { background: var(--surface); color: var(--text); padding: 14px 16px; display: grid; gap: 12px; align-content: start; }
.pv-author { display: flex; align-items: center; gap: 10px; }
.pv-author .avatar { background: var(--ink); color: var(--ink-text); }
.pv-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-badges:empty { display: none; }
.pv-badges .badge { display: inline-flex; align-items: center; gap: 5px; }
.pv-cap { white-space: pre-wrap; word-break: break-word; color: var(--text); }
.pv-cap:empty { display: none; }
.pv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-actions:empty { display: none; }
.pv-actions .btn { flex: 1 1 auto; min-width: 0; }
.pv-actions .btn.is-on { color: #fe2c55; border-color: currentColor; }
/* Isang post na buo (parang Facebook): isang scroll lang ang buong modal, walang scroll sa loob ng box */
.modal-post .modal-body { display: block; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 900px) {
  .modal-post.modal-full { width: min(680px, calc(100vw - 48px)); height: auto; max-height: calc(100dvh - 48px); }
  .pv-media img, .pv-media video { max-height: calc(100dvh - 160px); }
  .pv-info { padding: 18px 20px; }
}

/* ---------- Naka-pilang uploads (Profile) ---------- */
.queue { display: grid; gap: 8px; }
.queue:empty { display: none; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); background: var(--bg-soft); }
.q-thumb { width: 52px; height: 52px; border-radius: 10px; flex: none; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.q-main { flex: 1; min-width: 0; }
.q-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { font-size: 12.5px; color: var(--text-3); display: flex; gap: 4px 12px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.q-sub > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.q-sub.err { color: var(--danger); }
.q-bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.q-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.q-state { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.q-state.uploading { color: var(--accent); }
.q-state.done { color: var(--success, #16a34a); }
.q-acts { display: flex; gap: 4px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Moderation: nakatago habang nire-review */
.pt-badge.review { background: #b45309; color: #fff; }
.badge-review { background: color-mix(in srgb, #b45309 14%, transparent); color: #b45309; }
.q-state.err { color: var(--danger); }
.pv-actions .pv-report { flex: 0 0 auto; color: var(--text-2); }

/* ---------- ♪ sound chip (sounds.js) ---------- */
.pc-music { padding: 0 14px 8px; }
.pv-sound:empty { display: none; }
.snd-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 12px 4px 8px; border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.snd-chip:hover { border-color: var(--line-strong); }
.snd-chip.playing { border-color: transparent; color: #fff; background: linear-gradient(120deg, var(--ring-1), var(--ring-2) 55%, var(--ring-3)); }
.snd-note { font-size: 14px; }
.snd-chip .snd-eq { display: none; }
.snd-chip.playing .snd-note { display: none; }
.snd-chip.playing .snd-eq { display: inline-flex; }
.snd-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snd-by { font-weight: 500; opacity: .7; white-space: nowrap; }
@media (max-width: 420px) { .snd-by { display: none; } }
.snd-chip .snd-eq { align-items: flex-end; gap: 2px; height: 12px; }
.snd-chip .snd-eq i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
.snd-chip.playing .snd-eq i { animation: sndEq .8s ease-in-out infinite; }
.snd-chip.playing .snd-eq i:nth-child(2) { animation-delay: .2s; }
.snd-chip.playing .snd-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes sndEq { 0%, 100% { height: 4px; } 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) { .snd-chip .snd-eq i { animation: none !important; height: 8px; } }
