/* ============================================================
   Praia Digital — Ad Optimization: CLS-safe + Lazy GPT + DAI
   ============================================================ */

/* 1) CLS prevention: reserve ad slot space before render */
.pd-ad,
.pd-ad--in-article,
.pd-ad--in-feed {
  min-height: 250px;
  min-width: 300px;
  width: 100%;
  max-width: 100%;
  margin: 16px 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: pd-ad-shimmer 1.4s infinite linear;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* responsive variants */
.pd-ad--leaderboard { min-height: 90px; }
.pd-ad--half-page   { min-height: 600px; }
.pd-ad--rectangle   { min-height: 250px; }
.pd-ad--skyscraper  { min-width: 160px; min-height: 600px; }

/* 2) Skeleton state for clean visual while GPT auctions */
.pd-ad__placeholder {
  color: rgba(15, 23, 42, 0.35);
  font: 500 12px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  letter-spacing: 0.02em;
}

/* 3) Hide empty slots gracefully */
.pd-ad.is-empty .pd-ad__placeholder { display: none; }

/* 4) Improve viewability helper */
.pd-ad > div { width: 100%; }

/* 5) Animation */
@keyframes pd-ad-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 6) Optional: constrain image/iframe leakage */
.pd-ad iframe { max-width: 100%; }

/* ============================================================
   7. Mobile sticky anchor ad
   ============================================================ */
.pd-sticky-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  display: none;
}

/* only show on small viewports */
@media (max-width: 768px) {
  .pd-sticky-ad { display: block; }
}

.pd-sticky-ad__inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.pd-ad--sticky {
  min-height: 50px;
  min-width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.pd-sticky-ad__close {
  position: absolute;
  right: 6px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  line-height: 1;
  font-size: 16px;
  cursor: pointer;
}

.pd-sticky-ad.is-closed {
  display: none !important;
}

/* ============================================================
   8. Native CTA + newsletter + floating WhatsApp
   ============================================================ */
.pd-cta-native {
  margin: 1.4rem 0;
  padding: 1.2rem;
  border-radius: 14px;
  background: #eef6fb;
  border: 1px solid #c9e6f7;
}

.pd-cta-native__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.pd-cta-native__title {
  font-weight: 700;
  color: #023047;
  margin-bottom: 0.4rem;
}

.pd-cta-native__text {
  color: #4a5568;
  margin-bottom: 0.8rem;
}

.pd-cta-native__button {
  display: inline-block;
  background: #00B4D8;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.pd-newsletter {
  margin: 1.6rem 0;
  padding: 1.4rem;
  border-radius: 14px;
  background: #f7f7f2;
  border: 1px solid #e5e5db;
}

.pd-newsletter__inner {
  max-width: 720px;
  margin: 0 auto;
}

.pd-newsletter__title {
  font-weight: 700;
  color: #023047;
  margin-bottom: 0.4rem;
}

.pd-newsletter__text {
  color: #4a5568;
  margin-bottom: 0.8rem;
}

.pd-newsletter__form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pd-newsletter__input {
  flex: 1 1 220px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.pd-newsletter__submit {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: #0077B6;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pd-whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  background: #25D366;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

@media (max-width: 768px) {
  .pd-whatsapp-float {
    right: 12px;
    bottom: 12px;
    padding: 9px 12px;
    font-size: 14px;
  }
}
