/* ==========================================================================
   Ad slots and layout
   ========================================================================== */

.aadigital-ad-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-block: 15px;
	clear: both;
}

.aadigital-ad {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* Fixed-width creatives (728×90, 970×90, …) sit in wider containers: centre
	   the box itself, not just its contents. */
	margin-inline: auto;
	max-width: 100%;
}

.aadigital-ad__label {
	display: block;
	margin-block-end: 3px;
	color: #6b6b6b;
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.aadigital-ad__link,
.aadigital-ad__image {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Fallback box when the configured creative file is gone: keeps the slot at its
   banner size instead of collapsing to a broken-image icon. */
.aadigital-ad--empty {
	justify-content: center;
	min-height: 90px;
	border: 1px dashed #c5cbd4;
	background: #eceef1;
}

.aadigital-ad--empty .aadigital-ad__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 100%;
	min-block-size: 60px;
	color: #6b7280;
	font-family: system-ui, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* Google AdSense units: the ins element is styled by the AdSense script once it
   fills; until then it stays collapsed so no empty gap appears. */
.aadigital-ad--adsense ins.adsbygoogle {
	display: block;
	width: 100%;
}

.aadigital-ad__html {
	max-width: 100%;
	overflow: hidden;
}

/* Size presets ----------------------------------------------------------- */

/* Every preset is a maximum width plus the creative's aspect ratio: inside a
   narrower cell the box scales down instead of forcing its pixel width, and the
   reserved space keeps the right shape while the picture loads. */
.aadigital-ad--leaderboard {
	width: 100%;
	max-width: 728px;
	--aadigital-ad-ratio: 728 / 90;
}

.aadigital-ad--billboard {
	width: 100%;
	max-width: 970px;
	--aadigital-ad-ratio: 970 / 90;
}

.aadigital-ad--billboard-250 {
	width: 100%;
	max-width: 970px;
	--aadigital-ad-ratio: 970 / 250;
}

.aadigital-ad--billboard-wide {
	width: 100%;
	max-width: 1070px;
	--aadigital-ad-ratio: 1070 / 200;
}

.aadigital-ad--medium-rectangle {
	width: 100%;
	max-width: 300px;
	--aadigital-ad-ratio: 300 / 250;
}

.aadigital-ad--half-page {
	width: 100%;
	max-width: 300px;
	--aadigital-ad-ratio: 300 / 600;
}

/* 300×300 square. Reference 8 and 9 print the rail banner at this size through
   the `aadigital_ads_slot_size` filter. */
.aadigital-ad--square-300 {
	width: 100%;
	max-width: 300px;
	--aadigital-ad-ratio: 1 / 1;
}

.aadigital-ad--rail-tall {
	width: 100%;
	max-width: 300px;
	--aadigital-ad-ratio: 300 / 622;
}

.aadigital-ad--leaderboard-651 {
	width: 100%;
	max-width: 651px;
	--aadigital-ad-ratio: 651 / 90;
}

.aadigital-ad--mobile-square-512 {
	width: 100%;
	max-width: 512px;
	--aadigital-ad-ratio: 512 / 480;
}

.aadigital-ad--skyscraper {
	width: 100%;
	max-width: 160px;
	--aadigital-ad-ratio: 160 / 600;
}

.aadigital-ad--mobile-banner {
	width: 100%;
	max-width: 320px;
	--aadigital-ad-ratio: 320 / 100;
}

/* The link carries the reserved shape (the label sits above it, outside the
   ratio), and a differently shaped upload is letterboxed, never stretched. */
.aadigital-ad__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: var(--aadigital-ad-ratio, auto);
}

.aadigital-ad__link .aadigital-ad__image {
	width: 100%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
}

/* Slot layout ------------------------------------------------------------ */

.aadigital-ad-slot--header {
	margin-block: 10px 0;
}

.aadigital-ad-slot--article-top,
.aadigital-ad-slot--article-bottom {
	margin-block: 20px;
}

.aadigital-ad-slot--article-middle {
	margin-block: 20px;
	padding-block: 15px;
	border-block: 1px solid #ddd;
}

.aadigital-ad-slot--sidebar-left,
.aadigital-ad-slot--sidebar-right {
	margin-block: 0 20px;
}

.aadigital-ad-slot--sidebar-bottom {
	margin-block: 0;
}

.aadigital-ad-slot--footer {
	margin-block: 20px 0;
}

/* Fixed 160x600 side banners --------------------------------------------- */

.side-banner .widget,
.side-banner .widget_aadigital_ads {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.side-banner .aadigital-ad-slot {
	margin: 0;
}

.side-banner .aadigital-ad__label {
	display: none;
}

/* Sticky side banners ---------------------------------------------------- */

.widget_aadigital_ads--sticky {
	position: sticky;
	top: 145px;
}

@media (max-width: 1400px) {
	.widget_aadigital_ads--sticky {
		position: static;
	}
}

@media (max-width: 760px) {
	.aadigital-ad-slot {
		margin-block: 12px;
	}
}
