/*
 * Ogle Ads: the ad card. Uses the theme's colours and fonts when they exist, with plain
 * fallbacks so ads still look right under any theme.
 */

.ogle-ad-slot:empty {
	display: none;
}

.ogle-ad-slot.is-filled {
	animation: ogle-ad-in 0.3s ease-out;
}

@keyframes ogle-ad-in {
	from {
		opacity: 0;
	}
}

.ogle-ad {
	--ogle-ad-bg: var(--wp--preset--color--surface, #EAE5DA);
	--ogle-ad-fg: var(--wp--preset--color--contrast, #1C1B18);
	margin: 0;
	font-family: var(--wp--preset--font-family--sans, -apple-system, "Segoe UI", Roboto, sans-serif);
}

.ogle-ad--dark {
	--ogle-ad-bg: var(--wp--preset--color--contrast, #1C1B18);
	--ogle-ad-fg: var(--wp--preset--color--base, #F5F2EB);
}

/* "SPONSORED · ABC MOVERS" */
.ogle-ad .ogle-ad__label {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--mono, ui-monospace, Menlo, monospace);
	font-size: 11px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted, #77736B);
}

.ogle-ad .ogle-ad__media {
	display: block;
	line-height: 0;
}

.ogle-ad .ogle-ad__media img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

/* Strip under the image with the headline and button */
.ogle-ad .ogle-ad__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	padding: 14px 18px;
	background: var(--ogle-ad-bg);
	color: var(--ogle-ad-fg);
}

.ogle-ad .ogle-ad__headline {
	flex: 1 1 200px;
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
	color: inherit;
}

.ogle-ad .ogle-ad__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: var(--ogle-ad-fg);
	color: var(--ogle-ad-bg);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.ogle-ad .ogle-ad__button::after {
	content: "→";
}

.ogle-ad .ogle-ad__button:hover,
.ogle-ad .ogle-ad__button:focus-visible {
	opacity: 0.88;
	text-decoration: none;
}

.ogle-ad a:focus-visible {
	outline: 2px solid var(--ogle-ad-fg);
	outline-offset: 2px;
}

/* In the sidebar box, stack the headline above the button. */
.ogle-ad--box .ogle-ad__bar {
	flex-direction: column;
	align-items: stretch;
}

.ogle-ad--box .ogle-ad__headline {
	flex: none;
}

.ogle-ad--box .ogle-ad__button {
	justify-content: center;
}
