/**
 * ステップアップブロック
 * stepup_01_base.png + stepup_01_label_01〜04.png を stepup_image.png に合わせて配置
 * 各ラベル: Y軸回転。1→2→3→4を0.5秒間隔で順に1回転、4終了後2秒待ってから1から繰り返し
 */

.stepup-block {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.stepup-wrap {
    position: relative;
    width: 100%;
    overflow: visible;
    border-radius: 4px;
}

.stepup-base-wrap {
    position: relative;
    width: 100%;
}

.stepup-base {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

/* ラベル層：.stepup-base-wrap 内に配置し、ベース画像と同じ座標系で % 配置 */
.stepup-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    perspective: 1000px;
}

.stepup-label-link {
    position: absolute;
    pointer-events: auto;
    display: block;
    text-decoration: none;
    overflow: hidden;
    transform-style: preserve-3d;
}
/* img を直接モーダルトリガーにする場合 */
.stepup-label-trigger .stepup-label-part,
.stepup-label-trigger img {
    cursor: pointer;
}

/* 位置確認用.jpg 準拠：各ステップ上面の真上にラベル、縦間隔は1・2・3で揃え、4は最上部 */
/* ベースが左下→右上に上がるため、ラベル1が一番下・ラベル4が一番上になるよう配置 */
.stepup-label-1 { left: 5%;  top: 36.4%; width: 22%; height: 16%; }
.stepup-label-2 { left: 27.6%; top: 23.8%; width: 22%; height: 16%; }
.stepup-label-3 { left: 50.1%; top: 11.5%; width: 22%; height: 16%; }
.stepup-label-4 { left: 71.7%; top: -6.68%; width: 24%; height: 27.5%; }

/* ホバー・フォーカス時は枠を出さず、そのままクリッカブル */
.stepup-label-link:hover,
.stepup-label-link:focus,
.stepup-label-link:focus-visible {
    outline: none;
    box-shadow: none;
}
.stepup-label-link {
    cursor: pointer;
}
.stepup-label-placeholder {
    cursor: default;
    pointer-events: none;
}

/* ラベル画像をエリアいっぱいに表示し、Y軸回転アニメーション（1→2→3→4を0.5秒間隔、4終了後2秒待って繰り返し） */
.stepup-label-part {
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: stepup-rotate-y 4s ease-in-out infinite;
}

/* 1: 0s / 2: 0.5s / 3: 1s / 4: 1.5s から開始 */
.stepup-label-1 .stepup-label-part { animation-delay: 0s; }
.stepup-label-2 .stepup-label-part { animation-delay: 0.5s; }
.stepup-label-3 .stepup-label-part { animation-delay: 1s; }
.stepup-label-4 .stepup-label-part { animation-delay: 1.5s; }

.stepup-label-part img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    vertical-align: middle;
}

/* 1サイクル4秒: 0〜0.5sで1回転(0→360deg)、残り3.5sは360degキープ。4が終わった後2秒(2s〜4s)待ってループ */
@keyframes stepup-rotate-y {
    0%    { transform: perspective(800px) rotateY(0deg); }
    12.5% { transform: perspective(800px) rotateY(360deg); }
    100%  { transform: perspective(800px) rotateY(360deg); }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .stepup-block {
        padding: 0 0.75rem;
    }

    .stepup-label-1 { left: 5%; top: 36.5%; width: 22%; height: 16%; }
    .stepup-label-2 { left: 27.5%;  top: 23.9%;  width: 22%; height: 16%; }
    .stepup-label-3 { left: 50.1%; top: 11.5%; width: 22%; height: 16%; }
    .stepup-label-4 { left: 71.7%; top: -6%;  width: 24%; height: 26.5%; }

    @keyframes stepup-rotate-y {
        0%    { transform: perspective(600px) rotateY(0deg); }
        12.5% { transform: perspective(600px) rotateY(360deg); }
        100%  { transform: perspective(600px) rotateY(360deg); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .stepup-label-part {
        animation: none;
        transform: perspective(800px) rotateY(12deg);
    }
}
