/**
 * AdSense Ad Placements Styling
 * Optimized for viewability, fill rate, and CLS stability
 */

/* Base adsense container */
.adsense {
  margin: 24px 0;
  text-align: center;
}

/* InContent-Primary - After main content, before CTAs */
.adsense-incontent-primary {
  min-height: 100px; /* Prevents CLS */
  clear: both;
}

/* InContent-Secondary - After owner CTAs, before PDF section */
.adsense-incontent-secondary {
  min-height: 100px;
  clear: both;
}

/* Content-End - After comments section */
.adsense-content-end {
  margin: 32px 0 24px 0;
  min-height: 100px;
  clear: both;
}

/* Sidebar ad - Desktop only, 300x600 */
.adsense-sidebar-desktop {
  margin: 16px auto;
  width: 300px;
  min-height: 600px;
}

/* Hide desktop-only ads on mobile/tablet */
@media (max-width: 768px) {
  .adsense-desktop-only {
    display: none !important;
  }
}

/* Ensure ads don't break layout */
.adsense ins {
  display: block !important;
}

/* Prevent empty ad containers from taking space when unfilled */
.adsense:empty {
  min-height: 0;
  margin: 0;
}

/* Collapse ad containers when AdSense marks them as unfilled */
.adsense:has(ins[data-ad-status="unfilled"]) {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
}
