/* JP Photo Carousel: front end. The frame is always the full width of whatever it sits in. */

.jppc {
	position: relative;
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--jppc-ratio, 16 / 9);
	max-height: var(--jppc-max-h, none);
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--jppc-bg, #1e1e1e);
	isolation: isolate;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) {
	.jppc {
		aspect-ratio: var(--jppc-ratio-m, var(--jppc-ratio, 16 / 9));
	}
}

/* Used by the admin preview's phone view. */
.jppc.jppc--phone {
	aspect-ratio: var(--jppc-ratio-m, var(--jppc-ratio, 16 / 9));
}

.jppc:focus {
	outline: none;
}

.jppc:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.jppc .jppc__track {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
}

.jppc .jppc__slide {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--jppc-bg, #1e1e1e);
	visibility: hidden;
}

.jppc .jppc__slide.is-active {
	z-index: 2;
	visibility: visible;
}

.jppc .jppc__slide.is-leaving {
	z-index: 1;
	visibility: visible;
}

.jppc .jppc__slide img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: var(--x, 50%) var(--y, 50%);
	transform: scale(var(--z, 1));
	transform-origin: var(--x, 50%) var(--y, 50%);
	pointer-events: none;
	-webkit-user-drag: none;
}

.jppc .jppc__slide[data-fit="whole"] img {
	object-fit: contain;
}

/* Arrows */
.jppc .jppc__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: -22px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	box-shadow: none;
	color: #fff;
	font-size: 0;
	line-height: 0;
	text-shadow: none;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.25s ease, background-color 0.2s ease;
}

.jppc .jppc__arrow--prev {
	left: 14px;
}

.jppc .jppc__arrow--next {
	right: 14px;
}

/* Arrows and dots stay out of the way until someone's using the carousel:
   mouse over it, keyboard focus in it, or (on touch screens) a few seconds after a tap or swipe. */
.jppc:hover .jppc__arrow,
.jppc:focus-within .jppc__arrow,
.jppc.is-touched .jppc__arrow,
.jppc:hover .jppc__dots,
.jppc:focus-within .jppc__dots,
.jppc.is-touched .jppc__dots {
	opacity: 1;
}

@media (hover: none) {
	/* No hover on touch screens, so :hover would stick after a tap; rely on is-touched instead. */
	.jppc:hover:not(.is-touched):not(:focus-within) .jppc__arrow,
	.jppc:hover:not(.is-touched):not(:focus-within) .jppc__dots {
		opacity: 0;
	}
}

.jppc .jppc__arrow:hover,
.jppc .jppc__arrow:focus-visible {
	background: rgba(0, 0, 0, 0.72);
}

.jppc .jppc__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.jppc .jppc__arrow svg {
	display: block;
	width: 22px;
	height: 22px;
	pointer-events: none;
}

/* Dots */
.jppc .jppc__dots {
	position: absolute;
	right: 0;
	bottom: 8px;
	left: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0;
	padding: 0 12px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.jppc .jppc__dot {
	position: relative;
	box-sizing: border-box;
	width: 22px;
	height: 22px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}

.jppc .jppc__dot::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	margin: -4.5px 0 0 -4.5px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.jppc .jppc__dot[aria-current="true"]::before {
	background: #fff;
	transform: scale(1.2);
}

.jppc .jppc__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -2px;
	border-radius: 50%;
}

/* Shown only to people who can edit, e.g. an empty carousel. */
.jppc-notice {
	padding: 12px 16px;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	color: #1d2327;
	font-size: 14px;
}

/* Block editor caption under the preview. */
.jppc-block-caption {
	margin: 6px 0 0;
	font-size: 12px;
	opacity: 0.7;
}
