/* In-Text Ads. Colours and sizes come from the :root variables printed by the plugin. */

body a.ita-link {
	color: var(--ita-link, inherit);
	text-decoration-line: var(--ita-ul-line, underline);
	text-decoration-style: var(--ita-ul-style, dotted);
	text-decoration-color: var(--ita-ul-color, currentColor);
	text-decoration-thickness: var(--ita-ul-width, 2px);
	text-underline-offset: 0.24em;
	text-decoration-skip-ink: none;
	background-color: transparent;
	border-radius: 3px;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
	transition: background-color 0.15s ease, color 0.15s ease;
}

body a.ita-link:hover,
body a.ita-link:focus-visible,
body a.ita-link.is-open {
	color: var(--ita-link-hover, inherit);
	background-color: var(--ita-marker, transparent);
}

/* ---- popup ---- */

.ita-pop {
	position: fixed;
	z-index: 99999;
	top: 0;
	left: 0;
	box-sizing: border-box;
	width: var(--ita-pop-width, 320px);
	max-width: calc(100vw - 16px);
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	background: var(--ita-pop-bg, #fff);
	color: var(--ita-pop-text, #1d2327);
	border: 1px solid var(--ita-pop-border, #dcdcde);
	border-radius: var(--ita-pop-radius, 8px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
	font: 400 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.ita-pop.is-below {
	transform: translateY(-4px);
}

.ita-pop.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

/* arrow pointing at the phrase */
.ita-pop::before {
	content: "";
	position: absolute;
	left: var(--ita-arrow-x, 24px);
	bottom: -6px;
	width: 10px;
	height: 10px;
	background: var(--ita-pop-bg, #fff);
	border: 1px solid var(--ita-pop-border, #dcdcde);
	border-top: 0;
	border-left: 0;
	transform: rotate(45deg);
}

.ita-pop.is-below::before {
	top: -6px;
	bottom: auto;
	border: 1px solid var(--ita-pop-border, #dcdcde);
	border-right: 0;
	border-bottom: 0;
}

.ita-pop [hidden] {
	display: none !important;
}

.ita-pop__img {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: calc(var(--ita-pop-radius, 8px) - 2px);
	object-fit: cover;
	background: rgba(0, 0, 0, 0.06);
}

.ita-pop__body {
	flex: 1 1 auto;
	min-width: 0;
}

.ita-pop__label {
	margin: 0 0 2px;
	font-size: 12px;
	line-height: 1.4;
	opacity: 0.6;
}

.ita-pop__text {
	margin: 0 0 10px;
	overflow-wrap: anywhere;
}

body .ita-pop a.ita-pop__btn {
	display: inline-block;
	padding: 6px 14px;
	background: var(--ita-btn-bg, #2271b1);
	color: var(--ita-btn-text, #fff);
	border-radius: calc(var(--ita-pop-radius, 8px) - 2px);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	box-shadow: none;
}

body .ita-pop a.ita-pop__btn:hover,
body .ita-pop a.ita-pop__btn:focus-visible {
	filter: brightness(1.1);
	color: var(--ita-btn-text, #fff);
}

/* static copy used by the live preview on the settings screen */
.ita-pop--static {
	position: relative;
	opacity: 1;
	visibility: visible;
	transform: none;
	margin-top: 16px;
}

.ita-pop--static::before {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	body a.ita-link,
	.ita-pop {
		transition: none;
	}
}
