/* Smart Ad Placements – front end */
.sap-ad { margin: 28px auto; clear: both; max-width: 100%; overflow: hidden; line-height: 0; }
.sap-ad .sap-inner { line-height: normal; }
.sap-align-center { text-align: center; }
.sap-align-center .sap-inner > * { margin-left: auto; margin-right: auto; }
.sap-align-left { float: left; margin: 6px 24px 16px 0; clear: none; max-width: 50%; }
.sap-align-right { float: right; margin: 6px 0 16px 24px; clear: none; max-width: 50%; }
.sap-label { display: block; font-size: 11px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: #8a8a8a; margin-bottom: 6px; text-align: center; font-family: system-ui, -apple-system, sans-serif; }
.sap-infeed { margin: 32px auto; }
.sap-widget-sticky { position: sticky; top: 90px; }
.admin-bar .sap-widget-sticky { top: 122px; }

/* Device targeting via CSS so it works with page caching */
@media (max-width: 767px) {
	.sap-desktop-only { display: none !important; }
	.sap-align-left, .sap-align-right { float: none; max-width: 100%; margin: 24px auto; }
}
@media (min-width: 768px) {
	.sap-mobile-only { display: none !important; }
}

/* Sticky bottom anchor – max 30% of viewport, closable */
.sap-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; background: rgba(255,255,255,.97); box-shadow: 0 -2px 10px rgba(0,0,0,.12); padding: 6px 0 4px; max-height: 30vh; overflow: hidden; transition: transform .25s ease; }
.sap-sticky .sap-ad { margin: 0 auto; }
.sap-sticky .sap-label { margin-bottom: 2px; font-size: 10px; }
.sap-sticky.is-closed { transform: translateY(110%); }
.sap-sticky-close { position: absolute; top: -26px; right: 8px; width: 28px; height: 26px; border: 0; border-radius: 6px 6px 0 0; background: rgba(255,255,255,.97); box-shadow: 0 -2px 6px rgba(0,0,0,.1); color: #333; font-size: 20px; line-height: 24px; cursor: pointer; padding: 0; }
.sap-sticky:has(.sap-mobile-only) { display: none; }
@media (max-width: 767px) { .sap-sticky:has(.sap-mobile-only) { display: block; } .sap-sticky:has(.sap-desktop-only) { display: none; } }
@media (prefers-color-scheme: dark) { .sap-sticky, .sap-sticky-close { background: rgba(28,28,30,.97); color: #ddd; } }
