/*
 * Chelsea Gallery Lightbox - AUDIT-SEC-003
 * Site-owned replacement for carousel-without-jetpack's jetpack-carousel.css.
 * Scoped entirely to .cgl-* classes; nothing here can affect gallery grid
 * markup, which is left exactly as WordPress core renders it.
 */

.cgl-root {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	background: #000;
	color: #fff;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: subpixel-antialiased;
	opacity: 0;
	transition: opacity 0.2s ease;
	overscroll-behavior: contain;
}

.cgl-root[hidden] {
	display: none;
}

.cgl-root.is-open {
	opacity: 1;
}

/* Stage ------------------------------------------------------------------ */

.cgl-stage {
	position: relative;
	flex: 1 1 auto;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 48px 88px 8px;
	box-sizing: border-box;
}

.cgl-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	opacity: 1;
	transition: opacity 0.18s ease;
}

.cgl-root.is-loading .cgl-img {
	opacity: 0.25;
}

/* Meta ------------------------------------------------------------------- */

.cgl-meta {
	flex: 0 0 auto;
	padding: 0 88px 22px;
	text-align: left;
	box-sizing: border-box;
}

.cgl-title {
	display: block;
	margin: 0 0 2px;
	font-size: 16px;
	line-height: 1.35;
	font-weight: 400;
	color: #fff;
}

.cgl-caption {
	display: block;
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
	color: #999;
	white-space: pre-line;
}

.cgl-full {
	display: inline-block;
	margin-top: 8px;
	font-size: 13px;
	color: #999;
	text-decoration: underline;
}

.cgl-full:hover,
.cgl-full:focus {
	color: #fff;
}

/* Controls --------------------------------------------------------------- */

.cgl-btn {
	position: absolute;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
	line-height: 1;
}

.cgl-btn:hover {
	opacity: 1;
}

.cgl-btn:focus-visible {
	opacity: 1;
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.cgl-close {
	top: 10px;
	right: 12px;
	width: 44px;
	height: 44px;
	font-size: 30px;
	background: rgba(0, 0, 0, 0.8);
	border-radius: 3px;
}

.cgl-prev,
.cgl-next {
	top: 50%;
	transform: translateY(-50%);
	width: 64px;
	height: 96px;
	font-size: 46px;
}

.cgl-prev {
	left: 8px;
}

.cgl-next {
	right: 8px;
}

.cgl-btn[disabled] {
	opacity: 0.2;
	cursor: default;
}

/* Screen-reader-only live region ----------------------------------------- */

.cgl-status {
	position: absolute;
	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;
}

/* Narrow viewports ------------------------------------------------------- */

@media (max-width: 782px) {
	.cgl-stage {
		padding: 52px 12px 8px;
	}

	.cgl-meta {
		padding: 0 16px 18px;
	}

	.cgl-prev,
	.cgl-next {
		width: 44px;
		height: 72px;
		font-size: 34px;
		background: rgba(0, 0, 0, 0.45);
		border-radius: 3px;
	}

	.cgl-prev {
		left: 4px;
	}

	.cgl-next {
		right: 4px;
	}
}

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

@media (prefers-reduced-motion: reduce) {

	.cgl-root,
	.cgl-img,
	.cgl-btn {
		transition: none;
	}
}
