/**
 * Pixella Theme AdSense Ad Slot Styles
 */

.ad-slot-wrapper {
  margin: var(--space-xl) auto;
  text-align: center;
  max-width: 100%;
  /* CLS FIX: reserve space before AdSense injects the ad */
  /* Prevents page jumping when ad loads */
  contain: layout;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  opacity: 0.8;
}

/* Above-tool slot: Leaderboard / Responsive banner — reserve 90px (Google minimum) */
#ad-above-tool {
  min-height: 90px;
  width: 100%;
}

/* Below-tool slot: Large Rectangle — reserve 280px */
#ad-below-tool {
  min-height: 280px;
  width: 100%;
}

/* SEO Section slot (3rd ad): Large Rectangle — reserve 280px */
#ad-seo-section {
  min-height: 280px;
  width: 100%;
}

.ad-slot {
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: var(--space-lg) 0;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base);
}

.ad-slot-wrapper .ad-slot {
  margin-top: 0;
}

/* Placeholder state only: clip content before ad loads — no clipping risk once ad injects */
.ad-slot:not(:has(ins.adsbygoogle)):not(:has(iframe)) {
  overflow: hidden;
}

/* Ad loaded: remove placeholder styling — no !important needed */
.ad-slot:has(ins.adsbygoogle),
.ad-slot:has(iframe) {
  border: none;
  background: transparent;
  overflow: visible;
  padding: 0; /* Clear padding when loaded to avoid height expansion/CLS */
}

/* Mobile responsive ad slot height overrides */
@media (max-width: 768px) {
  .ad-slot {
    margin: var(--space-md) 0;
    min-height: 60px;
  }

  /* Mobile: reduce reserved heights to match mobile ad sizes */
  #ad-above-tool {
    min-height: 60px; /* Mobile banner: 320x50 or 320x100 */
  }

  #ad-below-tool {
    min-height: 250px; /* Mobile: Medium Rectangle 300x250 */
  }

  #ad-seo-section {
    min-height: 250px; /* Mobile: Medium Rectangle 300x250 */
  }
}

/* Print layout overrides */
@media print {
  .ad-slot-wrapper {
    display: none !important;
    visibility: hidden !important;
  }
}
