/* --------------------------------------------------------
   記事ページのインタースティシャル広告
   （resources/views/show/blog/parts/interstitial.blade.php）
   記事ページだけで読み込む。
-------------------------------------------------------- */

.c-interstitial {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(8, 10, 20, 0.86);
    animation: c-interstitial-fade-in 0.25s ease-out;
}

.c-interstitial[open] {
    display: flex;
}

.c-interstitial::backdrop {
    background: transparent;
}

.c-interstitial__box {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    max-height: 100%;
}

/* 広告の上に置く帯（広告の表記・秒読み・閉じるボタン） */
.c-interstitial__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    margin-bottom: 8px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}

.c-interstitial__label {
    flex-shrink: 0;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.c-interstitial__count {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.85);
}

.c-interstitial__count[hidden] {
    display: none;
}

.c-interstitial__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 24px;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
}

.c-interstitial__close[hidden] {
    display: none;
}

.c-interstitial__body {
    min-height: 0;
    text-align: center;
    line-height: 0;
}

.c-interstitial__body a {
    display: inline-block;
    max-width: 100%;
}

/* 画像・動画は、縦横の比を保ったまま画面に収める */
.c-interstitial__body img,
.c-interstitial__body video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 720px);
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    margin: 0 auto;
    border-radius: 8px;
}

/* 広告を出している間は、後ろのページをスクロールさせない */
.is-interstitial-open,
.is-interstitial-open body {
    overflow: hidden;
}

@keyframes c-interstitial-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .c-interstitial {
        animation: none;
    }
}
