/* =============================================
   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;
}

.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 ---- */
.yourvu-short-nav-hint {
    position: absolute;
    bottom: 14px;
    right: 16px;
    z-index: 3;
}

.yourvu-short-swipe-up {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    letter-spacing: 0.05em;
}

/* ---- Progress bar ---- */
.yourvu-shorts-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 5;
}

.yourvu-shorts-progress-bar {
    height: 100%;
    background: #fff;
    transition: width 0.3s ease;
    width: 0%;
}

/* ---- 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;
}
