/**
 * Media Gallery Pro — front-end styles.
 *
 * Everything tunable is a CSS custom property written inline on the gallery
 * wrapper by PHP, so a single stylesheet serves any number of galleries on a
 * page, each with its own columns, depth, radius and accent.
 *
 * @package MediaGalleryPro
 */

.mgp-gallery {
	/* Fallbacks; PHP overrides these inline per gallery. */
	--mgp-cols-d: 3;
	--mgp-cols-t: 2;
	--mgp-cols-m: 1;
	--mgp-gap: 24px;
	--mgp-depth: 6px;
	--mgp-radius: 16px;
	--mgp-ratio: 4 / 3;

	/*
	 * Visual gutter. Only the isometric style casts a hard offset slab, so
	 * only it needs the extra room; soft and flat use the gap as authored.
	 */
	--mgp-gutter: var(--mgp-gap);

	--mgp-accent: #111111;
	--mgp-surface: #ffffff;
	--mgp-line: #111111;
	--mgp-text: #14161a;
	--mgp-muted: #5b6270;
	--mgp-chip: #f3f4f6;
	--mgp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

	box-sizing: border-box;
	color: var(--mgp-text);

	/*
	 * Named container so the grid responds to the gallery's own width rather
	 * than the viewport: a gallery in a narrow sidebar should go single-column
	 * even on a wide screen. Also what makes the admin preview's device sizes
	 * work by simply resizing the wrapper.
	 */
	container: mgp / inline-size;
}

.mgp-gallery *,
.mgp-gallery *::before,
.mgp-gallery *::after {
	box-sizing: inherit;
}

/* -------------------------------------------------------------------------
 * Toolbar: filters, search, sort
 * ---------------------------------------------------------------------- */

.mgp-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-bottom: var(--mgp-gutter);
}

.mgp-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.mgp-toolbar__right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.mgp-filter {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 9px 16px;
	border: 2px solid var(--mgp-line);
	border-radius: calc(var(--mgp-radius) * 0.6);
	background: var(--mgp-surface);
	color: var(--mgp-text);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.2s var(--mgp-ease), box-shadow 0.2s var(--mgp-ease),
		background-color 0.2s var(--mgp-ease), color 0.2s var(--mgp-ease);
}

.mgp-filter__count {
	display: inline-block;
	min-width: 1.4em;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--mgp-chip);
	color: var(--mgp-muted);
	font-size: 0.75em;
	font-weight: 700;
	text-align: center;
	transition: background-color 0.2s var(--mgp-ease), color 0.2s var(--mgp-ease);
}

.mgp-filter:hover {
	transform: translate3d(-1px, -1px, 0);
}

.mgp-filter:focus-visible {
	outline: 3px solid var(--mgp-accent);
	outline-offset: 3px;
}

.mgp-filter.is-active {
	background: var(--mgp-accent);
	border-color: var(--mgp-accent);
	color: #fff;
}

.mgp-filter.is-active .mgp-filter__count {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

.mgp-search__input,
.mgp-sort__select {
	appearance: none;
	max-width: 100%;
	padding: 9px 14px;
	border: 2px solid var(--mgp-line);
	border-radius: calc(var(--mgp-radius) * 0.6);
	background: var(--mgp-surface);
	color: var(--mgp-text);
	font: inherit;
	font-size: 0.875rem;
	line-height: 1.2;
}

.mgp-sort__select {
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2314161a'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 18px 18px;
	cursor: pointer;
}

.mgp-search__input:focus-visible,
.mgp-sort__select:focus-visible {
	outline: 3px solid var(--mgp-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Responsive grid — the "grid numbers" options
 * ---------------------------------------------------------------------- */

.mgp-grid {
	display: grid;
	grid-template-columns: repeat(var(--mgp-cols-m), minmax(0, 1fr));
	gap: var(--mgp-gutter);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Masonry via CSS multi-column; cards keep their natural height. */
.mgp-layout-masonry .mgp-grid {
	display: block;
	column-count: var(--mgp-cols-m);
	column-gap: var(--mgp-gutter);
}

/*
 * Breakpoints are expressed twice on purpose. Container queries are the real
 * behaviour; the viewport fallback only runs where they are unsupported. The
 * two must not both apply, or a wide viewport would force desktop columns onto
 * a narrow container, so @supports keeps them mutually exclusive.
 */
@supports not (container-type: inline-size) {
	@media (min-width: 600px) {
		.mgp-grid {
			grid-template-columns: repeat(var(--mgp-cols-t), minmax(0, 1fr));
		}

		.mgp-layout-masonry .mgp-grid {
			column-count: var(--mgp-cols-t);
		}
	}

	@media (min-width: 1024px) {
		.mgp-grid {
			grid-template-columns: repeat(var(--mgp-cols-d), minmax(0, 1fr));
		}

		.mgp-layout-masonry .mgp-grid {
			column-count: var(--mgp-cols-d);
		}
	}
}

@supports (container-type: inline-size) {
	@container mgp (min-width: 600px) {
		.mgp-grid {
			grid-template-columns: repeat(var(--mgp-cols-t), minmax(0, 1fr));
		}

		.mgp-layout-masonry .mgp-grid {
			column-count: var(--mgp-cols-t);
		}
	}

	@container mgp (min-width: 1024px) {
		.mgp-grid {
			grid-template-columns: repeat(var(--mgp-cols-d), minmax(0, 1fr));
		}

		.mgp-layout-masonry .mgp-grid {
			column-count: var(--mgp-cols-d);
		}
	}
}

/* -------------------------------------------------------------------------
 * Playlist layout — big player, scrollable list beside it
 * ---------------------------------------------------------------------- */

.mgp-theater {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--mgp-gutter);
	/* Stretch so the list column ends level with the player. */
	align-items: stretch;
}

@supports (container-type: inline-size) {
	@container mgp (min-width: 800px) {
		.mgp-theater {
			grid-template-columns: minmax(0, 1fr) clamp(260px, 30%, 380px);
		}
	}
}

@supports not (container-type: inline-size) {
	@media (min-width: 900px) {
		.mgp-theater {
			grid-template-columns: minmax(0, 1fr) clamp(260px, 30%, 380px);
		}
	}
}

.mgp-player {
	position: sticky;
	top: 16px;
}

.mgp-player__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--mgp-radius);
	background: #0a0c10;
}

.mgp-style-isometric .mgp-player__stage {
	border: 2px solid var(--mgp-line);
	box-shadow:
		var(--mgp-depth) var(--mgp-depth) 0 0 var(--mgp-accent),
		calc(var(--mgp-depth) * 1.6) calc(var(--mgp-depth) * 1.6) 24px -6px rgba(0, 0, 0, 0.28);
}

.mgp-style-soft .mgp-player__stage {
	box-shadow: 0 var(--mgp-depth) calc(var(--mgp-depth) * 4) -8px rgba(16, 24, 40, 0.4);
}

.mgp-player__stage > img,
.mgp-player__stage > video {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.mgp-player__poster {
	object-fit: cover !important;
}

/* The iframe wrapper produced by mgp-media.js. */
.mgp-player__stage .mgp-frame {
	position: absolute;
	inset: 0;
}

.mgp-player__stage .mgp-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.mgp-player__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	padding: 0;
	border: 0;
	background: rgba(8, 10, 14, 0.28);
	cursor: pointer;
	transition: background-color 0.25s var(--mgp-ease);
}

.mgp-player__play:hover {
	background: rgba(8, 10, 14, 0.42);
}

.mgp-player__play:focus-visible {
	outline: 3px solid var(--mgp-accent);
	outline-offset: -6px;
}

.mgp-player__play .mgp-play {
	position: static;
	width: 78px;
	height: 78px;
	margin: 0;
}

.mgp-player__meta {
	padding: 14px 2px 0;
}

.mgp-player__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.mgp-player__caption {
	margin: 6px 0 0;
	color: var(--mgp-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* The list column */
.mgp-theater__list {
	display: flex;
	flex-direction: column;
	min-width: 0;
	/* Lets the scroll area shrink inside the stretched column. */
	min-height: 0;
}

.mgp-layout-playlist .mgp-grid {
	display: block;
	flex: 1 1 auto;
	min-height: 0;
	max-height: min(70vh, 620px);
	padding-right: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.mgp-layout-playlist .mgp-item {
	margin-bottom: 10px;
}

/*
 * Every row is exactly the same height. Titles wrap to different lengths, so
 * without a fixed height the list becomes a ragged stack of mismatched cards.
 * The thumbnail width is derived from the row height so it stays 16:9.
 */
.mgp-layout-playlist {
	--mgp-row-h: 78px;
}

.mgp-layout-playlist .mgp-card {
	display: grid;
	grid-template-columns: calc(var(--mgp-row-h) * 16 / 9) minmax(0, 1fr);
	gap: 0;
	height: var(--mgp-row-h);
	align-items: stretch;
	overflow: hidden;
}

.mgp-layout-playlist .mgp-card__media {
	/* Fill the fixed row rather than imposing its own ratio. */
	aspect-ratio: auto;
	width: 100%;
	height: 100%;
	border-radius: calc(var(--mgp-radius) - 2px) 0 0 calc(var(--mgp-radius) - 2px);
}

.mgp-layout-playlist .mgp-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mgp-layout-playlist .mgp-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	padding: 8px 12px;
	overflow: hidden;
}

/*
 * Captions and tags would reintroduce variable height, and the caption is
 * already shown in full under the big player.
 */
.mgp-layout-playlist .mgp-card__caption,
.mgp-layout-playlist .mgp-card__tags {
	display: none;
}

.mgp-layout-playlist .mgp-play {
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	box-shadow: none;
}

.mgp-layout-playlist .mgp-play svg {
	width: 16px;
	height: 16px;
}

/* Currently playing row */
.mgp-layout-playlist .mgp-item.is-playing .mgp-card {
	border-color: var(--mgp-accent);
}

.mgp-style-isometric .mgp-item.is-playing .mgp-card {
	box-shadow:
		calc(var(--mgp-depth) * 0.7) calc(var(--mgp-depth) * 0.7) 0 0 var(--mgp-accent),
		0 0 0 2px var(--mgp-accent);
}

.mgp-layout-playlist .mgp-item.is-playing .mgp-card__title {
	color: var(--mgp-accent);
}

/* Hover lift is wrong for a list row; keep it still. */
.mgp-layout-playlist .mgp-card:hover,
.mgp-layout-playlist .mgp-card:focus-within {
	transform: none;
}

/* Design-screen toggles: preview renders every part, JS hides what is off. */
.mgp-no-title .mgp-card__title,
.mgp-no-caption .mgp-card__caption,
.mgp-no-tags .mgp-card__tags {
	display: none;
}

.mgp-no-title.mgp-no-caption.mgp-no-tags .mgp-card__body {
	display: none;
}

.mgp-layout-masonry .mgp-item {
	break-inside: avoid;
	margin-bottom: var(--mgp-gutter);
}

.mgp-layout-masonry .mgp-card__media {
	aspect-ratio: auto;
}

.mgp-layout-masonry .mgp-card__img {
	height: auto;
}

.mgp-item {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

/* Filter transitions */
.mgp-item.is-hidden {
	display: none;
}

.mgp-item.is-entering {
	animation: mgp-enter 0.32s var(--mgp-ease) both;
}

@keyframes mgp-enter {
	from {
		opacity: 0;
		transform: scale(0.94) translate3d(0, 8px, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */

.mgp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--mgp-radius);
	background: var(--mgp-surface);
	transform: translate3d(0, 0, 0);
	transition: transform 0.28s var(--mgp-ease), box-shadow 0.28s var(--mgp-ease);
}

.mgp-card__media {
	position: relative;
	aspect-ratio: var(--mgp-ratio);
	overflow: hidden;
	background: var(--mgp-chip);
}

.mgp-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--mgp-ease);
}

.mgp-card__img--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e9ebef 25%, #f4f5f7 25%, #f4f5f7 50%, #e9ebef 50%, #e9ebef 75%, #f4f5f7 75%);
	background-size: 16px 16px;
}

.mgp-card:hover .mgp-card__img,
.mgp-card:focus-within .mgp-card__img {
	transform: scale(1.06);
}

/* Play affordance on video items */
.mgp-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 62px;
	height: 62px;
	margin: -31px 0 0 -31px;
	border: 2px solid var(--mgp-line);
	border-radius: 50%;
	background: var(--mgp-surface);
	color: var(--mgp-text);
	box-shadow: calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 0.5) 0 0 var(--mgp-accent);
	transition: transform 0.28s var(--mgp-ease), box-shadow 0.28s var(--mgp-ease),
		background-color 0.28s var(--mgp-ease), color 0.28s var(--mgp-ease);
	pointer-events: none;
}

.mgp-play svg {
	margin-left: 3px;
}

.mgp-card:hover .mgp-play,
.mgp-card:focus-within .mgp-play {
	background: var(--mgp-accent);
	color: #fff;
	transform: scale(1.08);
	box-shadow: calc(var(--mgp-depth) * 0.7) calc(var(--mgp-depth) * 0.7) 0 0 rgba(0, 0, 0, 0.25);
}

.mgp-badge {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 4px 9px;
	border-radius: calc(var(--mgp-radius) * 0.4);
	background: rgba(10, 12, 16, 0.82);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.3;
	backdrop-filter: blur(4px);
}

.mgp-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px 18px;
}

.mgp-card__title {
	margin: 0;
	color: var(--mgp-text);
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: break-word;
}

.mgp-card__caption {
	margin: 0;
	color: var(--mgp-muted);
	font-size: 0.875rem;
	line-height: 1.5;
}

.mgp-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: auto 0 0;
	padding: 0;
	list-style: none;
}

.mgp-card__tag {
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--mgp-chip);
	color: var(--mgp-muted);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

/* Full-card click target, layered above the artwork */
.mgp-card__trigger {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--mgp-radius);
	background: transparent;
	cursor: pointer;
}

.mgp-card__trigger:focus-visible {
	outline: 3px solid var(--mgp-accent);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Style: Isometric — a hard offset slab layered under soft ambient shadow
 * ---------------------------------------------------------------------- */

.mgp-style-isometric {
	/* Make room for the hard slab so it never crowds the next card. */
	--mgp-gutter: calc(var(--mgp-gap) + var(--mgp-depth));
}

.mgp-style-isometric .mgp-card {
	border: 2px solid var(--mgp-line);
	box-shadow:
		var(--mgp-depth) var(--mgp-depth) 0 0 var(--mgp-accent),
		calc(var(--mgp-depth) * 1.6) calc(var(--mgp-depth) * 1.6) 24px -6px rgba(0, 0, 0, 0.28),
		0 1px 2px rgba(0, 0, 0, 0.1);
}

.mgp-style-isometric .mgp-card:hover,
.mgp-style-isometric .mgp-card:focus-within {
	transform: translate3d(calc(var(--mgp-depth) * -0.5), calc(var(--mgp-depth) * -0.5), 0);
	box-shadow:
		calc(var(--mgp-depth) * 1.5) calc(var(--mgp-depth) * 1.5) 0 0 var(--mgp-accent),
		calc(var(--mgp-depth) * 2) calc(var(--mgp-depth) * 2) 32px -4px rgba(0, 0, 0, 0.32),
		0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Inner radius nests correctly inside the 2px border. */
.mgp-style-isometric .mgp-card__media {
	border-radius: calc(var(--mgp-radius) - 2px) calc(var(--mgp-radius) - 2px) 0 0;
}

.mgp-style-isometric .mgp-filter {
	box-shadow: calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 0.5) 0 0 var(--mgp-accent);
}

.mgp-style-isometric .mgp-filter:hover {
	box-shadow: calc(var(--mgp-depth) * 0.75) calc(var(--mgp-depth) * 0.75) 0 0 var(--mgp-accent);
}

.mgp-style-isometric .mgp-filter.is-active {
	box-shadow: calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 0.5) 0 0 rgba(0, 0, 0, 0.3);
}

.mgp-style-isometric .mgp-search__input,
.mgp-style-isometric .mgp-sort__select {
	box-shadow: calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 0.5) 0 0 var(--mgp-accent);
}

/* -------------------------------------------------------------------------
 * Style: Soft — stacked blurred shadows, no hard slab
 * ---------------------------------------------------------------------- */

.mgp-style-soft .mgp-card {
	border: 1px solid rgba(17, 17, 17, 0.08);
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.06),
		0 calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 2) -4px rgba(16, 24, 40, 0.12),
		0 var(--mgp-depth) calc(var(--mgp-depth) * 4) -8px rgba(16, 24, 40, 0.16);
}

.mgp-style-soft .mgp-card:hover,
.mgp-style-soft .mgp-card:focus-within {
	transform: translate3d(0, calc(var(--mgp-depth) * -0.6), 0);
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.06),
		0 var(--mgp-depth) calc(var(--mgp-depth) * 3) -4px rgba(16, 24, 40, 0.18),
		0 calc(var(--mgp-depth) * 2) calc(var(--mgp-depth) * 6) -8px rgba(16, 24, 40, 0.22);
}

.mgp-style-soft .mgp-card__media {
	border-radius: calc(var(--mgp-radius) - 1px) calc(var(--mgp-radius) - 1px) 0 0;
}

.mgp-style-soft .mgp-filter,
.mgp-style-soft .mgp-search__input,
.mgp-style-soft .mgp-sort__select {
	border-width: 1px;
	border-color: rgba(17, 17, 17, 0.14);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.mgp-style-soft .mgp-play {
	border-width: 0;
	box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.35);
}

/* -------------------------------------------------------------------------
 * Style: Flat
 * ---------------------------------------------------------------------- */

.mgp-style-flat .mgp-card {
	border: 1px solid rgba(17, 17, 17, 0.12);
	box-shadow: none;
}

.mgp-style-flat .mgp-card:hover,
.mgp-style-flat .mgp-card:focus-within {
	border-color: var(--mgp-accent);
}

.mgp-style-flat .mgp-card__media {
	border-radius: calc(var(--mgp-radius) - 1px) calc(var(--mgp-radius) - 1px) 0 0;
}

.mgp-style-flat .mgp-filter,
.mgp-style-flat .mgp-search__input,
.mgp-style-flat .mgp-sort__select {
	border-width: 1px;
	border-color: rgba(17, 17, 17, 0.16);
}

.mgp-style-flat .mgp-play {
	border-width: 0;
	box-shadow: none;
}

/* -------------------------------------------------------------------------
 * Empty states
 * ---------------------------------------------------------------------- */

.mgp-empty,
.mgp-empty-notice {
	margin: 24px 0;
	padding: 28px 20px;
	border: 2px dashed rgba(17, 17, 17, 0.18);
	border-radius: var(--mgp-radius, 16px);
	color: #5b6270;
	text-align: center;
}

.mgp-a11y-status,
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------------------
 * Lightbox
 * ---------------------------------------------------------------------- */

.mgp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	padding: max(20px, 3vmin);
	border: 0;
	background: rgba(8, 10, 14, 0.88);
	opacity: 0;
	transition: opacity 0.25s ease;
}

/*
 * A class selector beats the UA's [hidden] { display: none }, so without this
 * a closed lightbox stays full-screen and swallows every click on the page.
 */
.mgp-lightbox[hidden] {
	display: none;
}

.mgp-lightbox.is-open {
	opacity: 1;
}

.mgp-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(1200px, 100%);
	max-height: 100%;
}

.mgp-lightbox__stage img,
.mgp-lightbox__stage video {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	border-radius: var(--mgp-lb-radius, 16px);
	box-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.7);
	object-fit: contain;
}

.mgp-lightbox__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 120px);
	overflow: hidden;
	border-radius: var(--mgp-lb-radius, 16px);
	background: #000;
	box-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.7);
}

.mgp-lightbox__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.mgp-lightbox__caption {
	position: absolute;
	bottom: -42px;
	left: 0;
	right: 0;
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.9375rem;
	text-align: center;
}

.mgp-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.28);
	border-radius: 50%;
	background: rgba(20, 22, 26, 0.72);
	color: #fff;
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.mgp-lightbox__btn:hover {
	background: rgba(20, 22, 26, 0.95);
	border-color: rgba(255, 255, 255, 0.6);
	transform: scale(1.06);
}

.mgp-lightbox__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.mgp-lightbox__close {
	top: max(16px, 3vmin);
	right: max(16px, 3vmin);
}

.mgp-lightbox__prev {
	top: 50%;
	left: max(10px, 2vmin);
	margin-top: -23px;
}

.mgp-lightbox__next {
	top: 50%;
	right: max(10px, 2vmin);
	margin-top: -23px;
}

.mgp-lightbox__btn[hidden] {
	display: none;
}

body.mgp-lightbox-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Dark mode
 * ---------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.mgp-gallery {
		--mgp-surface: #171a1f;
		--mgp-line: #33383f;
		--mgp-text: #eceef2;
		--mgp-muted: #a2a9b6;
		--mgp-chip: #23272e;
	}

	.mgp-sort__select {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23eceef2'/%3E%3C/svg%3E");
	}

	.mgp-style-soft .mgp-card,
	.mgp-style-flat .mgp-card {
		border-color: rgba(255, 255, 255, 0.12);
	}

	.mgp-style-soft .mgp-filter,
	.mgp-style-soft .mgp-search__input,
	.mgp-style-soft .mgp-sort__select,
	.mgp-style-flat .mgp-filter,
	.mgp-style-flat .mgp-search__input,
	.mgp-style-flat .mgp-sort__select {
		border-color: rgba(255, 255, 255, 0.16);
	}

	.mgp-empty,
	.mgp-empty-notice {
		border-color: rgba(255, 255, 255, 0.18);
		color: #a2a9b6;
	}
}

/* -------------------------------------------------------------------------
 * Motion preferences
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.mgp-gallery *,
	.mgp-lightbox * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.mgp-card:hover,
	.mgp-card:focus-within,
	.mgp-filter:hover,
	.mgp-card:hover .mgp-card__img,
	.mgp-card:focus-within .mgp-card__img,
	.mgp-card:hover .mgp-play,
	.mgp-card:focus-within .mgp-play {
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * Theme hardening
 *
 * Card titles are <h3> and captions are <p>, which themes style heavily —
 * ".entry-content h3" (0,1,1) outranks ".mgp-card__title" (0,1,0), so a theme
 * could inflate the font, add margins, or uppercase it. Every rule here is
 * scoped to .mgp-gallery for the extra class, and restates the properties
 * themes commonly set rather than relying on defaults.
 * ---------------------------------------------------------------------- */

.mgp-gallery .mgp-card .mgp-card__title,
.mgp-gallery .mgp-card .mgp-card__caption,
.mgp-gallery .mgp-player .mgp-player__title,
.mgp-gallery .mgp-player .mgp-player__caption,
.mgp-gallery .mgp-card .mgp-card__tag,
.mgp-gallery .mgp-filter,
.mgp-gallery .mgp-card .mgp-badge, .mgp-gallery .mgp-badge {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: inherit;
	font-style: normal;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	text-shadow: none;
	overflow-wrap: anywhere;
}

.mgp-gallery .mgp-card .mgp-card__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--mgp-text);
	/* Three lines is plenty; beyond that one card would tower over the rest. */
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.mgp-gallery .mgp-card .mgp-card__caption {
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--mgp-muted);
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.mgp-gallery .mgp-player .mgp-player__title {
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--mgp-text);
}

.mgp-gallery .mgp-player .mgp-player__caption {
	margin-top: 6px;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--mgp-muted);
}

.mgp-gallery .mgp-card .mgp-card__tag {
	padding: 3px 9px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.mgp-gallery .mgp-filter {
	padding: 9px 16px;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
}

.mgp-gallery .mgp-badge {
	padding: 4px 9px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

/* The list column is narrow, so titles are a touch smaller and capped at two
   lines to keep every row the same height. */
.mgp-gallery.mgp-layout-playlist .mgp-card .mgp-card__title {
	font-size: 0.9375rem;
	line-height: 1.3;
	-webkit-line-clamp: 2;
}

/* -------------------------------------------------------------------------
 * Layout switcher (visitor-facing)
 * ---------------------------------------------------------------------- */

.mgp-layouts {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	border: 2px solid var(--mgp-line);
	border-radius: calc(var(--mgp-radius) * 0.6);
	background: var(--mgp-surface);
}

.mgp-style-isometric .mgp-layouts {
	box-shadow: calc(var(--mgp-depth) * 0.5) calc(var(--mgp-depth) * 0.5) 0 0 var(--mgp-accent);
}

.mgp-style-soft .mgp-layouts,
.mgp-style-flat .mgp-layouts {
	border-width: 1px;
	border-color: rgba(17, 17, 17, 0.16);
}

.mgp-layouts__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 12px;
	border: 0;
	border-radius: calc(var(--mgp-radius) * 0.45);
	background: transparent;
	color: var(--mgp-muted);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s var(--mgp-ease), color 0.2s var(--mgp-ease);
}

.mgp-layouts__btn:hover {
	color: var(--mgp-text);
	background: var(--mgp-chip);
}

.mgp-layouts__btn.is-active {
	background: var(--mgp-accent);
	color: #fff;
}

.mgp-layouts__btn:focus-visible {
	outline: 3px solid var(--mgp-accent);
	outline-offset: 2px;
}

.mgp-layouts__icon {
	display: inline-flex;
}

/* Labels are helpful on desktop, noise on a phone. */
@container mgp (max-width: 560px) {
	.mgp-layouts__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}
