.webza-ia-wrap {
  position: relative !important;
  display: inline-block !important;
  max-width: 100%;
  line-height: 0;
  vertical-align: middle;
}
.webza-ia-wrap > img,
.webza-ia-wrap > a,
.webza-ia-wrap > a > img {
  max-width: 100%;
}
.webza-ia-wrap > a {
  display: inline-block;
  line-height: 0;
}

/* Overlay host for absolutely positioned theme images: no extra wrapper is inserted. */
.webza-ia-overlay-host {
  /* Keep the theme's existing positioning and dimensions unchanged. */
}

.webza-ia-trigger {
  position: absolute;
  z-index: 21;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: var(--webza-ia-panel-bg, #fff);
  color: var(--webza-ia-accent, #1e3c96);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 7px rgba(0,0,0,.2);
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility .18s ease;
}
.webza-ia-top-right > .webza-ia-trigger { top: 10px; right: 10px; }
.webza-ia-top-left > .webza-ia-trigger { top: 10px; left: 10px; }
.webza-ia-bottom-right > .webza-ia-trigger { bottom: 10px; right: 10px; }
.webza-ia-bottom-left > .webza-ia-trigger { bottom: 10px; left: 10px; }

.webza-ia-panel {
  position: absolute;
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  min-height: 26px;
  padding: 0 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--webza-ia-panel-bg, #fff);
  color: var(--webza-ia-panel-text, #222);
  box-shadow: 0 2px 14px rgba(0,0,0,.2);
  font: 11px/1.4 Arial, sans-serif;
  text-align: left;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .16s ease, visibility .16s;
}
.webza-ia-top-right > .webza-ia-panel { top: 10px; right: 10px; }
.webza-ia-top-left > .webza-ia-panel { top: 10px; left: 10px; transform-origin: left center; }
.webza-ia-bottom-right > .webza-ia-panel { bottom: 10px; right: 10px; }
.webza-ia-bottom-left > .webza-ia-panel { bottom: 10px; left: 10px; transform-origin: left center; }

.webza-ia-row {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: baseline;
  gap: 3px;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.webza-ia-label { font-weight: 700; }
.webza-ia-value,
.webza-ia-link {
  color: var(--webza-ia-accent, #1e3c96) !important;
  text-decoration: none !important;
}
.webza-ia-link:hover { text-decoration: underline !important; }
.webza-ia-modified { flex: 0 0 auto; font-style: italic; opacity: .8; }

.webza-ia-open > .webza-ia-panel,
.webza-ia-wrap:focus-within > .webza-ia-panel,
.webza-ia-overlay-host:focus-within > .webza-ia-panel {
  opacity: 1;
  visibility: visible;
  transform: scaleX(1);
}
.webza-ia-open > .webza-ia-trigger,
.webza-ia-wrap:focus-within > .webza-ia-trigger,
.webza-ia-overlay-host:focus-within > .webza-ia-trigger {
  opacity: 0;
  visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
  /* Image hover (excluding the info button): highlight the icon and pulse it
     twice as a quiet invitation, without opening the attribution panel. */
  .webza-ia-wrap:hover:not(.webza-ia-control-hover) > .webza-ia-trigger,
  .webza-ia-overlay-host:hover:not(.webza-ia-control-hover) > .webza-ia-trigger {
    background: #ffd166;
    color: var(--webza-ia-accent, #1e3c96);
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
    animation: webza-ia-attention .72s ease-in-out 1;
  }

  /* Hovering the button itself restores its clean white appearance; the
     panel then expands over the button as before. */
  .webza-ia-wrap > .webza-ia-trigger:hover,
  .webza-ia-overlay-host > .webza-ia-trigger:hover {
    background: #fff;
    color: var(--webza-ia-accent, #1e3c96);
    border: 1px solid rgba(255,255,255,.98);
    animation: none !important;
    transform: none !important;
  }

  /* JS marks the host while the pointer is over the trigger or panel.
     This reliably prevents the image-hover pulse from being applied. */
  .webza-ia-wrap.webza-ia-control-hover > .webza-ia-trigger,
  .webza-ia-overlay-host.webza-ia-control-hover > .webza-ia-trigger {
    animation: none !important;
    transform: scale(1) !important;
  }

  @keyframes webza-ia-attention {
    0%, 100% { transform: scale(1); }
    18%, 58% { transform: scale(1.7); }
    36%, 76% { transform: scale(1); }
  }

  /* Open only over the info button; keep it open while moving across the
     expanded panel so its links remain reachable. :has() keeps the hover
     state on the shared host during the transition from button to panel. */
  .webza-ia-wrap:has(> .webza-ia-trigger:hover) > .webza-ia-panel,
  .webza-ia-wrap:has(> .webza-ia-panel:hover) > .webza-ia-panel,
  .webza-ia-overlay-host:has(> .webza-ia-trigger:hover) > .webza-ia-panel,
  .webza-ia-overlay-host:has(> .webza-ia-panel:hover) > .webza-ia-panel {
    opacity: 1;
    visibility: visible;
    transform: scaleX(1);
  }
}

@media (max-width: 600px) {
  .webza-ia-trigger { width: 24px; height: 24px; font-size: 14px; line-height: 22px; }
  .webza-ia-panel {
    min-height: 24px;
    max-width: min(360px, calc(100vw - 24px));
    gap: 7px;
    padding: 0 9px;
    font-size: 10px;
  }
}
