/* OFM Native Ads — consumes tokens from tokens.css
   Overlay scrims on image ads stay dark in both themes (for legibility over photos). */

/* Base ad container */
.ofm-ad {
	display: block;
	position: relative;
	border-radius: var(--ofm-radius-lg);
	overflow: hidden;
	text-decoration: none;
	background: var(--ofm-surface-container);
	box-shadow: var(--ofm-shadow-primary);
	font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
	color: var(--ofm-on-surface);
	isolation: isolate;
}

.ofm-ad__label {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ofm-on-surface-muted);
	padding: 0.25rem 0.6rem;
	background: var(--ofm-ghost);
	border-radius: 999px;
	backdrop-filter: blur(8px);
}

.ofm-ad__label--overlay {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
}

/* Image-ad now uses the same Tailwind utilities as .ofm-model-card in the
   theme (see theme/ofm/template-parts/model-card.php). Nothing needed here. */

/* Slot wrapper is a grid item (flex-column via JS) — make the inner ad anchor
   stretch to fill the row height so the visual card outline aligns with
   surrounding model cards (whose root <a> is itself the grid item). */
.oem-mg-slot { min-height: 0; }
.oem-mg-slot > .ofm-ad--image { flex: 1 1 auto; }

/* Compat: if the theme wraps ads in the legacy magazine-grid chrome
   (.feed-card--ad > .oem-ad-media), neutralize that wrapper. */
.feed-card--ad:has(.ofm-ad--image),
.oem-mg-slot:has(.ofm-ad--image) .feed-card--ad {
	border-radius: 0 !important;
	background: transparent !important;
	overflow: visible !important;
	padding: 0 !important;
}
.feed-card--ad:has(.ofm-ad--image)::before {
	display: none !important;
}
.oem-mg-slot:has(.ofm-ad--image) .oem-ad-media {
	aspect-ratio: auto !important;
	position: static !important;
	background: transparent !important;
	height: auto !important;
}

/* ── HTML banner (bare, no chrome) ───────────────────────────────────── */
.ofm-ad--html {
	display: block;
	text-align: center;
	margin: 1.5rem auto;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	padding: 0;
	overflow: visible;
	isolation: auto;
}

.ofm-ad--html img {
	max-width: 100%;
	height: auto;
	display: inline-block;
}

/* ── External embed: transparent pass-through; provider CSS owns chrome ─ */
.ofm-ad--embed {
	background: transparent;
	box-shadow: none;
	padding: 0;
	margin: 1.5rem 0;
}

/* When the ad lives inside the magazine-grid wrapper (.feed-card--ad),
   hide the wrapper's ::before "Advertentie" label — our ad already labels itself. */
.feed-card--ad:has(.ofm-ad)::before {
	content: '' !important;
	display: none !important;
}

/* ── Mobile tweaks ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
	.ofm-ad--image .ofm-ad__label--corner {
		font-size: 0.58rem;
		padding: 0.15rem 0.45rem;
	}
}

/* ── Respect prefers-reduced-motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.ofm-ad--image .ofm-ad__img { transition: none !important; }
	.ofm-ad--image:hover .ofm-ad__img { transform: none; }
}
