/*
 * embeds.css — click-to-load placeholders for third-party players.
 * Markup: embed_placeholder() in sites/music/scripts/embeds.py and wrap() in
 * theme/embeds.js. Each site's template sizes .ext-embed exactly like the
 * iframe it replaces (next to its own iframe rules).
 *
 * Inner selectors are two classes deep on purpose: they must beat page rules
 * such as `.post-body img { margin: 1.6em 0 }` or Water.css's `button:hover`
 * on the research site.
 */
.ext-embed {
    position: relative;
    display: block;
    width: 100%;
    background: #000;
    overflow: hidden;
}
.ext-embed[data-kind="video"] { aspect-ratio: 16 / 9; }
.ext-embed[data-provider="tidal"] { max-width: 500px; height: 120px; }
.ext-embed[data-provider="soundcloud"] { height: 166px; }
.ext-embed > template { display: none; }

.ext-embed .ext-embed-btn,
.ext-embed .ext-embed-btn:hover,
.ext-embed .ext-embed-btn:focus,
.ext-embed .ext-embed-btn:active {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.ext-embed .ext-embed-thumb {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    object-fit: cover;   /* crops the letterbox bars of YouTube's 4:3 thumbnails */
}
.ext-embed .ext-embed-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
}

/* Round play button in the middle (left-aligned for the flat audio bars). */
.ext-embed .ext-embed-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    transition: background 0.2s, transform 0.2s;
}
.ext-embed .ext-embed-play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -12px 0 0 -7px;
    border-style: solid;
    border-width: 12px 0 12px 21px;
    border-color: transparent transparent transparent #fff;
}
.ext-embed[data-kind="audio"] .ext-embed-play {
    left: 28px;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 0;
}
.ext-embed .ext-embed-btn:hover .ext-embed-play,
.ext-embed .ext-embed-btn:focus-visible .ext-embed-play {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.06);
}
.ext-embed .ext-embed-btn:focus-visible {
    outline: 3px solid var(--accent-color, #fff);
    outline-offset: -3px;
}

.ext-embed .ext-embed-label {
    position: absolute;
    right: 10px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    font-size: 0.72rem;
    line-height: 1.5;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ext-embed[data-kind="audio"] .ext-embed-label {
    right: auto;
    left: 100px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    background: none;
    font-size: 0.85rem;
    letter-spacing: 2px;
}
.ext-embed[data-kind="audio"] .ext-embed-label::before { content: "Load "; }
.ext-embed[data-kind="audio"] .ext-embed-label::after { content: " player"; }
