.foak-lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  /* padding: 24px; */
  z-index: 999999;
  padding: max(16px, env(safe-area-inset-top)) 16px
    max(16px, env(safe-area-inset-bottom));
}

.foak-lb-overlay.is-open {
  display: flex;
}

.foak-lb-dialog {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92dvh;
  overflow: visible;
}

.foak-lb-img {
  display: block;
  max-width: 100%;
  max-height: 92dvh;
  height: auto;
  width: auto;
  border-radius: 8px;
}

.foak-lb-close {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 38px;
  height: 38px;
  border-radius: 0px;
  border: none;
  cursor: pointer;
  background: #1f2933;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px;
  z-index: 1000000;
  pointer-events: auto;
}

.foak-lb-close:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* O link vira “container” do ícone */
.entry-content a[href$=".webp"],
.entry-content a[href$=".jpg"],
.entry-content a[href$=".jpeg"],
.entry-content a[href$=".png"],
.entry-content a[href$=".avif"],
.entry-content a[href$=".gif"] {
  position: relative;
  display: inline-block;
}

/* Garante o posicionamento do ícone no canto */
.entry-content a.foak-lb-has-icon {
  position: relative;
  display: inline-block; /* mantém o comportamento típico de imagem */
}

/* Ícone no canto (SVG inserido via JS) */
.entry-content a.foak-lb-has-icon .foak-lb-link-icon {
  position: absolute;
  right: 0px;
  top: 0px;

  width: 35px;

  padding: 10px 10px; /* igual ao seu */
  box-sizing: border-box;

  background: rgba(31, 41, 51, 0.85);
  color: #ffffff; /* controla a cor via currentColor */
  fill: currentColor; /* redundância boa */

  display: flex; /* centraliza o desenho dentro do quadrado */
  align-items: center;
  justify-content: center;

  pointer-events: none;
}

/* Quando o lightbox está aberto, esconda a lupa nas imagens do post */
.foak-lb-overlay.is-open ~ .entry-content a[href$=".webp"]::after,
.foak-lb-overlay.is-open ~ .entry-content a[href$=".jpg"]::after,
.foak-lb-overlay.is-open ~ .entry-content a[href$=".jpeg"]::after,
.foak-lb-overlay.is-open ~ .entry-content a[href$=".png"]::after,
.foak-lb-overlay.is-open ~ .entry-content a[href$=".avif"]::after,
.foak-lb-overlay.is-open ~ .entry-content a[href$=".gif"]::after {
  display: none;
}

.foak-lb-img {
  touch-action: none;
  cursor: grab;
  position: relative;
  z-index: 1;
}

.foak-lb-img:active {
  cursor: grabbing;
}
