/* Post Viewer - Horizontal fullscreen overlay for profile posts tab */

.x-posts-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.x-posts-overlay.is-open { display: block; }

/* Close button */
.x-posts-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  z-index: 12;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s ease;
}
.x-posts-close:hover { background: rgba(0,0,0,.65); }
.x-posts-close i { font-size: 18px; line-height: 1; }

/* Desktop nav arrows */
.x-posts-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.x-posts-nav:hover { background: rgba(0,0,0,.65); }
.x-posts-nav:active { transform: translateY(-50%) scale(.93); }
.x-posts-prev { left: 14px; }
.x-posts-next { right: 14px; }
@media (max-width: 576px) {
  .x-posts-nav { display: none !important; }
}

/* Horizontal track */
.x-posts-track {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  will-change: transform;
}
.x-posts-track-inner {
  display: flex;
  flex-direction: row;
  height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform .22s ease;
}

/* Individual post slide */
.x-post-slide {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
  overflow: hidden;
}
.x-post-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.x-post-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Locked media blur */
.x-post-locked-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.x-post-locked-wrap img,
.x-post-locked-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px);
  transform: scale(1.06);
}

/* Gradient overlay */
.x-post-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.7) 100%);
  z-index: 1;
  pointer-events: none;
}
.x-post-gradient-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: 18%;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Text-only post background */
.x-post-text-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(50,50,75,.35), rgba(0,0,0,0) 70%), #0d0d14;
}
.x-post-text-content {
  position: relative;
  z-index: 2;
  padding: 80px 28px 160px;
  text-align: center;
  color: rgba(255,255,255,.92);
  max-width: 640px;
  font-size: clamp(15px, 3.8vw, 22px);
  line-height: 1.65;
  font-weight: 500;
  overflow-y: auto;
  max-height: 100%;
  word-break: break-word;
}

/* Bottom info bar */
.x-post-bottom {
  position: absolute;
  left: 14px;
  right: 80px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 6;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-shadow: 0 6px 20px rgba(0,0,0,.55);
  pointer-events: none;
}
.x-post-bottom * { pointer-events: auto; }
@media (max-width: 576px) {
  .x-post-bottom {
    left: 10px;
    right: 62px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 6px;
  }
}

.x-post-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  text-decoration: none;
  color: #fff;
}
.x-post-user:hover { color: #fff; }
.x-post-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.85);
  object-fit: cover;
  background: #111;
  display: block;
}
.x-post-desc {
  font-weight: 500;
  font-size: clamp(12px, 2.8vw, 13px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  max-height: calc(1.35em * 3);
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.x-post-view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: fit-content;
  transition: background .2s ease;
}
.x-post-view-link:hover { background: rgba(0,0,0,.55); color: #fff; }
.x-post-unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: fit-content;
  cursor: pointer;
  transition: background .2s ease;
}
.x-post-unlock-btn:hover { background: rgba(0,0,0,.55); }

/* Right-side actions */
.x-post-actions {
  position: absolute;
  right: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
  pointer-events: none;
}
.x-post-actions * { pointer-events: auto; }
@media (max-width: 576px) {
  .x-post-actions {
    right: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    gap: 12px;
  }
}
.x-post-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  user-select: none;
  -webkit-user-select: none;
}
.x-post-action button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}
.x-post-action i {
  font-size: 30px;
  text-shadow: 0 8px 24px rgba(0,0,0,.45);
}
@media (max-width: 576px) {
  .x-post-action i { font-size: 26px; }
}
.x-post-count {
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.x-post-action.is-liked i { color: #ff2d55; }

/* Double-tap like burst */
.x-post-like-burst {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(.6);
  z-index: 5;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 8px 24px rgba(0,0,0,.45);
  transition: opacity .08s ease, transform .22s ease;
}
.x-post-like-burst i { font-size: 86px; line-height: 1; }
.x-post-like-burst.is-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Loading indicator */
.x-posts-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.x-posts-loading.is-show { opacity: 1; }

/* Comments sheet */
.x-posts-comments {
  position: absolute;
  inset: auto 0 0 0;
  height: 70vh;
  height: min(70dvh, calc(100dvh - 20px));
  background: #0b0b0c;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  transform: translateY(105%);
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 8;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 -10px 40px rgba(0,0,0,.5);
}
.x-posts-comments.is-open { transform: translateY(0); }

.x-posts-comments__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 50px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(15,15,15,.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.x-posts-comments__header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
}
.x-posts-comments__title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.02em;
  color: rgba(255,255,255,.95);
}
.x-posts-comments__close-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}
.x-posts-comments__close-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.x-posts-comments__close-btn i { font-size: 16px; line-height: 1; }
.x-posts-comments__body {
  padding: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.x-posts-comments__body .media { margin-bottom: 14px; }
.x-posts-comments__body .media .avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 999px;
  object-fit: cover;
}
.x-posts-comments__body .media-body {
  color: rgba(255,255,255,.9);
  font-size: 14px;
  line-height: 1.4;
}
.x-posts-comments__body .media-body .text-muted,
.x-posts-comments__body .media-body small {
  color: rgba(255,255,255,.5) !important;
  font-size: 12px;
}
.x-posts-comments__composer {
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0,0,0,.3);
}
.x-posts-comments__composer input {
  flex: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  outline: none;
  font-size: 14px;
  transition: all .2s ease;
}
.x-posts-comments__composer input:focus {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.15);
}
.x-posts-comments__composer input::placeholder { color: rgba(255,255,255,.4); }
.x-posts-comments__composer button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #007bff;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s ease;
}
.x-posts-comments__composer button:hover { transform: scale(1.03); }
.x-posts-comments__composer button:active { transform: scale(.97); }

/* Expand button on post cards */
.post-expand-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 14px;
  opacity: .55;
  transition: opacity .15s ease;
  line-height: 1;
  vertical-align: middle;
  float: right;
}
.post-expand-btn:hover { opacity: 1; }
