/*
Theme Name:        REALIZER child
Theme URI:         https://www.fuji-production.jp/wordpress-theme-realizer/
Author:            FUJI PRODUCTION
Author URI:        https://www.fuji-production.jp
Version:           1.0.0
Template:          realizer
Textdomain:        realizer-child
*/

/* ==========================================================================
 *  トップページ表示時のチラつき（FOUC）完全防止設定
 * ========================================================================== */

 body.home {
    opacity: 0;
}

body.home.op-initialized {
    opacity: 1;
}

/* ==========================================================================
 *  1. トップページ オープニング演出（クロスフェード版）
 * ========================================================================== */

 #opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--wp--preset--color--custom-color-1, #0075be);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 1.2s ease, opacity 1s ease;
}

#opening-overlay.is-logo-phase {
    background-color: var(--wp--preset--color--realizer-base, #fbfbfb);
}

.opening-text-wrap {
    text-align: center;
    padding: 20px;
    transition: opacity 0.8s ease;
}

.opening-text-wrap.fade-out {
    opacity: 0;
}

.op-txt {
    letter-spacing: 0.1em;
    color: #ffffff;
    opacity: 0;
    margin: 0;
    font-size: clamp(1.743rem, 1.743rem + ((1vw - 0.2rem) * 2.095), 3rem);
    font-weight: bold;
    line-height: 1.25;
}

.op-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.op-char.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.opening-logo-wrap {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.opening-logo-wrap.is-active {
    opacity: 1;
}

.op-logo-sub-text {
    font-size: clamp(1.1rem, 0.85rem + 1.25vw, 1.75rem);
    font-weight: 500;
    color: #333333;
    letter-spacing: 0.15em;
    margin: 0 0 16px 0;
    line-height: 1.4;
    white-space: nowrap;
}

.op-logo-main-box {
    width: 571px;
    max-width: 90vw;
}

.op-logo-img {
    width: 100%;
    height: auto;
    display: block;
}

.op-logo-text {
    font-size: 2rem;
    font-weight: bold;
    color: #333333;
}

#opening-overlay.hide-all {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
 *  2. カバーブロック内：スクロール促進アニメーション
 * ========================================================================== */

 div.wp-block-cover {
    position: relative !important;
}

div.wp-block-cover > .scrolldown-container {
    position: absolute !important;
    bottom: 3.5rem !important;
    left: 50% !important;
    z-index: 10 !important;
    width: 100px !important;
    height: 100px !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    animation: bounceScrollAll 2s infinite ease-in-out;
}

.scrolldown-text {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #ffffff;
    margin: 0 0 6px 0 !important;
    line-height: 1;
    display: block !important;
}

.scrolldown-arrow {
    display: inline-block !important;
    width: 2px;
    height: 30px;
    background-color: #ffffff;
    position: relative !important;
}

.scrolldown-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    transform: rotate(45deg);
}

@keyframes bounceScrollAll {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* ==========================================================================
 *  3. 任意要素のフェードイン ＆ 時間差（ディレイ）バリエーション
 * ========================================================================== */

 /* デフォルト（PC画面）：高級感を出すために1秒かけて優雅に表示 */
.inv-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}
.inv-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.inv-fade-up.delay-1 { transition-delay: 0.2s; }
.inv-fade-up.delay-2 { transition-delay: 0.4s; }
.inv-fade-up.delay-3 { transition-delay: 0.6s; }
.inv-fade-up.delay-4 { transition-delay: 0.8s; }
.inv-fade-up.delay-5 { transition-delay: 1.0s; }
.inv-fade-up.delay-6 { transition-delay: 1.2s; }
.inv-fade-up.delay-7 { transition-delay: 1.4s; }
.inv-fade-up.delay-8 { transition-delay: 1.6s; }
.inv-fade-up.delay-9 { transition-delay: 1.8s; }
.inv-fade-up.delay-10 { transition-delay: 2.0s; }

/* スマートフォン（横幅767px以下）用のスピード最適化 */
@media screen and (max-width: 767px) {
    .inv-fade-up {
        /* スマホの高速スクロールに合わせて、表示スピードを「0.5秒」に高速化 */
        transition-duration: 0.5s !important;
        transform: translateY(20px); /* 浮き上がる距離も少し短くしてサクサク感アップ */
    }

    /* スマホに合わせて時間差（ディレイ）の間隔も半分にギュッと凝縮 */
    .inv-fade-up.delay-1 { transition-delay: 0.1s; }
    .inv-fade-up.delay-2 { transition-delay: 0.2s; }
    .inv-fade-up.delay-3 { transition-delay: 0.3s; }
    .inv-fade-up.delay-4 { transition-delay: 0.4s; }
    .inv-fade-up.delay-5 { transition-delay: 0.5s; }
    .inv-fade-up.delay-6 { transition-delay: 0.6s; }
    .inv-fade-up.delay-7 { transition-delay: 0.7s; }
    .inv-fade-up.delay-8 { transition-delay: 0.8s; }
    .inv-fade-up.delay-9 { transition-delay: 0.9s; }
    .inv-fade-up.delay-10 { transition-delay: 1.0s; }
}

/* ==========================================================================
 *  ブランドロゴ自動スクロールセクション（サイズ ＆ ホバー停止無効化）
 * ========================================================================== */

/* 自動スクロールするロゴ画像の横幅を一括指定 */
.wp-block-gallery.is-style-loop-slide-right-to-left .wp-block-image {
    width: 128px !important;
}

/* ギャラリーにマウスが乗っても、強制的にアニメーションを動かし続ける */
.wp-block-gallery.is-style-loop-slide-right-to-left:hover {
    animation-play-state: running !important;
}

/* 親要素（グループ）のホバーによって中身が止まる設定がある場合も考慮し、上書きして動かし続ける */
.wp-block-group:hover .wp-block-gallery.is-style-loop-slide-right-to-left {
    animation-play-state: running !important;
}