/**
 * X（Twitter）埋め込み【X専用】CSS
 */

/* 1. 【厳格化】X専用ブロック（.wp-block-embed-x）の中にあるラッパー「だけ」をピンポイント解放 */
.post-content-wrap .wp-block-embed-x,
.post-content-wrap .wp-block-embed-x .wp-block-embed__wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;             /* Xブロックの中のpaddingだけを0にする */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 2. X公式コンテナ（他媒体には絶対に使われない固有クラス） */
.post-content-wrap .wp-block-embed-x .twitter-tweet.twitter-tweet-rendered {
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 3. X公式のiframe（IDがtwitter-widget-から始まるもの） */
.post-content-wrap .wp-block-embed-x iframe[id^="twitter-widget-"] {
    max-height: none !important;
    max-width: 100% !important;
    overflow: visible !important;
    height: auto; 
    margin: 0 !important;
    padding: 0 !important;
}

/* 4. 【安全策】スペーサーの解除も、Xブロックの直後および内部周辺のみに影響を限定 */
.post-content-wrap .wp-block-embed-x + .wp-block-spacer,
.post-content-wrap .wp-block-embed-x .wp-block-spacer {
    clear: both !important;
    display: block !important;
}