.media-gallery__content {
	margin-bottom: 64px;
	text-align: center;
}

.media-gallery__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 42px;
}

.media-gallery__filter {
	appearance: none;
	border: 2px solid var(--medium);
	background: transparent;
	color: var(--medium);
	border-radius: 999px;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.72px;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.media-gallery__filter:hover,
.media-gallery__filter:focus-visible {
	border-color: var(--primary-color);
	color: var(--primary-color);
	outline: none;
}

.media-gallery__filter.is-active {
	background: var(--primary-color);
	border-color: var(--primary-color);
	color: var(--white);
}

.media-gallery__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 32px;
}

.media-gallery__item {
	display: block;
	position: relative;
	flex: 0 0 100%;
	max-width: 100%;
	aspect-ratio: 400 / 225;
	border-radius: 16px;
	border: 0;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
}

.media-gallery__media {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.media-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.media-gallery__item--image .media-gallery__media::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: color-mix(in srgb, var(--medium) 75%, transparent);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.media-gallery__item--image:hover .media-gallery__media::after,
.media-gallery__item--image:focus-visible .media-gallery__media::after {
	opacity: 1;
}

.media-gallery__zoom {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	color: var(--white);
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.media-gallery__item--image:hover .media-gallery__zoom,
.media-gallery__item--image:focus-visible .media-gallery__zoom {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.08);
}

.media-gallery__item--video .media-gallery__media::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 0, 0, 0.3);
	pointer-events: none;
}

.media-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--medium);
	transform: translate(-50%, -50%);
	transition: transform 0.35s ease;
	pointer-events: none;
}

.media-gallery__play svg {
	display: block;
	width: 89px;
	height: auto;
}

.media-gallery__item--video:hover .media-gallery__play,
.media-gallery__item--video:focus-visible .media-gallery__play {
	transform: translate(-50%, -50%) scale(1.08);
}

.media-gallery__load-more {
	margin-top: 30px;
}

.bg-dark .media-gallery__load-more progress::-webkit-progress-bar {
	background-color: var(--white);
}

.bg-dark .media-gallery__load-more progress::-webkit-progress-value {
	background-color: var(--medium) !important;
}

.bg-light .media-gallery__load-more progress::-webkit-progress-bar {
	background-color: var(--white) !important;
}

.media-gallery__load-more .load-more__btn {
	background: var(--dark);
	border-color: var(--dark);
	color: var(--white);
	border-radius: 999px;
}

.media-gallery__load-more .load-more__btn::after {
	display: none;
}

.media-gallery__load-more .load-more__btn:hover,
.media-gallery__load-more .load-more__btn:focus-visible {
	filter: brightness(0.95);
}

.media-gallery.is-filtering {
	pointer-events: none;
}

.media-gallery.is-filtering .media-gallery__grid {
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.bg-dark .media-gallery__filter,
.bg-medium .media-gallery__filter {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.55);
	color: var(--body-with-dark-background);
}

.bg-dark .media-gallery__filter:hover,
.bg-dark .media-gallery__filter:focus-visible,
.bg-medium .media-gallery__filter:hover,
.bg-medium .media-gallery__filter:focus-visible {
	border-color: var(--primary-color);
	color: var(--primary-color);
}

.bg-dark .media-gallery__filter.is-active,
.bg-medium .media-gallery__filter.is-active {
	background: var(--primary-color);
	border-color: var(--primary-color);
	color: var(--white);
}

.bg-dark .media-gallery__load-more .load-more__btn,
.bg-medium .media-gallery__load-more .load-more__btn {
	background: var(--primary-color);
	border-color: var(--primary-color);
}

.bg-dark .media-gallery__load-more .load-more__counter,
.bg-medium .media-gallery__load-more .load-more__counter {
	color: var(--body-with-dark-background);
}

@media (min-width: 768px) and (max-width: 1024px) {
	.media-gallery__filters {
		gap: 12px;
	}

	.media-gallery__filter {
		padding: 12px 24px;
	}
}


/* The column is transparent unless the mobile scroll row is active, so
   fewer than 5 filters keep the normal wrapped buttons. */
.media-gallery__filters-col {
	display: contents;
}

.media-gallery__filters-mobile {
	display: none;
}

.media-gallery__filters-scrollbar {
	display: none;
}

/* Mobile, 5 or more filters: scrolling chips plus a bar that stays
   visible. Native bars hide when scrolling stops, so this one is ours. */
@media (max-width: 767px) {
	.media-gallery__filters-mobile {
		display: block;
		position: relative;
		margin: 0 0 42px;
		max-width: 100%;
	}

	.media-gallery__filters-wrap {
		display: none !important;
	}

	.media-gallery__filters-mobile .choices {
		width: 100%;
		margin-bottom: 0;
		z-index: 5;
	}

	.media-gallery__filters-mobile .choices__inner {
		box-sizing: border-box;
		display: flex;
		align-items: center;
		min-height: 52px;
		height: 52px;
		padding: 14px 48px 14px 28px !important;
		border: 2px solid var(--medium);
		border-radius: 999px;
		background-color: transparent;
		color: var(--medium);
		font-size: 16px;
		font-weight: 700;
		letter-spacing: 0.72px;
		line-height: 1.2;
		text-transform: uppercase;
	}

	.media-gallery__filters-mobile .choices__list--single {
		padding: 0;
		width: 100%;
	}

	.media-gallery__filters-mobile .choices.is-focused .choices__inner,
	.media-gallery__filters-mobile .choices.is-open .choices__inner {
		min-height: 52px;
		height: 52px;
		padding: 14px 48px 14px 28px !important;
		border: 2px solid var(--primary-color);
		border-radius: 999px;
		background-color: var(--white);
	}

	.media-gallery__filters-mobile .choices[data-type*='select-one']:before {
		display: none;
	}

	.media-gallery__filters-mobile .choices[data-type*='select-one']:after,
	.media-gallery__filters-mobile .choices[data-type*='select-one'].is-open:after,
	.media-gallery__filters-mobile .choices[data-type*='select-one'].is-focused:after {
		right: 22px;
		color: var(--medium);
		border: none;
	}

	.media-gallery__filters-mobile .choices__list--dropdown,
	.media-gallery__filters-mobile .choices__list[aria-expanded] {
		margin-top: 8px;
		border: 2px solid var(--primary-color);
		border-radius: 24px;
		background: var(--white);
		overflow: hidden;
		z-index: 6;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	}

	.media-gallery__filters-mobile .choices__list--dropdown .choices__item {
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.72px;
		color: var(--medium);
		background: var(--white);
	}

	.media-gallery__filters-mobile .choices__list--dropdown .choices__item--selectable.is-highlighted {
		background-color: var(--primary-color) !important;
		color: var(--white);
	}

	.bg-dark .media-gallery__filters-mobile .choices__inner,
	.bg-medium .media-gallery__filters-mobile .choices__inner {
		background-color: transparent;
		color: var(--white);
	}

	.bg-dark .media-gallery__filters-mobile .choices[data-type*='select-one']:after,
	.bg-medium .media-gallery__filters-mobile .choices[data-type*='select-one']:after {
		color: var(--white);
	}

	/* After select, Choices keeps is-focused with a white field; use dark text. */
	.bg-dark .media-gallery__filters-mobile .choices.is-focused .choices__inner,
	.bg-dark .media-gallery__filters-mobile .choices.is-open .choices__inner,
	.bg-medium .media-gallery__filters-mobile .choices.is-focused .choices__inner,
	.bg-medium .media-gallery__filters-mobile .choices.is-open .choices__inner {
		background-color: var(--white);
		color: var(--dark);
	}

	.bg-dark .media-gallery__filters-mobile .choices.is-focused[data-type*='select-one']:after,
	.bg-dark .media-gallery__filters-mobile .choices.is-open[data-type*='select-one']:after,
	.bg-medium .media-gallery__filters-mobile .choices.is-focused[data-type*='select-one']:after,
	.bg-medium .media-gallery__filters-mobile .choices.is-open[data-type*='select-one']:after {
		color: var(--dark);
	}

	.media-gallery__filters-wrap--scroll {
		display: flex;
		align-items: stretch;
		gap: 8px;
		margin-bottom: 30px;
	}

	.media-gallery__filters-wrap--scroll .media-gallery__filters-col {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-width: 0;
		gap: 8px;
	}

	.media-gallery__filters-wrap--scroll .media-gallery__filters {
		flex: 1 1 auto;
		min-width: 0;
		margin-bottom: 0;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.media-gallery__filters-wrap--scroll.is-scrollable .media-gallery__filters {
		justify-content: flex-start;
	}

	.media-gallery__filters-wrap--scroll .media-gallery__filters::-webkit-scrollbar {
		display: none;
		height: 0;
	}

	.media-gallery__filters-wrap--scroll.is-scrollable .media-gallery__filters-scrollbar {
		display: block;
		position: relative;
		height: 6px;
		border-radius: 999px;
		background: rgba(0, 0, 0, 0.15);
		cursor: pointer;
		touch-action: none;
	}

	.media-gallery__filters-scrollbar-thumb {
		position: absolute;
		top: 0;
		left: 0;
		height: 100%;
		border-radius: 999px;
		background: var(--medium);
		cursor: grab;
	}

	.bg-dark .media-gallery__filters-wrap--scroll.is-scrollable .media-gallery__filters-scrollbar,
	.bg-medium .media-gallery__filters-wrap--scroll.is-scrollable .media-gallery__filters-scrollbar {
		background: rgba(255, 255, 255, 0.25);
	}

	.bg-dark .media-gallery__filters-scrollbar-thumb,
	.bg-medium .media-gallery__filters-scrollbar-thumb {
		background: rgba(255, 255, 255, 0.75);
	}

	.media-gallery__filters-wrap--scroll .media-gallery__filter {
		flex: 0 0 auto;
		white-space: nowrap;
		padding-left: 20px;
		padding-right: 20px;
	}

	.media-gallery__filters-wrap--scroll.is-scrollable .media-gallery__filters-arrow {
		display: inline-flex;
	}
}

.media-gallery__filters-arrow {
	display: none;
	flex: 0 0 40px;
	width: 40px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 2px solid var(--medium);
	border-radius: 999px;
	background: transparent;
	color: var(--medium);
	cursor: pointer;
	transition: border-color 0.25s ease, opacity 0.25s ease;
}

.media-gallery__filters-arrow svg {
	display: block;
}

.media-gallery__filters-arrow:hover,
.media-gallery__filters-arrow:focus-visible {
	border-color: var(--primary-color);
	outline: none;
}

.media-gallery__filters-arrow:disabled {
	opacity: 0.35;
	cursor: default;
	border-color: var(--medium);
}

.bg-dark .media-gallery__filters-arrow,
.bg-medium .media-gallery__filters-arrow {
	border-color: rgba(255, 255, 255, 0.55);
	color: var(--body-with-dark-background);
}

.bg-dark .media-gallery__filters-arrow:hover,
.bg-dark .media-gallery__filters-arrow:focus-visible,
.bg-medium .media-gallery__filters-arrow:hover,
.bg-medium .media-gallery__filters-arrow:focus-visible {
	border-color: var(--primary-color);
}

.bg-dark .media-gallery__filters-arrow:disabled,
.bg-medium .media-gallery__filters-arrow:disabled {
	border-color: rgba(255, 255, 255, 0.55);
}

@media (min-width: 768px) {
	.media-gallery__item {
		flex: 0 0 calc((100% - 32px) / 2);
		max-width: calc((100% - 32px) / 2);
	}
}

@media (max-width: 767px) {
	.media-gallery__filters {
		gap: 20px 12px;
		margin-bottom: 32px;
	}

	.media-gallery__filter {
		padding: 10px 18px;
		font-size: 14px;
	}
}

@media (min-width: 1025px) {
	.media-gallery__item {
		flex: 0 0 calc((100% - 64px) / 3);
		max-width: calc((100% - 64px) / 3);
	}

	.media-gallery__load-more {
		margin-top: 50px;
	}
}
