body {
	font-family: YuGothic, sans-serif;
	margin: 0;
	padding: 0;
	background-color: #f6f4e3e0;
	color: #333333;
}

header {
	background-color: #634b32e8;
	color: #fff;
	padding: 1rem 0;
	text-align: center;
	position: relative;
}

#header-image-nikukyuu {
	position: absolute;
	top: 10px;
	left: 80%;
	transform: translateX(-50%);
	width: 120px;
	height: auto;
	z-index: 10;
}

header h1, header nav {
	position: relative;
	z-index: 5;
}

nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

nav ul li {
	display: inline;
	margin: 0 10px;
}

nav ul li a {
	color: #fff;
	text-decoration: none;
	padding: 10px;
}

/* メディアクエリを追加して小さいデバイス用のスタイルを定義 */
@media (max-width: 768px) {
	header h1 {
		font-size: 18px;
		
	}

	#header-image-nikukyuu {
		width: 80px;
		top: 5px;
		left: 85%;
		transform: translateX(-50%);
		height: auto;
	}

	nav ul {
		flex-direction: row;
		flex-wrap: wrap;
	}

	nav ul li {
		padding: 5px 0;
	}

	nav ul li a {
		font-size: 12px;
	}

	footer p {
		font-size: 12px;
		padding: 10px;
	}

	.main {
		padding: 10px;
	}

	.home p {
		font-size: 14px;
	}

	.home img {
		width: 100%;
	}

	section h2 {
		font-size: 18px;
	}

	section p {
		font-size: 14px;
		padding: 5px;
	}

	.family-tree img {
		width: 100%;
		height: auto;
	}

	.filter-controls {
		flex-direction: column;
		align-items: center;
	}

	.filter-controls label {
		margin-bottom: 5px;
	}

	.modal-body {
		position: fixed;
    left: 50%; /* 水平中央 */
    top: 50%; /* 垂直中央 */
    width: 60% !important;
    padding: 20px;
    border-radius: 10px;
    background-color: white;
    transform: translate(-70%, 20%);
    z-index: 1050;
	}

	.modal-body-gallery {
		width: 60% !important;
		max-width: none;
		padding: 10px;
		top: 10%;
		transform: translate(0, 0);
	}

	.modal-content {
		max-width: 100%;
		height: auto;
	}

	.nav.prev, .nav.next {
		top: 50%;
		transform: translateY(-50%);
	}

	.modal-content img, .modal-content h3, .modal-content p {
		max-width: 100%;
	}

	.cat-grid .cat-card {
		width: 25% !important;
		padding: 10px;
		box-sizing: border-box;
		margin: 5px;
		border-radius: 5px;
	}

	.cat-card img {
		height: auto;
		width: 100%;
	}

	.cat-card h3, .cat-card p {
		font-size: 12px;
	}

	.photo-grid {
		display: grid !important;
		grid-template-columns: repeat(3, 1fr) !important;	/* 3列表示に */
		gap: 5px;
		padding: 10px;
	}

	.photo-grid .photo-card {
		width: 100% !important;
		padding: 5px;
		box-sizing: border-box;
		margin-bottom: 10px;
	}

	.photo-grid .photo-card img {
		width: 100%;
		height: auto;
	}

	.photo-grid .photo-card .caption {
		font-size: 0.6rem;
		padding: 3px;
		margin-top: 10px;
		background-color: rgba(255, 255, 255, 0.8);
	}

	.pagination a, .pagination span {
		margin: 0 2px !important;
		font-size: 12px;
		padding: 5px 8px;
	}

	.current-page-info span {
		font-size: 14px;
	}

	.contact-section {
		width: 90%;
	}

	button {
		padding: 6px 12px;
		font-size: 12px;
	}
}

main {
	padding: 20px; /* これだけ */
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 80vh;
}

.home p {
	font-size: 16px;
	text-align: center;
	padding: 10px;
}

.home img {
	display: block;
	margin: 10px auto;
	width: 80%;
	height: auto;
}

.profile {
	background-color: #fff;
	padding: 20px;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.profile img {
	width: 150px;
	height: auto;
	margin-right: 20px;
}

.description h2 {
	margin-top: 0;
}

.photo-album {
	background-color: #fff;
	padding: 20px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px;	/* 写真間の隙間 */
}

.nav {
	cursor: pointer;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	color: #fff;
	font-size: 30px;
	font-weight: bold;
	user-select: none;
	padding: 10px;
	z-index: 1060;
}

.nav.prev  {
	left: -50px;
}

.nav.next {
	right: -50px;
}

.photo {
	width: 20%;
	margin-bottom: 10%;	/* キャプションのため下マージンを設定 */
	position: relative;	/* キャプションの位置指定のため */
	padding-top: 20%;	/* コンテナの高さを設定 */
	padding-bottom: 10px; /* 高さを確保 */
	height: 0;	/* パディングトップで高さが設定されているため、heightは0に */
	flex: 1 1 20%;	/* 最小幅を20%に設定し、一行に最大5枚表示 */
	text-align: center;
	background-color: #f0f0f0;
	overflow: visible;	/* はみ出した内容を表示する */
}

.photo-grid {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	align-items: center;
	gap: 10px;
	padding: 4%;
	margin-bottom: 60px;
	background-image: url('/static/images/コルクボード.jpg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.photo-grid::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(208, 208, 208, 0.441);
	z-index: 1;
}

.photo-grid > * {
	position: relative;	/* 直接の子要素を前面に持ってくる */
	z-index: 2;
}

.photo img {
	position: absolute;	/* 親要素の対して絶対位置指定 */
	top: 50%;
	left: 50%;
	width: 100%;	/* 画像の幅をコンテナの幅に合わせる */
	max-height: 100%;	/* 画像の最大高さに合わせる */
	object-fit: contain;
	transform: translate(-50%, -50%);	/* 画像をコンテナの中心に配置 */
	display: block;
}

.photo p {
	position: absolute;
	top: 100%;	/* コンテナの下にテキストを配置 */
	left: 50%;
	width: 100%;	/* テキストの幅をコンテナの幅に合わせる */
	transform: translateX(-50%);	/* テキストを中央に配置 */
	padding: 5px 0;	/* テキストのパディンング */
	background-color: rgba(255, 255, 255, 0.8);
	color: #333;
	font-size: 0.8rem;
	text-align: center;
	box-sizing: border-box;	/* paddingもwidthに含める */
	margin-top: 5px;	/* トップマージンを設定してキャプションの位置を上げる */
}

.photo-card {
	width: 20%;
	margin-bottom: 20px;
	box-sizing: border-box;
	background-color: white;
	padding: 5px;
	border-radius: 5px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.photo-card img {
	width: 100%;
	display: block;
}

.photo-card .caption {
	text-align: center;
	background-color: rgba(255, 255, 255, 0.8);
	color: #333;
	padding: 5px;
	margin-top: 10px;
	margin-bottom: 10px;
	box-sizing: border-box;
	font-size: 0.8rem;
	font-weight: bold;
}

.photo-card p {
	text-align: center;
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	padding: 5px 0;
	box-sizing: border-box;
	width: 100%;
}

.photo-card:hover img {
	transform: scale(1.05);
}

.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.8);
}

.modal-body {
	position: relative; /* navボタンの位置がmodal-bodyに対して絶対位置になるようにする */
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background-color: white;
	border-radius: 10px;
	width: auto;
	max-width: 600px;
	margin: auto;
}

.modal-body-gallery {
	position: relative; /* navボタンの位置がmodal-bodyに対して絶対位置になるようにする */
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background-color: white;
	border-radius: 10px;
	width: auto;
	max-width: 600px;
	margin: auto;
}

.modal-content {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0 auto;
}

.modal-content img {
	display: block;
	max-width: 90%;
	max-height: 80vh;	/* 画像の最大高さをビューポート高の80%に設定 */
	width: auto;
	height: auto;
	object-fit: contain; /* 縦横比を保持しつつ、コンテナに収める */
	margin: auto;
	padding: 10px;
}

.modal-content h3,
.modal-content p {
	text-align: center;
	width: 100%;
}

.close {
	position: absolute;
	top: 15px;
	right: 35px;
	color: white;
	font-size: 40px;
	font-weight: bold;
	transition: 0.3s;
	cursor: pointer;
}

.close:hover,
.close:focus {
	color: #777;
	text-decoration: none;
}

#caption {
	width: 100%;
	color: #333;
	padding: 10px 0;
	text-align: center;
}

.pagination-container {
	text-align: center;
	margin-bottom: 20px;
}

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	background-color: #f6f4e3e0;
	margin-bottom: 10px;
}

.pagination a {
	margin: 0 10px;
	text-decoration: none;
	color: #333;
	font-weight: bold;
}

.pagination span {
	margin: 0 10px;
}

.cat-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	padding: 0 5px;
}

.family-tree {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 5%;
}

.family-tree h3 {
	margin-bottom: 1remx;
	text-align: center;
}

.cat-card {
	background-color: #fff;
	padding: 7px !important;
	border-radius: 0.5rem;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
	text-align: center;
	width: 200px;
	margin: 10px;
}

.cat-card a {
	text-decoration: none;	/* 下線を消す */
	color: inherit; /* テキストの色を親要素から継承する */
}

.cat-card a img {
	display: block; /* 画像がリンクの中でブロック表示されるようにする */
}

.image-placeholder {
	width: 100%;
	height: 150px;
	background-color: #ddd;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
}

.image-placeholder p {
	color: #666;
	font-size: 1.5rem;
}

.cat-card img {
	max-width: 100%;
	border-radius: 0.5rem;
	height: auto;
}

.tags {
	margin-top: 0.5rem;
}

.tag {
	display: inline-block;
	background-color: #eee;
	color: #333;
	padding: 0.2rem 0.5rem;
	border-radius: 0.3rem;
	font-size: 0.9rem;
	margin: 0.2rem;
}

.filter-controls {
	padding: 10px 20px;
	border-top: 1px solid #ccc;
	border-bottom: 1px solid #ccc;
	display: flex;
	gap: 1rem;
	margin-bottom: 1rem;
	justify-content: center;
	align-items: center;
}

.contact-section {
	/* display: flex; */
	flex-direction: column;
	align-items: center;
	width: 90%;
	max-width: 600px;
	background-color: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	text-align: center;
	max-width: 500px;
}

.section .contact-section .contact-form {
	flex: 0 0 100%;
	margin: auto;
	padding: 20px;
}

.form-group {
	margin-bottom: 20px;
}

label {
	display: block;
	margin-bottom: 5px;
}

.contact-section input[type="text"],
.contact-section input[type="email"],
.contact-section textarea {
	display: block;
	margin: 10px auto;
	width: 80%;
	padding: 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}

button {
	background-color: #696969;
	color: white;
	padding: 8px 16px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

button:hover {
	background-color: #434343;
}

footer {
	text-align: center;
	padding: 20px;
	background-color: #f6f4e3e0;
	color: #333;
}