/* =========================================================================
   voice-gallery.css — 体験レポートの「フォトアルバム」
   2026-09-20

   もとは旧サイトのスライダー（bxSlider）用の <ul id="slider"> でしたが、
   スライダーの部品が読み込まれておらず、200×150の写真が縦一列に
   並んでいるだけの状態でした。タイル状に並べ直します。

   ・PC 3列 ／ スマホ 2列
   ・タイルは正方形（写真は中央を切り出して表示）
   ・タイルの幅は最大260px（元の写真が200pxなので、引き伸ばしを1.3倍までに抑える）
   ・本文の幅いっぱいに、中央揃えで並べる
   ・タイルの間は8px
   ========================================================================= */

.em-gallery {
	margin: 20px 0 32px;
}

.em-gallery__grid {
	display: grid;
	/* 3列。1列あたりの上限は260px（それ以上には広げない）。
	   本文が狭いときは自動で縮み、余った分は左右に均等に配る。 */
	grid-template-columns: repeat(3, minmax(0, 260px));
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* --- タイル --- */

.em-gallery__tile {
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
	background-color: #F1ECEB;
	text-decoration: none;
	cursor: zoom-in;
}

.em-gallery__tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform .35s ease;
}

.em-gallery__tile:hover img,
.em-gallery__tile:focus-visible img {
	transform: scale(1.06);
}

.em-gallery__tile:focus-visible {
	outline: 3px solid var(--em-red, #C8102E);
	outline-offset: 2px;
}

/* 最初は隠しておく分（「すべての写真を見る」で出す） */
.em-gallery__tile--rest {
	display: none;
}

.em-gallery.is-expanded .em-gallery__tile--rest {
	display: block;
}

/* --- 「すべての写真を見る」ボタン --- */

.em-gallery__morewrap {
	margin: 14px 0 0;
	text-align: center;
}

.em-gallery__more {
	display: inline-block;
	padding: 9px 22px;
	border: 1px solid var(--em-red, #C8102E);
	border-radius: 999px;
	background-color: #fff;
	color: var(--em-red, #C8102E);
	font-family: 'Zen Kaku Gothic New', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.em-gallery__more:hover,
.em-gallery__more:focus-visible {
	background-color: var(--em-red, #C8102E);
	color: #fff;
}

/* --- スマホ --- */

@media (max-width: 767.98px) {
	.em-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 260px));
	}
}

/* =========================================================================
   写真を大きく見るところ（ライトボックス）
   ------------------------------------------------------------------------
   もとの本文には data-lightbox="imagegroupe" が付いていましたが、
   その仕組み自体がサイトに入っていませんでした。
   前後送りと閉じるだけの、軽い作りにしています。
   ========================================================================= */

.em-glb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(20, 16, 16, .92);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}

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

.em-glb__figure {
	margin: 0;
	max-width: min(92vw, 1400px);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.em-glb__img {
	display: block;
	max-width: min(92vw, 1400px);
	max-height: 78vh;
	width: auto;
	height: auto;
	object-fit: contain;
	background-color: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.em-glb__caption {
	margin-top: 10px;
	color: #F3EFEE;
	font-size: 13px;
	letter-spacing: .04em;
	text-align: center;
}

/* --- 操作ボタン --- */

.em-glb__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease;
}

.em-glb__btn:hover,
.em-glb__btn:focus-visible {
	background-color: rgba(255, 255, 255, .3);
}

.em-glb__btn:disabled {
	opacity: .25;
	cursor: default;
}

.em-glb__close {
	top: 16px;
	right: 16px;
	font-size: 26px;
}

.em-glb__prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.em-glb__next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

/* 読み込み中の目印 */
.em-glb__figure.is-loading .em-glb__img {
	opacity: .35;
}

@media (max-width: 767.98px) {
	.em-glb__btn {
		width: 42px;
		height: 42px;
		font-size: 20px;
	}

	.em-glb__prev {
		left: 8px;
	}

	.em-glb__next {
		right: 8px;
	}

	.em-glb__close {
		top: 10px;
		right: 10px;
	}

	.em-glb__img {
		max-width: 94vw;
		max-height: 70vh;
	}
}

/* ライトボックスを開いている間は、後ろが動かないようにする */
body.em-glb-open {
	overflow: hidden;
}

/* 動きを減らす設定の方には、拡大やふわっとした変化を出さない */
@media (prefers-reduced-motion: reduce) {

	.em-gallery__tile img,
	.em-glb {
		transition: none;
	}

	.em-gallery__tile:hover img,
	.em-gallery__tile:focus-visible img {
		transform: none;
	}
}
