@charset "UTF-8";

/* ============================================================
   写真ギャラリー
   列数を変えたいときは --gallery-cols の数字だけ書き換えてください
   ============================================================ */

/* 写真ブロックの外枠（style.css の指定を上書き） */
#wrapper_photo {
	margin: 60px auto 0;
	width: 90%;
	max-width: 1120px;
}

.gallery-title {
	margin: 0 0 24px;
	padding: 0;
	font-family: "新ゴ B", 'メイリオ', sans-serif;
	font-size: 2rem;
	line-height: 1.3em;
	text-align: center;
	color: #003411;
}

.gallery-title:after {
	content: "";
	display: block;
	width: 64px;
	height: 4px;
	margin: 12px auto 0;
	background-color: #006c27;
}

.gallery {
	margin: 0 auto;
	width: 100%;
	--gallery-cols: 3;
	--gallery-gap: 6px;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--gallery-cols), 1fr);
	gap: var(--gallery-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.gallery-item {
	display: block;
	position: relative;
	overflow: hidden;
	background-color: #fff;
	border: 3px solid #fff;
	box-sizing: border-box;
	box-shadow: 1px 1px 3px rgba(0, 0, 0, .45);
	cursor: pointer;
	-webkit-tap-highlight-color: rgba(0, 108, 39, .35);
}

.gallery-item img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	object-fit: cover;
	background-color: #eceee4;
	transition: transform .35s ease, filter .35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
	transform: scale(1.06);
	filter: saturate(1.08);
}

.gallery-item:focus-visible {
	outline: 3px solid #006c27;
	outline-offset: 2px;
}

/* aspect-ratio 非対応ブラウザ向けの保険 */
@supports not (aspect-ratio: 1 / 1) {
	.gallery-item { padding-top: 100%; }
	.gallery-item img {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}
}

/* 状態表示・もっと見る */

.gallery-status {
	margin: 24px 0 0;
	text-align: center;
	font-size: .95rem;
	color: #003411;
}

.gallery-status[hidden] { display: none; }

.gallery-more {
	display: block;
	margin: 26px auto 0;
	padding: 12px 40px;
	border: none;
	border-radius: 40px;
	background-color: #006c27;
	color: #fff;
	font-family: 'UD新ゴ コンデンス90 M', 'メイリオ', sans-serif;
	font-size: 1.05rem;
	letter-spacing: .08em;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
	transition: background-color .2s ease;
}

.gallery-more:hover { background-color: #003411; }
.gallery-more:focus-visible { outline: 3px solid #003411; outline-offset: 3px; }
.gallery-more[hidden] { display: none; }

/* 画面幅ごとの列数 */

@media (min-width: 480px)  { .gallery { --gallery-cols: 4; } }
@media (min-width: 768px)  { .gallery { --gallery-cols: 5; --gallery-gap: 8px; } }
@media (min-width: 1024px) { .gallery { --gallery-cols: 6; } }
@media (min-width: 1400px) { .gallery { --gallery-cols: 7; } }

/* ============================================================
   ライトボックス（拡大表示）
   ============================================================ */

.lightbox {
	position: fixed;
	inset: 0;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(2, 18, 8, .94);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}

.lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.lightbox-stage {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 16px 64px;
	box-sizing: border-box;
}

.lightbox-image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	background-color: #fff;
	border: 5px solid #fff;
	box-sizing: border-box;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .6);
	opacity: 0;
	transition: opacity .25s ease;
}

.lightbox-image.is-ready { opacity: 1; }

.lightbox-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #dae751;
	border-radius: 50%;
	animation: lightbox-spin .8s linear infinite;
}

.lightbox-spinner[hidden] { display: none; }

@keyframes lightbox-spin {
	to { transform: rotate(360deg); }
}

/* 操作ボタン */

.lightbox button {
	position: absolute;
	margin: 0;
	padding: 0;
	border: none;
	background-color: rgba(0, 52, 17, .55);
	color: #fff;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease;
}

.lightbox button:hover { background-color: #006c27; }
.lightbox button:focus-visible { outline: 3px solid #dae751; outline-offset: 2px; }

.lightbox-close {
	top: 12px;
	right: 12px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	font-size: 26px;
}

.lightbox-prev,
.lightbox-next {
	top: 50%;
	width: 52px;
	height: 76px;
	margin-top: -38px;
	border-radius: 6px;
	font-size: 28px;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-counter {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	color: #fff;
	font-family: 'UD新ゴ コンデンス90 L', 'メイリオ', sans-serif;
	font-size: .95rem;
	letter-spacing: .12em;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

@media (max-width: 539px) {
	.gallery-title { font-size: 1.5rem; }
	.lightbox-stage { padding: 50px 8px 78px; }
	.lightbox-prev,
	.lightbox-next {
		top: auto;
		bottom: 14px;
		width: 64px;
		height: 44px;
		margin-top: 0;
	}
	.lightbox-counter { bottom: 26px; }
}

/* 本文のスクロール固定 */

body.lightbox-open {
	overflow: hidden;
}

/* アニメーションを控える設定を尊重 */

@media (prefers-reduced-motion: reduce) {
	.gallery-item img,
	.lightbox,
	.lightbox-image,
	.lightbox button {
		transition: none;
	}
	.gallery-item:hover img { transform: none; }
	.lightbox-spinner { animation-duration: 2s; }
}
