/* ============================================================
   banners.css — BG Swaper Ad Slots, Sticky Bar & Ad-Blocker Modal
   All ad-related CSS in one place, separate from theme.css.
   ============================================================ */

/* ── 1. AD SECTION WRAPPERS ───────────────────────────────── */
.ad-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  padding: 1.75rem 1.5rem;
  box-sizing: border-box;
}

.ad-section--plain  { padding: .5rem 1rem }
.ad-section--lg     { padding: 1.25rem 1.5rem }
.ad-section--flush  { padding: 0 }


/* ── 2. AD UNIT WRAPPER ───────────────────────────────────── */
.ad-unit {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
}

/* On desktop, constrain ad content to site container width (full-width bg stays) */
.ad-section .ad-unit {
  max-width: var(--container-max, 1200px);
}

/* CLS prevention — reserve space before ad renders */
.ad-unit--h60   { min-height: 60px  }
.ad-unit--h90   { min-height: 90px  }
.ad-unit--h100  { min-height: 100px }
.ad-unit--h250  { min-height: 250px }
.ad-unit--h280  { min-height: 280px }
.ad-unit--h600  { min-height: 600px }

/* Format-specific max-widths */
.ad-unit--leaderboard { max-width: 970px }
.ad-unit--rectangle   { max-width: 336px }
.ad-unit--half-page   { max-width: 300px }
.ad-unit--in-article  { max-width: 700px; margin: 1.75rem auto }
.ad-unit--multiplex   { max-width: 100%; margin: 1.5rem 0 }

.ad-unit ins.adsbygoogle { display: block }

/* ── 3. PLACEHOLDERS (show_placeholders=true) ─────────────── */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  min-height: 90px;
  background-color: unset;
  border: 1.5px dashed #a5b4fc;
  border-radius: 10px;
  box-sizing: border-box;
}

.ad-placeholder__label {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6366f1;
}

.ad-placeholder__name {
  font-size: .6875rem;
  font-weight: 600;
  color: #4338ca;
  font-family: ui-monospace, monospace;
}

.ad-placeholder__dim {
  font-size: .625rem;
  color: #6366f1;
  font-family: ui-monospace, monospace;
  opacity: .7;
}

/* ── 4. STICKY BOTTOM BAR ─────────────────────────────────── */
.ad-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998; /* below cookie consent bar (9999) */
  background: #ffffff;
  border-top: 1.5px solid #e5e7eb;
  box-shadow: 0 -4px 24px rgba(0,0,0,.09);
  transition: bottom .25s ease;
  box-sizing: border-box;
}

.ad-sticky-bar--ad {
  background: #f8f9fb;
  text-align: center;
}

.ad-sticky-bar__ad-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 3rem .5rem .5rem;
  min-height: 60px;
  box-sizing: border-box;
}

.ad-sticky-bar__ad-wrap ins.adsbygoogle {
  display: inline-block;
  width: 100%;
  max-width: 728px;
}

.ad-sticky-bar--text {
  padding: .75rem 3.5rem .75rem 1.5rem;
}

.ad-sticky-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ad-sticky-bar__title {
  font-size: .9375rem;
  font-weight: 600;
  color: #111827;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.ad-sticky-bar__desc {
  font-size: .8125rem;
  color: #6b7280;
  flex: 2;
  min-width: 0;
  line-height: 1.4;
}

.ad-sticky-bar__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: .5rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #423cbb;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.ad-sticky-bar__cta:hover { background-color: #2c2d6b; color: #ffffff }

.ad-sticky-bar__close {
  position: absolute;
  top: 50%;
  right: .75rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms ease, color 150ms ease;
}

.ad-sticky-bar__close:hover { background: #e5e7eb; color: #111827 }

/* ── 5. AD-BLOCKER MODAL ──────────────────────────────────── */
.adb-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.adb-overlay[hidden] { display: none !important }

.adb-modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  box-sizing: border-box;
}

.adb-modal__icon         { margin-bottom: 1.25rem }
.adb-modal__icon svg     { margin: 0 auto }

.adb-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: .75rem;
  line-height: 1.3;
}

.adb-modal__desc {
  font-size: .9375rem;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.adb-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  font-size: .9375rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #423cbb;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: background-color 150ms ease;
}

.adb-modal__btn:hover { background-color: #2c2d6b }

.adb-modal__retry-msg {
  margin-top: .875rem;
  font-size: .8125rem;
  color: #dc2626;
  line-height: 1.5;
}

.adb-modal__spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: adb-spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes adb-spin { to { transform: rotate(360deg) } }

body.adb-active { overflow: hidden }

/* ── 6. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .ad-section { padding: .5rem 1rem }

  .ad-sticky-bar--text { padding: .625rem 3rem .625rem 1rem }

  .ad-sticky-bar__inner { flex-wrap: nowrap; gap: .625rem }

  .ad-sticky-bar__desc { display: none }

  .ad-sticky-bar__title { font-size: .875rem }

  .ad-sticky-bar__cta {
    font-size: .8125rem;
    padding: .45rem .875rem;
  }

  .ad-unit--half-page   { max-width: 300px }
  .ad-unit--leaderboard { max-width: 100% }
}

@media (max-width: 480px) {
  .adb-modal { padding: 2rem 1.25rem }
  .adb-modal__title { font-size: 1.125rem }
  .adb-modal__btn { font-size: .875rem; padding: .65rem 1.25rem }

  .ad-sticky-bar__inner { gap: .5rem }
  .ad-sticky-bar__cta   { font-size: .75rem; padding: .4rem .75rem }
}
