.fsra-gallery-parity {
	/* The mobile breakpoint pads this box; without border-box it overflowed. */
	box-sizing: border-box;
	width: min(85vw, 1480px);
	margin-inline: auto;
}

body:not(.wp-admin) .wp-block-post-content:has(.fsra-gallery-parity),
body:not(.wp-admin) .wp-block-post-content:has(.fsra-gallery-album-shell) {
	width: 100%;
	max-width: none !important;
	margin-inline: 0 !important;
}

/* Remove the core content-width limit from the gallery grid. */
body:not(.wp-admin) .wp-block-post-content > .fsra-gallery-parity {
	max-width: none;
	margin-inline: auto !important;
}

/* Align template titles with the gallery grid. */
body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title {
	box-sizing: border-box;
	position: relative;
	width: min(82vw, 1440px);
	max-width: none;
	margin: 0 auto clamp(3.5rem, 6vw, 6rem) !important;
	padding-top: 3rem;
}

body:not(.wp-admin) .fsra-page-main:has(.fsra-gallery-parity) {
	width: 100%;
	max-width: none;
	margin: 0 !important;
	padding-top: 0 !important;
	padding-inline: 0 !important;
}

body:not(.wp-admin) .fsra-page-main:has(.fsra-gallery-parity) > .wp-block-post-content {
	margin-block-start: 0 !important;
}

.fsra-gallery-parity__header {
	box-sizing: border-box;
	position: relative;
	width: min(82vw, 1440px);
	max-width: 100%;
	margin: 0 auto clamp(3.5rem, 6vw, 6rem);
	padding-top: 3rem;
}

.fsra-gallery-parity__header::before,
body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title::before {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: clamp(4.5rem, 8vw, 7rem);
	height: 0.3rem;
	background: linear-gradient(90deg, #AF0000, #0AA7D9);
	content: "";
	pointer-events: none;
}

.fsra-gallery-parity__header h1,
body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title {
	margin-top: 0 !important;
	color: #071a33;
	font-family: var(--wp--preset--font-family--orbitron, "Futura PT", Futura, Jost, sans-serif);
	font-size: clamp(3.4rem, 8vw, 7.5rem) !important;
	font-weight: 800;
	line-height: 0.92;
	letter-spacing: -0.03em;
	text-align: left !important;
	text-transform: none !important;
	text-wrap: balance;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
}

.fsra-gallery-parity__header h1 {
	max-width: 13ch;
	margin: 0 !important;
}

/* Keep album previews large and let the available width choose the column count. */
.fsra-gallery-parity__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	gap: clamp(1rem, 1.5vw, 1.5rem);
	align-items: start;
}

/* Album cover tile. */
.fsra-gallery-parity-card {
	position: relative;
	display: block;
	min-width: 0;
	height: auto !important;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border: 1px solid rgba(7, 26, 51, 0.12);
	border-radius: var(--fsra-radius-card, 1rem);
	background: #071a33;
	box-shadow: 0 0.75rem 2rem rgba(7, 26, 51, 0.07);
	transition: transform 320ms var(--fsra-ease-out, ease), border-color 320ms ease, box-shadow 320ms ease;
}

.fsra-gallery-parity-card:hover,
.fsra-gallery-parity-card:focus-within {
	transform: translateY(-0.25rem);
	border-color: rgba(175, 0, 0, 0.35);
	box-shadow: 0 1.4rem 3rem rgba(7, 26, 51, 0.2);
}

.fsra-gallery-parity-card__media {
	position: absolute;
	inset: 0;
	background: #071a33;
}

.fsra-gallery-parity-card__open {
	position: absolute;
	inset: 0;
	display: block;
	color: inherit;
	text-decoration: none;
}

/* Scrim behind the label so the album name stays legible on any cover. */
.fsra-gallery-parity-card__open::after {
	position: absolute;
	z-index: 1;
	right: 0;
	bottom: 0;
	left: 0;
	height: 70%;
	background: linear-gradient(to top, rgba(4, 15, 31, 0.96) 0%, rgba(4, 15, 31, 0.76) 38%, rgba(4, 15, 31, 0) 100%);
	content: "";
	pointer-events: none;
	transition: opacity 320ms ease;
}

.fsra-gallery-parity-card__open:focus-visible,
.fsra-gallery-parity-card__link:focus-visible,
.fsra-gallery-parity-dialog button:focus-visible {
	outline: 3px solid #1b6fd1;
	outline-offset: -3px;
}

.fsra-gallery-parity-card__open img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	object-position: center;
	transition: transform 620ms var(--fsra-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

/* Album cover hover. */
.fsra-gallery-parity-card:hover .fsra-gallery-parity-card__open img,
.fsra-gallery-parity-card:focus-within .fsra-gallery-parity-card__open img {
	transform: scale(1.06);
}

.fsra-gallery-parity-card__affordance {
	position: absolute;
	z-index: 2;
	top: 0.7rem;
	right: 0.7rem;
	display: grid;
	width: 2.3rem;
	height: 2.3rem;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	background: rgba(7, 26, 51, 0.82);
	color: #fff;
	font-size: 1.45rem;
	font-weight: 400;
	line-height: 1;
	backdrop-filter: blur(0.35rem);
}

/*
 * Albums whose media lives on the canonical site and could not be resolved. The
 * tile stays dark so the overlaid album name reads the same as on a real cover.
 */
.fsra-gallery-parity-card__placeholder {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	padding: 1.25rem;
	background:
		linear-gradient(135deg, rgba(7, 38, 78, 0.92), rgba(175, 0, 0, 0.5)),
		#071a33;
	color: rgba(255, 255, 255, 0.66);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
}

/* Clear of the album name, which is pinned to the bottom of the tile. */
.fsra-gallery-parity-card__placeholder > span {
	padding: 0;
	transform: translateY(-1.1rem);
}

.fsra-gallery-parity-card__title {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	margin: 0;
	padding: 0.85rem 1rem 0.95rem;
	border-top: 0;
	background: none;
	color: #fff !important;
	font-size: clamp(1rem, 1vw, 1.12rem);
	font-weight: 800;
	letter-spacing: -0.005em;
	line-height: 1.28;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	text-transform: none;
	white-space: normal;
	hyphens: auto;
	overflow-wrap: break-word;
	transition: transform 320ms var(--fsra-ease-out, ease);
}

/* Override the global light-canvas heading color inside image overlays. */
body:not(.wp-admin) :is(main, #wp--skip-link--target) .fsra-gallery-parity .fsra-gallery-parity-card__title {
	color: #fff !important;
}

.fsra-gallery-parity-card:hover .fsra-gallery-parity-card__title,
.fsra-gallery-parity-card:focus-within .fsra-gallery-parity-card__title {
	transform: translateY(-0.15rem);
}

.fsra-gallery-parity-dialog[hidden] {
	display: none;
}

.fsra-gallery-parity-dialog {
	position: fixed;
	inset: 0;
	z-index: 12000;
	display: grid;
	place-items: center;
	padding: clamp(0.75rem, 3vw, 2rem);
}

.fsra-gallery-parity-dialog__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: rgba(2, 10, 22, 0.9);
	cursor: zoom-out;
}

.fsra-gallery-parity-dialog__panel {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	width: min(100%, 86rem);
	max-height: calc(100vh - 2rem);
}

.fsra-gallery-parity-dialog figure {
	display: grid;
	min-width: 0;
	max-height: calc(100vh - 2rem);
	margin: 0;
	place-items: center;
}

.fsra-gallery-parity-dialog img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 7rem);
	border-radius: 0.65rem;
	object-fit: contain;
	box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.38);
}

.fsra-gallery-parity-dialog figcaption {
	max-width: 68ch;
	padding: 0.75rem 1rem 0;
	color: #fff;
	font-size: 0.92rem;
	line-height: 1.5;
	text-align: center;
}

.fsra-gallery-parity-dialog__close,
.fsra-gallery-parity-dialog__previous,
.fsra-gallery-parity-dialog__next {
	display: grid;
	width: 2.8rem;
	height: 2.8rem;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 50%;
	background: rgba(7, 26, 51, 0.86);
	color: #fff;
	cursor: pointer;
	font-size: 2rem;
	line-height: 1;
}

.fsra-gallery-parity-dialog__close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	font-size: 1.55rem;
	transform: translate(30%, -30%);
}

.fsra-gallery-parity-dialog__previous {
	margin-right: 0.75rem;
}

.fsra-gallery-parity-dialog__next {
	margin-left: 0.75rem;
}

.fsra-gallery-parity-dialog button:disabled {
	opacity: 0.35;
	cursor: default;
}

body.fsra-gallery-parity-open {
	overflow: hidden;
}

.fsra-gallery-album-shell {
	width: min(82vw, 1440px);
	margin-inline: auto;
	padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3.5rem, 7vw, 7rem);
}

.fsra-gallery-album-nav {
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.fsra-gallery-album-nav__back {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	min-height: 2.75rem;
	padding: 0.55rem 0.85rem;
	border: 1px solid rgba(7, 26, 51, 0.14);
	border-radius: var(--fsra-radius-control, 0.625rem);
	background: #fff;
	color: #071a33;
	font-weight: 750;
	line-height: 1.25;
	text-decoration: none;
	transition: transform 280ms var(--fsra-ease-out, ease), border-color 280ms ease, box-shadow 280ms ease;
}

.fsra-gallery-album-nav__back:hover,
.fsra-gallery-album-nav__back:focus-visible {
	transform: translateX(-0.18rem);
	border-color: rgba(175, 0, 0, 0.36);
	box-shadow: 0 0.65rem 1.5rem rgba(7, 26, 51, 0.08);
}

.fsra-gallery-album-nav__back:focus-visible,
.fsra-gallery-single__thumb:focus-visible {
	outline: 3px solid #1b6fd1;
	outline-offset: 3px;
}

.fsra-gallery-album-header {
	max-width: 68rem;
	margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.fsra-gallery-album-header h1 {
	margin: 0;
	color: #071a33;
	font-size: clamp(2rem, 4.5vw, 4.25rem);
	line-height: 1.04;
	letter-spacing: -0.035em;
	hyphens: auto;
	overflow-wrap: anywhere;
}

.fsra-gallery-album-shell .fsra-gallery-single {
	width: 100%;
	margin: 0;
}

.fsra-gallery-album-shell .fsra-gallery-single__header:empty {
	display: none;
}

.fsra-gallery-album-shell .fsra-gallery-single__description {
	max-width: 72ch;
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
	color: var(--fsra-page-muted, #526174);
	line-height: 1.7;
}

.fsra-gallery-album-shell .fsra-gallery-single__grid--mosaic {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	grid-auto-flow: row;
	grid-auto-rows: auto;
	gap: clamp(0.9rem, 1.8vw, 1.4rem);
	align-items: stretch;
}

.fsra-gallery-album-shell .fsra-gallery-single__grid--mosaic .fsra-gallery-single__thumb:nth-child(n) {
	grid-column: auto;
	grid-row: auto;
	min-height: 0;
	aspect-ratio: 4 / 3;
	border: 1px solid rgba(7, 26, 51, 0.1);
	border-radius: var(--fsra-radius-card, 1rem);
	background: #eef3f8;
	box-shadow: 0 0.65rem 1.8rem rgba(7, 26, 51, 0.07);
	transition: transform 320ms var(--fsra-ease-out, ease), border-color 320ms ease, box-shadow 320ms ease;
}

.fsra-gallery-album-shell .fsra-gallery-single__thumb:hover,
.fsra-gallery-album-shell .fsra-gallery-single__thumb:focus-visible {
	transform: translateY(-0.18rem);
	border-color: rgba(175, 0, 0, 0.3);
	box-shadow: 0 1rem 2.25rem rgba(7, 26, 51, 0.11);
}

.fsra-gallery-album-shell .fsra-gallery-single__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.fsra-gallery-album-shell .fsra-gallery-empty {
	margin: 0;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid rgba(7, 26, 51, 0.12);
	border-radius: var(--fsra-radius-card, 1rem);
	background: #fff;
	color: var(--fsra-page-muted, #526174);
}

@media (max-width: 1199px) {
	.fsra-gallery-parity,
	.fsra-gallery-album-shell,
	body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title {
		width: min(92vw, 1120px);
	}

	.fsra-gallery-parity__header {
		width: min(92vw, 1120px);
	}
}

@media (max-width: 1023px) {
	.fsra-gallery-parity__grid {
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	}
}

@media (max-width: 799px) {
	.fsra-gallery-parity__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.fsra-gallery-parity,
	.fsra-gallery-album-shell,
	body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title {
		width: 100%;
		padding-inline: max(1rem, env(safe-area-inset-left));
	}

	.fsra-gallery-parity__header {
		width: 100%;
	}

	body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title::before {
		left: max(1rem, env(safe-area-inset-left));
	}

	.fsra-gallery-parity__header h1,
	body:not(.wp-admin) main:has(.fsra-gallery-parity) > .wp-block-post-title {
		font-size: clamp(3rem, 16vw, 5.75rem) !important;
	}

	.fsra-gallery-parity__grid {
		grid-template-columns: 1fr;
	}

	.fsra-gallery-parity-dialog__panel {
		grid-template-columns: 1fr;
	}

	.fsra-gallery-parity-dialog__previous,
	.fsra-gallery-parity-dialog__next {
		position: absolute;
		bottom: 0.75rem;
		z-index: 2;
		margin: 0;
	}

	.fsra-gallery-parity-dialog__previous {
		left: 0.75rem;
	}

	.fsra-gallery-parity-dialog__next {
		right: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fsra-gallery-parity-card,
	.fsra-gallery-parity-card__open img,
	.fsra-gallery-parity-card__title,
	.fsra-gallery-album-nav__back,
	.fsra-gallery-album-shell .fsra-gallery-single__thumb {
		transition: none;
	}

	.fsra-gallery-parity-card:hover,
	.fsra-gallery-parity-card:focus-within,
	.fsra-gallery-parity-card:hover .fsra-gallery-parity-card__open img,
	.fsra-gallery-parity-card:focus-within .fsra-gallery-parity-card__open img,
	.fsra-gallery-parity-card:hover .fsra-gallery-parity-card__title,
	.fsra-gallery-parity-card:focus-within .fsra-gallery-parity-card__title,
	.fsra-gallery-album-nav__back:hover,
	.fsra-gallery-album-nav__back:focus-visible,
	.fsra-gallery-album-shell .fsra-gallery-single__thumb:hover,
	.fsra-gallery-album-shell .fsra-gallery-single__thumb:focus-visible {
		transform: none;
	}
}
