/* ==========================================
   ads.css  —  Today's US Ad Unit Styles
   Slots are now rendered fully Server-Side (SSR).
   ========================================== */

/* ── Slot containers ── */
[data-ad-slot] {
  display: block;
}

/* ── Ad unit wrapper ── */
.tus-ad-unit {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

/* ── Inner ad box ── */
.tus-ad-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
}

/* ── "Advertisement" label ── */
.tus-ad-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted, #888);
  text-align: center;
  margin-bottom: 4px;
}

/* ── The clickable link ── */
.tus-ad-link {
  display: block;
  width: 100%;
  text-decoration: none;
}

/* ── Ad image ── */
.tus-ad-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: opacity 0.2s;
}
.tus-ad-link:hover .tus-ad-img {
  opacity: 0.92;
}

/* ── Banner Top slot ── */
[data-ad-slot="banner_top"] {
  padding: 0.75rem 1rem;
  background: var(--surface, #f8f8f8);
  border-bottom: 1px solid var(--border, #e5e5e5);
  text-align: center;
}

/* ── Sidebar slot ── */
[data-ad-slot="sidebar"] {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* ── Below article slot ── */
[data-ad-slot="below_article"] {
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border, #e5e5e5);
  text-align: center;
}

/* ── Popup overlay ── */
#tusPopupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: none;           /* JS reveals after 4s */
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: tusPopupIn 0.3s ease;
}

@keyframes tusPopupIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes tusPopupOut {
  to { opacity: 0; }
}

.tus-popup-box {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  animation: tusBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tusBoxIn {
  from { transform: scale(0.88) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.tus-popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;           /* Above popup image/link */
  background: var(--surface-2, #f0f0f0);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted, #555);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  pointer-events: all;
}
.tus-popup-close:hover {
  color: var(--primary, #ec1337);
  border-color: var(--primary, #ec1337);
  background: rgba(236, 19, 55, 0.08);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  [data-ad-slot="banner_top"] .tus-ad-inner {
    max-width: 100% !important;
    height: auto !important;
  }
}
