/* Acuántico Afiliados — ventanas de anuncio con el lenguaje visual del tema.
   Usa las variables --ap-* del tema; los valores de respaldo son los mismos. */

.apa-win {
	display: block;
	position: relative;
	box-sizing: border-box;
	background: var(--ap-surface, #121212);
	border: 1px solid var(--ap-border, #262626);
	border-radius: var(--ap-radius-lg, 16px);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 14px 34px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	color: var(--ap-text, #f4f4f4);
	text-decoration: none;
	font-family: var(--ap-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
	transition: box-shadow 0.2s var(--ap-ease, ease);
}

.apa-win:hover {
	box-shadow: var(--ap-shadow-card-hover, 0 0 0 1px rgba(255, 42, 42, 0.35));
	color: var(--ap-text, #f4f4f4);
}

.apa-win:focus-visible {
	outline: 2px solid var(--ap-focus, #ff6b6b);
	outline-offset: 2px;
}

/* Marco de ventana: solo los tres puntos, como el resto del tema. */
.apa-frame {
	position: relative;
	display: flex;
	align-items: center;
	padding: 8px 12px;
	background: var(--ap-surface-raised, #1a1a1a);
	border-bottom: 1px solid var(--ap-border, #262626);
}

.apa-frame::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--ap-accent, #ff2a2a) 20%, var(--ap-accent, #ff2a2a) 80%, transparent);
	opacity: 0.75;
}

.apa-dots {
	display: flex;
	gap: 6px;
}

.apa-dots span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.apa-dots span:nth-child(1) { background: #ff5f57; }
.apa-dots span:nth-child(2) { background: #febc2e; }
.apa-dots span:nth-child(3) { background: #28c840; }

.apa-tag {
	display: block;
	text-align: center;
	font: 10px/1.4 var(--ap-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ap-text-dim, #b8b8b8);
}

/* Tarjeta de texto */
.apa-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
	padding: 14px 12px 16px;
}

.apa-ico {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--ap-accent-soft, rgba(255, 42, 42, 0.16));
	color: var(--ap-accent, #ff2a2a);
}

.apa-name {
	display: block;
	font-size: 13px;
	line-height: 1.35;
	font-weight: 600;
}

.apa-btn {
	display: inline-block;
	padding: 7px 10px;
	border: 1px solid var(--ap-accent, #ff2a2a);
	border-radius: 8px;
	color: var(--ap-text, #f4f4f4);
	font-size: 12px;
	font-weight: 600;
}

.apa-win:hover .apa-btn {
	background: var(--ap-accent, #ff2a2a);
}

/* Ventana con banner */
.apa-win--ban .apa-tag {
	padding: 7px 8px 6px;
}

.apa-win picture {
	display: block;
}

.apa-img {
	display: block;
	margin: 0 auto 10px;
	max-width: 100%;
	height: auto;
}

/* ── Columnas laterales (solo escritorio ancho) ──
   Centradas en el hueco que dejan a cada lado de la ventana del contenido
   (1180 px) y en vertical sobre la barra inferior. */
.apa-rail {
	position: fixed;
	top: 0;
	bottom: var(--ap-dock-height, 64px);
	z-index: 40;
	width: calc((100% - 1180px) / 2);
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.apa-rail--l { left: 0; }
.apa-rail--r { right: 0; }

.apa-rail .apa-v {
	pointer-events: auto;
	width: clamp(120px, calc(100% - 24px), 200px);
}

.apa-rail .apa-v--ban {
	display: none;
	width: 164px;
}

@media (min-width: 1472px) {
	.apa-rail { display: flex; }
}

/* Hueco ancho: el banner de 160×600 sustituye a la tarjeta de texto. */
@media (min-width: 1620px) {
	.apa-rail .apa-v--ban { display: block; }
	.apa-rail .apa-v--ban + .apa-v--txt { display: none; }
}

/* ── Bloque al final del artículo ── */
.apa-inline {
	margin: 40px 0 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.apa-ban-wrap {
	display: flex;
	justify-content: center;
	width: 100%;
}

.apa-ban-wrap .apa-win {
	width: max-content;
	max-width: 100%;
}

.apa-grid {
	display: grid;
	width: 100%;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
}

.apa-legal {
	margin: 0;
	font-size: 11px;
	line-height: 1.5;
	color: var(--ap-text-dim, #b8b8b8);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.apa-win { transition: none; }
}
