@charset "utf-8";

#gallery {
	background: var(--white);
	border-top: 2px solid var(--pk1);
	border-bottom: 2px solid var(--pk1);
}
.gal-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.gal-controls {
	margin: 0 0 10px;
	padding: 14px 16px;
	border: 2px solid var(--pk1);
	border-radius: var(--radius-sm);
	background: linear-gradient(135deg, #fff7fb 0%, #fff 100%);
}

.gal-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

.gal-toggle input {
	display: none;
}

.gal-toggle-ui {
	position: relative;
	width: 52px;
	height: 30px;
	border-radius: 999px;
	background: #d9d9d9;
	transition: background .25s;
	flex-shrink: 0;
}

.gal-toggle-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
	transition: transform .25s;
}

.gal-toggle input:checked + .gal-toggle-ui {
	background: linear-gradient(135deg, var(--pk1), var(--pk2));
}

.gal-toggle input:checked + .gal-toggle-ui::after {
	transform: translateX(22px);
}

.gal-toggle-label {
	font-size: .95rem;
	font-weight: 700;
	color: var(--text2);
}

.gal-note {
	margin: 8px 0 0;
	font-size: .75rem;
	line-height: 1.5;
	color: var(--text3);
}

.gal-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}

.gal-filter-chip input {
	display: none;
}

.gal-filter-chip {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.gal-filter-chip span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 2px solid var(--pk1);
	border-radius: 999px;
	background: #fff;
	color: var(--text2);
	font-size: .88rem;
	font-weight: 800;
	line-height: 1;
	transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}

.gal-filter-chip:hover span {
	transform: translateY(-1px);
	box-shadow: var(--shadow);
}

.gal-filter-chip input:checked + span {
	background: linear-gradient(135deg, var(--pk1), var(--pk2));
	border-color: var(--pk2);
	color: #fff;
	box-shadow: var(--shadow);
}

.gal-item {
	aspect-ratio: 1;
	border-radius: var(--radius-sm);
	overflow: hidden;
	position: relative;
	border: 2.5px solid var(--pk1);
	background: linear-gradient(135deg, var(--pk0), var(--pk1));
	cursor: pointer;
	transition: transform .25s,box-shadow .25s;
}
.gal-item:hover {
	transform: scale(1.04) rotate(-1deg);
	box-shadow: var(--shadow);
}
.gal-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@keyframes galFadeIn {
	0% {
		opacity: 0;
		transform: translateY(16px) scale(.96);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.gal-item.is-hidden {
	display: none;
}
.gal-item.is-enter {
	animation: galFadeIn .45s cubic-bezier(.22, 1, .36, 1);
}

.gal-ph {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--text3);
	font-size: 2.2rem;
}
.gal-ph .gl {
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .1em;
}
.gal-ov {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(245, 80, 138, .65) 0%, transparent 55%);
	display: flex;
	align-items: flex-end;
	padding: 12px;
	opacity: 0;
	transition: opacity .25s;
}
.gal-item:hover .gal-ov {
	opacity: 1;
}
.gal-ov-txt {
	font-size: .72rem;
	font-weight: 800;
	text-shadow: 1px 1px 0 #222,-1px 1px 0 #222,1px -1px 0 #222,-1px -1px 0 #222;
	color: #fff;
	line-height: 1.4;
}

.hide {
	display: none;
}

.gal-more-wrap {
	margin-top: 20px;
	text-align: center;
}

.gal-more-btn {
	min-width: 180px;
	padding: 12px 20px;
	border: 2px solid var(--pk1);
	border-radius: 999px;
	background: linear-gradient(135deg, #fff, #ffeef5);
	color: var(--text2);
	font-size: .95rem;
	font-weight: 800;
	cursor: pointer;
	transition: transform .2s, box-shadow .2s, opacity .2s;
}

.gal-more-btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

.gal-more-btn.hide {
	display: none;
}

	/* ── Lightbox ── */
#lb {
	display: flex; /* 常にflexで保持しアニメーション可能にする */
	position: fixed;
	inset: 0;
	z-index: 600;
	background: rgba(58, 24, 40, .88);
	backdrop-filter: blur(7px);
	align-items: center;
	justify-content: center;

	/* 初期状態: 不可視 */
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity .32s cubic-bezier(.22,1,.36,1), visibility .32s;
}
/* 表示状態 */
#lb.show {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}
/* 閉じるアニメーション用クラス */
#lb.closing {
	opacity: 0;
	visibility: hidden;
	transition: opacity .24s cubic-bezier(.4, 0, 1, 1), visibility .24s;
}
/* PC: 余白を確保したサイズ指定 */
#lb img {
	max-width: 90vw;
	max-height: 85vh;
	border-radius: var(--radius);
	object-fit: contain;
	/* 画像自体もスケールでふわっと */
	transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .35s cubic-bezier(.22, 1, .36, 1);
	transform: scale(.88);
	opacity: 0;
}
#lb.show img {
	transform: scale(1);
	opacity: 1;
}
#lb.closing img {
	transform: scale(.92);
	opacity: 0;
	transition: transform .22s cubic-bezier(.4, 0, 1, 1), opacity .22s;
}
#lb-x {
	position: absolute;
	top: 20px;
	right: 24px;
	font-size: 2rem;
	color: #fff;
	cursor: pointer;
	background: none;
	border: none;
	font-weight: 900;
	transition: transform .2s;
}
#lb-x:hover {
	transform: scale(1.2);
}

/* =========================================================
	変更内容：Lightboxページ送りボタンを追加
	目的：前後移動操作を分かりやすく表示する
========================================================= */
.lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 12;

	width: 64px;
	height: 64px;

	border: none;
	border-radius: 999px;

	background: rgba(255, 255, 255, .14);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);

	color: #fff;
	font-size: 2rem;
	font-weight: 900;

	cursor: pointer;

	transition:
		background .2s,
		transform .2s,
		opacity .2s;

	opacity: .72;
}

.lb-nav:hover {
	background: rgba(255, 255, 255, .26);
	transform: translateY(-50%) scale(1.08);
	opacity: 1;
}

.lb-prev {
	left: 24px;
}

.lb-next {
	right: 24px;
}

/* =========================================================
	変更内容：スマホ時のLightbox矢印調整
	目的：画面を圧迫しないようにする
========================================================= */
@media(max-width:768px) {
	.lb-nav {
		width: 48px;
		height: 48px;
		font-size: 1.4rem;
	}

	.lb-prev {
		left: 10px;
	}

	.lb-next {
		right: 10px;
	}
}

/* スマホ: 画像をほぼ全画面に */
@media(max-width:768px){
	.gal-filter {
		gap: 8px;
	}

	.gal-filter-chip span {
		min-height: 36px;
		padding: 8px 12px;
		font-size: .8rem;
	}
	
	#lb img {
		max-width: 96vw;
		max-height: 92svh;
		border-radius: var(--radius-sm);
	}
	#lb-x {
		top: 12px;
		right: 14px;
		font-size: 1.6rem;
	}
}