/* =================================================================
 * Adbris AI Ad Inserter — frontend wrapper styles
 *
 * Keep this lean. Publisher themes vary wildly so we only set the
 * minimum that makes ads land cleanly without breaking layouts.
 * ================================================================= */

.adbris-ad-wrap {
	display: block;
	max-width: 100%;
	overflow: hidden;
	clear: both;
	box-sizing: border-box;
}

.adbris-ad-wrap > .adbris-ad-inner {
	display: inline-block;
	max-width: 100%;
}

.adbris-align-center > .adbris-ad-inner {
	display: block;
}

.adbris-align-left,
.adbris-align-right {
	overflow: hidden;
}

/* Floats clear themselves once the float region ends. */
.adbris-align-float_left,
.adbris-align-float_right {
	overflow: visible;
}

/* Mobile safety — no horizontal scroll from oversized banners. */
@media (max-width: 640px) {
	.adbris-ad-wrap {
		max-width: 100vw;
		overflow-x: auto;
	}
}

/* Hide ads in print. */
@media print {
	.adbris-ad-wrap { display: none !important; }
}

/* ============================ Floating ============================ */

.adbris-floating {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: rgba(255, 255, 255, 0.96);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.18);
	padding: 8px 12px;
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
}

/* Top-anchor variant — sticks to the top of the viewport with a
   reverse border + shadow so it sits above page content. Close
   button is the same as the bottom variant. */
.adbris-floating.adbris-floating-top {
	top: 0;
	bottom: auto;
	border-top: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}
.adbris-floating.adbris-floating-top .adbris-floating-close {
	top: 6px;
	bottom: auto;
}

.adbris-floating .adbris-ad-inner {
	display: flex;
	justify-content: center;
}

.adbris-floating-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 26px;
	height: 26px;
	display: grid;
	place-items: center;
	font-size: 18px;
	line-height: 1;
	color: #1d1d1f;
	background: rgba(0, 0, 0, 0.06);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease;
}
.adbris-floating-close:hover { background: rgba(0, 0, 0, 0.12); }
.adbris-floating-close:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

.adbris-floating.is-dismissed {
	display: none;
}

@media (prefers-color-scheme: dark) {
	.adbris-floating {
		background: rgba(28, 28, 30, 0.94);
		border-top-color: rgba(255, 255, 255, 0.08);
	}
	.adbris-floating-close { color: #f5f5f7; background: rgba(255, 255, 255, 0.10); }
	.adbris-floating-close:hover { background: rgba(255, 255, 255, 0.18); }
}

/* ============================ Lazy load ========================== */

/* When data-lazy="1" we tag the wrapper so JS can flip a visibility
   class once the slot enters the viewport. The actual ad-request
   deferral is the publisher's responsibility — GPT has its own
   `pubads().enableLazyLoad()`; AdSense is auto-lazy. */
.adbris-ad-wrap[data-lazy="1"] {
	min-height: 1px;
}
.adbris-ad-wrap[data-lazy="1"].is-visible .adbris-ad-inner {
	opacity: 1;
}

/* ============================ Optional label ===================== */

.adbris-ad-label {
	display: block;
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(0, 0, 0, 0.4);
	text-align: center;
	margin-bottom: 4px;
}
@media (prefers-color-scheme: dark) {
	.adbris-ad-label { color: rgba(255, 255, 255, 0.4); }
}

/* ====================== AdBlock notice (Phase 12) ===================== */

.adbris-adblock-notice {
	position: fixed;
	bottom: 16px;
	left: 16px;
	right: 16px;
	max-width: 520px;
	margin: 0 auto;
	z-index: 99998;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.96);
	color: #1d1d1f;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.22), 0 4px 12px -4px rgba(0, 0, 0, 0.10);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
	font-size: 13.5px;
	line-height: 1.45;
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	animation: adbris-slide-up 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.adbris-adblock-notice-icon {
	flex: 0 0 auto;
	color: #ff9500;
	margin-top: 1px;
}
.adbris-adblock-notice-body { flex: 1; min-width: 0; }
.adbris-adblock-notice-body strong { display: block; font-weight: 600; margin-bottom: 2px; }
.adbris-adblock-notice-body p { margin: 0; color: #424246; font-size: 13px; }
.adbris-adblock-notice-close {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #1d1d1f;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}
.adbris-adblock-notice-close:hover { background: rgba(0, 0, 0, 0.12); }
.adbris-adblock-notice.is-dismissing {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s, transform 0.2s;
}

@keyframes adbris-slide-up {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
	.adbris-adblock-notice {
		background: rgba(28, 28, 30, 0.94);
		color: #f5f5f7;
		border-color: rgba(255, 255, 255, 0.10);
	}
	.adbris-adblock-notice-body p { color: #d1d1d6; }
	.adbris-adblock-notice-close {
		background: rgba(255, 255, 255, 0.10);
		color: #f5f5f7;
	}
	.adbris-adblock-notice-close:hover { background: rgba(255, 255, 255, 0.18); }
}

/* ====================== AdBlock lock overlay (Phase 12) ============== */

html.adbris-adblock-locked,
html.adbris-adblock-locked body { overflow: hidden !important; }

.adbris-adblock-lock {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(15, 15, 15, 0.78);
	backdrop-filter: blur(8px) saturate(140%);
	-webkit-backdrop-filter: blur(8px) saturate(140%);
	animation: adbris-fade-in 0.25s ease;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
.adbris-adblock-lock-card {
	max-width: 480px;
	width: 100%;
	background: #ffffff;
	color: #1d1d1f;
	border-radius: 22px;
	padding: 32px 28px 24px;
	text-align: center;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.adbris-adblock-lock-icon {
	margin: 0 auto 18px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(255, 59, 48, 0.10);
	color: #ff3b30;
	display: grid;
	place-items: center;
}
.adbris-adblock-lock-card h2 {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.015em;
	margin: 0 0 8px;
}
.adbris-adblock-lock-card p {
	margin: 0 0 18px;
	color: #424246;
	font-size: 14.5px;
	line-height: 1.5;
}
.adbris-adblock-lock-steps {
	text-align: left;
	margin: 0 0 22px;
	padding: 0 0 0 22px;
	color: #1d1d1f;
	font-size: 14px;
	line-height: 1.7;
}
.adbris-adblock-lock-steps li { margin-bottom: 6px; }
.adbris-adblock-lock-reload {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 22px;
	height: 44px;
	border-radius: 999px;
	background: linear-gradient(180deg, #10b981 0%, #0a9168 100%);
	color: #fff;
	border: 0;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 6px 14px -6px rgba(16, 185, 129, 0.5);
	transition: background 0.18s;
}
.adbris-adblock-lock-reload:hover { background: linear-gradient(180deg, #34d399 0%, #10b981 100%); }

@keyframes adbris-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-color-scheme: dark) {
	.adbris-adblock-lock-card {
		background: #1c1c1e;
		color: #f5f5f7;
	}
	.adbris-adblock-lock-card p { color: #d1d1d6; }
	.adbris-adblock-lock-steps { color: #f5f5f7; }
}
