/* ---------- ベース ---------- */
.wp-block-firstvisit-hero-media {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ---------- 背景 ---------- */
.firstvisit-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

iframe.firstvisit-hero-bg {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------- オーバーレイ ---------- */
.firstvisit-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ---------- 中央 ---------- */
.firstvisit-hero-center-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

/* 位置クラス */
.firstvisit-hero-text-top-left {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.firstvisit-hero-text-top-center {
    justify-content: center;
    align-items: flex-start;
    text-align: center;
}

.firstvisit-hero-text-top-right {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: right;
}

.firstvisit-hero-text-center-left {
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

.firstvisit-hero-text-center {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.firstvisit-hero-text-center-right {
    justify-content: flex-end;
    align-items: center;
    text-align: right;
}

.firstvisit-hero-text-bottom-left {
    justify-content: flex-start;
    align-items: flex-end;
    text-align: left;
}

.firstvisit-hero-text-bottom-center {
    justify-content: center;
    align-items: flex-end;
    text-align: center;
}

.firstvisit-hero-text-bottom-right {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}

/* サイズクラス */
.firstvisit-hero-text-size-small {
    font-size: 1rem;
    line-height: 1.2;
}

.firstvisit-hero-text-size-medium {
    font-size: 1.5rem;
    line-height: 1.3;
}

.firstvisit-hero-text-size-large {
    font-size: 2.5rem;
    line-height: 1.3;
}

.firstvisit-hero-text-size-xlarge {
    font-size: 4rem;
    line-height: 1.1;
}

.firstvisit-hero-text {
    margin: 0;
    padding: 20px;
}

.firstvisit-hero-center-image {
    display: block;
    margin: 0 auto;
    pointer-events: none;
    max-width: 100%;
    height: auto;
}

/* ===== Intro Overlay ===== */
.firstvisit-intro-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    pointer-events: none;
}

.firstvisit-intro-overlay canvas {
    display: block;
}

.firstvisit-hero-hidden {
    visibility: hidden;
}

@media (max-width: 767px) {

    /* 背景自体をフローに参加させる */
    .firstvisit-hero-bg,
    video.firstvisit-hero-bg,
    iframe.firstvisit-hero-bg {
        position: static !important;
        /* ← ここがポイント */
        width: 100%;
        height: auto;
        object-fit: contain !important;
    }

    /* div 背景画像の場合も高さが出るように */
    .firstvisit-hero-bg {
        background-size: contain !important;
        aspect-ratio: 16 / 9;
        /* 任意。比率が分かっていれば指定すると安定 */
    }

    /* 親は auto で OK */
    .wp-block-firstvisit-hero-media {
        height: auto !important;
    }
}