/*------------------------------
	Header
------------------------------*/

#header {
    z-index: 1000;
}
#gnav-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#gnav-ul li a {
    text-decoration: none;
}
#gnav-ul .nav_btn img {
    width: auto;
    display: inline-block;
}
/* --- アイコンを白丸で囲む設定 --- */
.nav_ico {
    display: inline-flex;
    justify-content: center;
    width: 18px;  /* 丸のサイズ */
    height: 18px;
    border: 2px solid #fff; /* 白丸 */
    border-radius: 50%;     /* 正円にする */
    flex-shrink: 0;         /* 潰れないように固定 */
    margin-right: 15px;
    overflow: hidden;       /* 矢印がはみ出さないように */
    transition: background-color 0.3s ease;
    position: relative;
}
@media screen and (min-width: 768px) {
    .nav_ico {
        top: 5px;
    }
}

/* --- 矢印アイコン自体の設定 --- */
.nav_ico img {
    width: 4px;
    height: auto;
    display: block;
    transition: transform 0.3s ease; /* スライドのアニメーション設定 */
}

/* --- ホバー時にアイコンのみ右に5pxスライド --- */
#gnav-ul li a:hover .nav_ico img,
.gnav-btn a:hover .btn_ico img {
    transform: translateX(3px);
}

#gnav-btn-col {
    margin: auto;
    position: absolute;
    bottom: 0;
    width: 100%;
}
@media screen and (min-width: 768px) {
    #gnav-btn-col {
        left: 0;
        right: 0;
    }
}

.gnav-btn a {
    display: block;
    position: relative;
}

.btn_ico {
    display: inline-flex;
    justify-content: center;
    width: 54px;
    height: 22px;
    border: 2px solid #00205b; /* 白丸 */
    border-radius: 9999px;
    flex-shrink: 0;
    margin-right: 15px;
    overflow: hidden;
    transition: background-color 0.3s ease;
    position: absolute;
    right: 0;
    top: 35%;
}
@media screen and (min-width: 768px) {
    .gnav-btn .btn_ico {
        right: 0;
    }
}

.btn_ico img {
    width: 25px;
    height: auto;
    display: block;
    transition: transform 0.3s ease; /* スライドのアニメーション設定 */
}

@media screen and (max-width: 768px) {
    /* メインコンテンツの被り防止 */
    main { padding-top: 30px; }

    #header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #00205b;
        box-sizing: border-box;
        overflow: hidden;
    }

    #mobile-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 60px; /* 任意のヘッダー高 */
        padding: 0 5%;
    }

    #logoimg {
        position: relative;
        z-index: 1001;
    }
    /* ロゴのサイズ（390px時の44pxを基準に比率計算、または固定） */
    #logoimg img {
        width: 44px;
        height: auto;
    }

    /* ハンバーガーメニューボタン */
    #nav-toggle {
        position: relative;
        z-index: 1010; /* ナビゲーションより上に表示 */
    }

    .sp-nav-toggle {
        display: block;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        position: relative;
        cursor: pointer;
        padding: 0;
    }

    /* 三本線の設定 */
    .sp-nav-toggle span {
        display: block;
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: #fff; /* 平常時の線の色 */
        transition: all 0.3s ease-in-out;
        left: 0;
    }
    .sp-nav-toggle span:nth-child(1) { top: 0; }
    .sp-nav-toggle span:nth-child(2) { top: 11px; }
    .sp-nav-toggle span:nth-child(3) { bottom: 0; }

    /* メニュー展開時（×ボタンに変化） */
    .sp-nav-toggle.is-active span {
        background-color: #fff; /* 背景が青になるので線を白に */
    }
    .sp-nav-toggle.is-active span:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }
    .sp-nav-toggle.is-active span:nth-child(2) {
        opacity: 0; /* 中央の線を消す */
    }
    .sp-nav-toggle.is-active span:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }

    /* グローバルナビゲーション (ベタ背景色 #00205b) */
    #global-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #00205b;
        padding-top: 80px; /* ヘッダーと被らないように下げる */
        box-sizing: border-box;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(100%); 
        transition: transform 0.4s ease-in-out;
    }

    #global-nav.is-active {
        transform: translateX(0);
    }

    /* メニュー内のレイアウト */
    #gnav-ul li {
        margin-bottom: 20px;
        padding: 0 20px;
    }
    #gnav-ul li a {
        display: flex;
        align-items: center;
    }
    .nav_ico {
        margin-right: 15px;
        bottom: 5px;
    }
    #gnav-ul .nav_btn img {
        height: 36px;
    }
    .gnav-btn {
        width: 150px;
        margin: 0 5% 40px;
    }
}

@media screen and (min-width: 769px) {
    main, #primary, .site-main, footer { 
        margin-left: 180px; 
        padding: 0;
    }
    #header {
        position: fixed;
        top: 0;
        left: 0;
        width: 180px; /* PC時の横幅 */
        height: 100vh;
        background-color: #00205b;
    }
    #mobile-head {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 30px;
        height: 100%;
        box-sizing: border-box;
    }
    #logoimg {
        padding-top: 24px;
    }
    #nav-toggle {
        display: none;
    }
    #global-nav {
        display: block !important;
        transform: none !important; 
        position: static;
        width: 90%;
        margin: 40px auto 0;
        flex-grow: 1;
    }
    #gnav-ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    #gnav-ul li {
        margin-bottom: 20px;
        vertical-align: middle;
    }
    #gnav-ul .nav_btn img {
        height: 22px;
    }
    .gnav-btn {
        width: 150px;
        margin: 0 auto 20px;
    }
}

#footer {
    padding: 16px 0;
    background-color: #00205b;
}
#copy {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}
@media screen and (min-width: 769px) {
    #copy {
        font-size: 16px;
    }
}

/**
 * 1. 下層ページ共通設定（スマホ・PC共通）
 **/
#header.is-subpage {
    background-color: #fff !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    height: auto;
}

#header.is-subpage .nav-text-pc {
    display: none;
}
#header.is-subpage .nav-img-sp {
    display: flex;
    align-items: center;
}

/**
 * 2. スマホ表示時の設定 (max-width: 768px)
 **/
@media screen and (max-width: 768px) {
    #header.is-subpage .sp-nav-toggle span {
        background-color: #00205b;
    }
    #header.is-subpage .sp-nav-toggle.is-active span {
        background-color: #fff;
    }
    #header.is-subpage .sp-nav-toggle.is-active span {
        background-color: #00205b;
    }
    #header.is-subpage #global-nav {
        background-color: #00205b;
        margin-top: 60px;
        padding-top: 30px;
    }
    #header.is-subpage #gnav-btn-col {
        bottom: 60px;
    }
    #header.is-subpage .nav-img-sp .nav_ico {
        border-color: #fff;
    }
    #header.is-subpage .nav-img-sp .nav_btn img {
        height: 36px;
    }
}

/**
 * 3. PC表示時の設定 (min-width: 769px)
 **/
@media screen and (min-width: 769px) {
    /* TOPページ用の左マージンを解除 */
    body:not(.home) main,
    body:not(.home) #primary,
    body:not(.home) .site-main,
    body:not(.home) footer {
        margin-left: 0 !important;
    }
    body:not(.home) main {
        padding-top: 144px;
    }
    #header.is-subpage {
        height: 170px;
    }
    #header.is-subpage .inner {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 0 20px;
    }
    #header.is-subpage #mobile-head {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    #header.is-subpage #logo {
        margin: 0;
        padding-top: 0;
    }
    #header.is-subpage #global-nav {
        display: block !important;
        position: static !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0;
        background: none;
        transform: none !important;
    }
    #header.is-subpage #gnav-ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end;
        gap: 40px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    #header.is-subpage #gnav-ul li {
        margin: 0;
        white-space: nowrap;
    }
    #header.is-subpage .nav-img-sp {
        display: none !important;
    }
    #header.is-subpage .nav-text-pc {
        display: block;
        font-family: 'DIN Condensed', 'Oswald', sans-serif;
        font-size: 18px;
        font-weight: bold;
        color: #00205b;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        transition: opacity 0.3s;
    }
    #header.is-subpage .nav-text-pc:hover {
        opacity: 0.6;
    }
    #header.is-subpage #gnav-btn-col {
        display: none !important;
    }
}