/**
 * YouTube Facade（封面替身）樣式
 *
 * 封面維持 16:9，縮圖填滿，中央放 YouTube 風格播放鍵。
 * 點擊後 JS 會把 .ezc-ytf 內容換成真正的 iframe（.ezc-ytf__iframe）。
 *
 * @package EZC
 * @since 1.11.19
 */

.ezc-ytf {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    overflow: hidden;
    line-height: 0;
}

/* aspect-ratio 的後備：極舊瀏覽器用 padding-top 撐出 16:9 */
@supports not (aspect-ratio: 16 / 9) {
    .ezc-ytf::after {
        content: "";
        display: block;
        padding-top: 56.25%;
    }
}

.ezc-ytf__btn {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.ezc-ytf__thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* YouTube 風格播放鍵：圓角紅底 + 白色三角形 */
.ezc-ytf__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 48px;
    transform: translate(-50%, -50%);
    background-color: rgba(33, 33, 33, 0.8);
    border-radius: 14%;
    transition: background-color 0.2s ease;
    pointer-events: none;
}

.ezc-ytf__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
}

.ezc-ytf__btn:hover .ezc-ytf__play,
.ezc-ytf__btn:focus-visible .ezc-ytf__play {
    background-color: #f00;
}

/* 點擊後替換進來的真播放器 */
.ezc-ytf__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
