/* ============================================================
   Ad placeholders — stub system for free-tier monetization preview.
   Real ad network (AdMob in Capacitor, AdSense in webview) plugs into
   the same DOM hooks later. Today these render branded placeholder
   slots so we can validate layout + UX before any AdSense compliance
   review (EI's site is in AdSense Ready window — keep zero real ads
   in app until web is approved).

   All slots gate on `body.is-premium` — hidden for Premium subscribers,
   visible for anonymous + Free users.
   ============================================================ */

/* ── Sticky bottom banner ─────────────────────────────────────
   Sits ABOVE the bottom tab nav. Compact 60-72px tall. Tap → opens
   paywall (real ad network will replace this with actual creative).
   ──────────────────────────────────────────────────────────── */
.ei-ad-banner {
  display: none; /* shown via body.is-free + section-aware show rules */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  background: linear-gradient(135deg, #f5ebd4 0%, #faf3e3 100%);
  border-top: 1px solid var(--app-border, #e8dfc8);
  border-bottom: 1px solid var(--app-border, #e8dfc8);
  padding: 10px 16px 8px;
  color: var(--ink-navy-1, #0d2846);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  z-index: 21;
}
.ei-ad-banner__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f6450;
  margin-bottom: 1px;
}
.ei-ad-banner__copy {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-navy-1, #0d2846);
}
.ei-ad-banner__cta {
  font-size: 0.75rem;
  color: var(--ink-navy-3, #1f4c84);
  font-weight: 700;
}
.ei-ad-banner__cta strong { color: var(--app-gold-deep, #b8841e); }
.ei-ad-banner__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(13,40,70,0.08);
  color: var(--app-muted, #8a7e64);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Show banner only in tabs where ads are allowed.
   AdSense child-safety policy: NO ads in Niños tab.
   Cuenta = login flow, NO ads.
   Home + Iglesias + Vida = OK. */
body.is-free .section[data-section="iglesias"].active ~ .ei-ad-banner-host .ei-ad-banner,
body.is-free .section[data-section="vida"].active     ~ .ei-ad-banner-host .ei-ad-banner {
  display: flex;
}
/* Fallback when sibling selector chain doesn't match (new layouts):
   use a JS-toggled class to show/hide. */
body.is-free .ei-ad-banner.is-active { display: flex; }
body.is-premium .ei-ad-banner { display: none !important; }

/* ── Native ad card ───────────────────────────────────────────
   Drops inline in a feed (Vida articles, Iglesias results). Same
   visual rhythm as the surrounding cards so it doesn't break flow,
   but tagged "Publicidad" to comply with FTC/EU disclosure rules.
   ──────────────────────────────────────────────────────────── */
.ei-ad-native {
  background: linear-gradient(135deg, #faf3e3 0%, #f5ebd4 100%);
  border: 1px solid var(--app-border, #e8dfc8);
  border-left: 3px solid var(--app-gold, #d9a028);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 16px;
  cursor: pointer;
  position: relative;
  font-family: inherit;
}
.ei-ad-native__label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f6450;
  margin-bottom: 4px;
}
.ei-ad-native__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-navy-1, #0d2846);
  margin: 0 0 4px;
  line-height: 1.3;
}
.ei-ad-native__body {
  font-size: 0.85rem;
  color: var(--ink-navy-2, #123c68);
  margin: 0 0 8px;
  line-height: 1.45;
}
.ei-ad-native__cta {
  display: inline-block;
  background: var(--ink-navy-2, #1f4c84);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
body.is-premium .ei-ad-native { display: none !important; }
