/**
 * SPI模試プラグイン共通リセット
 * テーマ（Cocoon/SANGO/その他）の .entry-content 系スタイルが
 * プラグイン内のh2/h3/h4/ul/ol/img を上書きしないように防御。
 * 全プラグインCSSの先頭に読み込まれる。
 *
 * このCSSは has_shortcode() でSPIショートコードが存在するページにのみ
 * 読み込まれるため、ここでテーマのページ装飾を消すのは安全。
 */

/* ===== ページヘッダー（パンくず + タイトル）非表示 ===== */
.entry-header,
.article-header,
.article-header.entry-header,
#entry > .entry-header,
#entry > .article-header {
    display: none !important;
}

/* ===== entry-content の上下padding を打ち消し ===== */
.entry-content,
.entry-content.cf,
body .entry-content,
body .entry-content.cf {
    padding: 0 !important;
}
body .entry-content > *:first-child {
    margin-top: 0 !important;
}
body .entry-content > *:last-child {
    margin-bottom: 0 !important;
}

/* ===== article-footer（SNSボタン）はSPIページでは不要 ===== */
.article-footer,
#entry > .article-footer {
    display: none !important;
}

/* ===== コメント欄もSPIページでは非表示 ===== */
#respond,
#comments,
.commentlist,
.comments-area {
    display: none !important;
}

/* ===== SANGOコンテナの上下padding/marginを詰める =====
   注意：横方向のmarginは「margin: 0 auto」を残す必要がある。
   .spi-top-page の bleedout（calc(50% - 50vw)）が中央寄せされた親を前提
   に計算するため、auto centeringを殺すと右側に余白ができる。 */

/* #content / #entry：元から横marginは持たないので margin/padding 完全リセットOK */
#content,
#content.one-column,
#content.page-forfront,
.page #content,
.page #content.one-column,
.page #content.page-forfront,
#entry,
.page #entry {
    margin: 0 !important;
    padding: 0 !important;
}

/* #inner-content / #main：横方向の auto centering を保つ */
#inner-content,
.page #inner-content,
#main,
.one-column #main,
.page #main {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    /* margin-left/right は理論上 auto のまま（中央寄せ維持） */
}

/* ===== 全幅bleedout用：親のoverflow:hiddenを無効化 =====
   SANGOの #wrapper / #container が overflow:hidden を持つと
   width:100vw + margin-left:calc(50% - 50vw) の突き抜けが効かない。
   overflow-x:clip はBFCを作らないため sticky等に影響しない。 */
#wrapper,
#container,
.l-wrap,
.wrap {
    overflow-x: clip !important;
}

/* ===== SPIページを強制1カラム化 =====
   2カラム（サイドバーあり）レイアウトだとコンテンツエリアが中央に来ず
   calc(50% - 50vw) のbleedoutがズレるため、サイドバーを非表示にして
   メインエリアを100%幅にする。 */
#sidebar,
.sidebar,
#side-left,
#side-right,
.l-sidebar {
    display: none !important;
}
#main,
.l-main,
#inner-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ===== 各SPIショートコードの自前ヘッダー（緑バー）を非表示 ===== */
.spi-top-header,
.spi-confirm-header,
.spi-exam-page-header,
.spi-lp-header {
    display: none !important;
}

/* ===== UL/OL: テーマの border/padding/list-style を打ち消し ===== */
.spi-exam-page ul, .spi-exam-page ol,
.spi-top-page ul, .spi-top-page ol,
.spi-confirm-page ul, .spi-confirm-page ol,
.spi-lp-page ul, .spi-lp-page ol {
    border: 0;
    border-radius: 0;
    background: none;
}
.spi-exam-page ul, .spi-exam-page ol,
.spi-top-page ul, .spi-top-page ol,
.spi-confirm-page ul, .spi-confirm-page ol,
.spi-lp-page ul, .spi-lp-page ol {
    list-style: none;
}

/* ===== LI: テーマのpaddingを打ち消し ===== */
.spi-exam-page li,
.spi-top-page li,
.spi-confirm-page li,
.spi-lp-page li {
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== 見出し: テーマの装飾border/background/padding を打ち消し ===== */
.spi-exam-page h1, .spi-exam-page h2, .spi-exam-page h3, .spi-exam-page h4, .spi-exam-page h5, .spi-exam-page h6,
.spi-top-page h1, .spi-top-page h2, .spi-top-page h3, .spi-top-page h4, .spi-top-page h5, .spi-top-page h6,
.spi-confirm-page h1, .spi-confirm-page h2, .spi-confirm-page h3, .spi-confirm-page h4, .spi-confirm-page h5, .spi-confirm-page h6,
.spi-lp-page h1, .spi-lp-page h2, .spi-lp-page h3, .spi-lp-page h4, .spi-lp-page h5, .spi-lp-page h6 {
    border: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

/* spi-confirm内のh2はテーマのfont-sizeを上書き */
.spi-confirm-page .spi-confirm-caution-title {
    font-size: 12px !important;
    margin: 0 0 10px !important;
}
.spi-exam-page h1::before, .spi-exam-page h1::after,
.spi-exam-page h2::before, .spi-exam-page h2::after,
.spi-exam-page h3::before, .spi-exam-page h3::after,
.spi-exam-page h4::before, .spi-exam-page h4::after,
.spi-top-page h1::before, .spi-top-page h1::after,
.spi-top-page h2::before, .spi-top-page h2::after,
.spi-top-page h3::before, .spi-top-page h3::after,
.spi-top-page h4::before, .spi-top-page h4::after,
.spi-confirm-page h1::before, .spi-confirm-page h1::after,
.spi-confirm-page h2::before, .spi-confirm-page h2::after,
.spi-confirm-page h3::before, .spi-confirm-page h3::after,
.spi-confirm-page h4::before, .spi-confirm-page h4::after,
.spi-lp-page h1::before, .spi-lp-page h1::after,
.spi-lp-page h2::before, .spi-lp-page h2::after,
.spi-lp-page h3::before, .spi-lp-page h3::after,
.spi-lp-page h4::before, .spi-lp-page h4::after {
    content: none;
    display: none;
}

/* ===== IMG: テーマのmargin/box-shadow/borderを打ち消し ===== */
.spi-exam-page img,
.spi-top-page img,
.spi-confirm-page img,
.spi-lp-page img {
    margin: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

/* ===== P: テーマのline-height/marginを統一 ===== */
.spi-exam-page p,
.spi-top-page p,
.spi-confirm-page p,
.spi-lp-page p {
    margin: 0;
}
