/**
 * WordPress.org Plugins “Screenshots” style gallery.
 */

.screenshot-slider {
	--ss-arrow-color: #1e1e1e;
	--ss-arrow-shadow-color: rgba(0, 0, 0, 0.25);
	--ss-stage-max-width: 90vw;
	--ss-stage-max-height: 90vh;
	--ss-border: #dcdcde;
	--ss-surface: #f6f7f7;
	--ss-accent: #2271b1;
	--ss-text: #1d2327;
	--ss-muted: #50575e;
	box-sizing: border-box;
	color: var(--ss-text);
	margin: 1.5rem 0;
}

.screenshot-slider *,
.screenshot-slider *::before,
.screenshot-slider *::after {
	box-sizing: border-box;
}

.screenshot-slider--empty {
	padding: 1.25rem;
	border: 1px dashed var(--ss-border);
	background: var(--ss-surface);
	text-align: center;
	color: var(--ss-muted);
}

.screenshot-slider__stage-wrap {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.5rem;
	background: var(--ss-surface);
	border: 1px solid var(--ss-border);
	border-radius: 2px;
	padding: 1rem 0.5rem 1.25rem;
}

.screenshot-slider__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
	outline: none;
}

.screenshot-slider__stage:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ss-accent);
}

.screenshot-slider__figure {
	margin: 0;
	display: flex;
	justify-content: center;
	width: 100%;
}

.screenshot-slider__main-trigger {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: block;
	padding: 0 !important;
	margin: 0;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: inherit !important;
	cursor: zoom-in;
	line-height: 0;
	max-width: 100%;
	text-decoration: none !important;
	transform: none !important;
}

.screenshot-slider__main-trigger:hover,
.screenshot-slider__main-trigger:focus,
.screenshot-slider__main-trigger:focus-visible,
.screenshot-slider__main-trigger:active {
	appearance: none !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
	transform: none !important;
}

.screenshot-slider__main-trigger:focus-visible {
	outline: 2px solid var(--ss-accent);
	outline-offset: 3px;
}

.screenshot-slider__main-image {
	display: block !important;
	box-sizing: border-box !important;
	/* Attrs drive max-* only — never treat maxHeight/maxWidth as height/width. */
	width: auto !important;
	height: auto !important;
	max-width: min(100%, var(--ss-stage-max-width, 100%)) !important;
	max-height: var(--ss-stage-max-height, 90vh) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	object-fit: contain !important;
	object-position: center center !important;
	margin: 0 auto;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	background: #fff;
}

/* Lightbox off: image itself is the hit target for next-slide. */
.screenshot-slider__main-image--advance {
	cursor: pointer;
}

.screenshot-slider__caption {
	margin: 0.85rem 0 0;
	padding: 0 0.75rem;
	text-align: center;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--ss-muted);
	min-height: 1.45em;
	max-width: 48rem;
}

.screenshot-slider--caption-above .screenshot-slider__caption {
	margin: 0 0 0.85rem;
	order: -1;
}

.screenshot-slider__arrow {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--ss-arrow-color) !important;
	font-size: 2rem;
	line-height: 1;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0 !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 2px;
	text-decoration: none !important;
	transform: none !important;
}

.screenshot-slider__arrow:hover,
.screenshot-slider__arrow:focus,
.screenshot-slider__arrow:focus-visible,
.screenshot-slider__arrow:active {
	appearance: none !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--ss-arrow-color) !important;
	text-decoration: none !important;
	transform: none !important;
}

.screenshot-slider__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.screenshot-slider__arrow:focus-visible {
	outline: 2px solid var(--ss-accent);
	outline-offset: 2px;
}

.screenshot-slider--arrow-shadow .screenshot-slider__arrow span {
	text-shadow: 0 1px 2px var(--ss-arrow-shadow-color);
}

.screenshot-slider__thumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1rem;
	margin-top: 1rem;
	padding: 0.25rem 0;
}

.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: 0 !important;
	/* Isolate thumb chrome from theme button fills; title colors stay on .thumb-title below. */
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	padding: 0 !important;
	width: 7.5rem;
	max-width: 28vw;
	cursor: pointer;
	text-align: center;
	color: inherit !important;
	font: inherit;
	box-shadow: none !important;
	text-decoration: none !important;
	transform: none !important;
}

.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:hover,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:focus,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:focus-visible,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:active {
	appearance: none !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	color: inherit !important;
	box-shadow: none !important;
	text-decoration: none !important;
	transform: none !important;
}

/* Also cover non-worg / generic button descendants themes may style. */
.screenshot-slider button.screenshot-slider__thumb:hover,
.screenshot-slider button.screenshot-slider__thumb:focus,
.screenshot-slider button.screenshot-slider__thumb:focus-visible,
.screenshot-slider button.screenshot-slider__thumb:active,
.screenshot-slider button.screenshot-slider__main-trigger:hover,
.screenshot-slider button.screenshot-slider__main-trigger:focus,
.screenshot-slider button.screenshot-slider__main-trigger:focus-visible,
.screenshot-slider button.screenshot-slider__main-trigger:active,
.screenshot-slider button.screenshot-slider__arrow:hover,
.screenshot-slider button.screenshot-slider__arrow:focus,
.screenshot-slider button.screenshot-slider__arrow:focus-visible,
.screenshot-slider button.screenshot-slider__arrow:active {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
}

.screenshot-slider__thumb:focus-visible .screenshot-slider__thumb-frame {
	outline: 2px solid var(--ss-accent);
	outline-offset: 2px;
}

.screenshot-slider__thumb-frame {
	display: block;
	border: 2px solid transparent;
	border-radius: 2px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 0 0 1px var(--ss-border);
	aspect-ratio: 4 / 3;
}

.screenshot-slider__thumb.is-active .screenshot-slider__thumb-frame {
	border-color: var(--ss-accent);
	box-shadow: 0 0 0 1px var(--ss-accent);
}

.screenshot-slider__thumb-frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb-title {
	display: block;
	margin-top: 0.4rem;
	padding: 0.15rem 0.25rem;
	font-size: 0.75rem;
	line-height: 1.3;
	color: var(--ss-thumb-title-color, inherit) !important;
	background: var(--ss-thumb-title-bg, transparent) !important;
	background-color: var(--ss-thumb-title-bg, transparent) !important;
	background-image: none !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	border-radius: 2px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:hover .screenshot-slider__thumb-title,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:focus .screenshot-slider__thumb-title,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:focus-visible .screenshot-slider__thumb-title,
.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb:active .screenshot-slider__thumb-title {
	color: var(--ss-thumb-title-hover-color, inherit) !important;
	background: var(--ss-thumb-title-hover-bg, transparent) !important;
	background-color: var(--ss-thumb-title-hover-bg, transparent) !important;
	background-image: none !important;
}

.screenshot-slider.screenshot-slider--worg .screenshot-slider__thumb.is-active .screenshot-slider__thumb-title {
	color: var(--ss-thumb-title-hover-color, inherit) !important;
	font-weight: 600;
}

.screenshot-slider__lightbox[hidden] {
	display: none !important;
}

/* Lightbox may be moved to document.body; do not require a .screenshot-slider ancestor. */
.screenshot-slider__lightbox {
	/* Desktop defaults; mobile media query overrides width to 95vw. */
	--ss-lightbox-max-width: 80vw;
	--ss-lightbox-max-height: 80vh;
	/* Full-viewport overlay; center dialog with flex (beats theme layout). */
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	z-index: 100000;
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw !important;
	max-height: 100vh !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	transform: none !important;
}

.screenshot-slider__lightbox-backdrop {
	position: absolute !important;
	inset: 0 !important;
	z-index: 0;
	background: rgba(0, 0, 0, 0.82);
}

.screenshot-slider__lightbox-dialog {
	position: relative !important;
	z-index: 1;
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	/* Viewport caps via vars — height always 80vh; width 80vw desktop / 95vw mobile. */
	width: auto !important;
	height: auto !important;
	max-width: var(--ss-lightbox-max-width, 80vw) !important;
	max-height: var(--ss-lightbox-max-height, 80vh) !important;
	margin: 0 !important;
	padding: 0 !important;
	transform: none !important;
	overflow: visible !important;
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-image,
.screenshot-slider__lightbox-dialog > img.screenshot-slider__lightbox-image,
img.screenshot-slider__lightbox-image {
	display: block !important;
	box-sizing: border-box !important;
	/* Kill theme height:100% / width:100% so tall screenshots stay within 80vh. */
	width: auto !important;
	height: auto !important;
	max-width: var(--ss-lightbox-max-width, 80vw) !important;
	max-height: var(--ss-lightbox-max-height, 80vh) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: contain !important;
	object-position: center center !important;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transform: none !important;
}

@media (max-width: 768px) {
	.screenshot-slider__lightbox {
		--ss-lightbox-max-width: 95vw;
		--ss-lightbox-max-height: 80vh;
	}
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-close {
	/* Perfect circle + flex-centered SVG — reset theme button chrome. */
	appearance: none !important;
	-webkit-appearance: none !important;
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	z-index: 2;
	box-sizing: border-box !important;
	width: 2.25rem !important;
	height: 2.25rem !important;
	min-width: 2.25rem !important;
	min-height: 2.25rem !important;
	max-width: 2.25rem !important;
	max-height: 2.25rem !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--ss-lightbox-close-bg, #ffffff) !important;
	background-color: var(--ss-lightbox-close-bg, #ffffff) !important;
	background-image: none !important;
	color: var(--ss-lightbox-close-color, #1e1e1e) !important;
	fill: currentColor !important;
	box-shadow: 0 1px 4px var(--ss-lightbox-close-shadow, rgba(0, 0, 0, 0.25)) !important;
	font-size: 0 !important;
	line-height: 0 !important;
	letter-spacing: 0 !important;
	text-indent: 0 !important;
	text-align: center !important;
	text-decoration: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-content: center !important;
	gap: 0 !important;
	cursor: pointer;
	overflow: hidden !important;
	transform: none !important;
	transition: none !important;
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-close::before,
.screenshot-slider__lightbox .screenshot-slider__lightbox-close::after {
	content: none !important;
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-close-icon {
	display: block !important;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px !important;
	min-height: 16px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	flex: 0 0 16px !important;
	pointer-events: none !important;
	overflow: visible !important;
	position: static !important;
	inset: auto !important;
	transform: none !important;
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-close:hover,
.screenshot-slider__lightbox .screenshot-slider__lightbox-close:focus,
.screenshot-slider__lightbox .screenshot-slider__lightbox-close:active {
	appearance: none !important;
	background: var(--ss-lightbox-close-bg, #ffffff) !important;
	background-color: var(--ss-lightbox-close-bg, #ffffff) !important;
	background-image: none !important;
	color: var(--ss-lightbox-close-color, #1e1e1e) !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: 0 1px 4px var(--ss-lightbox-close-shadow, rgba(0, 0, 0, 0.25)) !important;
	padding: 0 !important;
	transform: none !important;
	text-decoration: none !important;
}

.screenshot-slider__lightbox .screenshot-slider__lightbox-close:focus-visible {
	outline: 2px solid var(--ss-accent, #2271b1);
	outline-offset: 2px;
}

html.screenshot-slider-lightbox-open {
	overflow: hidden;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

@media (max-width: 600px) {
	.screenshot-slider__stage-wrap {
		grid-template-columns: 1fr;
		padding: 0.75rem;
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	.screenshot-slider__arrow {
		justify-self: center;
	}

	.screenshot-slider__arrow--prev {
		order: 2;
	}

	.screenshot-slider__arrow--next {
		order: 3;
	}

	.screenshot-slider__stage {
		order: 1;
		flex: 1 1 100%;
	}

	/* Default: hide thumbnail strip on small screens unless Miniatures mobile is on. */
	.screenshot-slider:not(.screenshot-slider--mobile-thumbs) .screenshot-slider__thumbs {
		display: none;
	}
}
