@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    font-weight: normal;
    font-family: "Zen Kurenaido", sans-serif;
}

:root {
    --white: #FFFFFF;
    --another: #FFFFFF26;
    --green: #68CE81;
    --red: #FF6565;
}

/* common KM  */
.centering {
    width: 1080px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

html {
    scroll-behavior: smooth;
}

/* ********** */

body {
    background: linear-gradient(to right bottom, #71DD8C, var(--red))no-repeat;
    padding-top: 100px;
    animation: fadeIn 1.5s ease-out forwards;
}

header {
    height: 100px;
    background-color: var(--another);
    display: flex;
    justify-content: center;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 999;
}

#header_wrap {
    width: 1080px;
    display: flex;
    justify-content: space-between;
}

/* stage_main km */
.p_title {
    text-align: center;
    margin: 50px 0 50px;
    color: var(--white);

    &::before {
        content: url(../img/stage_kazari_01.png);
        vertical-align: middle;
        margin-right: 1em;
    }

    &::after {
        content: url(../img/stage_kazari_01.png);
        vertical-align: middle;
        margin-left: 1em;
    }
}

.stage {
    display: flex;
    justify-content: space-between;
    margin-bottom: 129px;
}

.time_schedule {
    width: 1080px;
    background-color: rgb(255, 255, 255, .5);
    border-radius: 50px;
    margin-bottom: 129px;

    p {
        text-align: center;
        padding: 30px;
        font-size: 36px;
    }

    dl {
        width: 80%;
        margin: 0 auto;
        padding-bottom: 50px;
        font-size: 24px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        text-indent: 0.5em;
    }

    dt,
    dd {
        height: 40px;
        line-height: 40px;
        border-bottom: 1px dotted black;

        span {
            font-size: 18px;
            text-decoration: underline;
        }
    }

    /* 4番目の要素（有志ステージ）の高さ調整 */
    dt:nth-of-type(4),
    dd:nth-of-type(4) {
        /* height: 160px; */
        height: 200px;
    }

    dt {
        flex-basis: 10%;
    }

    dd {
        flex-basis: 85%;

        ol {
            display: block;

            li {
                color: black;
                text-indent: 1em;
                height: 40px;
            }
        }
    }
}


.stage_document {
    padding-left: 185px;
    position: relative;
}

.kazari_02 {
    position: absolute;
    left: 0;
    top: -30px;
}

.stage_time,
.stage_title,
.stage_discription {
    position: relative;
    z-index: 100;
}

.stage_time {
    margin-top: 35px;
}

.stage_title {
    margin-top: 10px;
    font-size: 36px;
}

.stage_discription {
    width: 400px;
    margin-top: 30px;
    line-height: 1.5;
}

.stage_photo {
    padding-right: 145px;
    position: relative;

    div {
        width: 300px;
        height: 400px;
        background-color: lightgray;
        
        img {
            position: relative;
            object-fit: cover;
            object-position: center;
            width: 100%;
            height: 100%;
            z-index: 10;
        }
    }
}

/* 装飾関係 */
.kazari_06a { position: absolute; left: -30px; top: -30px; }
.kazari_03 { position: absolute; right: 0; bottom: -49px; }
.kazari_04 { position: absolute; right: 0; top: -30px; }
.kazari_06b { position: absolute; top: -30px; left: 112px; }
.kazari_05 { position: absolute; left: 0; bottom: -42px; }
.kazari_07 { position: absolute; bottom: 0; right: 0; }
.top_kazari_02 { position: absolute; left: -100px; bottom: 0; }

.reverse {
    flex-direction: row-reverse;

    .stage_document {
        padding-left: 0;
        padding-right: 57px;
    }

    .stage_discription {
        width: 520px;
    }

    .stage_photo {
        padding-left: 142px;
        padding-right: 0;
    }
}

.stage:last-child {
    margin-bottom: 227px;
}

/* トップへ戻るボタン */
#scroll {
    position: fixed;
    right: 5%;
    bottom: 20px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

#scroll.is-show {
    opacity: 1;
    pointer-events: auto;
}

/* ********************************** */

footer {
    background-color: var(--another);
    height: 400px;
    position: relative;
}

h5 {
    margin-right: auto;
    margin: 0 0 15px 180px;
    padding-top: 150px;
}

footer a {
    color: var(--white);
    font-size: 20px;
    text-decoration: underline;
    text-decoration-color: var(--white);
    margin-left: 330px;
}

footer p {
    color: var(--white);
    font-size: 16px;
    margin-top: 15px;
    margin-left: 210px;
    line-height: 1.5;
}

h1 {
    padding: 23px 0 26px;
}

/* ロゴアニメーション */
@keyframes logoSway {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(5deg); }
    20% { transform: rotate(-5deg); }
    30% { transform: rotate(5deg); }
    40% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

header h1 img {
    animation: logoSway 4s ease-in-out infinite;
    transform-origin: center center;
    will-change: transform;
}


ul {
    display: flex;
    gap: 55px;
    line-height: 100px;
    margin-left: auto;

    li {
        color: var(--white);
        font-size: 20px;

        a {
            position: relative;
        }

        a::after {
            content: "";
            position: absolute;
            display: block;
            left: 0;
            bottom: -3px;
            width: 100%;
            height: 2px;
            background-color: #FFFFFF;
            transform: scaleX(0);
            transform-origin: center;
            transition: transform 0.4s ease-in-out;
        }

        a:hover::after {
            transform: scaleX(1);
        }
    }
}

#map iframe {
    position: absolute;
    height: 350px;
    top: 7%;
    right: 10%;
    width: 600px;
}


/* 装飾画像アニメーション */
@keyframes random-fade {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.kazari_02 { animation: random-fade 4s ease-in-out infinite; }
.kazari_03 { animation: random-fade 3s ease-in-out infinite 1.2s; }
.kazari_04 { animation: random-fade 5s ease-in-out infinite 0.5s; }
.kazari_05 { animation: random-fade 3.5s ease-in-out infinite 2s; }
.top_kazari_02 { animation: random-fade 4.5s ease-in-out infinite 0.8s; }
.top_kazari_06 { animation: random-fade 3.2s ease-in-out infinite 1.5s; }
.stage_kazari_07 { animation: random-fade 5.5s ease-in-out infinite; }
.kazari_06a { animation: random-fade 4.2s ease-in-out infinite 2.5s; }


/* =================================================
   レスポンシブ対応（修正版）
   ================================================= */

img {
    max-width: 100%;
    height: auto;
}

/* -------------------------------------------------
   【iPad・タブレット】
   画面幅 1100px 以下
   ------------------------------------------------- */
@media screen and (max-width: 1100px) {
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    #header_wrap,
    .centering,
    .time_schedule,
    footer {
        width: 100% !important;
        padding-left: 5%;
        padding-right: 5%;
        box-sizing: border-box;
    }
    
    .centering {
        margin: 0 auto;
    }

    ul {
        gap: 20px;
    }

    .stage {
        width: 100%;
        gap: 30px;
        align-items: center;
    }
    
    .stage_document {
        padding-left: 0;
    }
    .stage_photo {
        padding-right: 0;
    }
    
    /* Footer調整 (タブレットでも地図が重ならないように) */
    footer {
        height: auto;
        padding-bottom: 50px;
    }
    #map iframe {
        /* タブレットでは少し小さく、でも絶対配置維持で調整 */
        width: 40%;
        right: 5%;
    }
    h5, footer p, footer a {
        /* マップに被らないよう左寄せ維持 */
    }
}

/* -------------------------------------------------
   【iPhone・スマホ】
   画面幅 768px 以下
   ------------------------------------------------- */
@media screen and (max-width: 768px) {

    /* --- ヘッダー --- */
    header {
        height: auto !important;
        padding-bottom: 10px;
        position: relative;
    }

    body { padding-top: 0 !important; }

    #header_wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    h1 { padding: 10px 0; }
    h1 img { max-width: 200px; }

    ul {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        line-height: 2;
        margin: 0;
    }

    /* --- STAGE コンテンツ --- */

    h3.p_title {
        font-size: 32px;
        margin: 30px 0;
    }
    
    .time_schedule p { font-size: 24px; }
    
    .time_schedule dl {
        width: 100%;
        font-size: 16px;
        display: block;
    }
    
    .time_schedule dt, .time_schedule dd {
        display: block;
        width: 100%;
        height: auto;
        border: none;
        margin-bottom: 10px;
    }
    
    .time_schedule dt {
        font-weight: bold;
        background: rgba(255,255,255,0.5);
        padding: 5px;
    }

    /* --- 各ステージ紹介（重要修正箇所） --- */
    
    /* .stage も .reverse も強制的に縦積みにする */
    .stage, .reverse {
        display: flex;
        flex-direction: column !important; /* 強制縦並び */
        align-items: center; /* 中央揃え */
        margin-bottom: 80px;
        gap: 30px; /* テキストと写真の間隔 */
        width: 100%;
    }

    /* --- テキストエリア（順番を変更） --- */
    .stage_document {
        width: 90%;
        margin: 0 auto;
        padding: 0;
        text-align: left;
        /* order: 2; を削除し、HTMLの記述順（先頭）に戻す */
    }

    .stage_title {
        font-size: 24px;
        text-align: center;
        margin-bottom: 15px;
    }

    .stage_discription {
        width: 100%;
        max-width: 100%;
        font-size: 15px;
        line-height: 1.8;
    }

    /* --- 写真エリア（順番と表示方法を変更） --- */
    .stage_photo {
        width: 100%;
        padding: 0;
        display: flex;
        justify-content: center;
        /* order: 1; を削除し、HTMLの記述順（後方）に戻す */
    }
    
    .stage_photo div {
        width: 90%; /* 写真の枠を少し広げる */
        height: auto; /* 【重要】高さを固定せず、画像に合わせて自動調整 */
        aspect-ratio: 3 / 4; /* 【任意】もし枠の比率を固定したい場合は指定（例：3:4） */
        background-color: transparent; /* 背景色を透明に（トリミングされなくなったため） */
    }

    .stage_photo div img {
        /* 【重要】ここを変更 */
        object-fit: contain; /* cover から contain に変更。全体が収まるように縮小表示 */
        width: 100%;
        height: 100%;
    }

    /* 装飾画像を控えめに */
    .kazari_02, .kazari_03, .kazari_04, .kazari_05, 
    .top_kazari_02, .top_kazari_06, .stage_kazari_07, .kazari_06a, .kazari_06b {
        transform: scale(0.6);
        z-index: -1;
        opacity: 0.5; 
    }
    .kazari_02 { top: -10px; left: -10px; }

    
    /* --- フッター（地図） --- */
    footer {
        height: auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 40px;
    }

    h5 {
        margin: 0;
        padding: 40px 0 20px;
        text-align: center;
    }
    
    footer a {
        margin: 0 0 20px 0;
        display: block;
        text-align: center;
    }
    
    footer p {
        margin: 0 0 30px 0;
        text-align: center;
    }

    #map {
        position: relative;
        width: 90%;
        height: 300px;
        margin: 0 auto;
    }
    
    #map iframe {
        position: static;
        width: 100%;
        height: 100%;
    }
}