/* ==========================================================================
   1. 共通・ベーススタイル（モバイルファースト：1279px以下）
   ========================================================================== */

/* ヘッダー全体のレイアウト */
.global-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    z-index: 1000;
}

.global-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.global-header .logo {
    max-width: 80%;
    height: min(var(--vw50), 56px);
    padding: 12px 0 0;
}

/* --- ハンバーガーメニューボタン --- */
.nav-toggle {
    /* flex関連を削除し、内部の基準として position: relative を指定 */
    position: absolute;
    right: 0;
    width: min(var(--vw50), 56px);
    height: min(var(--vw50), 56px);
    background: var(--gradation-navy);
    border: none;
    cursor: pointer;
    z-index: 100;
    /* padding も不要になるため削除 */
}

.nav-toggle span {
    display: block;
    position: absolute;
    /* 絶対配置に変更 */
    top: 50%;
    /* いったん縦中央に配置 */
    left: 50%;
    /* 横中央に配置 */
    transform: translate(-50%, -50%);
    /* 自身のサイズ分戻して完全に中央揃え */
    width: 60%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease-in-out;
}

/* 3本線の配置（中央からの距離を指定） */
.nav-toggle span:nth-child(1) {
    /* 完全に中央にいる状態から、上に8px移動 */
    transform: translate(-50%, -50%) translateY(-8px);
}

.nav-toggle span:nth-child(2) {
    /* 中央のまま */
}

.nav-toggle span:nth-child(3) {
    /* 完全に中央にいる状態から、下に8px移動 */
    transform: translate(-50%, -50%) translateY(8px);
}

/* ボタンアクティブ時（開いたとき）のクロスアニメーション */
.nav-toggle.is-active span:nth-child(1) {
    /* 中央（50%, 50%）の位置でそのまま45度回転 */
    transform: translate(-50%, -50%) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
    /* 中央（50%, 50%）の位置でそのまま-45度回転 */
    transform: translate(-50%, -50%) rotate(-45deg);
}


/* --- ナビゲーションメニュー（SP版） --- */
.gnav {
    opacity: 0;
    /* 初期状態は非表示 */
    position: absolute;
    top: 100%;
    left: -100%;
    width: 100%;
    border-top: 1px solid #eeeeee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    transition: .2s;
}

/* ハンバーガー開閉用クラス */
.gnav.is-active {
    opacity: 1;
    height: 100vh;
    padding: 0 0 10vh;
    overflow-y: scroll;
    left: 0;
}

.global-nav-list {
    width: 100%;
    margin: 0;
    padding: 0 min(var(--vw20), 20px);
    list-style: none;
    font-weight: bold;
}

.global-nav-list li {
    position: relative;
    border-bottom: 1px solid #707070;
}


.global-nav-list li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333333;
    font-size: 16px;
}


/* --- アコーディオン（子階層）のスタイル --- */
.menu-item-has-children>a {
    cursor: pointer;
}

/* サブメニューの器（JSで max-height を制御） */
.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9f9f9;

    /* JavaScriptの動作と干渉しないための初期値設定 */
    max-height: 0;
    overflow: hidden;
}

.sub-menu li {
    border-bottom: none;
    /* 子階層内の線は消去 */
}

.sub-menu li a {
    padding: 12px 20px 12px 40px;
    /* インデントを下げて子階層らしく */
    font-size: 14px;
    color: #666666;
}

.global-nav-list :is(.gnav-contact, .gnav-external-link) {
    width: min(80%, 300px);
    margin: min(var(--vw20), 20px) auto 0;
    border: none;
}

.global-nav-list :is(.gnav-contact a, .gnav-external-link a) {
    display: block;
    border-radius: 100px;
    padding: 10px 25px;
    text-align: center;
}

.global-nav-list .gnav-contact a {
    background: var(--gradation-navy);
    color: #fff;
}

.global-nav-list .gnav-external-link a {
    border: 1px solid var(--navy);
}


.gnav .list-lang {
    gap: 20px;
    margin: 30px 0 0;
}

.gnav .list-lang li:first-of-type a::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 12px;
    background: #707070;
    margin: 0 0 0 10px;
}

.gnav .list-lang li a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--st20);
}

/* メニューが開いているときに body に付与するクラス */
body.is-fixed {
    overflow: hidden;
}

/* ==========================================================================
   2. PC版スタイル（1100px以上）
   ========================================================================== */
@media screen and (min-width: 960px) {
    .gnav {
        flex-direction: column;
    }
}

@media screen and (min-width: 1100px) {

    .global-header-inner {
        min-width: 1000px;
        gap: 10px;
        padding: 10px 0;
    }

    .global-header .logo {
        width: min(27%, 328px);
        max-width: none;
    }

    /* ハンバーガーボタンを非表示 */
    .nav-toggle {
        display: none;
    }

    /* メニューを常時表示、レイアウトのリセット */
    .gnav {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-end;
        flex-shrink: 0;
        gap: 10px;
        width: auto;
        position: static;
        background: transparent;
        border-top: none;
        box-shadow: none;
        opacity: 1;
    }

    /* 親階層を横並びに */
    .global-nav-list {
        display: flex;
        align-items: center;
        gap: min(var(--vw6), 6px);
        padding: 0;
    }

    .global-nav-list li {
        border-bottom: none;
        /* 横並びのため下線を消去 */
    }

    .global-nav-list>li>a {
        padding: 10px 5px;
    }

    /* PC版のサブメニュー（絶対配置で下にドロップダウン） */
    .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: max-content;
        background: #ffffff;
    }

    .is-open .sub-menu {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 1px solid #eeeeee;
    }

    .sub-menu li a {
        padding: 12px 20px;
        /* PC版の子階層の余白調整 */
    }

    .global-nav-list :is(.gnav-contact, .gnav-external-link) {
        width: auto;
        margin: 0;
    }

    .global-nav-list :is(.gnav-contact a, .gnav-external-link a) {
        padding: 5px 25px;
    }

    .gnav .list-lang {
        margin: 0;
    }

    .gnav .list-lang li a {
        font-size: var(--st14);
    }

    .menu-item-has-children>a::before,
    .menu-item-has-children>a::after {
        display: none;
    }
}