.jamcono-ad {
  --jamcono-ad-max-width: 100%;
  --jamcono-ad-max-height: none;
  box-sizing: border-box;
  position: relative;
  width: min(100%, var(--jamcono-ad-max-width));
  max-height: var(--jamcono-ad-max-height);
  margin: 14px auto;
  padding: 8px 10px 5px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 14px rgba(15, 23, 42, .06);
  color: #172033;
  font: inherit;
}
.jamcono-ad *, .jamcono-ad *::before, .jamcono-ad *::after { box-sizing: border-box; }
.jamcono-ad__creative { display: flex; align-items: center; gap: 10px; min-width: 0; }
.jamcono-ad__image-link { flex: 0 0 auto; line-height: 0; }
.jamcono-ad__image { display: block; width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.jamcono-ad__content { flex: 1 1 auto; min-width: 0; }
.jamcono-ad__disclosure { display: block; margin-bottom: 2px; color: #697386; font-size: 10px; font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: .05em; }
.jamcono-ad__headline { display: block; overflow: hidden; color: inherit; font-size: 14px; font-weight: 700; line-height: 1.25; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.jamcono-ad__headline:hover { text-decoration: underline; }
.jamcono-ad__body { display: -webkit-box; margin-top: 2px; overflow: hidden; color: #4b5563; font-size: 12px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.jamcono-ad__cta { flex: 0 0 auto; padding: 7px 9px; border: 1px solid rgba(15, 23, 42, .13); border-radius: 8px; background: #fff; color: inherit; font-size: 12px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; }
.jamcono-ad__cta:hover { background: #f7f8fa; }
.jamcono-ad__network { margin-top: 4px; text-align: right; font-size: 9px; line-height: 1.2; }
.jamcono-ad__network a { color: #7b8494; text-decoration: none; }
.jamcono-ad__network a:hover { text-decoration: underline; }
.jamcono-ad--tight .jamcono-ad__body { display: none; }

/* Explicit Image Banner mode. Core chooses the Ad Type; Serve does not guess from dimensions.
 * Banner artwork may scale DOWN to fit the Placement/container, but is never scaled UP
 * beyond its intrinsic pixel dimensions. */
.jamcono-ad--banner-image {
  padding: 0;
  width: fit-content;
  max-width: min(100%, var(--jamcono-ad-max-width, 100%));
  max-height: none;
  aspect-ratio: auto;
  background: #fff;
}
.jamcono-ad__banner-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  line-height: 0;
  text-decoration: none;
}
.jamcono-ad__banner-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}
.jamcono-ad__banner-disclosure {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.88);
  color: #5f6878;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
}
.jamcono-ad__banner-network {
  position: absolute;
  right: 5px;
  bottom: 4px;
  z-index: 3;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.88);
  font-size: 8px;
  line-height: 1.15;
}
.jamcono-ad__banner-network a { color: #687284; text-decoration: none; }
.jamcono-ad__banner-network a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .jamcono-ad { border-radius: 10px; }
  .jamcono-ad__creative { gap: 8px; }
  .jamcono-ad__image { width: 48px; height: 48px; }
  .jamcono-ad__headline { font-size: 13px; }
  .jamcono-ad__body { -webkit-line-clamp: 1; }
  .jamcono-ad__cta { padding: 6px 7px; font-size: 11px; }
  .jamcono-ad--banner-image { border-radius: 8px; }
  .jamcono-ad__banner-disclosure,
  .jamcono-ad__banner-network { font-size: 7px; }
}


/* Keep finished banner artwork immune to broad theme/page-builder image rules while
 * preserving intrinsic-size-first responsive behavior. */
.jamcono-ad--banner-image .jamcono-ad__banner-link {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 auto !important;
}
.jamcono-ad--banner-image .jamcono-ad__banner-image {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* v0.4.0: cache-safe dynamic slot. The outer slot stays neutral; Core/Serve artwork defines the ad. */
.jamcono-ad-slot{display:block;width:100%;margin:0;padding:0}
.jamcono-ad-slot[data-jamcono-slot-state="waiting"],.jamcono-ad-slot[data-jamcono-slot-state="loading"],.jamcono-ad-slot[data-jamcono-slot-state="empty"],.jamcono-ad-slot[data-jamcono-slot-state="error"]{min-height:0}

/* Build 5: Google is a fallback provider inside the same Jamcono Placement. */
.jamcono-ad-provider--google {
  --jamcono-google-max-width: 100%;
  box-sizing: border-box;
  position: relative;
  display: block;
  width: min(100%, var(--jamcono-google-max-width));
  max-width: 100%;
  min-height: 0;
  margin: 14px auto;
  padding: 0;
  overflow: visible;
  text-align: center;
}
.jamcono-ad-provider--google .jamcono-google-slot {
  display: flex;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.jamcono-ad-provider--google .jamcono-google-network {
  display: none;
  margin-top: 3px;
  text-align: right;
  font-size: 8px;
  line-height: 1.2;
}
.jamcono-ad-provider--google[data-jamcono-google-state="filled"] .jamcono-google-network { display: block; }
.jamcono-ad-provider--google .jamcono-google-network a { color: #687284; text-decoration: none; }
.jamcono-ad-provider--google .jamcono-google-network a:hover { text-decoration: underline; }
.jamcono-ad-provider--google[data-jamcono-google-state="empty"],
.jamcono-ad-provider--google[data-jamcono-google-state="error"] { min-height: 0; margin-top: 0; margin-bottom: 0; }
