@charset "utf-8";

/* --- レスンシブ制御 --- */

/* 1. スマホ表示（画面幅 768px 未満）のとき */
@media screen and (max-width: 670px) {
    /* 【修正】PC版用の float: right 固定を解除し、都庁トップの下に回るようにします */
    .ua_area {
        float: none !important;
        width: 100% !important;
        text-align: right !important; /* パーツを右寄せに */
        display: block !important;
    }

    /* 文字サイズ、配色、都庁トップリンクを横並びで維持 */
    #FontChange, 
    #ScreenColor, 
    .ua_area .header_link {
        display: inline-block !important;
        float: none !important;
        vertical-align: middle !important;
        margin-left: 8px !important;
    }

    /* 【修正】LANGUAGEボタンがある下の段(ua_under)も位置をリセット */
    .ua_under {
        position: static !important; /* common2.css のマイナスマージンなどを解除 */
        float: none !important;
        width: 100% !important;
        clear: both !important;
        text-align: right !important;
        display: block !important;
        margin-top: 5px !important;  /* 都庁トップとの上下の隙間 */
    }

    /* 【修正】LANGUAGEボタン自体を右端に配置し、都庁トップの真下へ回り込ませます */
    .custom-gt-switcher {
        display: inline-block !important; /* スマホでは非表示にせず、ここで位置を調整 */
        float: none !important;
        vertical-align: middle !important;
        position: relative !important;
        height: auto !important;
        margin-top: 5px !important;
    }

    /* スマホでドロップダウンを開いたとき、メニューが右画面外に飛び出さないよう調整 */
    .gt-menu {
        right: 0 !important;
        left: auto !important;
        top: 100% !important;
    }

    /* 元々あったスマホ用リスト（グローバルナビ内）は今回は非表示にするか、お好みで調整 */
    .sp_lang_switcher {
        display: none !important; 
    }
	
	/* JSでの開閉コントロール（LANGUAGEボタンクリック時） */
	.gt-menu.is-open {
		display: block !important; /* 最初は1列に縦並びさせるためblockにする */
		position: fixed !important;
		top: 60px !important;
        right: 10px !important;
        width: 90vw !important;
        max-width: 300px !important;
	}
}

/* 2. PC表示（画面幅 768px 以上）のとき */
@media screen and (min-width: 670px) {
    /* PC用の言語切替を表示する */
    .header_right .custom-gt-switcher {
        display: inline-flex !important;
    }
    
    /* スマホ用の言語切替を隠す */
    .sp_lang_switcher {
        display: none !important;
    }
	
	/* JSでの開閉コントロール（LANGUAGEボタンクリック時） */
	.gt-menu.is-open {
		display: block !important; /* 最初は1列に縦並びさせるためblockにする */
	}
}

/* --- 共通設定 --- */
.custom-gt-switcher, .sp_lang_switcher {
    font-family: sans-serif;
}

/* --- PC版：ヘッダー内のデザイン --- */
.custom-gt-switcher {
    position: relative;
    display: inline-flex; /* inline-blockより整列しやすい */
    align-items: center;
	float: right;
	height: 30px;        /* 検索窓と高さを揃える */
	margin-left: 0px;
	z-index: 100;

}

/* ボタンのデザイン */
.gt-btn {
    background: transparent;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    height: 100%;
    outline: none;
    /* 下線を絶対に出さない設定 */
    text-decoration: none !important; 
}

/* ホバー時の設定 */
.gt-btn:hover {
    /* 下線を消す */
    text-decoration: none !important;
    /* 代わりに少し透明度を下げるなど、反応を分かりやすくする場合（任意） */
    opacity: 0.7; 
}

.gt-icon {
    margin-right: 5px;
}

/* ==========================================
   PC版ドロップダウンメニュー全体（外枠）
   ========================================== */
.gt-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none !important;
    padding: 5px 0 !important;
    margin: 5px 0 0 !important;
    z-index: 99999;
    
    /* 最初の7言語が表示される時の横幅 */
    width: 240px !important; 
    
    /* 【二重スクロール防止】外枠のスクロールは完全に禁止 */
    max-height: none !important;
    overflow: visible !important;
}



/* メニュートップ内のすべてのliの基本リセット */
.gt-menu li {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ------------------------------------------
   各言語のリンク（a）のデザイン（主要・100語共通）
   ------------------------------------------ */
.gt-menu li a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 15px;
    text-decoration: none;
    color: #333 !important;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
    white-space: nowrap !important; /* 言語名が途中で改行されて崩れるのを防ぐ */
}

.gt-menu li a:hover {
    background: #005bb7;
    color: #fff !important;
}

/* ------------------------------------------
   「もっと見る」ボタンのデザイン
   ------------------------------------------ */
.gt-btn-more-container {
    border-bottom: 1px solid #eee;
}
.gt-btn-more {
    display: block !important;
    width: 100% !important;
    padding: 12px 15px !important;
    background: #f9f9f9 !important;
    color: #005bb7 !important;     /* 都教委のテーマカラー青 */
    font-weight: bold !important;
    border: none !important;
    text-align: center !important;
    cursor: pointer !important;
    font-size: 13px !important;
}
.gt-btn-more:hover {
    background: #f0f0f0 !important;
}

/* ==========================================
   残りの100言語エリアの設定（ここだけスクロール）
   ========================================== */
/* 初期状態：もっと見るを押す前は完全に非表示 */
.gt-more-langs-wrapper {
    display: none !important;
    width: 100% !important;
}
#pc-more-langs {
    display: none !important;
}

/* ------------------------------------------
   「もっと見る」が押されて展開されたときのスタイル
   ------------------------------------------ */
/* 100言語展開時は、メニュー全体の横幅を広げる */
.gt-menu.has-more-open {
    width: 460px !important; 
}

/* 展開時：100言語を包む特別なラッパーを表示 */
.gt-menu.has-more-open .gt-more-langs-wrapper {
    display: block !important;
}

/* 展開時：100言語のリストを「2列のスクロール付き」にする */
.gt-menu.has-more-open #pc-more-langs {
    display: flex !important;       /* 2列並び（flex）を有効化 */
    flex-wrap: wrap !important;     /* 枠幅を超えたら次の列へ折り返す */
    list-style: none !important;
    padding: 5px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;

    /* 【一本化】スクロールバーをここだけに限定出現させる */
    max-height: 320px !important;   /* 100言語エリアの最大高さ */
    overflow-y: auto !important;    /* 縦スクロールバーを出す */
}

/* 100言語エリアの中のli（綺麗に左右50%ずつに割る） */
.gt-menu.has-more-open #pc-more-langs li {
    width: 50% !important;         /* 2列並び（1行に2言語） */
    float: left !important;
    clear: none !important;        /* 横並びを許可するためクリアを解除 */
    display: block !important;
}




/* ==========================================
   --- スマホ版：メニュー内（gnav_f）のデザイン ---
   ========================================== */
.sp_lang_switcher {
    margin: 20px 0;
    padding: 15px 10px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.sp_lang_label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    display: block;
}

/* 言語リストの土台：ここをスクロールできるようにします */
.sp_lang_list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;            /* ボタン同士の隙間を少しタイトに */
    list-style: none !important;
    padding: 5px !important;
    margin: 0 !important;
    
    /* 【スマホ用100言語対応】
       画面が下まで伸び続けないよう、高さを制限して
       この枠内だけでスクロールできるようにします。
    */
    max-height: 280px !important;  /* スマホ画面で邪魔にならない絶妙な高さ */
    overflow-y: auto !important;   /* 縦スクロールバーを有効化 */
    -webkit-overflow-scrolling: touch; /* iPhoneなどで滑らかにスクロールさせる設定 */
}

/* 各言語の項目（li）：スマホの画面幅に合わせて「3列並び」にする */
.sp_lang_list li {
    /* 3分割（33.33%）から隙間（gap）の分を引いて、綺麗に3列に収めます */
    width: calc(33.33% - 4px) !important; 
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    float: none !important;
}

/* 各言語のボタン（a）のデザイン（既存の美しい形をベースに最適化） */
.sp_lang_list li a {
    display: block !important;
    background: #f2f2f2;           /* 薄いグレーのボタン */
    color: #333 !important;
    text-align: center !important;
    padding: 10px 4px !important;  /* 3列でも文字がはみ出さないように上下左右を調整 */
    text-decoration: none;
    font-size: 12px !important;    /* 多くの言語が収まるように少し小さめに */
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box !important;
    
    /* 言語名が長すぎる場合にボタンを突き破るのを防ぐ設定 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important; /* 万が一入り切らない場合は「...」にする安全弁 */
}

/* タップされたとき（都教委テーマカラーの青に変化） */
.sp_lang_list li a:active,
.sp_lang_list li a:hover {
    background: #005bb7 !important;
    color: #fff !important;
    border-color: #005bb7 !important;
}

/* --- 免責事項バーのスタイル（強化版） --- */
.gt-disclaimer-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.9) !important; /* 少し濃くして視認性アップ */
    color: #fff !important;
    padding: 12px 20px !important;
    /* z-indexを最大級に。他のどんな要素よりも上に表示させます */
    z-index: 2147483647 !important; 
    font-size: 14px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    /* 最初はJSで判定されるまで表示させないための初期値（JS側で block に書き換えます） */
    display: none; 
}

.gt-disclaimer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* スマホ用の調整 */
@media screen and (max-width: 767px) {
    .gt-disclaimer-inner {
        flex-direction: column;
        text-align: left;
    }
    .gt-disclaimer-bar {
        padding: 15px !important;
    }
}