/* Papotage Gallery */
.gallery.papotage-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 1.5em;
}
.gallery.papotage-gallery::after {
	content: "";
	flex-grow: 1000000;
}
.gallery.papotage-gallery .gallery-item {
	float: none;
	margin: 0;
	padding: 0;
	width: auto;
	flex: calc(var(--r, 1) * 100) 1 calc(var(--r, 1) * 190px);
	min-width: 0;
}
.gallery.papotage-gallery .gallery-icon {
	margin: 0;
	padding: 0;
	line-height: 0;
}
.gallery.papotage-gallery .gallery-icon a {
	display: block;
	border: 0;
	box-shadow: none;
}
.gallery.papotage-gallery img {
	display: block;
	width: 100%;
	height: auto;
	border: 0;
	margin: 0;
	padding: 0;
}
.gallery.papotage-gallery > br {
	display: none;
}
.gallery.papotage-gallery .gallery-caption {
	display: none;
}

/* タイル状：JSが行を作ったあと。どの行も横いっぱいにそろえる（JSが動かないときは、上のflex-wrapのまま）。 */
.gallery.papotage-type-tile.is-laid-out {
	display: block;
}
.gallery.papotage-type-tile.is-laid-out::after {
	display: none;
}
.gallery.papotage-type-tile .papotage-row {
	display: flex;
	gap: 6px;
	margin: 0 0 6px;
}
.gallery.papotage-type-tile .papotage-row:last-child {
	margin-bottom: 0;
}
.gallery.papotage-type-tile .papotage-row .gallery-item {
	flex: var(--r, 1) 1 0;
	min-width: 0;
}

/* type="square": 正方形に切りそろえる。列の数は columns で決まる。 */
.gallery.papotage-type-square::after {
	display: none;
}
.gallery.papotage-type-square .gallery-item {
	flex: 0 0 calc((100% - 12px) / 3);
}
.gallery.papotage-type-square img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.gallery.papotage-type-square.gallery-columns-1 .gallery-item { flex-basis: calc((100% - 0px) / 1); }
.gallery.papotage-type-square.gallery-columns-2 .gallery-item { flex-basis: calc((100% - 6px) / 2); }
.gallery.papotage-type-square.gallery-columns-3 .gallery-item { flex-basis: calc((100% - 12px) / 3); }
.gallery.papotage-type-square.gallery-columns-4 .gallery-item { flex-basis: calc((100% - 18px) / 4); }
.gallery.papotage-type-square.gallery-columns-5 .gallery-item { flex-basis: calc((100% - 24px) / 5); }
.gallery.papotage-type-square.gallery-columns-6 .gallery-item { flex-basis: calc((100% - 30px) / 6); }
.gallery.papotage-type-square.gallery-columns-7 .gallery-item { flex-basis: calc((100% - 36px) / 7); }
.gallery.papotage-type-square.gallery-columns-8 .gallery-item { flex-basis: calc((100% - 42px) / 8); }
.gallery.papotage-type-square.gallery-columns-9 .gallery-item { flex-basis: calc((100% - 48px) / 9); }

/* 拡大表示 */
.papotage-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .88);
}
.papotage-lightbox.is-open {
	display: flex;
}
.papotage-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	box-shadow: 0 0 24px rgba(0, 0, 0, .5);
}
.papotage-lightbox button {
	position: absolute;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	color: #333;
	font: 28px/48px sans-serif;
	text-align: center;
	cursor: pointer;
	padding: 0;
}
.papotage-lightbox__close { top: 16px; right: 16px; }
.papotage-lightbox__prev { left: 16px; top: 50%; margin-top: -24px; }
.papotage-lightbox__next { right: 16px; top: 50%; margin-top: -24px; }
.papotage-lightbox__count {
	position: absolute;
	bottom: 14px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font: 13px/1 sans-serif;
}
