/* --- 全体のスタイルリセットと基本設定 --- */
body {
	margin: 0;
	padding: 0;
	font-family: "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
	background-color: #f0f0f0;
	/* 全体の背景色 (画像のグレー系) */
	color: #333;
}

/* --- ヘッダー --- */
.site-header {
	background-color: #333;
	/* ヘッダーの背景色 (ダークグレー) */
	color: #fff;
	/* ヘッダーの文字色 (白) */
	padding: 15px 0;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.container {
	/* コンテンツの幅を制限し、中央寄せ */
	max-width: 960px;
	margin: 0 auto;
	padding: 0 20px;
}

.site-header .container {
	display: flex;
	/* Flexboxでタイトルとナビを横並び */
	justify-content: space-between;
	/* 両端に配置 */
	align-items: center;
	/* 垂直方向中央揃え */
}

/* --- グラデーション --- */
.site-header,
.site-footer {
	/* background-color: #333; */
	/* ← 単色指定をコメントアウトまたは削除 */
	background: linear-gradient(to bottom, rgb(18, 16, 16), #222);
	/* ★ 上が#444、下が#333の暗いグラデーション */
	color: #fff;
	/* 文字色は白のまま */
	/* ... 他のスタイル (padding, box-shadow など) ... */
}

.site-title {
	font-size: 1.5em;
	font-weight: bold;
	text-decoration: none;
	color: #fff;
}

.main-nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	/* ナビゲーション項目を横並び */
}

.main-nav li {
	margin-left: 20px;
}

.main-nav a {
	color: #fff;
	text-decoration: none;
}

.main-nav a:hover {
	text-decoration: underline;
}

/* --- メインコンテンツエリア --- */
.main-content {
	background-color: #fff;
	/* コンテンツエリアの背景色 (白) */
	margin-top: 30px;
	/* ヘッダーとの間にスペース */
	margin-bottom: 30px;
	padding: 30px;
	border-radius: 5px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-content h2 {
	/* メインコンテンツ内の見出し */
	border-bottom: 2px solid #eee;
	padding-bottom: 10px;
	margin-top: 0;
	/* 上の余白を削除 */
	margin-bottom: 30px;
	/* 見出しと画像の間にスペース */
}

/* --- 画像表示部分のスタイル調整 --- */
.image-post {
	margin-bottom: 40px;
	padding-bottom: 20px;
	border-bottom: 1px solid #eee;
	/* 区切り線を少し細く */
}

.image-post:last-child {
	/* 最後の画像の区切り線は不要 */
	border-bottom: none;
	margin-bottom: 0;
}

.image-post img {
	max-width: 100%;
	height: auto;
	display: block;
	margin-bottom: 15px;
	border-radius: 4px;
	/* box-shadow は main-content にあるので、ここでは削除しても良いかも */
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-post p {
	font-size: 0.9em;
	color: #555;
	/* 少し濃いめのグレー */
	word-wrap: break-word;
}

.image-post code {
	/* コード部分 (パス表示) */
	background-color: #f8f8f8;
	padding: 2px 5px;
	border-radius: 3px;
	font-family: monospace;
}

.container {
	max-width: 960px;
	/* 最大幅を指定 */
	margin: 0 auto;
	/* 左右のマージンを自動調整して中央寄せ */
	padding: 0 20px;
}

/* --- フッター --- */
.site-footer {
	background-color: #333;
	color: #ccc;
	text-align: center;
	padding: 20px 0;
	font-size: 0.9em;
	margin-top: 40px;
	/* コンテンツとの間にスペース */
}

/* --- その他 --- */
a {
	color: #007bff;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* --- トップページ用スタイル (必要なら追加) --- */
.upload-link-button {
	display: inline-block;
	background-color: #007bff;
	color: white;
	padding: 12px 25px;
	text-align: center;
	border-radius: 5px;
	text-decoration: none;
	font-size: 1.1em;
	margin-top: 20px;
	border: none;
	/* ボタンのように見せる */
	cursor: pointer;
	/* マウスカーソルを指に */
}

.upload-link-button:hover {
	background-color: #0056b3;
	text-decoration: none;
}

/* --- ログアウトボタン --- */
/* ログアウトボタンをリンク風に見せるスタイル */
.logout-button-link {
	background: none;
	/* 背景なし */
	border: none;
	/* ボーダーなし */
	padding: 0;
	/* パディングなし */
	color: #fff;
	/* ヘッダーの文字色に合わせる */
	text-decoration: none;
	/* 下線なし */
	cursor: pointer;
	/* マウスカーソルを指に */
	font-size: 1em;
	/* 周囲のリンクとサイズを合わせる */
	font-family: inherit;
	/* フォントを継承 */
}

.logout-button-link:hover {
	text-decoration: underline;
	/* ホバー時に下線 */
}

/* =================================== */
/* スマートフォン向けスタイル (画面幅 767px 以下) */
/* =================================== */
@media (max-width: 767px) {
	/* スマートフォンと小型タブレットを想定 */

	/* 全体の文字サイズを大きく */
	body {
		font-size: 17px;
		/* 例: 16pxから少し大きく */
		-webkit-text-size-adjust: 100%;
		/* iOSでの自動調整抑制 */
	}

	/* コンテンツ幅を画面いっぱいに、左右の余白を少しに */
	.container {
		max-width: 100%;
		padding-left: 15px;
		padding-right: 15px;
	}

	/* 見出しサイズ調整 */
	h1,
	.site-title {
		font-size: 1.6em;
	}

	h2 {
		font-size: 1.4em;
	}

	h3 {
		font-size: 1.3em;
	}

	/* ヘッダー: タイトルとナビを縦積み */
	.site-header .container {
		flex-direction: column;
		/* 縦積み */
		align-items: flex-start;
		/* 左揃え */
	}

	.main-nav {
		margin-top: 10px;
		/* タイトルとの間に少しスペース */
		width: 100%;
		/* ナビも幅いっぱい使う */
	}

	.main-nav ul {
		justify-content: space-around;
		/* ナビ項目を均等配置 */
		flex-wrap: wrap;
		/* 必要なら折り返し */
	}

	.main-nav li {
		margin-left: 0;
		/* 左マージンリセット */
		margin-right: 10px;
		/* 項目間の右マージン */
		margin-bottom: 5px;
	}

	/* ログイン/ログアウト部分も調整が必要ならここに追加 */
	.main-nav form.logout-button-link {
		/* ログアウトフォーム調整 */
		margin-left: 10px;
	}

	/* ボタン類のパディングと文字サイズを大きく */
	.button-action,
	.delete-button,
	.upload-link-button,
	.upload-submit-button,
	.login-button,
	.form-actions button {
		padding: 12px 18px;
		/* パディングを増やす */
		font-size: 1.05em;
		/* 文字サイズを少し大きく */
	}

	/* ページネーションリンクのサイズ調整 */
	.page-link,
	.back-to-list a {
		padding: 10px 14px;
		/* パディングを増やす */
		font-size: 0.95em;
		/* 文字サイズを少し大きく */
	}

	.page-info {
		font-size: 0.95em;
	}

	/* ページネーションのレイアウト調整 */
	.pagination-controls {
		flex-direction: column;
		/* 縦積み */
		gap: 10px;
		/* 要素間のスペース */
		align-items: stretch;
		/* ★ 各要素を横幅いっぱいに伸ばす */
		text-align: center;
		/* ★ 中央揃え */
	}

	.back-to-list {
		/* 一覧へ戻るリンク */
		margin-right: 0;
		/* マージンリセット */
		margin-bottom: 5px;
		/* 下とのスペース */
	}

	.back-to-list a {
		display: block;
		/* ブロック要素にして幅いっぱい */
	}

	.page-navigation {
		margin-left: 0;
		/* マージンリセット */
		justify-content: center;
		/* ★ ページナビを中央揃え */
	}


	/* ギャラリー一覧のレイアウト調整 */
	.gallery-list li {
		flex-direction: column;
		/* 縦積み */
		align-items: flex-start;
		/* 左揃え */
	}

	.gallery-actions {
		margin-top: 15px;
		/* 上の要素とのスペース */
		width: 100%;
		/* 幅いっぱい */
		display: flex;
		justify-content: flex-end;
		/* ボタンを右寄せ */
	}

	.gallery-actions a,
	.gallery-actions form {
		/* フォームも対象に */
		margin-left: 8px;
		/* ボタン間のスペースを少し詰める */
		margin-bottom: 5px;
		/* 縦積み時の下スペース */
	}

	/* その他、フォーム要素なども必要なら調整 */
	.form-group input[type="text"],
	.form-group input[type="password"],
	.form-group textarea {
		font-size: 1em;
		/* スマホでの入力欄文字サイズ */
	}

	.site-header .container {
		flex-direction: column;
		/* 縦積みは維持 */
		align-items: center;
		/* ★ flex-start から center に変更して中央揃え */
	}

	.main-nav {
		margin-top: 10px;
		width: 100%;
	}

	.main-nav ul {
		justify-content: center;
		/* ★ space-around から center に変更してナビ項目も中央揃え */
		flex-wrap: wrap;
		padding-left: 0;
		/* ★ 左のパディングを削除 */
	}

	.main-nav li {
		margin-left: 8px;
		/* ★ 少し調整 */
		margin-right: 8px;
		/* ★ 少し調整 */
		margin-bottom: 5px;
	}
}

/* @media end */