/**
 * VIPsAllowed - Post Styles
 */

/* Post Box */
.post-box {
    background: #fff;
    /* The card is a white surface — pin dark text so a surrounding dark theme
       (hub fs-dark / hub-dark) can't bleed light body text onto it. The
       platform's own .dark mode re-lightens it below. */
    color: #1a1a1a;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    overflow: hidden;
}

.post-box .text-muted {
    color: #6c757d !important;
}

/* bootstrap.dark.css sets `p { color: var(--body-color) }` (light) — inside the
   white card that renders near-invisible text on dark hubs. Pin paragraphs and
   the post body back to the card's own colour. */
.post-box p,
.post-box .post-content-data {
    color: inherit;
}

.post-box .avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.post-box .text-dark-r {
    color: inherit;
    text-decoration: none;
}

.post-box .text-dark-r:hover {
    text-decoration: none;
}

/* Dark page chrome: move the card SURFACE with the theme instead of keeping it
   white — the same model front.css uses for --fs-card. Flipping the surface
   (rather than re-pinning text) is the only thing that holds, because
   bootstrap.dark.css sets `.text-dark-r { color: var(--body-color) !important }`
   and cannot be beaten by the `color: inherit` above.

   THE --hub-* FALLBACKS ARE FOR THE APEX, NOT FOR HUBS. The tenant views that
   render a post card — marketplace-hub, marketplace-community, content, profile
   and jam-detail — all carry `.hub-body`, so marketplace-hub.css:27-45 defines
   --hub-surface there and `.hub-body .post-box` (:284) paints it; this rule
   resolves to the same value, and they agree by construction rather than by
   luck. The apex dark feed/profile has no .hub-body and no --hub-surface, which
   is what the `var(--card-bg, #16181d)` tail exists to cover. Do NOT add a
   tenant page that reaches this rule WITHOUT .hub-body: that split is exactly
   what left the hub profile on a white card under light text, and the base rule
   above is still `background:#fff` (BUG-2026-0928-0024). */
body.fs-dark .post-box {
    background: var(--hub-surface, var(--card-bg, #16181d));
    border: 1px solid var(--hub-surface-border, var(--border-color, #23262d));
    color: var(--body-color, #f2f4f7);
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* Undo the white-card muted pin above — on a dark surface #6c757d is the grey
   the user couldn't read. */
body.fs-dark .post-box .text-muted {
    color: var(--text-muted, #9ca3af) !important;
}

body.fs-dark .post-box .h-pill:hover {
    background-color: rgba(255,255,255,0.08);
}

.post-box .text-hover:hover {
    text-decoration: underline;
}

/* Post Content */
.post-content-data {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-content-data.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Media */
.post-media img,
.post-media video {
    max-height: 600px;
    object-fit: contain;
    background: #f8f9fa;
}

.post-media .swiper-container {
    width: 100%;
}

.post-media .swiper-slide img,
.post-media .swiper-slide video {
    width: 100%;
}

.post-media .swiper-button {
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media .swiper-button::after {
    display: none;
}

/* Post Locked */
.post-locked-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locked-content-box {
    background: rgba(255,255,255,0.95);
    max-width: 300px;
}

/* The paywall kept a near-white box and a pale gradient while bootstrap.dark.css
   painted its heading with the light --body-color, so "Subscribe to see this
   content" rendered white-on-white (~1.1:1) — invisible on exactly the card that
   is supposed to sell a subscription. Same fix as .post-box above: move the
   SURFACE with the theme rather than re-pinning the text, which cannot win
   against bootstrap.dark.css's !important colour rules. */
body.fs-dark .post-locked-wrapper {
    background: linear-gradient(135deg, #1b1e24 0%, #2a2f38 100%);
}

body.fs-dark .locked-content-box {
    background: rgba(18, 19, 23, 0.95);
    border: 1px solid var(--hub-surface-border, var(--border-color, #2f333c));
}

/* Post Footer Actions */
.h-pill {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.h-pill:hover {
    background-color: rgba(0,0,0,0.05);
}

.h-pill.active {
    background-color: rgba(var(--primary-rgb), 0.1);
}

.h-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.h-pill.disabled:hover {
    background-color: transparent;
}

.icon-medium {
    font-size: 1.25rem;
}

.icon-large {
    font-size: 1.5rem;
}

.icon-xlarge {
    font-size: 3rem;
}

/* Post Count Details */
.post-count-details {
    font-size: 0.875rem;
}

.post-count-details a {
    color: inherit;
}

/* Post Comments */
.post-comments-wrapper .rounded-circle,
.new-post-comment-area .rounded-circle {
    height: 50px;
    width: 50px;
}

.post-comment .separator {
    right: 1rem;
}

.comment-textarea {
    height: 45px !important;
    min-height: 45px !important;
    border-radius: 20px !important;
    padding-top: 10px !important;
    overflow: hidden !important;
}

/* Comment Box */
.comment-box {
    transition: background-color 0.2s;
}

.comment-box:hover {
    background-color: rgba(0,0,0,0.02);
}

.comment-content {
    display: inline-block;
    max-width: 100%;
}

.comment-actions a {
    transition: color 0.2s;
}

.comment-actions a:hover {
    color: var(--primary) !important;
}

/* Loading Skeleton */
.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-text {
    height: 12px;
    width: 150px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Badges */
.badge.bg-gradient-faded-secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
}

.badge.bg-gradient-faded-primary {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.2) 100%);
    color: var(--primary);
}

/* Dropzone */
.dropzone-previews.dropzone {
    min-height: 0px !important;
    border: none !important;
}

.dropzone .dz-preview.dz-image-preview {
    background: transparent !important;
}

.dropzone .dz-preview:hover .dz-image img {
    -webkit-filter: blur(2px) !important;
    filter: blur(2px) !important;
}

.dropzone .dz-preview .dz-filename {
    display: none !important;
}

.dropzone .dz-preview {
    min-height: unset;
}

/* P-pill buttons */
.p-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    transition: background-color 0.2s;
}

.p-pill:hover {
    background: rgba(0,0,0,0.1);
}

.p-pill-text {
    width: auto;
    border-radius: 18px;
    padding: 0 1rem;
}

.p-pill-white {
    background: rgba(255,255,255,0.9);
}

/* Pointer cursor utility */
.pointer-cursor {
    cursor: pointer;
}

/* Dark Theme Adjustments */
.dark .post-box {
    background: #1a1a2e;
    color: #e6e6e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.dark .post-box .text-muted {
    color: rgba(255,255,255,0.6) !important;
}

.dark .h-pill:hover {
    background-color: rgba(255,255,255,0.1);
}

.dark .comment-box:hover {
    background-color: rgba(255,255,255,0.05);
}

.dark .comment-content.bg-light {
    background: #2d2d44 !important;
}

/* The comment bubble carries Bootstrap's `.bg-light` (#f8f9fa) while the name
   inside is `.text-dark-r`, which bootstrap.dark.css pins to the light
   --body-color with !important. Only `.dark` undid that, so on an fs-dark hub the
   bubble stayed near-white under light text — the same white-on-white failure as
   .post-box and .post-locked-wrapper above, just one level deeper. Fixed the same
   way: move the SURFACE, never re-pin the text. */
body.fs-dark .comment-content.bg-light {
    background: var(--hub-surface-alt, rgba(255,255,255,0.06)) !important;
}

.dark .p-pill {
    background: rgba(255,255,255,0.1);
}

.dark .p-pill:hover {
    background: rgba(255,255,255,0.2);
}

/* Single-post page (/posts/:id/:username) — the canonical, shareable URL for a
   post. Column width matches the feed so the card is the same object here as it
   is in a list; nothing about the card itself changes. */
.post-single {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.post-single-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: 1rem;
    font-size: .875rem;
    text-decoration: none;
    color: inherit;
    opacity: .75;
}

.post-single-back:hover {
    opacity: 1;
    color: inherit;
    text-decoration: none;
}

.post-single-comments-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 .75rem;
}

@media (max-width: 576px) {
    .post-comments-wrapper .rounded-circle,
    .new-post-comment-area .rounded-circle {
        height: 36px;
        width: 36px;
    }
}
