/**
 * Shared podcast styles: YouTube facade, transcript trigger button, transcript modal.
 * Enqueued (handle: budi-podcast) by every budi_podcast_* shortcode.
 */

:root {
    --budi-podcast-red: #e30613;
    --budi-podcast-red-2: #ff2d2d;
    --budi-podcast-radius: 20px;
}

/* ---------- YouTube facade ---------- */
.budi-podcast-video {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--budi-podcast-radius) !important;
    overflow: hidden;
    background: #000 !important;
    cursor: pointer;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    line-height: 0;
}

.budi-podcast-video__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease, filter .3s ease;
}

.budi-podcast-video:hover .budi-podcast-video__poster {
    transform: scale(1.03);
    filter: brightness(.92);
}

.budi-podcast-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: auto;
    transition: transform .25s ease;
    pointer-events: none;
    z-index: 2;
}

.budi-podcast-video__play svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35));
}

.budi-podcast-video__play-bg {
    fill: var(--budi-podcast-red);
    transition: fill .25s ease;
}

.budi-podcast-video:hover .budi-podcast-video__play {
    transform: translate(-50%, -50%) scale(1.08);
}

.budi-podcast-video:hover .budi-podcast-video__play-bg {
    fill: var(--budi-podcast-red-2);
}

.budi-podcast-video.is-playing {
    cursor: default;
}

.budi-podcast-video.is-playing .budi-podcast-video__poster,
.budi-podcast-video.is-playing .budi-podcast-video__play {
    display: none;
}

.budi-podcast-video__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Transcript trigger button ---------- */
.budi-podcast__transcript-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px !important;
    background: #fff !important;
    color: var(--budi-podcast-red) !important;
    border: none !important;
    border-radius: 999px !important;
    font-family: var(--font-heading) !important;
    font-size: 18px !important;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    z-index: 0;
    transition: background .2s ease, color .2s ease;
}

/* Gradient border via ::before — border-image breaks border-radius */
.budi-podcast__transcript-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 999px;
    background: linear-gradient(90deg, #E30612 0%, #FF4540 100%);
    z-index: -2;
}

/* White inner fill sits above gradient, below button content */
.budi-podcast__transcript-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #fff;
    z-index: -1;
    transition: background .2s ease;
}

.budi-podcast__transcript-btn:hover {
    color: #fff !important;
}

.budi-podcast__transcript-btn:hover::after {
    background: linear-gradient(90deg, #E30612 0%, #FF4540 100%);
}

.budi-podcast__transcript-icon {
    display: inline-flex;
    line-height: 0;
}

.budi-podcast__transcript-icon svg {
    width: 20px;
    height: 20px;
}

/* ---------- Transcript modal ---------- */
.budi-podcast-modal[hidden] {
    display: none;
}

.budi-podcast-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .2s ease;
}

.budi-podcast-modal.is-open {
    opacity: 1;
}

.budi-podcast-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
}

.budi-podcast-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--budi-podcast-radius);
    padding: 40px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

.budi-podcast-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: var(--budi-podcast-red) !important;
    border: 0 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 34px !important;
    line-height: 1;
    cursor: pointer;
}

.budi-podcast-modal__close:hover {
    background: rgba(227, 6, 19, .08) !important;
}

.budi-podcast-modal__title {
    margin: 0 30px 20px 0;
    font-size: 26px;
    line-height: 1.25;
}

.budi-podcast-modal__body {
    font-size: 17px;
    line-height: 1.7;
}

.budi-podcast-modal__body > *:first-child {
    margin-top: 0;
}

body.budi-podcast-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .budi-podcast-modal__dialog {
        padding: 28px 20px;
    }

    .budi-podcast-video__play {
        width: 58px;
    }

    .budi-podcast__transcript-btn {
        font-size: 16px !important;
        padding: 14px 20px !important;
    }
}
