/**
 * Shared THF advertising appearance.
 * Applies to the new homepage/archives, legacy shortcode ads,
 * single-listing banners, and sidebar ad placements.
 */
body .thf-discovery-home .thf-discovery-sponsor,
body .thf-archive-sponsors .thf-archive-sponsor,
body .ad-wrapper,
body .ad-content {
  border: 1px solid #43434391 !important;
  border-color: #43434391 !important;
  background: linear-gradient(45deg, #000911, #0085440d) !important;
}

/* Five pixels less rounding than each placement's existing radius. */
body .thf-discovery-home .thf-discovery-sponsor {
  position: relative !important;
  border-radius: 7px !important; /* 12 -> 7 */
}
body .thf-archive-sponsors .thf-archive-sponsor {
  position: relative !important;
  border-radius: 10px !important; /* 15 -> 10 */
}
body .ad-wrapper {
  position: relative !important;
  border-radius: 0 !important; /* base 5 -> 0 */
}
body.home .thf-sponsored-panel .ad-wrapper,
body.home .thf-sponsored-panel .ad-overlay {
  border-radius: 4px !important; /* mobile/legacy 9 -> 4 */
}
body .thf-v2-ad-grid > .ad-wrapper {
  border-radius: 6px !important; /* listing ad 11 -> 6 */
}
body:is(.single-post, .single-news) #et-boc .ads-sidebar .ad-wrapper {
  border-radius: 9px !important; /* article sidebar 14 -> 9 */
}
body .ad-content {
  position: relative !important;
  border-radius: 0 !important;
  overflow: hidden;
}
@media (max-width: 640px) {
  body .thf-discovery-home .thf-discovery-sponsor {
    border-radius: 5px !important; /* mobile 10 -> 5 */
  }
}

/* A small clearly visible white advertisement disclosure, 5% inset. */
body .thf-ad-tag,
body .ad-wrapper .ad-label,
body .ad-content .ad-label {
  position: absolute !important;
  top: 5% !important;
  right: 5% !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 99 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 22px !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 3px 6px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: #fff !important;
  color: #111820 !important;
  font-family: inherit !important;
  font-size: 9px !important;
  font-style: normal !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  text-shadow: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 4px #0003 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}

/* No redundant sponsor heading or empty strip before the cards. */
body .thf-discovery-home .thf-discovery-sponsor-top {
  justify-content: flex-end !important;
  min-height: 0 !important;
  margin-bottom: 7px !important;
}
body .thf-discovery-home .thf-discovery-sponsor-top:has(.thf-discovery-rail-controls[hidden]) {
  display: none !important;
}
body .thf-archive-sponsors__heading {
  justify-content: flex-end !important;
  margin-bottom: 9px !important;
}
body .thf-archive-sponsors__heading:empty {
  display: none !important;
}

/*
 * Homepage sponsored rail matches archive partner cards: same visible width,
 * image-to-copy ratio, minimum height, typography and responsive breakpoints.
 */
body.home .thf-discovery-home .thf-discovery-sponsor-rail {
  grid-auto-columns: calc((100% - 45px) / 4) !important;
  gap: 15px !important;
}
body.home .thf-discovery-home .thf-discovery-sponsor {
  display: grid !important;
  grid-template-columns: 32% minmax(0, 1fr) !important;
  min-height: 139px !important;
  align-items: stretch;
}
body.home .thf-discovery-home .thf-discovery-sponsor-media {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #0d151c !important;
}
body.home .thf-discovery-home .thf-discovery-sponsor-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.home .thf-discovery-home .thf-discovery-sponsor-copy {
  min-width: 0;
  padding: 18px 15px !important;
  justify-content: center;
  align-items: flex-start;
}
body.home .thf-discovery-home .thf-discovery-sponsor-name {
  display: block;
  margin-bottom: 5px !important;
  color: #b7c7d1 !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}
body.home .thf-discovery-home .thf-discovery-sponsor h3,
body.home .thf-discovery-home .thf-discovery-sponsor h3 a {
  color: #eef4f6 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
}
body.home .thf-discovery-home .thf-discovery-sponsor-profile {
  color: #9ce8bc !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin-top: 7px !important;
}
@media (max-width: 1100px) {
  body.home .thf-discovery-home .thf-discovery-sponsor-rail {
    grid-auto-columns: calc((100% - 30px) / 3) !important;
  }
  body.home .thf-discovery-home .thf-discovery-sponsor-copy {
    padding: 13px 11px !important;
  }
  body.home .thf-discovery-home .thf-discovery-sponsor h3,
  body.home .thf-discovery-home .thf-discovery-sponsor h3 a {
    font-size: 14px !important;
  }
}
@media (max-width: 800px) {
  body.home .thf-discovery-home .thf-discovery-sponsor-rail {
    grid-auto-columns: calc((100% - 15px) / 2) !important;
  }
  body.home .thf-discovery-home .thf-discovery-sponsor {
    min-height: 125px !important;
  }
}
@media (max-width: 550px) {
  body.home .thf-discovery-home .thf-discovery-sponsor-rail {
    grid-auto-columns: 85% !important;
    gap: 12px !important;
  }
  body.home .thf-discovery-home .thf-discovery-sponsor {
    grid-template-columns: 30% minmax(0,1fr) !important;
  }
  body.home .thf-discovery-home .thf-discovery-sponsor-copy {
    padding: 12px 14px !important;
  }
}
