.sam-ad-slot:empty {
    display: none;
}

.sam-ad-slot-below-toc,
.sam-ad-slot-inarticle {
    clear: both;
}

.sam-ad-preview-active .sam-ad-slot[data-sam-rendered="1"] {
    position: relative;
    outline: 2px dashed #dba617;
    outline-offset: 3px;
}

.sam-ad-preview-active .sam-ad-slot[data-sam-rendered="1"]::before {
    position: absolute;
    z-index: 2147483647;
    top: -20px;
    left: 0;
    padding: 2px 6px;
    color: #1d2327;
    background: #ffdc73;
    content: attr(data-sam-label) ": " attr(data-sam-provider) " / " attr(data-sam-device);
    font: 11px/1.4 sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

/* FourM インタースティシャル用: 通常バナー枠を全画面モーダルとして表示する */
html.sam-interstitial-open,
html.sam-interstitial-open body {
    overflow: hidden;
}

.sam-ad-slot.sam-ad-slot-interstitial.sam-fourm-interstitial-modal {
    position: fixed !important;
    z-index: 2147483000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 64px 16px 24px;
    background: rgba(0, 0, 0, 0.8);
}

.sam-fourm-interstitial-dialog {
    position: relative;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 88px);
}

.sam-fourm-interstitial-dialog > #shu_pc_all_interstitial,
.sam-fourm-interstitial-dialog > #shu_sp_all_interstitial {
    max-width: 100%;
    max-height: calc(100vh - 88px);
    overflow: auto;
}

.sam-fourm-interstitial-dialog iframe {
    max-width: 100%;
}

/* バナーの外側に表示する閉じるボタン */
.sam-fourm-interstitial-close {
    position: absolute;
    z-index: 2;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    font: 400 26px/32px sans-serif;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* 広告枠の生成後、少し間をおいて閉じるボタンを表示する */
.sam-fourm-interstitial-close.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.sam-fourm-interstitial-close:hover,
.sam-fourm-interstitial-close:focus-visible {
    color: #1d2327;
    background: #fff;
}

.sam-ad-preview-active .sam-fourm-interstitial-modal::before {
    top: 4px;
    left: 4px;
}

/* COMPASS インタースティシャル用: 背景を半透明のグレーにする */
div#rise-interstitial-area {
    background-color: rgba(89, 89, 89, 0.8) !important;
}

/* FourM オーバーレイ用 */

/* PC・SP共通: 画面下部に固定し、広告を中央配置する */
.fourm-overlay-pc,
.fourm-overlay-sp {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* 広告だけクリック可能にする */
.fourm-overlay-pc iframe,
.fourm-overlay-sp iframe {
    pointer-events: auto;
}

/* フッター到達時は固定を解除する */
.fourm-overlay-pc.is-footer-visible,
.fourm-overlay-sp.is-footer-visible {
    position: absolute;
    bottom: auto;
}

/* PCではSP用オーバーレイを非表示にする */
@media (min-width: 768px) {
    .fourm-overlay-sp {
        display: none;
    }
}

/* SPではPC用オーバーレイを非表示にする */
@media (max-width: 767px) {
    .fourm-overlay-pc {
        display: none;
    }
}

