/* PDF Figures widget — responsive figure grid. */
.pdftopost-figures {
	margin: 0 0 1.5rem;
}

.pdftopost-figures-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 0.4rem;
	color: #1f2335;
}

.pdftopost-figures-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.pdftopost-figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #aab0cf;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(49, 46, 86, 0.08);
}

.pdftopost-figure-link {
	display: block;
	line-height: 0;
}

.pdftopost-figure-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #ffffff;
}

.pdftopost-figure-caption {
	font-size: 0.85rem;
	line-height: 1.4;
	color: #4a4f63;
	padding: 0.6rem 0.75rem;
	border-top: 1px solid #eef0f8;
}

.pdftopost-figures--placeholder {
	padding: 1rem;
	border: 1px dashed #c7cbe0;
	border-radius: 10px;
	color: #6b7186;
	background: #f7f8fc;
}

@media (max-width: 1024px) {
	.pdftopost-figures-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.pdftopost-figures-grid { grid-template-columns: 1fr; }
}

/* ── Carousel layout ── */
.pdftopost-figures-viewport {
	position: relative;
}

/* Edge-fade scroll hints — same as the related carousel. ::before (left)
   fades in when scrolled (has-prev); ::after (right) when more remains
   (has-next). Sit above the images, below the arrows; never block taps. */
.pdftopost-figures-viewport::before,
.pdftopost-figures-viewport::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 4px;
	width: 56px;
	pointer-events: none;
	z-index: 2;
	opacity: 0;
	transition: opacity 0.22s ease;
}

.pdftopost-figures-viewport::before {
	left: 0;
	background: linear-gradient(
		to right,
		rgba(242, 244, 254, 1) 0%,
		rgba(242, 244, 254, 0.85) 40%,
		rgba(242, 244, 254, 0) 100%
	);
}

.pdftopost-figures-viewport::after {
	right: 0;
	background: linear-gradient(
		to left,
		rgba(242, 244, 254, 1) 0%,
		rgba(242, 244, 254, 0.85) 40%,
		rgba(242, 244, 254, 0) 100%
	);
}

.pdftopost-figures-viewport.has-prev::before { opacity: 1; }
.pdftopost-figures-viewport.has-next::after  { opacity: 1; }

.pdftopost-figures-track {
	display: flex;
	gap: 0.45rem;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	scrollbar-width: none;
	/* No left/right inner spacing (figures sit flush to the edges); bottom
	   keeps the scrollbar gap. */
	padding: 0 0 4px;
}

/* Round only the outer corners: first figure's left side, last figure's
   right side — nothing in between. */
.pdftopost-figures-track .pdftopost-figure:first-child {
	border-top-left-radius: 26px;
	border-bottom-left-radius: 26px;
}

.pdftopost-figures-track .pdftopost-figure:last-child {
	border-top-right-radius: 26px;
	border-bottom-right-radius: 26px;
}

.pdftopost-figures-track::-webkit-scrollbar {
	display: none;
}

.pdftopost-figures--carousel .pdftopost-figure {
	flex: 0 0 280px;
	width: 280px;
	scroll-snap-align: start;
}

/* Prev/next arrows — same navy-on-white style as the related carousel. */
.pdftopost-figures-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	background: #ffffff;
	color: #312e56;
	border: 1px solid #e0e3f5;
	border-radius: 50%;
	box-shadow: 0 6px 16px -4px rgba(49, 46, 86, 0.18), 0 1px 2px rgba(49, 46, 86, 0.10);
	cursor: pointer;
	transition: opacity 0.22s ease, transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pdftopost-figures-nav svg {
	width: 20px;
	height: 20px;
	display: block;
}

.pdftopost-figures-nav:hover {
	background: #1f1d3d;
	color: #ffffff;
	border-color: transparent;
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 10px 24px -6px rgba(49, 46, 86, 0.55);
}

.pdftopost-figures-nav:active {
	transform: translateY(-50%) scale(0.96);
}

.pdftopost-figures-nav:focus-visible {
	outline: 3px solid rgba(49, 46, 86, 0.35);
	outline-offset: 2px;
}

.pdftopost-figures-prev { left: -8px; }
.pdftopost-figures-next { right: -8px; }

.pdftopost-figures-nav[disabled] {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

