/* YouTube video card + floating pill (youtube_video_widget.js).
   The card renders where marketing_manager's youtube_publish.py injects a
   <div class="youtube-video-card" data-youtube-id="..."> right after the H1;
   the pill follows the reader once the card scrolls out of view. */

/* Compact 16:9 card under the H1 (CLS-safe: aspect-ratio reserves height) */
.ytv-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    margin: 0 0 28px;
}
.ytv-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ytv-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 56px;
    height: 40px;
    background: #dc2626;
    border-radius: 10px;
    transition: transform 0.15s ease, background 0.15s ease;
}
.ytv-card:hover .ytv-play {
    transform: scale(1.07);
    background: #b91c1c;
}
.ytv-play::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #fff;
}
.ytv-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
}

/* Floating pill (bottom-right), visible only while the card is out of view */
.ytv-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    padding: 8px 14px 8px 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.ytv-fab.ytv-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ytv-fab:hover {
    transform: scale(1.04);
}
.ytv-fab-icon {
    width: 44px;
    height: 32px;
    background: #dc2626;
    border-radius: 9px;
    position: relative;
    flex: none;
}
.ytv-fab-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #fff;
}
.ytv-fab-label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}
.ytv-fab-label small {
    display: block;
    font-weight: 400;
    color: #64748b;
    font-size: 11px;
}

@media (max-width: 640px) {
    .ytv-fab {
        right: 16px;
        bottom: 16px;
    }
    .ytv-card {
        margin-bottom: 20px;
    }
}
