.idb-wrapper {
  position: relative;
  display: inline-block;
  line-height: 0;
}

/* Fix: WordPress applique height:100% sur tous les <a>, ce qui inclut
   notre bouton (.idb-btn est une balise <a>). On réinitialise ici. */
.wp-block-post-featured-image .idb-btn {
  display: inline-flex;
  height: auto;
  width: auto;
}

.idb-btn {
  position: absolute;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  pointer-events: none;
}

.idb-wrapper:hover .idb-btn {
  opacity: 1;
  pointer-events: auto;
}

.idb-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  text-decoration: none;
}

.idb-btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Positions */
.idb-top    { top: 8px; }
.idb-bottom { bottom: 8px; }
.idb-left   { left: 8px; }
.idb-right  { right: 8px; }
.idb-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Download icon before label */
.idb-btn::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  vertical-align: middle;
}
