/**
 * King Ad Manager Front-end Styles.
 *
 * Clean, responsive presentation for custom client image banners, custom code
 * embeds, AdSense wrappers, and mobile floating sticky banner.
 */

.king-ad-unit {
	display: block;
	margin: 24px auto;
	text-align: center;
	max-width: 100%;
	position: relative;
	clear: both;
}

.king-ad-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	margin-bottom: 6px;
	text-align: center;
	line-height: 1;
}

.king-ad-link {
	display: inline-block;
	max-width: 100%;
	text-decoration: none;
	border: none;
	outline: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.king-ad-link:hover {
	opacity: 0.94;
}

.king-ad-image {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.king-ad-code-inner {
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
}

/* Placements */
.king-ad-placement--article_top {
	margin: 16px auto 24px auto;
}

.king-ad-placement--article_mid {
	margin: 28px auto;
	padding: 12px 0;
}

.king-ad-placement--article_bottom {
	margin: 28px auto 20px auto;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.king-ad-placement--sidebar_right {
	margin: 20px 0;
}

.king-ad-placement--sidebar_right .king-ad-image {
	width: 100%;
	max-width: 336px;
}

.king-ad-placement--home_header {
	margin: 15px auto 25px auto;
}

.king-ad-placement--home_mid {
	margin: 30px auto;
}

/* Mobile floating sticky ad banner */
.king-float-ad {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99998;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
	padding: 8px 12px;
	text-align: center;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.king-float-ad.is-hidden {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

.king-float-ad__label {
	position: absolute;
	top: -18px;
	left: 12px;
	background: #1e293b;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 4px 4px 0 0;
}

.king-float-ad__close {
	position: absolute;
	top: -24px;
	right: 12px;
	width: 24px;
	height: 24px;
	line-height: 22px;
	text-align: center;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 50%;
	font-size: 16px;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: background 0.2s ease, color 0.2s ease;
}

.king-float-ad__close:hover {
	background: #ef4444;
	color: #ffffff;
	border-color: #ef4444;
}

.king-float-ad__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	max-height: 90px;
}

.king-float-ad__inner .king-ad-unit {
	margin: 0 !important;
}

.king-float-ad__inner .king-ad-label {
	display: none;
}

.king-float-ad__inner .king-ad-image {
	max-height: 70px;
	width: auto;
}

/* Dark mode compatibility */
.dark .king-ad-label,
.king-dark .king-ad-label {
	color: #64748b;
}

.dark .king-ad-placement--article_bottom,
.king-dark .king-ad-placement--article_bottom {
	border-top-color: #334155;
}

.dark .king-float-ad,
.king-dark .king-float-ad {
	background: #0f172a;
	border-top-color: #334155;
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.dark .king-float-ad__close,
.king-dark .king-float-ad__close {
	background: #1e293b;
	border-color: #475569;
	color: #94a3b8;
}

@media (min-width: 992px) {
	.king-float-ad {
		display: none !important;
	}
}
