/* YouTube 影片 facade 與彈窗（主站，搭配 public/js/yt-video.js）。純 CSS，不需 npm build。 */

/* ---------- 文章內嵌 facade：16:9、圓角、縮圖＋播放鍵 ---------- */
.yt-facade { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; background: #0b0f1a; box-shadow: 0 14px 36px -18px rgba(236, 72, 153, .45), 0 8px 24px -16px rgba(14, 165, 233, .4); cursor: pointer; text-decoration: none !important; border: 0 !important; }
.yt-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; border-radius: 0 !important; transition: transform .35s ease, filter .35s ease; }
.yt-facade:hover img { transform: scale(1.025); filter: brightness(.92); }
.yt-facade__play { position: absolute; left: 50%; top: 50%; width: 4.25rem; height: 4.25rem; margin: -2.125rem 0 0 -2.125rem; border-radius: 9999px; background: linear-gradient(135deg, #0ea5e9 0%, #ec4899 100%); box-shadow: 0 10px 30px -6px rgba(236, 72, 153, .7); transition: transform .2s ease; }
.yt-facade__play::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -.7rem 0 0 -.35rem; border-style: solid; border-width: .7rem 0 .7rem 1.15rem; border-color: transparent transparent transparent #fff; }
.yt-facade:hover .yt-facade__play { transform: scale(1.08); }
.yt-facade:focus-visible { outline: 3px solid #0ea5e9; outline-offset: 3px; }
.yt-facade__time { position: absolute; right: .625rem; bottom: .625rem; padding: .125rem .5rem; border-radius: .375rem; background: rgba(2, 6, 23, .78); color: #fff; font-size: .75rem; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; }
.yt-facade--playing { cursor: default; }
.yt-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 639px) { .yt-facade__play { width: 3.5rem; height: 3.5rem; margin: -1.75rem 0 0 -1.75rem; } }

/* ---------- 彈窗 ---------- */
html.yt-modal-open { overflow: hidden; }
.yt-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(2, 6, 23, .86); }
.yt-modal[hidden] { display: none; }
.yt-modal__box { position: relative; width: 100%; max-width: 64rem; max-width: min(64rem, calc((100vh - 6rem) * 16 / 9)); }
.yt-modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; color: #f1f5f9; }
.yt-modal__title { margin: 0; min-width: 0; font-size: .9375rem; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-modal__close { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 9999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background .2s ease; }
.yt-modal__close:hover { background: rgba(236, 72, 153, .85); }
.yt-modal__close:focus-visible { outline: 3px solid #0ea5e9; outline-offset: 2px; }
.yt-modal__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; background: #000 center / cover no-repeat; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.yt-modal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
