/* 全体レイアウト */
* {
	margin: 0;
	padding: 0;
}
body {
	margin: 0;
	padding: 0;
	color: #000;
	background-color: #eee;
	font-family: sans-serif;

}
#container {
	margin: 0 auto;
	max-width: 960px;
	height: auto;
	padding: 0.5em;
	box-shadow: 0px 0px 5px #2B3C45;
	background-color: #fff;
}
@media screen and (max-width: 768px) {
	#container { padding: 0; }
}
main { margin: 1em; }
@media screen and (max-width: 480px) {
	main { margin: 0.5em; }
}
header { padding-bottom: 1em; }
#pageFooter {
	clear: both;
	color: #777;
	padding: 0.5em;
	text-align: center;
}

/* ナビゲーション */
.logo_lab { float: left; }
.logo_iisec { float: right; }
/* iPhone SE サイズでロゴが2行に渡るのを回避する */
@media screen and (max-width: 360px) {
	.logo_lab img { width: 93px; }
	.logo_iisec img { width: 174px; }
}
#language {
	text-align: right;
	margin-bottom: 0.5em;
}

/* メニュー */
#menu {
	list-style-type: none;
	padding: 0;
	margin: 0;
	text-align: center;
}
#menu li {
	padding: 0;
	font-size: 125%;
	font-weight: bold;
	line-height: 1.2;
	background-color: #366;
}
/* iPhone SE サイズで英語のメニューが見きれるのを回避する */
@media screen and (max-width: 360px) {
	#menu li { font-size: 100%; }
}
#menu li a {
	display: block;
	padding: 0.4em 0.1em;
	color: #fff;
	text-decoration: none;
}
#menu li a:hover {
	color: #3d0;
}
#menu li a { transition: all 0.25s; }

#menu {
    clear: both;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

#menu li {
    width: auto;
    flex: 1 1 max-content;
}

#menu li a {
    white-space: nowrap;
}

/* 共通 */
h1, h2, h3 {
	line-height: 1.2;
}
h1 {
	margin: 0;
	color: #336666;
	font-size: 250%;
}
@media screen and (max-width: 480px) {
	h1 { font-size: 200%; }
}
h2 { margin: 1em 0 0 0; font-size: 150%; }
h3 { margin: 1em 0 0 0; font-size: 120%; }
p, li { line-height: 1.5; }
a {
	color: #0000CC;
	text-decoration: underline;
}
a:hover, a:active { color: #CC0000; }
a:visited { color: #800080; }
a img { border: none; }
/* PDF へのリンクの冒頭 PDF アイコンを挿入する */
a[href$=".pdf"]:before {
	content: "";
	display: inline-block;
	width: 24px;
	height: 24px;
	background-image: url(http://lab.iisec.ac.jp/~goto_lab/image/pdf_icon_24x24.png);
	vertical-align: middle;
}

ul { margin-left: 2em; }
figure { margin: 0; }
figure img { margin: 0 auto; }
figcaption {
	text-align: center;
	font-size: 120%;
	font-weight: bold;
}
img.bookcover { float: right; }

/* できごと */
.event {
	padding: 1em 0;
	border-top: 1px solid #A5A5A5;
}
.event h2 {
	margin-top: 0;
}
.event h3 {
	margin-left: 2em;
	text-indent: -1em;
}
.event p {
	margin-left: 3em;
}

/* メンバー */
.member {
	padding: 1em 0;
	border-top: 1px solid #A5A5A5;
}
.member h2 {
	margin-top: 0;
}
.member h3 {
	margin-top: 1em;
}
.member td.name {
	white-space: nowrap;
}
@media screen and (max-width: 320px) {
	.member td.name { white-space: normal; }
}

/* Security Goals */
#security_goals div img {
	margin: 4px auto;
}

/* 公開資料 */
.publication {
	padding: 1em 0;
	border-top: 1px solid #A5A5A5;
}
.publication h2 {
	margin-top: 0;
}
.publication ul li {
	margin: 1em 0;
}

/* 振り返り */
.topic {
	padding: 1em 0;
	border-top: 1px solid #A5A5A5;
}
.topic h2 {
	margin-top: 0;
}
.topic dl {
	margin-left: 1em;
}
.topic dt {
	font-size: 120%;
	font-weight: bold;
}
.topic dd {
	margin-left: 2em;
}
/* Catchup画像の表示調整 */
.index .pure-img {
    margin: 1em 0; /* 上下に適度な余白を作る */
}
/* スマホ画面での英語メニュー表示の最適化 */
@media screen and (max-width: 480px) {
	#menu li {
		font-size: 85%; /* 文字サイズを少し小さくして収める */
	}
	#menu li a {
		padding: 0.4em 0.05em; /* 左右の余白を詰めてはみ出しを防止 */
		white-space: nowrap;  /* 文字の意図しない改行を防ぐ */
	}
}
/* スマホ画面でメニューを画面横幅いっぱいに広げる設定 */
@media screen and (max-width: 480px) {
	/* メニュー自体の横幅を100%に広げる */
	#menu {
		width: 100%;
		margin: 0;
		padding: 0;
	}

	/* 1文字ずつの余白と文字サイズを最適化 */
	#menu li {
		font-size: 90%; /* 読みやすい大きさに維持 */
	}

	#menu li a {
		padding: 0.5em 0.1em; /* タップしやすい上下の高さ */
		white-space: nowrap;  /* 文字の折り返しを防止 */
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
}
/* スマホ画面でメニューを画面横幅いっぱいに広げる設定 */
@media screen and (max-width: 960px) {
    #menu {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    #menu li {
        font-size: 110%; /* 文字を大きめにして押しやすくする */
        border: 1px solid #fff; /* ボタンの区切り線を追加 */
        box-sizing: border-box;
    }

    #menu li a {
        padding: 0.6em 0.2em;
        white-space: nowrap;
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
/* Google Pixel 9 などすべてのスマホ画面でメニューを横幅一杯に広げる強制的設定 */
@media screen and (max-width: 768px) {
    /* 容器や外枠の余白を完全にリセット */
    #container {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #globalNav, #logo, #menu {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* メニューリストの幅を100%にして隙間をなくす */
    #menu {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* Pure CSSの幅指定を上書きして1行に2個（50%ずつ）均等配置 */
    #menu li {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        font-size: 100% !important;
        box-sizing: border-box !important;
        border: 1px solid #ffffff; /* ボタン間の白い境界線 */
    }

    /* タップエリアを画面幅に合わせて最大化 */
    #menu li a {
        display: block !important;
        width: 100% !important;
        padding: 0.8em 0.2em !important; /* タップしやすい高さ */
        text-align: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }
}
