/* ToFindAI Enterprise Banner System styles (responsive + mobile-safe) */

/* Base container */
.tfa-ad {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25em 0;
  position: relative;
  max-width: 100%;
}

/* Sponsor label (mobile-safe overlay, never forces layout width/height) */
.tfa-ad__label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;

  display: inline-flex;
  align-items: center;

  background: rgba(17, 24, 39, 0.75);
  color: #ffffff;
  font-size: 0.75em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);

  /* prevent long labels from causing odd wrap/cut */
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* label shouldn’t block clicking the banner */
  pointer-events: none;
}

/* Banner/image type */
.tfa-ad--banner a {
  display: block;
  width: 100%;
  max-width: 100%;
  line-height: 0; /* removes tiny inline gaps on some mobile browsers */
}

.tfa-ad--banner img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;

  /* ensure no hidden overflow artifacts on mobile scaling */
  object-fit: contain;
}

/* Native type */
.tfa-ad--native {
  padding: 1.25em;
}

.tfa-ad--native .tfa-ad__label {
  position: static;
  pointer-events: auto;
  margin: 0 0 0.75em 0;
}

.tfa-ad__inner {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1em;
  align-items: start;
  max-width: 100%;
}

.tfa-ad__logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: #f2f4f6;
  border: 1px solid var(--border);
  display: block;
}

.tfa-ad__title {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35em;
}

.tfa-ad__text {
  color: var(--text-muted);
  font-size: 0.95em;
  line-height: 1.5;
  margin-bottom: 0.9em;
}

.tfa-ad__cta {
  width: fit-content;
}

/* Mobile tuning */
@media (max-width: 600px) {
  .tfa-ad {
    margin: 1em 0;
  }

  .tfa-ad__label {
    top: 8px;
    left: 8px;
    font-size: 0.72em;
    padding: 0.22em 0.55em;
    max-width: calc(100% - 16px);
  }

  .tfa-ad--native {
    padding: 1em;
  }

  .tfa-ad__inner {
    grid-template-columns: 1fr;
  }

  .tfa-ad__logo img {
    width: 64px;
    height: 64px;
  }
}