/* ==================================================
 * 写真展メーカー：フロント表示
 * ACJサイトに合わせた上品なフォトギャラリーデザイン
 * ================================================== */

.pem-gallery-wrap,
.pem-gallery-wrap * {
	box-sizing: border-box;
}

.pem-gallery-wrap {
	--pem-navy: #0b2f52;
	--pem-blue: #1e6e9f;
	--pem-blue-light: #e8f1f7;
	--pem-cream: #f7f4ed;
	--pem-line: #d9d4ca;
	--pem-text: #172536;
	--pem-muted: #66717e;

	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 30px auto 0;
	padding: 42px 40px 48px;
	background:
		linear-gradient(
			180deg,
			#faf8f3 0%,
			#f7f4ed 100%
		);
	border: 1px solid #e3ded4;
	border-radius: 4px;
	box-shadow: 0 18px 50px rgba(11, 47, 82, 0.07);
	overflow: hidden;
}

.pem-gallery-wrap::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--pem-navy);
}

/* 写真展タイトル
---------------------------- */

/*
 * ACJページの見出しに合わせ、写真展タイトルは明朝体で表示します。
 * テーマ側のゴシック体指定より優先するため !important を付けています。
 */
.ncf-photo-exhibition-section .ncf-section-title,
.pem-gallery-title {
	font-family:
		"Yu Mincho",
		"游明朝",
		YuMincho,
		"Hiragino Mincho ProN",
		"Hiragino Mincho Pro",
		"Noto Serif JP",
		serif !important;
}

.pem-gallery-title {
	position: relative;
	margin: 0 0 24px;
	padding: 0 0 20px;
	border: 0;
	border-bottom: 1px solid var(--pem-line);
	color: var(--pem-navy);
	font-size: clamp(27px, 3vw, 38px);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.05em;
}

.pem-gallery-title::before {
	content: "PHOTO GALLERY";
	display: block;
	margin: 0 0 8px;
	color: var(--pem-blue);
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.22em;
}

/* 写真カテゴリ
---------------------------- */

.pem-category-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin: 0 0 30px;
}

.pem-category-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 9px 18px;
	border: 1px solid #c8d0d8;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.82);
	color: var(--pem-navy);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.02em;
	text-decoration: none !important;
	box-shadow: none;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease;
}

.pem-category-button:hover {
	border-color: var(--pem-navy);
	background: #fff;
	color: var(--pem-navy);
	text-decoration: none !important;
	transform: translateY(-1px);
}

.pem-category-button.is-current {
	border-color: var(--pem-navy);
	background: var(--pem-navy);
	color: #fff;
	box-shadow: 0 8px 18px rgba(11, 47, 82, 0.16);
}

/* ギャラリー一覧
---------------------------- */

.pem-gallery-list {
	width: 100%;
	max-width: 100%;
	overflow: visible;
}

.pem-week-block {
	display: grid;
	grid-template-columns: repeat(var(--pem-columns-pc), minmax(0, 1fr));
	gap: 34px 24px;
	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow: visible;
}

.pem-week-title {
	grid-column: 1 / -1;
	margin: 0 0 2px;
	padding: 0 0 13px;
	border-bottom: 2px solid var(--pem-navy);
	color: var(--pem-navy);
	font-size: 21px;
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: 0.04em;
}

/* 写真カード
---------------------------- */

.pem-photo-card {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

.pem-photo-button,
.pem-photo-image {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: #e7e3db;
	box-shadow: 0 12px 28px rgba(11, 47, 82, 0.13);
	cursor: zoom-in;
	line-height: normal;
	overflow: hidden;
}

.pem-photo-image {
	cursor: default;
}

.pem-photo-button::after {
	content: "VIEW";
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	height: 27px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 2px;
	background: rgba(11, 47, 82, 0.83);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.12em;
	opacity: 0;
	transform: translateY(5px);
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.pem-photo-card img,
.pem-photo-img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center center !important;
	transform: scale(1) !important;
	transition:
		transform 0.45s ease,
		filter 0.45s ease !important;
}

.pem-photo-card:hover img,
.pem-photo-card:hover .pem-photo-img {
	transform: scale(1.018) !important;
	filter: saturate(1.04) contrast(1.02);
}

.pem-photo-card:hover .pem-photo-button::after {
	opacity: 1;
	transform: translateY(0);
}

.pem-photo-caption {
	position: relative;
	margin: 0;
	padding: 14px 2px 0 14px;
	border: 0;
	background: transparent;
	color: var(--pem-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.75;
	text-align: left;
	word-break: break-word;
}

.pem-photo-caption::before {
	content: "";
	position: absolute;
	top: 18px;
	left: 0;
	width: 3px;
	height: calc(100% - 18px);
	min-height: 18px;
	background: var(--pem-blue);
}

/* 詳細リンク
---------------------------- */

.pem-photo-link-area {
	margin: 12px 0 0;
	padding: 0 2px;
	text-align: left;
}

.pem-photo-detail-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 8px 17px;
	border: 1px solid var(--pem-navy);
	border-radius: 2px;
	background: transparent;
	color: var(--pem-navy) !important;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-decoration: none !important;
	box-shadow: none;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

.pem-photo-detail-link::after {
	content: "→";
	margin-left: 8px;
}

.pem-photo-detail-link:hover {
	background: var(--pem-navy);
	color: #fff !important;
	text-decoration: none !important;
}

/* 写真がない場合
---------------------------- */

.pem-empty {
	margin: 0;
	padding: 30px 24px;
	border: 1px solid #cfd9e1;
	border-left: 4px solid var(--pem-navy);
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--pem-navy);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.8;
	text-align: center;
}

/* ページネーション
---------------------------- */

.pem-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 46px 0 0;
	padding: 30px 0 0;
	border-top: 1px solid var(--pem-line);
}

.pem-page-number,
.pem-page-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 8px 13px;
	border: 1px solid #bfc9d2;
	border-radius: 2px;
	background: #fff;
	color: var(--pem-navy);
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
	box-shadow: none;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease;
}

.pem-page-number:hover,
.pem-page-next:hover {
	border-color: var(--pem-navy);
	background: var(--pem-blue-light);
	color: var(--pem-navy);
	text-decoration: none !important;
	transform: translateY(-1px);
}

.pem-page-number.is-current {
	border-color: var(--pem-navy);
	background: var(--pem-navy);
	color: #fff;
	pointer-events: none;
}

.pem-page-next {
	padding-right: 18px;
	padding-left: 18px;
}

/* ライトボックス
---------------------------- */

.pem-lightbox {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(4, 19, 33, 0.92);
}

.pem-lightbox.is-active {
	display: flex;
}

.pem-lightbox img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(1180px, 94vw);
	max-height: 86vh;
	border: 5px solid #fff;
	border-radius: 2px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.pem-lightbox-close {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	background: #fff;
	color: var(--pem-navy);
	font-size: 29px;
	font-weight: 400;
	line-height: 1;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	transform: translateX(-50%);
}

.pem-lightbox-close:hover {
	background: var(--pem-blue-light);
	color: var(--pem-navy);
}

/* タブレット
---------------------------- */

@media (max-width: 900px) {
	.pem-gallery-wrap {
		padding: 36px 28px 42px;
	}

	.pem-week-block {
		gap: 28px 18px;
	}
}

/* スマートフォン
---------------------------- */

@media (max-width: 767px) {
	.pem-gallery-wrap {
		margin-top: 22px;
		padding: 28px 16px 34px;
		border-right: 0;
		border-left: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.pem-gallery-title {
		margin-bottom: 18px;
		padding-bottom: 15px;
		font-size: 25px;
	}

	.pem-gallery-title::before {
		margin-bottom: 7px;
		font-size: 10px;
	}

	.pem-category-filter {
		flex-wrap: nowrap;
		gap: 7px;
		margin: 0 -16px 24px;
		padding: 0 16px 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.pem-category-filter::-webkit-scrollbar {
		display: none;
	}

	.pem-category-button {
		flex: 0 0 auto;
		min-height: 38px;
		padding: 8px 13px;
		font-size: 12px;
		white-space: nowrap;
	}

	.pem-week-block {
		grid-template-columns: repeat(var(--pem-columns-sp), minmax(0, 1fr));
		gap: 25px 12px;
	}

	.pem-week-title {
		font-size: 18px;
	}

	.pem-photo-button,
	.pem-photo-image {
		border-radius: 2px;
		box-shadow: 0 8px 20px rgba(11, 47, 82, 0.12);
	}

	.pem-photo-button::after {
		display: none;
	}

	.pem-photo-caption {
		padding: 10px 0 0 10px;
		font-size: 11px;
		line-height: 1.6;
	}

	.pem-photo-caption::before {
		top: 13px;
		width: 2px;
		height: calc(100% - 13px);
	}

	.pem-photo-link-area {
		margin-top: 9px;
	}

	.pem-photo-detail-link {
		min-height: 34px;
		padding: 7px 12px;
		font-size: 11px;
	}

	.pem-pagination {
		margin-top: 34px;
		padding-top: 24px;
	}

	.pem-page-number,
	.pem-page-next {
		min-width: 38px;
		min-height: 38px;
		padding: 7px 11px;
		font-size: 13px;
	}

	.pem-page-next {
		padding-right: 14px;
		padding-left: 14px;
	}
}
