@charset "UTF-8";

/* ==========================================================================
   グローバルナビゲーション
   ========================================================================== */

/* JSによるスクロールロック時に適用される共通クラス */
body.is-scroll-locked {
    overflow: hidden;
    padding-right: var(--scrollbar-compensation, 0px);
}

.main-nav {
    margin: 0 auto;
    background-color: #00759C;
    position: relative;
}

.main-nav>ul {
    margin: 0px;
    display: flex;
    justify-content: center;
    padding: 0;
    column-gap: 20px;
}

.main-nav>ul>li {
    list-style: none;
    position: relative;
    /* メガメニューの配置基準点とする */
}

.main-nav>ul>li>a {
    display: block;
    padding: 11px 15px 8px;
    color: #FFF;
    font-weight: bold;
    position: relative;
    /* border-bottom: solid 4px transparent; */
    text-decoration: none;
}

/* 項目間の区切り線 */
.main-nav>ul>li:not(:last-child)>a::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -11px;
    width: 1px;
    height: 24px;
    background-color: #D8D8D8;
}

.main-nav>ul>li.is-open>a {
    background-color: #4C9EB9;
    color: #002B3D;
}

.main-nav>ul>li.is-open>a::before {
    content: '';
    position: absolute;
    top: 100%;
    /* aタグの真下に配置 */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    /* 横幅20pxの半分 */
    border-right: 10px solid transparent;
    /* 横幅20pxの半分 */
    border-top: 11px solid #00759C;
    /* 縦幅と色 */
    z-index: 110;
}

/* PCでは開閉ボタンを非表示 */
.accordion-toggle {
    display: none;
}

/* ==========================================================================
   メガメニュー (PC)
   ========================================================================== */
.mega-menu {
    display: none;
    position: absolute;
    left: 0;
    /* 親要素(li)の左端に配置 */
    top: 100%;
    width: 620px;
    z-index: 100;
    box-sizing: border-box;
}

.main-nav>ul>li.is-open .mega-menu {
    display: block;
}

.mega-menu-content {
    display: block;
    background-color: #fffffff7;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mega-menu-column {
    flex: none;
}

.mega-menu-column ul {
    columns: 3;
    column-gap: 10px;
    padding: 12px 16px;
    list-style: none;
}

.mega-menu-column ul li a {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #555;
    position: relative;
}

.mega-menu-column ul li a::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background-color: #00759C;
    border-radius: 50%;
    margin-right: 8px;
}

.mega-menu-column ul li a::after {
    content: '';
    position: absolute;
    border: solid white;
    border-width: 0 2px 2px 0;
    padding: 3px;
    left: 8px;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ==========================================================================
   ハンバーガーメニュー (モバイル)
   ========================================================================== */
.hamburger-menu {
    display: none;
    cursor: pointer;
    padding: 15px;
    background: #0c446e;
    border: none;
    border-radius: 6px;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #FFF;
    margin: 5px 0;
    transition: 0.4s;
}

/* ==========================================================================
   レスポンシブ (992px以下)
   ========================================================================== */
@media screen and (max-width: 992px) {

    .hamburger-menu {
        display: block;
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 2000;
        transition: right 0.3s ease-in-out;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background-color: #e0e8f0;

        /* Flexboxをやめて通常のブロック要素としてスクロールさせる */
        display: block;
        box-sizing: border-box;

        padding-top: 60px;
        /* 上部の余白 */
        padding-bottom: 0;

        transition: left 0.4s ease-in-out;
        overflow-y: auto;
        margin: 0;
        z-index: 1900;
        border-radius: 0px;
    }

    .main-nav.active {
        left: 0;
    }

    /* --- HeaderUtility (モバイル用スタイル) --- */
    .main-nav #headerUtility {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 90%;
        /* 幅を画面に合わせる */
        max-width: 90%;
        margin: 0 auto 20px;
        padding: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }

    /* 右寄せを解除して中央揃えに */
    .main-nav .headerRight1,
    .main-nav .headerRight2 {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 15px;
    }

    .main-nav .headerRight1 {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .main-nav .headerRight2 {
        flex-direction: column-reverse;
        /* 検索窓を上に */
        width: 100%;
    }

    .main-nav .headerLink {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* 検索フォーム調整 */
    .main-nav #searchKeyword2 {
        width: 100%;
        margin-bottom: 0;
    }

    .main-nav #searchKeyword2 form {
        display: flex;
        width: 100%;
    }

    .main-nav #searchKeyword2 .search_ipt {
        width: 100%;
        display: flex;
    }

    .main-nav #searchKeyword2 input[type="text"] {
        flex: 1;
        height: 44px;
        /* タップしやすい高さ */
        box-sizing: border-box;
    }

    .main-nav #searchKeyword2 input[type="submit"] {
        height: 44px;
        width: 60px;
    }

    /* --- ここまで HeaderUtility --- */


    /* メニューリストのスタイル調整 */
    .main-nav>ul {
        flex-direction: column;
        width: 90%;
        /* 幅調整 */
        background-color: #FFF;
        border-radius: 6px;
        margin: 0 auto 100px;
        /* 中央揃え */
    }

    .main-nav>ul>li>a {
        padding: 15px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #333;
    }

    /* PC用の区切り線を非表示に */
    .main-nav>ul>li:not(:last-child)>a::after {
        content: '';
        background-color: transparent;
        width: auto;
        height: auto;
        position: static;
        transform: none;
    }

    /* モバイル用のアコーディオン開閉アイコン（旧a::afterを無効化） */
    .main-nav>ul>li:has(.mega-menu)>a::after {
        display: none;
    }

    /* 開閉ボタン（.accordion-toggle）のスタイル */
    .accordion-toggle {
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        /* タップ領域 */
        height: 50px;
        /* リンク行の高さに合わせる */
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 10;
        font-size: 0;
        /* テキスト「+」を隠す */
        background-color: #eef1f4;
    }

    .accordion-toggle::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid #0c446e;
        transition: transform 0.3s ease-in-out;
    }

    /* 開いたときのアイコン回転 */
    .accordion-toggle.open::after {
        transform: rotate(180deg);
    }

    .mega-menu {
        display: none;
        position: static;
        width: auto;
        transform: none;
        left: auto;
        max-width: none;
        box-shadow: none;
        border-top: none;
        padding: 10px;
        background-color: #EEF1F4;
    }

    .mega-menu-content {
        background-color: transparent;
        box-shadow: none;
    }

    .mega-menu-column ul {
        columns: 2;
        padding: 0;
        column-gap: 10px;
        text-align: left;
    }

    .mega-menu-column ul li {
        margin-bottom: 8px;
        display: block;
        width: 100%;
        break-inside: avoid-column;
        -webkit-column-break-inside: avoid;
    }

    .mega-menu-column ul li:last-child {
        margin-bottom: 0;
    }

    .mega-menu-column ul li a {
        display: block;
        background-color: #FFF;
        color: #333;
        text-decoration: none;
        padding: 6px 8px 6px 19px;
        border-radius: 5px;
        box-shadow: 2px 2px 0px #C7CACC;
        transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
        text-align: left;
    }

    .mega-menu-column ul li a::after {
        border-color: #0c446e;
    }

    .mega-menu-column ul li a::before {
        display: none;
    }

    .mega-menu-column ul li a:hover {
        background-color: #0c446e;
        color: #fff;
        border-color: #0c446e;
    }
}

/* --- スクロールロック時のfixed要素の位置補正 --- */
body.is-scroll-locked .hamburger-menu {
    right: calc(12px + var(--scrollbar-compensation, 0px));
}