/* -----------------------------------------------------------------------
   Base ad slot
   ----------------------------------------------------------------------- */
.ad-slot {
  position: relative;
  margin: var(--space-4) 0;
}

/* Shared image class — used by all format renderers */
.ad-slot__img-main {
  width: 100%;
  display: block;
  height: auto;
}

/* Shared link wrapper */
.ad-slot__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Shared "Sponsored" text */
.ad-slot__sponsored {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  font-style: italic;
}

.ad-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  color: #888;
  background: rgba(255, 255, 255, .85);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
}

/* -----------------------------------------------------------------------
   Format: banner
   ----------------------------------------------------------------------- */
.ad-slot--banner {
  width: 100%;
  overflow: hidden;
}
.ad-slot--banner .ad-slot__img-main,
.ad-slot--banner img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  display: block;
}

/* Text-only banner fallback */
.ad-slot__text {
  padding: var(--space-4, 1rem);
}
.ad-slot__text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

/* -----------------------------------------------------------------------
   Format: sidebar
   ----------------------------------------------------------------------- */
.ad-slot--sidebar {
  max-width: 300px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.ad-slot--sidebar .ad-slot__img-main {
  width: 100%;
  display: block;
  object-fit: cover;   /* desktop: landscape crop looks good */
  max-height: 200px;
}
.ad-slot--sidebar .ad-slot__body {
  padding: 12px 14px 14px;
}
.ad-slot--sidebar .ad-slot__title {
  display: block;
  font-size: .9375rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #1a1a2e;
}
.ad-slot--sidebar .ad-slot__content {
  font-size: .8125rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* -----------------------------------------------------------------------
   Format: inline
   ----------------------------------------------------------------------- */
.ad-slot--inline {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.ad-slot--inline .ad-slot__inner {
  display: flex;
  text-decoration: none;
  color: inherit;
}
.ad-slot--inline .ad-slot__img {
  width: 120px;
  flex-shrink: 0;
  object-fit: cover;
}
.ad-slot--inline .ad-slot__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* -----------------------------------------------------------------------
   Format: feed_native (inherits .post-card)
   ----------------------------------------------------------------------- */
.ad-native-card {
  margin-bottom: 0; /* inherits .post-card layout */
}
.post-card__sponsored {
  font-size: 11px;
  color: #888;
  margin-left: 6px;
  font-style: italic;
}
.post-card__avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
}

/* -----------------------------------------------------------------------
   Format: interstitial
   ----------------------------------------------------------------------- */
.ad-slot--interstitial {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot__overlay-inner {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  position: relative;
}
.ad-slot__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #e5e7eb;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
}
.ad-slot__close:hover {
  background: #d1d5db;
}

/* -----------------------------------------------------------------------
   Format: video_preroll
   ----------------------------------------------------------------------- */
.ad-slot--video-preroll {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.ad-slot__video {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: contain;
}
.ad-skip-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
}
.ad-skip-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   Footer leaderboard strip — full width, outside the footer container
   ----------------------------------------------------------------------- */
.footer__ad-strip {
  width: 100%;
  background: #000;
  overflow: hidden;
}
.footer__ad-strip .ad-slot {
  margin: 0;
  width: 100%;
}
.footer__ad-strip .ad-slot--banner img {
  max-height: 90px;
  width: 100%;
  object-fit: cover;
  display: block;
}
.footer__ad-strip .ad-label {
  z-index: 2;
}

/* -----------------------------------------------------------------------
   Mobile responsive — all ad formats adapt to full width on small screens
   ----------------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Every slot takes the full available width */
  .ad-slot {
    width: 100%;
    margin: var(--space-4) 0;
  }

  /* ── Sidebar ad: remove the 300px cap, go full width ── */
  .ad-slot--sidebar {
    max-width: 100%;
    width: 100%;
    border-radius: 8px;
  }

  /* Portrait-style images: use contain so the full image shows */
  .ad-slot--sidebar .ad-slot__img-main {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;   /* show full image — no cropping */
    background: #f5f5f5;   /* neutral fill for any letterbox areas */
    border-radius: 8px 8px 0 0;
  }

  /* ── Banner: taller on mobile, still cover crop ── */
  .ad-slot--banner .ad-slot__img-main,
  .ad-slot--banner img {
    max-height: 180px;
    object-fit: cover;
  }

  /* ── Inline: stack vertically on mobile ── */
  .ad-slot--inline .ad-slot__inner {
    flex-direction: column;
  }
  .ad-slot--inline .ad-slot__img,
  .ad-slot--inline .ad-slot__img-main {
    width: 100%;
    height: 180px;
    object-fit: cover;
  }

  /* ── Native feed ad: full width card ── */
  .ad-native-card {
    width: 100%;
  }

  /* ── Video preroll: full width ── */
  .ad-slot--video-preroll {
    width: 100%;
    border-radius: 8px;
  }
  .ad-slot__video {
    max-height: 220px;
  }

  /* ── Interstitial overlay: padding so content doesn't touch edges ── */
  .ad-slot__overlay-inner {
    width: 92%;
    padding: 20px 16px;
  }

  /* ── Footer leaderboard ── */
  .footer__ad-strip .ad-slot--banner img,
  .footer__ad-strip .ad-slot--banner .ad-slot__img-main {
    max-height: 100px;
  }
}

/* Portrait images without explicit dimensions — always contain on mobile */
@media (max-width: 768px) {
  .ad-slot--sidebar .ad-slot__img-main {
    object-fit: contain;
    background: #f5f5f5;
  }
}

/* -----------------------------------------------------------------------
   Seamless native feed ad — social-post-style card
   Blends with .social-post; only the "Sponsored" pill distinguishes it.
   ----------------------------------------------------------------------- */

/* "Sponsored" pill — replaces the bold "Ad" badge */
.sn-ad-sponsored-pill {
  display: inline-flex;
  align-items: center;
  font-size: .6875rem;
  font-weight: 600;
  color: #888;
  background: #f0f0f0;
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
  letter-spacing: .02em;
}

/* Avatar uses the brand gradient like a real fan avatar */
.sn-ad-avatar {
  background: linear-gradient(135deg, #1a1a2e 0%, #e94560 100%);
  color: #fff;
  font-weight: 800;
}

/* Title link — looks like body text, not a hyperlink */
.sn-ad-title {
  font-size: .9375rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  line-height: 1.4;
}
.sn-ad-title-link {
  color: inherit;
  text-decoration: none;
}
.sn-ad-title-link:hover { color: #e94560; }

/* Body text */
.sn-ad-body {
  margin-top: 0;
  margin-bottom: 8px;
}

/* Inline video container */
.sn-ad-video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.sn-ad-video {
  width: 100%;
  display: block;
  max-height: 400px;
  object-fit: cover;
  border-radius: 0; /* container already rounds */
}
/* Transparent click overlay captures taps and routes to destination */
.sn-ad-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

/* CTA button row */
.sn-ad-cta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.sn-ad-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 8px;
  background: #f4f5f7;
  color: #333;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sn-ad-cta-btn:hover {
  background: #e94560;
  color: #fff;
}

/* -----------------------------------------------------------------------
   Community sidebar ad card
   Sits in the right sidebar under "Artists to Follow" exactly like
   Facebook's "Sponsored" sidebar panel.
   ----------------------------------------------------------------------- */
.social-sidebar__card--ad {
  padding: 0;             /* let the ad-slot handle its own padding */
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

/* Override the default sidebar ad container so it fills its card */
.social-sidebar__card--ad .ad-slot--sidebar {
  max-width: 100%;
  width: 100%;
  border-radius: 12px;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

/* Section label above the sidebar ad — matches the artists panel header */
.social-sidebar__card--ad::before {
  content: 'Sponsored';
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #bbb;
  padding: 14px 16px 6px;
}

/* -----------------------------------------------------------------------
   Autoplay video ad — IntersectionObserver pauses when off-screen
   ----------------------------------------------------------------------- */
.sn-ad-video[data-ad-paused] {
  opacity: 0.98; /* near-imperceptible dim — JS manages play/pause state */
}

/* -----------------------------------------------------------------------
   Music page: main-content + sticky sidebar ad layout
   ----------------------------------------------------------------------- */

/* Two-column layout: releases grid on the left, sticky ad on the right */
.music-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-8, 2rem);
  align-items: start;
}

.music-page-layout__main {
  min-width: 0; /* prevent grid blowout */
}

/* Sticky sidebar wrapper */
.music-page-layout__sidebar {
  position: sticky;
  top: calc(var(--header-height, 72px) + 16px);
  align-self: start;
}

/* The ad card inside the sidebar */
.music-sidebar-ad-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

/* Force sidebar ad slot to fill the 300px column */
.music-sidebar-ad-wrap .ad-slot {
  margin: 0;
  width: 100%;
}

.music-sidebar-ad-wrap .ad-slot--sidebar,
.music-sidebar-ad-wrap .ad-slot--inline {
  max-width: 100%;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* Inline ad in sidebar: stack image above text (not side-by-side) */
.music-sidebar-ad-wrap .ad-slot--inline .ad-slot__inner {
  flex-direction: column;
}
.music-sidebar-ad-wrap .ad-slot--inline .ad-slot__img,
.music-sidebar-ad-wrap .ad-slot--inline .ad-slot__img-main {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* Mobile: collapse to single column, hide sidebar, show inline mob ad */
@media (max-width: 900px) {
  .music-page-layout {
    grid-template-columns: 1fr;
  }

  .music-page-layout__sidebar {
    display: none; /* hidden on mobile — mob ad shown below the grid instead */
  }

  .music-page-layout__mob-ad {
    margin-top: var(--space-6, 1.5rem);
  }
}

/* Desktop: hide the duplicated mobile ad */
@media (min-width: 901px) {
  .music-page-layout__mob-ad {
    display: none;
  }
}
