.apsp-gallery {
	margin-top: 2.5rem;
	padding-top: 0.25rem;
}

.apsp-gallery__grid {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
	gap: 1.25rem;
}

.apsp-gallery__grid > li,
.apsp-gallery figure {
	margin: 0;
}

.apsp-gallery__open {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid #d5dee7;
	border-radius: 4px;
	background: #e8eef4;
	cursor: zoom-in;
	overflow: hidden;
}

.apsp-gallery__open img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.apsp-gallery__zoom {
	position: absolute;
	right: 0.6rem;
	bottom: 0.6rem;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	background: rgba(0, 32, 64, 0.82);
	color: #fff;
	font-size: 0.875rem;
	line-height: 1.4;
}

.apsp-gallery__open:hover .apsp-gallery__zoom,
.apsp-gallery__open:focus-visible .apsp-gallery__zoom {
	background: #0066cc;
}

.apsp-gallery__open:focus-visible {
	outline: 3px solid #0066cc;
	outline-offset: 3px;
}

.apsp-gallery figcaption {
	margin-top: 0.55rem;
	color: #1a1a1a;
	font-size: 1rem;
	line-height: 1.45;
}

.apsp-gallery__dialog {
	width: min(62rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	margin: auto;
	padding: 1rem 1rem 1.25rem;
	border: 0;
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
}

.apsp-gallery__dialog::backdrop {
	background: rgba(0, 20, 40, 0.78);
}

.apsp-gallery__dialog-bar,
.apsp-gallery__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.apsp-gallery__count {
	margin: 0;
	font-weight: 700;
}

.apsp-gallery__dialog button {
	min-height: 2.75rem;
	padding: 0.4rem 0.9rem;
	border: 2px solid #0066cc;
	border-radius: 4px;
	background: #fff;
	color: #004d99;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.apsp-gallery__dialog button:hover,
.apsp-gallery__dialog button:focus-visible {
	background: #0066cc;
	color: #fff;
}

.apsp-gallery__dialog button:focus-visible {
	outline: 3px solid #f5b335;
	outline-offset: 2px;
}

.apsp-gallery__full {
	display: block;
	width: 100%;
	max-height: 68vh;
	margin-top: 0.75rem;
	object-fit: contain;
	background: #0b1f33;
}

.apsp-gallery__dialog-caption {
	margin: 0.75rem 0;
	font-size: 1.05rem;
	line-height: 1.45;
}

.apsp-gallery__nav {
	justify-content: flex-start;
}

@media (max-width: 40rem) {
	.apsp-gallery__nav {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apsp-gallery__dialog,
	.apsp-gallery__open {
		transition: none;
	}
}
