/*
 * Cross-promo slot styles. All visuals are driven by CSS custom properties so
 * each host portal adapts the promo to its own design tokens:
 *
 *   --cp-bg      slot background        (fallback: subtle translucent gray)
 *   --cp-border  slot border color      (fallback: subtle translucent gray)
 *   --cp-fg      primary text color     (fallback: inherit)
 *   --cp-muted   secondary text color   (fallback: inherit)
 *   --cp-radius  corner radius          (fallback: 12px)
 *   --cp-font    heading font stack     (fallback: inherit)
 *
 * --cp-accent comes from the creative itself (inline) and is not host-set.
 * Heights are reserved per format so creative swaps never shift layout.
 */

.cp {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  border: 1px solid var(--cp-border, rgba(127, 127, 127, 0.25));
  border-radius: var(--cp-radius, 12px);
  background: var(--cp-bg, rgba(127, 127, 127, 0.08));
  color: var(--cp-fg, inherit);
  font-family: inherit;
  overflow-wrap: anywhere;
}

/* Brand media chip: logo image or muted looping animation. */
.cp-img,
.cp-video {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

/* Brand icon chip: tinted with the destination accent. */
.cp-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  background: color-mix(in srgb, var(--cp-accent, currentColor) 14%, transparent);
}

/* Native ad disclosure, kept subtle and out of the click area. */
.cp-ad {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cp-muted, inherit);
  opacity: 0.55;
}

.cp * {
  box-sizing: border-box;
}

.cp-label {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cp-muted, inherit);
  opacity: 0.85;
}

.cp-headline {
  margin: 0.25rem 0 0;
  font-family: var(--cp-font, inherit);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cp-fg, inherit);
}

.cp-blurb {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--cp-muted, inherit);
}

.cp-link {
  color: var(--cp-fg, inherit);
  text-decoration: none;
}

.cp-link:hover .cp-cta,
.cp-link:focus-visible .cp-cta {
  text-decoration: underline;
}

.cp-link:focus-visible {
  outline: 2px solid var(--cp-accent, currentColor);
  outline-offset: 2px;
}

.cp-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cp-accent-fg, #ffffff);
  background: var(--cp-accent, currentColor);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}

.cp-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}

.cp-link:hover .cp-arrow,
.cp-link:focus-visible .cp-arrow {
  transform: translateX(3px);
}

/* Horizontal band: icon + copy left, CTA right; stacks on narrow viewports. */
.cp--band {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--cp-accent, transparent);
}

.cp--band .cp-copy {
  min-width: 0;
  flex: 1 1 16rem;
}

.cp--band .cp-headline {
  font-size: 1.0625rem;
}

.cp--band .cp-copy {
  flex: 1 1 16rem;
}

.cp--band .cp-link {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 480px) {
  .cp--band {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Native in-feed card: matches listing card rhythm. */
.cp--card {
  min-height: 148px;
  padding: 1rem;
}

.cp--card .cp-headline {
  font-size: 1rem;
}

.cp--card {
  border-top: 4px solid var(--cp-accent, transparent);
}

.cp--card .cp-link {
  margin-top: 0.75rem;
}

.cp--card .cp-cta {
  width: 100%;
  justify-content: center;
}

/* Compact pre-footer strip: one line, small footprint. */
.cp--strip {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.cp--strip .cp-label {
  flex-shrink: 0;
}

.cp--strip .cp-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.cp--strip .cp-cta {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.75rem;
}

@media (max-width: 480px) {
  .cp--strip .cp-blurb,
  .cp--strip .cp-cta {
    display: none;
  }
}
