/**
 * Adify front-end styles. Tiny and theme-agnostic: ad containers, the label,
 * responsive device hiding, sticky bars and the sticky sidebar.
 */

.adify-ad {
	display: block;
	margin: 1.4em auto;
	clear: both;
	max-width: 100%;
}
.adify-ad--center { text-align: center; }
.adify-ad--left { text-align: left; }
.adify-ad--right { text-align: right; }

.adify-ad__label {
	display: block;
	margin-bottom: 4px;
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.55;
}

.adify-ad__code,
.adify-ad__frame,
.adify-ad__placeholder {
	display: inline-block;
	max-width: 100%;
}
.adify-ad__frame { border: 0; }
.adify-ad__placeholder { width: 100%; }

/* Cache-safe device targeting: the wrong-device copy is display:none, so a
   lazy ad inside it never enters the viewport and never loads. */
@media (max-width: 781px) {
	.adify-ad--desktop-only { display: none !important; }
}
@media (min-width: 782px) {
	.adify-ad--mobile-only { display: none !important; }
}

/* ---- Sticky header / footer bars ---- */
.adify-sticky {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px 34px;
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
	box-sizing: border-box;
}
.adify-sticky--top { top: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.adify-sticky--bottom { bottom: 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.adify-sticky__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	overflow: hidden;
}
.adify-sticky .adify-ad { margin: 0 auto; line-height: 0; }
/* Block-level frame: no inline-box baseline gap, so the bar is exactly the
   creative's height plus the 4px padding — nothing taller. */
.adify-sticky .adify-ad__frame,
.adify-sticky .adify-ad__code { display: block; margin: 0 auto; }
.adify-sticky .adify-ad__label { margin-bottom: 0; font-size: 9px; }
.adify-sticky__close {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: #111;
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.85;
	padding: 0;
}
.adify-sticky__close:hover { opacity: 1; }
.adify-sticky--hidden { display: none !important; }

/* ---- Sticky sidebar ---- */
.adify-sidebar-ad { margin: 0 0 20px; }
.adify-sidebar-ad:last-child { margin-bottom: 0; }
.adify-sidebar-ad--sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 90px;
	overflow-anchor: none;
}

/* ---- Selector relocation, collapse & sticky-overflow fix ---- */

/* The footer pool that holds the selector <template>s is never shown in place;
   adify.js clones the ad out of it to the target element. */
.adify-selector-pool { display: none !important; }

/* An ad the front end judged empty (no fill) collapses so there is no gap. */
.adify-ad--collapsed { display: none !important; }

/* position:sticky breaks when an ancestor clips overflow. When a sticky sidebar
   ad exists and <body> clips, adify.js adds .adify-sticky-fix to <html>: keep the
   sideways clip at <html> (so no horizontal scrollbar appears) while freeing
   <body> so the sidebar can stick. */
html.adify-sticky-fix { overflow-x: hidden; }
html.adify-sticky-fix body { overflow: visible; }

/* Responsive safety: fixed-width creatives never overflow their column. */
.adify-ad__code img { max-width: 100%; height: auto; }
.adify-ad__code iframe,
.adify-ad__frame { max-width: 100%; }

/* ---- Auto-refresh rotation pool + swap state ---- */

/* The rotation pool is an inert <template> (already not rendered); the explicit
   rule is a belt-and-braces guard in case a browser ever exposes template DOM. */
.adify-ad__pool,
.adify-ad__variant { display: none !important; }

/* Brief fade while adify.js tears down the old creative and swaps in the next
   one, so a refresh never flashes empty. */
.adify-ad--refreshing { transition: opacity 0.2s ease; opacity: 0.35; }

/* ---- Anti-adblock ---- */

/* Bait element: ad-like class names + size so blockers hide/remove it, parked
   offscreen so it never affects layout when it is NOT blocked. */
.adify-bait {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 300px;
	height: 250px;
	background: transparent;
	pointer-events: none;
}

/* Dismissible notice shown when the bait is blocked. Fixed to the bottom so it
   never covers or blocks the article. */
.adify-adblock {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	z-index: 99999;
	max-width: 92%;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 40px 12px 16px;
	background: rgba(20, 20, 20, 0.96);
	color: #fff;
	font-size: 14px;
	line-height: 1.45;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
	box-sizing: border-box;
}
.adify-adblock__msg a { color: #8ab4ff; }
.adify-adblock__close {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.adify-adblock__close:hover { background: rgba(255, 255, 255, 0.28); }
.adify-adblock--hidden { display: none !important; }
