/* Radvertise front end — base styles; per-class CSS is added inline. */

.radv-ad {
	box-sizing: border-box;
	max-width: 100%;
}
/* Media ads hug their banner so class borders/shadows fit it. */
.radv-ad.radv-image {
	display: inline-block;
	vertical-align: top;
}
.radv-ad.radv-image a {
	display: block;
}
.radv-ad img,
.radv-ad video,
.radv-ad iframe {
	display: block;
	max-width: 100%;
	height: auto;
}

/* -- Video -------------------------------------------------------------- */
.radv-video-inner {
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
}
.radv-video-inner.is-embed {
	display: block;
}
.radv-video-media {
	position: relative;
}
.radv-video-frame {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
}
.radv-video-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
}
.radv-video-title {
	display: block;
	padding: 6px 0;
}
.radv-video-title.radv-title-over {
	position: absolute;
	z-index: 2;
	max-width: calc(100% - 24px);
	padding: 4px 10px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	text-decoration: none;
}
.radv-title-top-left { top: 12px; left: 12px; }
.radv-title-top-center { top: 12px; left: 50%; translate: -50% 0; }
.radv-title-top-right { top: 12px; right: 12px; }
.radv-title-bottom-left { bottom: 12px; left: 12px; }
.radv-title-bottom-center { bottom: 12px; left: 50%; translate: -50% 0; }
.radv-title-bottom-right { bottom: 12px; right: 12px; }
/* Bottom corners clear the native video controls. */
.radv-video-media video ~ .radv-title-bottom-left,
.radv-video-media video ~ .radv-title-bottom-center,
.radv-video-media video ~ .radv-title-bottom-right {
	bottom: 52px;
}

/* -- Icons of text ads (color follows the link) ---------------------------- */
/* A text link: its icon beside the content block, vertically centered. */
.radv-text-link {
	display: inline-flex;
	align-items: center;
	gap: .35em;
}
/* Hover transition "draw" and the texture animation move these numbers. */
@property --radv-tr {
	syntax: "<number>";
	inherits: false;
	initial-value: 0;
}

@property --radv-tex {
	syntax: "<number>";
	inherits: false;
	initial-value: 0;
}

.radv-text-body {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
}
.radv-icon {
	display: block;
	flex: none;
	width: 1.15em;
	height: 1.15em;
	line-height: 1;
}
.radv-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* Moving light effects: one sweep, fading in and out (values set per class). */
@keyframes radv-sweep {
	0% {
		background-position: var(--radv-ls);
		opacity: 0;
	}
	8% {
		opacity: var(--radv-lo, 1);
	}
	80% {
		opacity: var(--radv-lo, 1);
	}
	100% {
		background-position: var(--radv-le);
		opacity: 0;
	}
}

/* Hover icon swaps (class icons): the icons change half-way. */
@keyframes radv-icon-fade {
	0% { opacity: 1; -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	49.9% { opacity: 0; -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	50% { opacity: 0; -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
	100% { opacity: 1; -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
}
@keyframes radv-icon-spin {
	0% { transform: rotate(0) scale(1); -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	49.9% { transform: rotate(180deg) scale(.2); -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	50% { transform: rotate(180deg) scale(.2); -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
	100% { transform: rotate(360deg) scale(1); -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
}
@keyframes radv-icon-flip {
	0% { transform: perspective(200px) rotateY(0); -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	49.9% { transform: perspective(200px) rotateY(90deg); -webkit-mask-image: var(--radv-i1); mask-image: var(--radv-i1); }
	50% { transform: perspective(200px) rotateY(-90deg); -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
	100% { transform: perspective(200px) rotateY(0); -webkit-mask-image: var(--radv-i2); mask-image: var(--radv-i2); }
}

/* Heading inside a text link ({heading:…} in its title) */
.radv-text-link .radv-text-heading {
	display: block;
	margin: 0 0 .2em;
	padding: 0;
	color: inherit;
	font-size: 1.05em;
	line-height: 1.4;
}
/* Only a title: the click count stays beside it. */
.radv-text-link .radv-text-heading.is-alone {
	display: inline;
	margin: 0;
}

/* -- Groups ------------------------------------------------------------- */
.radv-group {
	margin: 0;
	padding: 0;
}
ul.radv-group {
	list-style: none;
}
.radv-group-item {
	margin-bottom: 8px;
}
.radv-mode-random > .radv-group-item:not(.is-active),
.radv-mode-rotate > .radv-group-item:not(.is-active),
.radv-mode-carousel:not(.radv-carousel-on) > .radv-group-item:not(.is-active) {
	display: none;
}

/* Carousel: [prev] [viewport with a sliding track] [next] */
.radv-carousel {
	display: flex;
	align-items: center;
	gap: 8px;
}
.radv-carousel-viewport {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}
.radv-mode-carousel.radv-carousel-on {
	display: flex;
	transition: transform .4s ease;
}
.radv-carousel .radv-mode-carousel > .radv-group-item {
	flex: 0 0 calc(100% / var(--radv-per-view, 1));
	box-sizing: border-box;
	margin: 0;
	padding: 0 4px;
	text-align: center;
}
.radv-carousel-btn {
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 50%;
	background: #fff;
	color: #333;
	font-size: 0;
	cursor: pointer;
}
/* Chevrons drawn with borders so no icon font is needed. */
.radv-carousel-btn::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}
.radv-carousel-prev::before {
	transform: rotate(-135deg);
}
.radv-carousel-next::before {
	transform: rotate(45deg);
}
[dir="rtl"] .radv-carousel-prev::before,
.rtl .radv-carousel-prev::before {
	transform: rotate(45deg);
}
[dir="rtl"] .radv-carousel-next::before,
.rtl .radv-carousel-next::before {
	transform: rotate(-135deg);
}
.radv-carousel-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.radv-mode-carousel.radv-carousel-on {
		transition: none;
	}
}
.radv-text-group + .radv-text-group {
	margin-top: 16px;
}
.radv-click-count {
	opacity: .7;
	font-size: .9em;
	white-space: nowrap;
}
.radv-text-group-title {
	margin: 0 0 8px;
	font-size: 1.1em;
}

/* -- Popups ------------------------------------------------------------- */
html.radv-popup-lock,
html.radv-popup-lock body {
	overflow: hidden;
}
.radv-popup {
	position: fixed;
	z-index: 999990;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.radv-popup[hidden] {
	display: none;
}
.radv-popup-slide-right,
.radv-popup-slide-left {
	inset: auto 16px 16px auto;
	padding: 0;
	pointer-events: none;
}
.radv-popup-slide-left {
	inset: auto auto 16px 16px;
}
.radv-popup-overlay {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity .3s;
}
.radv-popup.is-open .radv-popup-overlay {
	opacity: 1;
}
.radv-popup-box {
	position: relative;
	box-sizing: border-box;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 32px);
	padding: 12px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
	pointer-events: auto;
	outline: none;
	transition: opacity .3s, transform .3s;
}
.radv-popup-slide-right .radv-popup-box,
.radv-popup-slide-left .radv-popup-box {
	max-width: calc(100vw - 32px);
}
.radv-popup-content {
	min-height: 0;
	overflow: auto;
}
.radv-popup-content .radv-ad {
	display: block;
}
.radv-popup-content img,
.radv-popup-content video {
	margin: 0 auto;
}
.radv-popup-close {
	position: absolute;
	z-index: 3;
	/* On the window's top corner: half outside, half inside. */
	top: -16px;
	inset-inline-end: -16px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 0;
	border-radius: 16px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.radv-popup-close:disabled {
	cursor: default;
	font-size: 14px;
}
.radv-popup-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.radv-popup-remaining {
	margin: 8px 0 0;
	font-size: 13px;
	text-align: center;
	opacity: .75;
}

/* Entry animations: start state, then .is-open. */
.radv-popup .radv-popup-box { opacity: 0; }
.radv-popup.is-open .radv-popup-box { opacity: 1; transform: none; }
.radv-anim-zoom .radv-popup-box { transform: scale(.85); }
.radv-anim-slide-up .radv-popup-box { transform: translateY(40px); }
.radv-anim-slide-down .radv-popup-box { transform: translateY(-40px); }
.radv-popup-slide-right.radv-anim-fade .radv-popup-box { transform: translateX(40px); }
.radv-popup-slide-left.radv-anim-fade .radv-popup-box { transform: translateX(-40px); }
.radv-anim-none .radv-popup-box,
.radv-anim-none .radv-popup-overlay {
	transition: none;
}
@media (prefers-reduced-motion: reduce) {
	.radv-popup-box,
	.radv-popup-overlay {
		transition: none !important;
		transform: none !important;
	}
}

/* -- Reportage ---------------------------------------------------------- */
.radv-reportage-image {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 16px;
	border-radius: 6px;
}
.radv-reportage-title {
	margin: 0 0 12px;
}

.radv-reportage-label {
	display: inline-block;
	margin-bottom: 8px;
	padding: 2px 10px;
	border-radius: 12px;
	background: rgba(0, 0, 0, .06);
	font-size: .85em;
	text-decoration: none;
}
