/* =============================================
   YourVu Shorts - CSS
   ============================================= */

/* ---- Grid (thumbnail cards on the page) ---- */
.yourvu-shorts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* 2 columns mobile */
    gap: 8px;
    padding: 16px 0;
}

@media (min-width: 480px) {
    .yourvu-shorts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .yourvu-shorts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1200px) {
    .yourvu-shorts-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.yourvu-shorts-thumb {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.yourvu-shorts-thumb:hover,
.yourvu-shorts-thumb:focus {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    outline: none;
}

.yourvu-shorts-thumb-img {
    position: relative;
    width: 100%;
    padding-top: 177%; /* 9:16 aspect ratio */
    background-size: cover;
    background-position: center;
    background-color: #222;
}

.yourvu-shorts-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s;
}

.yourvu-shorts-thumb:hover .yourvu-shorts-thumb-play,
.yourvu-shorts-thumb:focus .yourvu-shorts-thumb-play {
    opacity: 1;
}

.yourvu-shorts-thumb-title {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700 !important;
    color: #ddd;
    line-height: 1.4;
    min-height: 36px;
}

/* ---- Full-screen overlay ---- */
.yourvu-shorts-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    flex-direction: column;
}

.yourvu-shorts-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}

.yourvu-shorts-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ---- Swiper ---- */
.yourvu-shorts-swiper {
    width: 100%;
    height: 100%;
    flex: 1;
}

/* When the overlay is rendered visible from the server (shared-link entry),
   the slides briefly stack vertically before Swiper applies its transforms.
   Hide the wrapper until JS adds .yvs-swiper-ready in the Swiper init hook. */
.yourvu-shorts-overlay:not(.yvs-swiper-ready) .swiper-wrapper {
    visibility: hidden;
}

.swiper-slide.yourvu-short-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: flex-end;
}

/* ---- Background image ---- */
.yourvu-short-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* ---- Video ---- */
.yourvu-short-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
}

/* ---- YouTube iframe ---- */
.yourvu-short-yt-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.yourvu-short-yt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh; /* 16:9 aspect at full height */
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    border: none;
    pointer-events: none; /* prevent click-away on overlay */
}

/* ---- Gradient overlay ---- */
.yourvu-short-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(0,0,0,0.3) 60%,
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
}

/* ---- Info panel ---- */
.yourvu-short-info {
    position: relative;
    z-index: 2;
    padding: 16px 16px 60px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.yourvu-short-cat {
    display: inline-block;
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.yourvu-short-title {
    color: #fff !important;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 800 !important;
    line-height: 1.3;
    margin: 0 0 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Override any theme link colors inside shorts info (exclude button) */
.yourvu-short-info a:not(.yourvu-short-readmore),
.yourvu-short-info h2,
.yourvu-short-info h2 a {
    color: #fff !important;
    text-decoration: none !important;
}

.yourvu-short-excerpt {
    color: rgba(255,255,255,0.9) !important;
    font-size: clamp(12px, 3vw, 14px);
    line-height: 1.5;
    margin: 0 0 14px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.yourvu-short-readmore {
    display: inline-flex !important;
    align-items: center;
    background: #fff !important;
    color: #111 !important;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 24px;
    text-decoration: none !important;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.yourvu-short-readmore:hover,
.yourvu-short-readmore:visited,
.yourvu-short-readmore:active,
.yourvu-short-readmore:focus {
    background: #f0f0f0 !important;
    color: #000 !important;
    text-decoration: none !important;
}

/* ---- Buttons row (Read Full Post + Share) ---- */
.yourvu-short-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.yourvu-short-share-btn {
    display: inline-flex !important;
    align-items: center;
    background: rgba(255,255,255,0.18) !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s;
}

.yourvu-short-share-btn:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* ---- Share bottom sheet popup (created via JS, appended to body) ---- */
#yourvuShareInner {
    background: #1c1c1e;
    width: 100%;
    max-width: 400px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    padding-bottom: 6px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
}

#yourvuSharePopup.yvs-open #yourvuShareInner {
    transform: translateY(0);
}

#yourvuShareHeading {
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 14px 16px 10px;
    margin: 0;
}

#yourvuSharePopup a,
#yourvuShareCopy,
#yourvuShareCancel {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    padding: 14px 22px !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: none !important;
    border: none !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    cursor: pointer !important;
    text-align: left !important;
    box-sizing: border-box !important;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

#yourvuSharePopup a:hover,
#yourvuShareCopy:hover {
    background: rgba(255,255,255,0.06) !important;
    color: #fff !important;
}

#yourvuShareCancel {
    margin: 8px 16px 4px !important;
    width: calc(100% - 32px) !important;
    border-radius: 12px !important;
    justify-content: center !important;
    font-weight: 600 !important;
    background: rgba(255,255,255,0.1) !important;
    border: none !important;
    border-top: none !important;
    color: #fff !important;
}

/* Toast notification */
.yourvu-shorts-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 100001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.yourvu-shorts-toast.show {
    opacity: 1;
}

/* ---- Swipe hint (bottom-center) ---- */
.yourvu-short-nav-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    text-align: center;
}

.yourvu-short-swipe-up {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    letter-spacing: 0.08em;
    background: rgba(0,0,0,0.35);
    padding: 6px 14px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* ---- Mute button ---- */
.yourvu-shorts-mute-btn {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.yourvu-shorts-mute-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ---- Responsive: desktop - maintain 9:16 phone shape ---- */
@media (min-width: 600px) {
    .yourvu-shorts-overlay {
        align-items: center;
        justify-content: center;
    }
    .yourvu-shorts-swiper {
        /* Width = height × 9/16, capped at 420px */
        width: calc(100vh * 9 / 16);
        max-width: 420px;
        /* Height = width × 16/9 → capped so aspect ratio stays 9:16 */
        height: 100%;
        max-height: calc(420px * 16 / 9); /* ≈ 747px */
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    }
}

/* ---- Body scroll lock ---- */
body.yourvu-shorts-open {
    overflow: hidden;
}

/* ---- Comments button on slide ---- */
.yourvu-short-comments-btn {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.yourvu-short-comments-btn:hover {
    background: rgba(255,255,255,0.28);
}
.yourvu-short-comments-count {
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}

/* ---- Comments bottom-sheet panel ---- */
#yourvuCommentsPopup.yvs-open #yourvuCommentsInner {
    transform: translateY(0);
}
#yourvuCommentsInner {
    width: 100%;
    max-width: 640px;
    background: #1a1a1a;
    color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
#yourvuCommentsHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
#yourvuCommentsTitle { font-weight: 700; font-size: 15px; }
#yourvuCommentsClose {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
#yourvuCommentsList {
    overflow-y: auto;
    padding: 12px 18px;
    flex: 1 1 auto;
}
.yvs-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.yvs-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #333;
}
.yvs-comment-avatar-fallback {
    background: linear-gradient(135deg, #444, #222);
}
.yvs-comment-body { flex: 1; min-width: 0; }
.yvs-comment-meta {
    font-size: 13px;
    margin-bottom: 3px;
}
.yvs-comment-date {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    margin-left: 6px;
    font-weight: normal;
}
.yvs-comment-content {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.yvs-comment-content p { margin: 0 0 6px; }
.yvs-comment-loading,
.yvs-comment-empty {
    text-align: center;
    color: rgba(255,255,255,0.55);
    padding: 18px 8px;
    font-size: 14px;
}
#yourvuCommentsForm {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 12px 18px;
    flex-shrink: 0;
}
.yvs-comment-loginprompt { text-align: center; padding: 6px; }
.yvs-comment-loginprompt a {
    color: #4ea1ff;
    text-decoration: none;
    font-weight: 600;
}
.yvs-comment-form-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}
.yvs-comment-form textarea {
    width: 100%;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 44px;
    box-sizing: border-box;
}
.yvs-comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.yvs-comment-submit {
    background: #4ea1ff;
    color: #fff;
    border: 0;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}
.yvs-comment-submit:disabled { opacity: 0.6; cursor: default; }
.yvs-comment-form-error {
    color: #ff7c7c;
    font-size: 13px;
    margin-top: 8px;
}
