/* Ensure opt-in containers create a positioned context for overlays */
.mcred-optin,
.mcred-bg-auto { position: relative; }

/* Inline <img> wrapper (added around images automatically) */
.mcred-wrap { position: relative; display: inline-block; }

/* Credit chip base */
.mcred-chip {
  position: absolute;
  right: 8px; bottom: 8px; /* default: bottom-right */
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  max-width: 75%;
  text-overflow: ellipsis; 
  overflow: hidden;
  font-size: 12px;
  font-family: "Raleway", Sans-serif !important;
  font-weight: 400 !important;
  color: #fff;
  /* Optional offsets via CSS vars if you ever want fine-tune per container */
  margin-left: var(--mcred-offx, 0);
  margin-top:  var(--mcred-offy, 0);
}

/* Anchor modifiers (apply class on container: .anchor-bl, etc.) */
.mcred-optin.anchor-bl  > .mcred-chip,
.mcred-bg-auto.anchor-bl > .mcred-chip,
.mcred-wrap.anchor-bl  > .mcred-chip { left: 8px; right: auto; }

.mcred-optin.anchor-tr  > .mcred-chip,
.mcred-bg-auto.anchor-tr > .mcred-chip,
.mcred-wrap.anchor-tr  > .mcred-chip { top: 8px; bottom: auto; }

.mcred-optin.anchor-tl  > .mcred-chip,
.mcred-bg-auto.anchor-tl > .mcred-chip,
.mcred-wrap.anchor-tl  > .mcred-chip { top: 8px; left: 8px; right: auto; bottom: auto; }

/* Center anchor (chip centered on container) */
.mcred-optin.anchor-c  > .mcred-chip,
.mcred-bg-auto.anchor-c > .mcred-chip,
.mcred-wrap.anchor-c  > .mcred-chip {
  top: 50%; left: 50%; right: auto; bottom: auto;
  transform: translate(-50%, -50%);
}
