/**
 * PWD Animations - Orbit Gallery widget stylesheet.
 * Loaded together with pwd-animations-core.css.
 *
 * HTML and CSS only. The ring is a square box. Each image carries its position
 * on the ring as two numbers (--pwd-orb-x, --pwd-orb-y: sine and cosine of its
 * angle, written by the PHP render) and is moved out to the ring by a
 * translate of that many ring radii, where the radius is worked out here from
 * the image size, the number of images (--pwd-orb-k) and the extra space. The
 * ring turns; every image turns back by the same amount, so they stay upright.
 *
 * Elementor and themes style bare ul, li, img and a elements, so every rule is
 * scoped under .pwd-orb and goes two or three classes deep.
 */

.pwd-orbw {
	display: flex;
	justify-content: center;
	max-width: 100%;
}

.pwd-orb {
	--pwd-orb-s: 120px;
	--pwd-orb-g: 30px;
	--pwd-orb-k: 1;
	--pwd-orb-bw: 6px;
	--pwd-orb-dur: 30s;
	--pwd-orb-dir: normal;
	--pwd-orb-zoom: 1.5;
	--pwd-orb-shrink: 0.6;
	--pwd-orb-rc: #20c863;
	--pwd-orb-ic: #20c863;
	--pwd-orb-ihc: #d4ff00;
	--pwd-orb-ibw: 3px;
	--pwd-orb-glow: transparent;
	--pwd-orb-bg: transparent;
	--pwd-orb-r: calc(var(--pwd-orb-s) * var(--pwd-orb-k) + var(--pwd-orb-g));
	--pwd-orb-d: calc(2 * var(--pwd-orb-r) + var(--pwd-orb-s));
	position: relative;
	display: block;
	flex: 0 0 auto;
	box-sizing: border-box;
	width: var(--pwd-orb-d);
	height: var(--pwd-orb-d);
}

/* The ring: a square the size of the whole stage, turning slowly */
.pwd-orb .pwd-orb__ring {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
	animation: pwd-orb-spin var(--pwd-orb-dur) linear infinite;
	animation-direction: var(--pwd-orb-dir);
}

/* The visible circle runs through the centres of the images */
.pwd-orb .pwd-orb__ring::before {
	content: "";
	position: absolute;
	top: calc(var(--pwd-orb-s) / 2);
	left: calc(var(--pwd-orb-s) / 2);
	box-sizing: border-box;
	width: calc(var(--pwd-orb-d) - var(--pwd-orb-s));
	height: calc(var(--pwd-orb-d) - var(--pwd-orb-s));
	border: var(--pwd-orb-bw) solid var(--pwd-orb-rc);
	border-radius: 50%;
	background-color: var(--pwd-orb-bg);
	transition: box-shadow 0.3s ease;
}

.pwd-orb.pwd-orb--pause:hover .pwd-orb__ring::before,
.pwd-orb.pwd-orb--pause:focus-within .pwd-orb__ring::before {
	box-shadow: inset 0 0 60px 12px var(--pwd-orb-glow);
}

.pwd-orb .pwd-orb__item {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--pwd-orb-s);
	height: var(--pwd-orb-s);
	margin: calc(var(--pwd-orb-s) / -2) 0 0 calc(var(--pwd-orb-s) / -2);
	padding: 0;
	list-style: none;
	transform: translate(calc(var(--pwd-orb-x) * var(--pwd-orb-r)), calc(var(--pwd-orb-y) * var(--pwd-orb-r)));
	pointer-events: auto;
}

/* Each image turns back as the ring turns, so it stays upright */
.pwd-orb .pwd-orb__hold {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	color: inherit;
	text-decoration: none;
	animation: pwd-orb-unspin var(--pwd-orb-dur) linear infinite;
	animation-direction: var(--pwd-orb-dir);
}

.pwd-orb .pwd-orb__hold:focus-visible {
	outline: 2px solid var(--pwd-orb-ihc);
	outline-offset: 3px;
}

.pwd-orb .pwd-orb__hold .pwd-orb__img {
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border: var(--pwd-orb-ibw) solid var(--pwd-orb-ic);
	border-radius: 50%;
	object-fit: cover;
	transition: transform 0.3s ease-in-out, border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

@keyframes pwd-orb-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes pwd-orb-unspin {
	to {
		transform: rotate(-360deg);
	}
}

/* Pause while the pointer is over the gallery or an image has keyboard focus */
.pwd-orb.pwd-orb--pause:hover .pwd-orb__ring,
.pwd-orb.pwd-orb--pause:hover .pwd-orb__hold,
.pwd-orb.pwd-orb--pause:focus-within .pwd-orb__ring,
.pwd-orb.pwd-orb--pause:focus-within .pwd-orb__hold {
	animation-play-state: paused;
}

/* The hovered image grows and lights up, the others shrink */
.pwd-orb .pwd-orb__item:hover,
.pwd-orb .pwd-orb__item:focus-within {
	z-index: 2;
}

.pwd-orb .pwd-orb__item:hover .pwd-orb__img,
.pwd-orb .pwd-orb__item:focus-within .pwd-orb__img {
	border-color: var(--pwd-orb-ihc);
	box-shadow: 0 0 1rem var(--pwd-orb-ihc);
	transform: scale(var(--pwd-orb-zoom));
}

.pwd-orb .pwd-orb__ring:has(.pwd-orb__item:hover) .pwd-orb__item:not(:hover) .pwd-orb__img,
.pwd-orb .pwd-orb__ring:has(.pwd-orb__item:focus-within) .pwd-orb__item:not(:focus-within) .pwd-orb__img {
	transform: scale(var(--pwd-orb-shrink));
}

/* Centre label: one per image, shown for the hovered one */
.pwd-orb .pwd-orb__center {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	pointer-events: none;
}

.pwd-orb .pwd-orb__lbl {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: max-content;
	max-width: calc(var(--pwd-orb-d) * 0.4);
	text-align: center;
	opacity: 0;
	transform: translate(-50%, -50%);
	transition: opacity 0.3s ease;
}

.pwd-orb .pwd-orb__name {
	display: block;
	color: #111;
	font-weight: 600;
	line-height: 1.2;
}

.pwd-orb .pwd-orb__sub {
	display: block;
	margin-top: 4px;
	color: #666;
	font-size: 0.85em;
	line-height: 1.2;
}

/* Reduced motion: a still ring, nothing turns */
@media (prefers-reduced-motion: reduce) {
	.pwd-orb .pwd-orb__ring,
	.pwd-orb .pwd-orb__hold {
		animation: none;
	}

	.pwd-orb .pwd-orb__hold .pwd-orb__img,
	.pwd-orb .pwd-orb__lbl,
	.pwd-orb .pwd-orb__ring::before {
		transition: none;
	}
}
