/* DiluxOne Slider. Themes restyle it through the custom properties below;
 * Sliders › Settings sets them for the whole site. */
:where(.wp-block-diluxone-slider) {
	--dxs-accent: currentcolor;
	--dxs-control-bg: rgb(255 255 255 / 92%);
	--dxs-control-fg: #1e1e1e;
	--dxs-control-size: 44px;
}

.wp-block-diluxone-slider {
	position: relative;
}

/* ---- Slides: background, overlay, content and position ---- */
.wp-block-diluxone-slide {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
	overflow: hidden;
}

:where(.wp-block-diluxone-slide) {
	padding: clamp(24px, 5vw, 64px);
}

.wp-block-diluxone-slider.dxs--h-auto .wp-block-diluxone-slide {
	min-height: 320px;
}

.wp-block-diluxone-slider.dxs--h-fixed .wp-block-diluxone-slide {
	min-height: var(--dxs-h-mobile, 420px);
}

@media (min-width: 600px) {

	.wp-block-diluxone-slider.dxs--h-fixed .wp-block-diluxone-slide {
		min-height: var(--dxs-h-tablet, 480px);
	}
}

@media (min-width: 1024px) {

	.wp-block-diluxone-slider.dxs--h-fixed .wp-block-diluxone-slide {
		min-height: var(--dxs-h-desktop, 560px);
	}
}

.wp-block-diluxone-slider.dxs--h-screen .wp-block-diluxone-slide {
	min-height: 100vh;
	min-height: 100svh;
}

/* Image: fills its area around the focal point (--dxs-fp), or shows whole. */
.dxs-slide__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--dxs-fp, 50% 50%);
	margin: 0;
	border-radius: 0;
}

.dxs-img-contain .dxs-slide__image {
	object-fit: contain;
	padding: clamp(24px, 10%, 96px);
	box-sizing: border-box;
}

.dxs-slide__overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: var(--dxs-ov, none);
}

.dxs-slide__content {
	position: relative;
	z-index: 1;
	width: 100%;
	box-sizing: border-box;
}

.dxs--width-content .dxs-slide__content {
	max-width: var(--wp--style--global--content-size, 760px);
}

.dxs--width-wide .dxs-slide__content {
	max-width: var(--wp--style--global--wide-size, 1200px);
}

.dxs-slide__content > :first-child {
	margin-top: 0;
}

.dxs-slide__content > :last-child {
	margin-bottom: 0;
}

.is-position-top-left,
.is-position-top-center,
.is-position-top-right {
	justify-content: flex-start;
}

.is-position-bottom-left,
.is-position-bottom-center,
.is-position-bottom-right {
	justify-content: flex-end;
}

.is-position-top-left,
.is-position-center-left,
.is-position-bottom-left {
	align-items: flex-start;
}

.is-position-top-right,
.is-position-center-right,
.is-position-bottom-right {
	align-items: flex-end;
}

/* Text that reads on the overlay, unless the slide sets its own color. */
.dxs-text-lg-light {
	--dxs-text-lg: #fff;
}

.dxs-text-lg-dark {
	--dxs-text-lg: #1e1e1e;
}

.dxs-text-sm-light {
	--dxs-text-sm: #fff;
}

.dxs-text-sm-dark {
	--dxs-text-sm: #1e1e1e;
}

/* Wide screens: a side image takes half the slide, the content the other. */
@media (min-width: 600px) {

	.dxs-img-side .dxs-slide__image {
		width: 50%;
	}

	.dxs-img-right .dxs-slide__image {
		left: 50%;
	}

	.dxs-img-side .dxs-slide__content {
		width: 50%;
	}

	.dxs-img-right .dxs-slide__content {
		align-self: flex-start;
		padding-right: clamp(16px, 4vw, 64px);
	}

	.dxs-img-left .dxs-slide__content {
		align-self: flex-end;
		padding-left: clamp(16px, 4vw, 64px);
	}

	.wp-block-diluxone-slide:is(.dxs-text-lg-light, .dxs-text-lg-dark) {
		color: var(--dxs-text-lg);
	}

	.wp-block-diluxone-slide:is(.dxs-text-lg-light, .dxs-text-lg-dark) :is(h1, h2, h3, h4, h5, h6):not(.has-text-color) {
		color: inherit;
	}
}

/* Small screens: the side image goes behind the text, above it or away;
 * its own focal point (--dxs-fp-sm), overlay (--dxs-ov-sm) and position. */
@media (max-width: 599px) {

	.dxs-slide__image {
		object-position: var(--dxs-fp-sm, var(--dxs-fp, 50% 50%));
	}

	.dxs-slide__overlay {
		background: var(--dxs-ov-sm, var(--dxs-ov, none));
	}

	.dxs-img-sm-hidden .dxs-slide__image {
		display: none;
	}

	.dxs-img-sm-above .dxs-slide__image {
		height: var(--dxs-img-sm-h, 240px);
	}

	.dxs-img-sm-above .dxs-slide__content {
		margin-top: var(--dxs-img-sm-h, 240px);
	}

	.wp-block-diluxone-slide.is-sm-position-top {
		justify-content: flex-start;
	}

	.wp-block-diluxone-slide.is-sm-position-center {
		justify-content: center;
	}

	.wp-block-diluxone-slide.is-sm-position-bottom {
		justify-content: flex-end;
	}

	.wp-block-diluxone-slide:is(.dxs-text-sm-light, .dxs-text-sm-dark) {
		color: var(--dxs-text-sm);
	}

	.wp-block-diluxone-slide:is(.dxs-text-sm-light, .dxs-text-sm-dark) :is(h1, h2, h3, h4, h5, h6):not(.has-text-color) {
		color: inherit;
	}
}

/* A link for the whole slide, under the content: buttons inside still work. */
.dxs-slide__link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.dxs-slide__content:has(~ .dxs-slide__link) {
	z-index: 2;
	pointer-events: none;
}

.dxs-slide__content :is(a, button, input, select, textarea, summary, [tabindex]) {
	pointer-events: auto;
}

.dxs-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---- Track ---- */
.dxs__track {
	display: flex;
}

.dxs__track > .wp-block-diluxone-slide {
	flex: 0 0 100%;
	margin: 0;
	max-width: none;
}

/* Slide: native scroll with snap, so swipe and trackpads just work. */
.dxs--slide .dxs__track {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.dxs--slide .dxs__track::-webkit-scrollbar {
	display: none;
}

.dxs--slide .dxs__track > * {
	scroll-snap-align: start;
}

/* Fade: slides stacked in one grid cell; before the script, the first shows. */
.dxs--fade .dxs__track {
	display: grid;
}

.dxs--fade .dxs__track > * {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s ease, visibility 0.7s;
}

.dxs--fade .dxs__track > .is-active,
.dxs--fade:not(.is-ready) .dxs__track > :first-child {
	opacity: 1;
	visibility: visible;
}

/* ---- Controls (rendered by the server, shown once the script runs) ---- */
.dxs:not(.is-ready) > :is(.dxs__btn, .dxs__dots, .dxs__progress) {
	display: none;
}

.dxs__btn {
	border: 0;
	padding: 0;
	cursor: pointer;
	background: var(--dxs-control-bg);
	color: var(--dxs-control-fg);
}

.dxs__btn:focus-visible {
	outline: 3px solid var(--dxs-accent);
	outline-offset: 3px;
}

.dxs__btn[aria-disabled="true"] {
	opacity: 0.4;
	cursor: default;
}

.dxs__arrow,
.dxs__pause {
	position: absolute;
	z-index: 3;
	width: var(--dxs-control-size);
	height: var(--dxs-control-size);
	border-radius: 50%;
	display: grid;
	place-items: center;
	box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
	transition: transform 0.2s;
}

.dxs__arrow {
	top: 50%;
	transform: translateY(-50%);
}

.dxs__arrow:hover {
	transform: translateY(-50%) scale(1.06);
}

.dxs__arrow--prev {
	left: 16px;
}

.dxs__arrow--next {
	right: 16px;
}

.dxs__arrow::before,
.dxs__pause::before {
	content: "";
	width: 12px;
	height: 12px;
	background: currentcolor;
	-webkit-mask: var(--dxs-icon) center / contain no-repeat;
	mask: var(--dxs-icon) center / contain no-repeat;
}

.dxs__arrow--prev {
	--dxs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M8 1L3 6l5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dxs__arrow--next {
	--dxs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 1l5 5-5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dxs__pause {
	--dxs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='1' width='3' height='10' rx='1'/%3E%3Crect x='7' y='1' width='3' height='10' rx='1'/%3E%3C/svg%3E");
	right: 16px;
	bottom: 16px;
	width: 32px;
	height: 32px;
}

.dxs__pause.is-paused {
	--dxs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 1.5v9l7.5-4.5z'/%3E%3C/svg%3E");
}

.dxs__dots {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: 22px;
	display: flex;
	justify-content: center;
	gap: 8px;
	pointer-events: none;
}

.dxs__dot {
	pointer-events: auto;
	width: 10px;
	height: 10px;
	border-radius: 999px;
	opacity: 0.85;

	/* A thin ring keeps light dots visible on light slides. */
	box-shadow: 0 0 0 1px rgb(0 0 0 / 18%);
	transition: width 0.3s ease, background 0.3s ease;
}

.dxs__dot[aria-current="true"] {
	width: 28px;
	background: var(--dxs-accent);
	opacity: 1;
}

.dxs__progress {
	position: absolute;
	z-index: 3;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 0;
	background: var(--dxs-accent);
}

.dxs.is-playing .dxs__progress {
	animation: dxs-progress var(--dxs-interval, 6s) linear;
}

@keyframes dxs-progress {

	from {
		width: 0;
	}

	to {
		width: 100%;
	}
}

/* The content of the active slide enters in a short cascade. */
.dxs.is-ready .dxs__track > * .dxs-slide__content > * {
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.dxs.is-ready .dxs__track > :not(.is-active) .dxs-slide__content > * {
	opacity: 0;
	transform: translateY(16px);
}

@media (max-width: 600px) {

	.dxs__arrow {
		top: auto;
		bottom: 10px;
		transform: none;
		width: 36px;
		height: 36px;
	}

	.dxs__arrow:hover {
		transform: none;
	}

	.dxs__arrow--prev {
		left: 10px;
	}

	.dxs__arrow--next {
		right: 54px;
	}

	.dxs__pause {
		right: 10px;
		bottom: 12px;
	}

	.dxs__dots {
		bottom: 24px;
	}
}

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

	.dxs--slide .dxs__track {
		scroll-behavior: auto;
	}

	.dxs--fade .dxs__track > *,
	.dxs .dxs__track * {
		transition: none;
	}

	.dxs.is-ready .dxs__track > :not(.is-active) .dxs-slide__content > * {
		opacity: 1;
		transform: none;
	}
}
