/**
 * News Ads Manager — Public styles
 */

.nam-ad-slot {
	display: block;
	margin: 16px auto;
	text-align: center;
	overflow: visible;
	line-height: 0;
}

.nam-ad-slot__inner {
	display: inline-block;
	max-width: 100%;
	line-height: normal;
}

/* ══════════════════════════════════════
   STICKY AD
   ══════════════════════════════════════ */
.nam-ad-slot--sticky-bottom,
.nam-ad-slot--sticky-top {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	margin: 0;
	padding: 0;
	background: #fff;
	line-height: normal;
	transition: transform 0.35s ease, opacity 0.35s ease;
	overflow: visible;
}

.nam-ad-slot--sticky-bottom {
	bottom: 0;
	border-top: 3px solid #1a3a6b;
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
}

.nam-ad-slot--sticky-top {
	top: 0;
	border-bottom: 3px solid #1a3a6b;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.admin-bar .nam-ad-slot--sticky-top {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .nam-ad-slot--sticky-top {
		top: 46px;
	}
}

/* Tab de controles centrado */
.nam-sticky-tab {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	background: #fff;
	border: 1px solid #c8c8c8;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
	z-index: 99991;
	padding: 0 2px;
}

.nam-ad-slot--sticky-bottom .nam-sticky-tab {
	top: -24px;
	border-radius: 6px 6px 0 0;
	border-bottom: none;
}

.nam-ad-slot--sticky-top .nam-sticky-tab {
	bottom: -24px;
	border-radius: 0 0 6px 6px;
	border-top: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nam-sticky-tab__divider {
	width: 1px;
	height: 18px;
	background: #dcdcde;
}

.nam-sticky-toggle,
.nam-sticky-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	color: #50575e;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.nam-sticky-toggle:hover,
.nam-sticky-close:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #1d2327;
}

.nam-sticky-toggle__icon {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	transition: transform 0.25s ease;
}

.nam-ad-slot--sticky-top .nam-sticky-toggle__icon {
	border-top: none;
	border-bottom: 6px solid currentColor;
}

.nam-ad-slot--sticky.is-collapsed .nam-sticky-toggle__icon {
	transform: rotate(180deg);
}

.nam-ad-slot__content {
	overflow: hidden;
	max-height: 500px;
	transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
	padding: 4px 8px 8px;
	text-align: center;
}

.nam-ad-slot--sticky.is-collapsed .nam-ad-slot__content {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.nam-ad-slot--sticky.is-collapsed.nam-ad-slot--sticky-bottom,
.nam-ad-slot--sticky.is-collapsed.nam-ad-slot--sticky-top {
	min-height: 0;
	height: 0;
	overflow: visible;
	border: none;
	box-shadow: none;
	background: transparent;
}

.nam-ad-slot--sticky.is-closed {
	transform: translateY(calc(100% + 30px));
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

.nam-ad-slot--sticky-top.is-closed {
	transform: translateY(calc(-100% - 30px));
}

/* ══════════════════════════════════════
   INTERSTITIAL MODAL
   ══════════════════════════════════════ */
.nam-interstitial-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	background: transparent;
	pointer-events: none;
}

.nam-interstitial-modal.is-visible {
	display: flex;
	pointer-events: auto;
}

.nam-interstitial-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.nam-interstitial-modal.is-visible:not(.has-shown) .nam-interstitial-backdrop {
	animation: nam-fade-in 0.25s ease;
}

.nam-interstitial-modal.has-shown.is-visible .nam-interstitial-backdrop {
	animation: none;
}

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

.nam-interstitial-dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
	width: fit-content;
	height: fit-content;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	padding: 0;
	line-height: 0;
	overflow: visible;
}

.nam-interstitial-modal.is-visible:not(.has-shown) .nam-interstitial-dialog {
	animation: nam-modal-in 0.3s ease;
}

.nam-interstitial-modal.has-shown.is-visible .nam-interstitial-dialog {
	animation: none;
}

.nam-interstitial-modal:not(.is-rendered) .nam-interstitial-dialog {
	visibility: hidden;
}

.nam-interstitial-modal.is-rendered .nam-interstitial-dialog {
	visibility: visible;
}

@keyframes nam-modal-in {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

.nam-interstitial-close-wrap {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
}

.nam-interstitial-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #5bbce4;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	transition: background 0.15s, transform 0.15s;
}

.nam-interstitial-close:hover {
	background: #3aa8d8;
	transform: scale(1.08);
}

.nam-interstitial-ad {
	display: block;
	min-width: 0;
	min-height: 0;
	padding: 0;
	margin: 0;
	line-height: 0;
	overflow: hidden;
}

html.nam-interstitial-active,
body.nam-interstitial-active {
	overflow: hidden;
	overscroll-behavior: none;
}

body.nam-interstitial-active {
	touch-action: none;
}

.nam-interstitial-modal.is-visible {
	touch-action: auto;
}

/* De-emphasize sticky while interstitial is open (keep in DOM so GPT can fill) */
body.nam-interstitial-active .nam-ad-slot--sticky {
	opacity: 0;
	pointer-events: none;
}

body.nam-interstitial-active .nam-ad-slot--sticky.nam-ad-slot--has-ad {
	opacity: 0;
}

.nam-ad-slot--sticky.nam-ad-slot--empty:not(.nam-ad-slot--has-ad) {
	display: none;
}

body.nam-force-immediate .nam-ad-slot--sticky.nam-ad-slot--empty {
	display: block;
	min-height: 90px;
}

.nam-ad-slot--in-content {
	margin: 1.5em auto;
	text-align: center;
	clear: both;
	max-width: 100%;
}

.nam-ad-slot--in-content.nam-ad-slot--empty {
	display: none;
	margin: 0;
	min-height: 0;
}

.nam-ad-slot--in-content .nam-ad-slot__inner {
	min-height: 90px;
	min-width: 1px;
}

.nam-ad-slot--in-content .nam-ad-slot__inner iframe {
	display: block;
	margin: 0 auto;
}

.nam-ad-widget .nam-ad-slot {
	margin: 0;
}

/* ── Editor-only: post excluded from ads ── */
.nam-post-exclusion-notice {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0;
	padding: 10px 16px;
	background: #fcf9e8;
	border-bottom: 1px solid #dba617;
	color: #1d2327;
	font-size: 13px;
	line-height: 1.45;
	z-index: 99998;
}

.admin-bar .nam-post-exclusion-notice {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .nam-post-exclusion-notice {
		top: 46px;
	}
}

.nam-post-exclusion-notice__icon {
	color: #996800;
	font-size: 20px;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.nam-post-exclusion-notice__text {
	margin: 0;
	flex: 1 1 240px;
}

.nam-post-exclusion-notice__text strong {
	display: inline;
	margin-right: 0.35em;
}

.nam-post-exclusion-notice__link {
	flex-shrink: 0;
	padding: 4px 12px;
	border-radius: 4px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
}

.nam-post-exclusion-notice__link:hover,
.nam-post-exclusion-notice__link:focus {
	background: #135e96;
	color: #fff;
}
