.fmc-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .8);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.fmc-popup.is-open {
  opacity: 1;
  visibility: visible;
}
.fmc-popup__box {
  position: relative;
  line-height: 0;
  /* larghezza: schermo, max 900px, e comunque tale da non superare l'altezza della finestra */
  width: min(100%, 560px, calc((100vh - 32px) * 1.856));
  width: min(100%, 560px, calc((100dvh - 32px) * 1.856));
}
.fmc-popup__img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.fmc-popup__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font: 400 28px/44px Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.fmc-popup__close:hover,
.fmc-popup__close:focus-visible {
  background: #e4002b;
  color: #fff;
}
@media (max-width: 767px) {
  .fmc-popup { padding: 12px; }
  .fmc-popup__box { width: min(100%, calc((100dvh - 24px) * 1.856)); }
  .fmc-popup__close { top: -22px; right: -4px; width: 40px; height: 40px; font-size: 26px; line-height: 40px; }
}
body.fmc-popup-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .fmc-popup { transition: none; } }
