/* TechLine KI / Caption badges on images */

.tl-cap-img-wrap {
  display: block;
  position: relative !important;
  width: 100%;
  max-width: 100%;
  line-height: 0;
}

p.tl-cap-host {
  position: static !important;
}

.tl-cap-img-wrap > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Elementor listing thumbs: wrap must fill the reserved box, not shrink to 0. */
.elementor-post__thumbnail .tl-cap-img-wrap,
.elementor-post__thumbnail__link .tl-cap-img-wrap {
  width: 100%;
  height: 100%;
}

.elementor-post__thumbnail .tl-cap-img-wrap > img,
.elementor-post__thumbnail__link .tl-cap-img-wrap > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.tl-cap-host,
.tl-cap-img-wrap,
.elementor-posts-container .elementor-post__thumbnail,
.elementor-posts-container .elementor-post__thumbnail__link,
.e-loop-item .elementor-widget-theme-post-featured-image,
.e-loop-item .elementor-widget-image,
.elementor-widget-theme-post-featured-image .elementor-widget-container,
.elementor-widget-image.tl-techlog-cover-img,
.tl-techlog-cover-img,
.tl-post-card__media {
  position: relative !important;
}

/* Subtle pill: readable on light + dark photos */
.tl-cap-badge,
.tl-ki-badge {
  position: absolute !important;
  display: inline-block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  right: 0.65rem !important;
  left: auto !important;
  bottom: 0.65rem !important;
  top: auto !important;
  z-index: 30 !important;
  max-width: min(90%, 20rem);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(12, 14, 18, 0.58) !important;
  color: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: right;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .tl-cap-badge,
  .tl-ki-badge {
    font-size: 0.5625rem;
    padding: 0.24rem 0.48rem;
    right: 0.45rem !important;
    bottom: 0.45rem !important;
    left: auto !important;
    white-space: normal;
  }
}
