/* Shared first-party advertising slot.
   Hidden until a validated creative image has loaded, so an empty or failed
   response never reserves layout space. */

.ad-slot {
  margin-block: clamp(1.25rem, 2.5vw, 2rem);
}

.ad-slot[hidden] {
  display: none !important;
}

.ad-slot-inner {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: clamp(0.7rem, 1.4vw, 1rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ad-slot-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ad-slot-media {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.ad-slot-link {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.ad-slot-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ad-slot-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(200px, 26vh);
  border-radius: var(--radius-md);
}

@media (max-width: 720px) {
  .ad-slot {
    margin-block: 1rem;
  }

  .ad-slot-inner {
    padding: 0.65rem;
  }

  .ad-slot-image {
    max-height: min(150px, 22vh);
  }
}

@media (max-width: 430px) {
  .ad-slot-inner {
    border-radius: var(--radius-md);
  }

  .ad-slot-image {
    max-height: 120px;
  }
}

/* The creative box is reserved from the API dimensions before the image
   decodes, so loading the banner never shifts the page. */
.ad-slot-media[style] {
  margin-inline: auto;
}

.ad-slot-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.ad-slot-video-stack {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  gap: 0.5rem;
}

.ad-slot-video {
  position: relative;
  display: grid;
  width: 100%;
  height: auto;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.ad-slot-poster,
.ad-slot-video-player {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  object-fit: contain;
  background: #000;
}

.ad-slot-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: rgb(0 0 0 / 28%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgb(0 0 0 / 80%);
}

.ad-slot-play::before {
  content: "";
  position: absolute;
  width: clamp(42px, 8vw, 64px);
  height: clamp(42px, 8vw, 64px);
  border-radius: 50%;
  background: rgb(0 0 0 / 56%);
  box-shadow: 0 2px 12px rgb(0 0 0 / 25%);
}

.ad-slot-play {
  isolation: isolate;
}

.ad-slot-play::after {
  content: "";
  position: relative;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
  z-index: 1;
}

.ad-slot-play:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.ad-slot-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.ad-slot-cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ad-slot-cta:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .ad-slot-play,
  .ad-slot-cta {
    transition: none;
  }
}

