@charset "utf-8";

/*ギャラリーグリッド
---------------------------------------------------------------------------*/
.gallery-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 0;
}

/*1枚あたりのカード*/
.gallery-item {
	width: calc((100% - 32px) / 3);	/*3列。gap2個分(16px×2)を引いて3等分*/
	box-sizing: border-box;
	cursor: pointer;
	overflow: hidden;
	border-radius: 4px;
	box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
	background: #fff;
	transition: transform 0.3s;
}

.gallery-item:hover {
	transform: scale(1.02);
}

/*figure*/
.gallery-item figure {
	margin: 0;
	width: 100%;
}

/*写真*/
.gallery-item img {
	width: 100%;
	height: 200px;			/*写真の高さ。統一感を出す*/
	object-fit: cover;		/*縦横比を保ってトリミング*/
	object-position: center;
	display: block;
}

/*タイトル・コメントのブロック*/
.gallery-item figcaption {
	padding: 10px 12px;
	text-align: center;
}

/*タイトル*/
.gallery-title {
	margin: 0 0 4px;
	font-weight: bold;
	font-size: 0.95em;
	color: #555;
}

/*コメント*/
.gallery-comment {
	margin: 0;
	font-size: 0.8em;
	color: #999;
	line-height: 1.6;
}


/*スマホ：1列*/
@media screen and (max-width:599px) {
	.gallery-item {
		width: 100%;
	}
}

/*タブレット：2列*/
@media screen and (min-width:600px) and (max-width:899px) {
	.gallery-item {
		width: calc((100% - 16px) / 2);
	}
}


/*ライトボックス
---------------------------------------------------------------------------*/
#lightbox {
	display: none;
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	z-index: 1000;
}

/*暗い背景*/
#lightbox-overlay {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background: rgba(0,0,0,0.85);
}

/*コンテンツ（写真＋テキスト）*/
#lightbox-content {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	width: 90%;
	max-width: 800px;
}

/*拡大写真*/
#lightbox-img {
	max-width: 100%;
	max-height: 70vh;
	display: block;
	margin: 0 auto;
	border-radius: 4px;
}

/*タイトル・コメント*/
#lightbox-caption {
	color: #fff;
	margin-top: 15px;
}

#lightbox-title {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight: bold;
}

#lightbox-comment {
	margin: 0;
	font-size: 0.9em;
	color: #ccc;
}

/*閉じるボタン*/
#lightbox-close {
	position: absolute;
	top: -40px; right: 0;
	background: none;
	border: none;
	color: #fff;
	font-size: 1.8em;
	cursor: pointer;
	line-height: 1;
}

/*前へ・次へボタン*/
#lightbox-prev,
#lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255,255,255,0.2);
	border: none;
	color: #fff;
	font-size: 1.5em;
	padding: 10px 14px;
	cursor: pointer;
	border-radius: 3px;
	transition: background 0.3s;
}

#lightbox-prev { left: -60px; }
#lightbox-next { right: -60px; }

#lightbox-prev:hover,
#lightbox-next:hover {
	background: rgba(255,255,255,0.4);
}

/*スマホ時は前後ボタンを内側に*/
@media screen and (max-width:599px) {
	#lightbox-prev { left: 0; }
	#lightbox-next { right: 0; }
}
