/* ── Adsterra top leaderboard slot ─────────────────────────────────────────
   Seamlessly integrates with the site's theming system.
   All colours read from CSS variables set by themes.css.
   ─────────────────────────────────────────────────────────────────────────── */

/* Spacer that reserves the 90 px the fixed bar occupies */
.tp-hold {
  height: 90px;
  width: 100%;
}

/* Fixed bar across the top of every page */
.tp-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Theme-aware background — matches the page's secondary bg with a subtle tint */
  background: var(--bg-secondary, #111827);

  /* Gentle separator between the ad bar and the page content below */
  border-bottom: 1px solid var(--glass-border, rgba(96, 165, 250, 0.2));

  /* Soft depth shadow so the bar sits above the page rather than being pasted on */
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.35),
    0 1px 0 var(--glass-border, rgba(96, 165, 250, 0.15));

  /* Start invisible; fade in once the ad unit (or timeout) fires is-ready */
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Once the JS marks the slot ready, reveal the bar smoothly */
.tp-shell.is-ready {
  opacity: 1;
}

/* Show immediately when loading (before ad fires) */
.tp-shell:not(.is-ready) {
  opacity: 1;
}

/* Inner container — constrains the ad unit to standard leaderboard width */
.tp-core {
  width: min(728px, 100%);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── "Advertisement" label shown while the ad is loading ─────────────────── */
.tp-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  /* Tiny, unobtrusive label text */
  font:
    600 10px/1 'Inter',
    Arial,
    sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  /* Use the theme accent colour at low opacity so it blends in */
  color: var(--accent-color, rgba(96, 165, 250, 0.6));
  opacity: 0.45;

  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

/* Hide loading label once the ad slot is ready */
.tp-shell.is-ready .tp-mark {
  display: none;
}

/* ── Responsive: switch to 320 × 50 mobile format on narrow viewports ─────── */
@media (max-width: 759px) {
  .tp-hold {
    height: 50px;
  }

  .tp-shell {
    height: 50px;
  }

  .tp-core {
    width: 100%;
    height: 50px;
  }
}

/* ── Optional accent glow line along the bottom edge ─────────────────────── */
.tp-shell::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(728px, 90%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-color, rgba(96, 165, 250, 0.4)) 40%,
    var(--accent-color, rgba(96, 165, 250, 0.4)) 60%,
    transparent 100%
  );
  opacity: 0.5;
  pointer-events: none;
}
