/* ========================
   AD SLOTS
   ======================== */
.ad-slot {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.ad-slot__inner {
  position: relative;
  transition: opacity 0.5s ease;
}

.ad-slot__inner.is-fading {
  opacity: 0;
}

/* Leaderboard */
.ad-slot--leaderboard {
  max-width: 728px;
  padding: var(--space-sm) 0;
}

.ad-slot--leaderboard .ad-slot__inner {
  width: 728px;
  max-width: 100%;
  height: 90px;
}

/* Medium Rectangle */
.ad-slot--medium-rectangle {
  max-width: 300px;
  padding: var(--space-md) 0;
}

.ad-slot--medium-rectangle .ad-slot__inner {
  width: 300px;
  height: 250px;
}

/* Ad image */
.ad-slot__ad-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.ad-slot__ad-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  display: block;
}

/* "Ad" label */
.ad-slot__label {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.55rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1px 5px;
  border-radius: 2px;
  line-height: 1.4;
}

/* Placeholder */
.ad-slot__placeholder-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ad-slot__placeholder {
  width: 100%;
  height: 100%;
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
  transition: all var(--transition-normal);
}

.ad-slot__placeholder:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.ad-slot__placeholder-inner {
  text-align: center;
}

.ad-slot__placeholder-inner svg {
  color: var(--color-text-dim);
  margin-bottom: var(--space-xs);
}

.ad-slot__placeholder-text {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-heading);
  margin-bottom: 2px;
}

.ad-slot__placeholder-sub {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
}

/* Ad container sections on the site */
.ad-section {
  padding: var(--space-sm) 0;
  text-align: center;
}

.ad-section--header {
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
}

.ad-section--footer {
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
}

.ad-section--content {
  margin: var(--space-xl) 0;
}

/* Mobile: scale ads properly */
@media (max-width: 767px) {
  .ad-section { padding: var(--space-xs) 0; }

  .ad-slot--leaderboard {
    max-width: 100%;
    padding: var(--space-xs) var(--space-md);
  }

  .ad-slot--leaderboard .ad-slot__inner {
    width: 100%;
    height: auto;
    aspect-ratio: 728 / 90;
  }

  /* Keep images crisp — no stretching, no blur */
  .ad-slot__ad-link img {
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
  }

  .ad-slot__placeholder {
    border-width: 1px;
  }

  .ad-slot__placeholder-inner svg {
    width: 20px;
    height: 20px;
  }

  .ad-slot__placeholder-text {
    font-size: 0.75rem;
  }

  .ad-slot__placeholder-sub {
    font-size: 0.6rem;
  }

  /* Medium rectangle: center and cap at screen width */
  .ad-slot--medium-rectangle {
    max-width: calc(100% - 32px);
  }

  .ad-slot--medium-rectangle .ad-slot__inner {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 300 / 250;
    margin: 0 auto;
  }
}
