/**
 * AdSense Auto ads, fitted to the theme (inc/ads.php, 3.0.89)
 *
 * Auto ads drop their units into the page inside div.google-auto-placed,
 * wherever Google's placement picks: between paragraphs, between home
 * sections, and at times after the footer. Google sets the unit's own size
 * and the page keeps it; this file sets the frame around it so each unit
 * reads as part of the page:
 *
 * - the reading column's width inside an article, the content width
 *   elsewhere, centred, with a hairline above and below and the
 *   "Advertisement" label the theme's own slots carry;
 * - a unit placed after the footer sits on a band of its own, set off from
 *   the footer by the gold rule, instead of hanging loose below it;
 * - a unit Google could not fill gives its space back (AdSense marks it
 *   data-ad-status="unfilled"; hiding a filled ad is never done);
 * - an anchor ad at the foot of the screen keeps the footer's last lines
 *   clear of it.
 *
 * Vignettes and side rails are Google's own overlays and are left alone.
 * The label text comes from Theme Options (--bm-ad-label).
 *
 * @since 3.0.89
 */

/* ---------------------------------------------------------------
   In-page units
   --------------------------------------------------------------- */
.google-auto-placed {
	box-sizing: border-box;
	clear: both;
	width: auto !important;
	max-width: min(100%, var(--wp--style--global--content-size, 1360px));
	margin: 2.25rem auto !important;
	padding: 12px 0 16px;
	border-block: 1px solid var(--bm-border, #dce3f1);
	text-align: center;
}
.google-auto-placed::before {
	content: var(--bm-ad-label, "Advertisement");
	display: block;
	margin-bottom: 10px;
	font: 600 11px/1.4 var(--bm-sans, Montserrat, Arial, sans-serif);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bm-meta, #5d6983);
}
.google-auto-placed ins.adsbygoogle { margin-inline: auto !important; }

/* Inside an article: the width of the text, the spacing of a figure. */
.bismika-prose .google-auto-placed {
	max-width: 100%;
	margin: 2em 0 !important;
}

/* Inside a card grid (archives, The Latest): a full row. */
:is(.wp-block-post-template, .bismika-archive-grid) > .google-auto-placed { grid-column: 1 / -1; }

/* ---------------------------------------------------------------
   A unit placed after the footer: a band of its own
   --------------------------------------------------------------- */
:is(footer, .wp-block-template-part:has(.bismika-footer)) ~ .google-auto-placed,
.wp-site-blocks ~ .google-auto-placed,
body > .google-auto-placed {
	max-width: none;
	margin: 0 !important;
	padding: 18px max(16px, calc((100% - var(--wp--style--global--content-size, 1360px)) / 2)) 26px;
	border-top: 2px solid var(--bm-gold, #b8913a);
	border-bottom: 0;
	background: var(--bm-surface, #e6efff);
}

/* ---------------------------------------------------------------
   Units Google could not fill give the space back
   --------------------------------------------------------------- */
.google-auto-placed:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }

/* ---------------------------------------------------------------
   Anchor ad at the foot of the screen
   --------------------------------------------------------------- */
body:has(> ins.adsbygoogle[data-anchor-status="displayed"][style*="bottom: 0"]) {
	padding-bottom: var(--bm-anchor-gap, 110px) !important;
}

html[data-theme="dark"] .google-auto-placed::before { color: #a0aec0; }

@media print {
	.google-auto-placed { display: none !important; }
}
