.media_embed_wrapper {
    margin: 0 auto;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
}
.media_embed_wrapper {
    _max-width: 640px;
}
.media_embed.podbbang-embed {
    height: 0;
    _padding-bottom: 202px !important;
}

/* YouTube 등 일반 영상 비율 16:9 고정 (팟빵 제외) */
.media_embed:not(.podbbang-embed) {
    padding-bottom: 56.25% !important;
}
.media_embed:not(.podbbang-embed) img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* =========================================================
   🔥 유튜브 Shorts 전용 수정 (반응형)
   ========================================================= */

/* 1️⃣ wrapper: 높이 기준으로 너비 자동 계산 (9:16 비율) */
.media_embed_wrapper:has(>.short_form) {
    height: 80vh;                        /* 화면 높이의 80% */
    width: calc(80vh * 9 / 16);          /* 높이에 맞춰 너비 자동 계산 */
    max-width: 100%;                     /* 모바일에서 화면 밖으로 안 나가게 */
    margin: 20px auto;
}

/* 2️⃣ Shorts: padding-bottom 방식 제거, 절대 크기로 채우기 */
.media_embed.short_form {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;        /* 기존 padding 비율 방식 무효화 */
    background: #000;
}

/* 3️⃣ wrapper를 relative 기준점으로 설정 */
.media_embed_wrapper:has(>.short_form) {
    position: relative;
}

/* 4️⃣ 썸네일 이미지 제거 */
.media_embed.short_form > img {
    display: none !important;
}

/* 5️⃣ iframe 정상 출력 */
.media_embed.short_form iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================================
   📱 반응형 미디어쿼리
   ========================================================= */

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    .media_embed_wrapper:has(>.short_form) {
        height: 70vh;
        width: calc(70vh * 9 / 16);
    }
}

/* 모바일 (480px 이하) - 가로폭 기준으로 전환 */
@media (max-width: 480px) {
    .media_embed_wrapper:has(>.short_form) {
        width: 92vw;                     /* 화면 너비의 92% */
        height: calc(92vw * 16 / 9);    /* 너비에 맞춰 높이 자동 계산 */
    }
}