/* WebMitr Ad Manager: front end. */

.wam-ad {
	position: relative;
	max-width: 100%;
	margin: 0 auto;
	line-height: 0;
}
.wam-ad__track {
	position: relative;
	width: 100%;
	overflow: hidden;
}
.wam-ad__slide a {
	display: block;
}
.wam-ad__img {
	display: block;
	width: 100%;
	height: auto;
}

/* Slider: slides stack and fade. Without JS only the first shows. */
.wam-ad--slider .wam-ad__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity .5s ease, visibility 0s linear .5s;
}
.wam-ad--slider .wam-ad__slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	transition: opacity .5s ease;
}
/*
 * Crop / Show whole: the box takes the first image's ratio and every slide
 * fills it, so nothing below the ad moves.
 * Resize (fit-auto): no fixed box; the active slide sets the height.
 */
.wam-ad--slider.wam-ad--sized .wam-ad__slide.is-active {
	position: absolute;
}
.wam-ad--slider.wam-ad--sized .wam-ad__slide a {
	height: 100%;
}
.wam-ad--slider.wam-ad--sized .wam-ad__img {
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}
.wam-ad--slider.wam-ad--sized.wam-ad--fit-contain .wam-ad__img {
	object-fit: contain;
}
/* Space between an ad widget and the widgets around it. Override with --wam-gap. */
.widget.widget_wam_ad:not(:last-child) {
	margin-bottom: var(--wam-gap, 16px);
}
.widget:not(.widget_wam_ad) + .widget.widget_wam_ad {
	margin-top: var(--wam-gap, 16px);
}

.wam-ad__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 22px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s;
}
.wam-ad__arrow--prev { left: 8px; }
.wam-ad__arrow--next { right: 8px; }
.wam-ad:hover .wam-ad__arrow,
.wam-ad__arrow:focus-visible {
	opacity: 1;
}
@media (hover: none) {
	.wam-ad__arrow { opacity: .8; }
}

.wam-ad__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 6px;
}
.wam-ad__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .6);
	box-shadow: 0 0 2px rgba(0, 0, 0, .5);
	cursor: pointer;
}
.wam-ad__dot.is-active {
	background: #fff;
	transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
	.wam-ad--slider .wam-ad__slide,
	.wam-ad--slider .wam-ad__slide.is-active {
		transition: none;
	}
}
