/* Diwan Canada homepage banners ([diwan_banners]).
   Banners cross-fade in a box shaped like the first banner, so nothing is
   cropped. The controls sit under the banner, not over the artwork. */

.dwb {
	--dwb-red: #C63D32;
	--dwb-ink: #2D2926;
	--dwb-line: #E8DCD1;
	--dwb-blush: #F7DFD0;
	margin: 0 0 8px;
}

.dwb .dwb__viewport {
	position: relative;
	aspect-ratio: var(--dwb-ratio, 3);
	overflow: hidden;
	border-radius: 12px;
	background: #FFF8EF;
	touch-action: pan-y;
}

.dwb .dwb__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}

.dwb .dwb__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.7s ease, visibility 0s;
}

.dwb .dwb__link,
.dwb .dwb__slide picture {
	display: block;
	width: 100%;
	height: 100%;
}

.dwb .dwb__slide img.dwb__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
}

.dwb a.dwb__link:focus-visible {
	outline: 3px solid var(--dwb-red);
	outline-offset: -3px;
}

/* ---------- controls ---------- */

.dwb .dwb__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
}

.dwb.dwb .dwb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--dwb-line);
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	color: var(--dwb-ink);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dwb.dwb .dwb__btn:hover {
	border-color: var(--dwb-blush);
	background: var(--dwb-blush);
	color: var(--dwb-ink);
}

.dwb.dwb .dwb__btn:focus-visible,
.dwb.dwb .dwb__dot:focus-visible {
	outline: 2px solid var(--dwb-red);
	outline-offset: 2px;
}

.dwb .dwb__pause .dwb__icon-play,
.dwb .dwb__pause.is-playing .dwb__icon-pause {
	display: block;
}

.dwb .dwb__pause .dwb__icon-pause,
.dwb .dwb__pause.is-playing .dwb__icon-play {
	display: none;
}

.dwb .dwb__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dwb.dwb .dwb__dot {
	position: relative;
	display: block;
	width: 10px;
	height: 10px;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 999px;
	background: var(--dwb-line);
	box-shadow: none;
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.15s ease;
}

.dwb.dwb .dwb__dot:hover {
	background: #D9C7B8;
}

.dwb.dwb .dwb__dot[aria-current="true"] {
	width: 36px;
}

.dwb .dwb__dot-fill {
	position: absolute;
	inset: 0;
	background: var(--dwb-red);
	transform: scaleX(0);
	transform-origin: left center;
}

.dwb .dwb__dot[aria-current="true"] .dwb__dot-fill {
	animation: dwb-fill var(--dwb-delay, 10s) linear forwards;
}

.dwb.is-paused .dwb__dot[aria-current="true"] .dwb__dot-fill {
	animation-play-state: paused;
}

@keyframes dwb-fill {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* ---------- phones ---------- */

@media (max-width: 767px) {
	.dwb .dwb__viewport {
		aspect-ratio: var(--dwb-ratio-m, var(--dwb-ratio, 3));
		border-radius: 8px;
	}
	/* A banner without a phone version is shown whole inside a phone-shaped box. */
	.dwb .dwb__slide:not(.has-mobile) img.dwb__img {
		object-fit: contain;
	}
	.dwb .dwb__controls {
		gap: 10px;
		margin-top: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dwb .dwb__slide,
	.dwb .dwb__slide.is-active {
		transition: none;
	}
	.dwb .dwb__dot[aria-current="true"] .dwb__dot-fill {
		animation: none;
		transform: scaleX(1);
	}
}
