/* O3Naija Ads Manager — Frontend CSS */

/* ── Shared ad unit base ── */
.o3ads-unit {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

/* ── Ad label ── */
.o3ads-label {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: rgba(0,0,0,.45);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(4px);
  padding: 2px 7px;
  border-radius: 3px;
  z-index: 10;
  pointer-events: none;
  line-height: 1.4;
}

/* ── Media (image / gif / video) — always fitted, never distorted ── */
.o3ads-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* keeps full image visible, no cropping */
  object-position: center;
}

/* ════════════════════════════════════════════
   HEADER BANNER
════════════════════════════════════════════ */
.o3ads-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease;
  z-index: 200;
  position: relative;
}

/* Contain the media to the banner height */
.o3ads-header .o3ads-media,
.o3ads-header video {
  max-width: 100%;
  max-height: 100%;   /* set by inline style from PHP */
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Full-width option */
.o3ads-header .o3ads-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Close button */
.o3ads-close {
  position: absolute;
  top: 5px;
  right: 8px;
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: background .15s;
  font-family: inherit;
  padding: 0;
}
.o3ads-close:hover { background: rgba(0,0,0,.6); }

/* Dismissed state */
.o3ads-header.dismissed {
  max-height: 0 !important;
  min-height: 0 !important;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Slide-in animation on load */
@keyframes o3adsSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.o3ads-header { animation: o3adsSlideDown .45s cubic-bezier(.4,0,.2,1) both; }

/* Code wrap */
.o3ads-header .o3ads-code-wrap { width: 100%; display: flex; align-items: center; justify-content: center; }

/* Placeholder */
.o3ads-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: rgba(0,0,0,.25); font-size: 13px; }

/* ════════════════════════════════════════════
   INLINE ADS (inside post content)
════════════════════════════════════════════ */
.o3ads-inline {
  display: block;
  margin: 24px 0;
  clear: both;
}

/* Alignment */
.o3ads-align-center { text-align: center; }
.o3ads-align-left   { text-align: left; }
.o3ads-align-right  { text-align: right; }
.o3ads-align-full   { margin-left: 0; margin-right: 0; }

.o3ads-inline .o3ads-link { display: inline-block; max-width: 100%; }
.o3ads-inline-media {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: inline-block;
  object-fit: contain;
}

/* Full-width inline */
.o3ads-align-full .o3ads-inline-media,
.o3ads-align-full video {
  width: 100%;
  border-radius: 6px;
}

/* Video inline */
.o3ads-inline video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: inline-block;
}

/* Code wrap inline */
.o3ads-inline .o3ads-code-wrap { display: block; }

/* ════════════════════════════════════════════
   SIDEBAR AD
════════════════════════════════════════════ */
.o3ads-sidebar {
  display: block;
  margin: 0 0 20px;
}
.o3ads-sidebar .o3ads-media,
.o3ads-sidebar img,
.o3ads-sidebar video {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  display: block;
}
.o3ads-sidebar .o3ads-link { display: block; }
.o3ads-sidebar .o3ads-code-wrap { display: block; }

/* ════════════════════════════════════════════
   LINK WRAPPER — cursor + no underline
════════════════════════════════════════════ */
.o3ads-link {
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.o3ads-link:hover { opacity: .92; }

/* ════════════════════════════════════════════
   MOBILE
════════════════════════════════════════════ */
@media (max-width: 600px) {
  .o3ads-header { animation: none; }
  .o3ads-inline { margin: 18px 0; }
  .o3ads-inline-media { max-width: 100%; }
}
