/*
 * modal.css  ―  STAND ALIVE  サブメニュー共通スタイル
 */


/* ============================================================
   モーダル外枠
   ============================================================ */

/* #modal本体：スクロール可能に（stylesheet.cssのposition:fixedはそのまま） */
#modal {
    overflow-y: auto;
}

#modal_header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(220, 220, 255, 0.95);
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#modal_titleFrame {
    max-width: 1100px;
    margin: 0 auto;
}

#modal_title {
    margin: 0;
    font-size: 22px;
    color: rgba(0, 0, 0, 0.88);
}

#modal_main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

#modal_contents {
    width: 100%;
}


/* ============================================================
   サブメニュー骨格（全 index.jsp 共通）
   ============================================================ */
#subMenues {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;     /* デスクトップではモーダル内でスクロール制御 */
}

#subMenueIndex {
    margin-left: 50px;
    width: fit-content;
    padding: 10px 20px;
    border-radius: 10px;
    background-color: rgba(255,255,255,0.6);
    box-shadow: 30px 30px 10px 10px rgba(0,0,0,0.5);
    position: relative;
    flex-shrink: 0;
}

#subMenueTitle {
    font-size: 35px;
    font-weight: bold;
}

.indexMenues {
    text-shadow: 5px 5px 5px rgba(255,0,255,0.5);
    padding-top: 0px;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}
.indexMenues:hover {
    text-shadow: 5px 5px 5px rgba(255,255,0,0.9);
    cursor: pointer;
}
.indexMenues:active {
    text-shadow: 5px 5px 5px rgba(255,0,255,0.5);
    cursor: pointer;
    padding-top: 5px;
    padding-bottom: 0px;
}

#subMenueIndex h2 {
    width: fit-content;
    margin-left: auto;
    margin-right: 0px;
}
#subMenueIndex h2:hover {
    margin-right: 10px;
}

#subMenueScreen {
    background-color: rgba(255,255,255,0.7);
    margin-left: 8px;
    margin-right: 8px;
    width: 90%;
    scroll-behavior: smooth;
    overflow-y: auto;          /* デスクトップ：右ペインのみスクロール */
    max-height: 100vh;
}

#screenTitle {
    margin-top: 10px;
    margin-left: 30px;
}

#subMenueSpace {
    margin-left: 30px;
    padding-bottom: 30px;
}

#itemPage {
    display: none;
    max-height: 98vh;
    overflow-y: auto;
    padding-right: 10px;
}

#return {
    width: fit-content;
    text-shadow: 10px 10px 5px rgba(255,0,0,0.5);
    transition: all 0.3s ease;
    margin-bottom: 0px;
    position: absolute;
    font-size: 40px;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
}
#return:hover {
    text-shadow: 10px 10px 5px rgba(255,255,0,0.9);
    cursor: pointer;
}
#return:active {
    text-shadow: 0px 0px 5px rgba(255,0,0,0.5);
    cursor: pointer;
    bottom: 60px;
}


/* ============================================================
   itemPage内：共通リセット
   ============================================================ */
#itemPage h1,
#itemPage h2,
#itemPage h3,
#subMenueSpace h1,
#subMenueSpace h2,
#subMenueSpace h3 {
    width: auto;
    height: auto;
    font-style: normal;
    color: rgba(0,0,0,0.92);
}

#itemPage p,
#subMenueSpace p {
    padding-bottom: 0;
}


/* ============================================================
   レスポンシブ
   ============================================================ */

/* ----- 991px以下：縦積みレイアウト ----- */
@media (max-width: 991px) {

    /* モーダル全体：縦スクロールで全コンテンツを見られるように */
    #modal {
        overflow-y: auto;
    }

    #subMenues {
        flex-direction: column;
        height: auto;
        min-height: 0;         /* 100vhを解除 */
        overflow: visible;
    }

    /* ---- ナビゲーションバー：fixed で画面上部に固定 ---- */
    #subMenueIndex {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
        box-shadow: 0 3px 10px rgba(0,0,0,0.25);
        padding: 8px 12px 10px;
        background-color: rgba(255,255,255,0.95);
        z-index: 150;          /* #modal(100)より手前 */
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-left: 0;
    }

    #subMenueTitle {
        font-size: 18px;
        font-weight: bold;
        color: rgba(0,80,180,0.9);
        border-bottom: 1px solid rgba(0,80,180,0.2);
        padding-bottom: 4px;
        margin-bottom: 2px;
    }

    /* メニュー項目：横スクロール対応の1行並び */
    .nav-items-row {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        align-items: center;
    }

    #subMenueIndex h1.indexMenues,
    #subMenueIndex h2.indexMenues {
        display: inline-block;
        margin: 0;
        padding: 4px 10px;
        font-size: 14px;
        font-weight: bold;
        border-radius: 20px;
        background: rgba(0,137,255,0.08);
        border: 1px solid rgba(0,137,255,0.25);
        color: rgba(0,80,180,0.9);
        text-shadow: none;
        transition: background 0.2s, color 0.2s;
        white-space: nowrap;
    }
    #subMenueIndex h1.indexMenues:hover,
    #subMenueIndex h2.indexMenues:hover {
        background: rgba(0,137,255,0.18);
        color: rgba(0,60,160,1.0);
        text-shadow: none;
        opacity: 1;
    }

    /* RETURNボタン：コンパクトに右端へ */
    #return {
        position: static;
        transform: none;
        font-size: 14px;
        font-weight: bold;
        color: rgba(200,0,0,0.8);
        text-shadow: none;
        padding: 4px 10px;
        border-radius: 20px;
        background: rgba(255,200,200,0.3);
        border: 1px solid rgba(200,0,0,0.25);
        display: inline-block;
        margin: 0;
        align-self: flex-end;
    }
    #return:hover {
        background: rgba(255,150,150,0.4);
        text-shadow: none;
        opacity: 1;
    }

    /* コンテンツエリア：fixedナビバーの高さ分だけ上に余白 */
    #subMenueScreen {
        width: 100%;
        margin: 0;
        padding-top: 110px;   /* ナビバーが2行になっても隠れないよう余裕を持たせる */
        max-height: none;
        overflow-y: visible;
        background-color: rgba(255,255,255,0.85);
    }

    #screenTitle {
        margin-left: 16px;
        font-size: 1.2em;
    }

    #subMenueSpace {
        margin-left: 12px;
        margin-right: 12px;
    }

    #itemPage {
        max-height: none;
        overflow-y: visible;
        padding: 0 12px 30px;
    }
}


/* ----- 600px以下：さらにコンパクトに ----- */
@media (max-width: 600px) {

    #subMenueTitle {
        font-size: 15px;
    }

    #subMenueIndex h1.indexMenues,
    #subMenueIndex h2.indexMenues {
        font-size: 12px;
        padding: 3px 8px;
    }

    #return {
        font-size: 12px;
        padding: 3px 8px;
    }

    #modal_title {
        font-size: 16px;
    }

    #modal_main {
        padding: 10px 12px 30px;
    }

    #screenTitle {
        margin-left: 8px;
        font-size: 1.05em;
    }

    #subMenueSpace {
        margin-left: 8px;
        margin-right: 8px;
    }
}
