/*
  BSO Popups (frontend)
  - classi primarie: lr-*
  - alias compatibilità: bso-*
*/

/* Overlay full-screen */
.lr-popup__overlay,
.bso-popup__overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  padding: 2rem;
}

/* Box quadrato con immagine */
.lr-popup__box,
.bso-popup__box {
  position: relative;
  width: 30vw;
  height: 30vw; /* fallback */
  aspect-ratio: 1 / 1;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  background: #fff;
}

.lr-popup__img,
.bso-popup__img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Link cliccabile invisibile */
.lr-popup__link,
.bso-popup__link {
  position: absolute;
  inset: 0;
  text-indent: -999em;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.lr-popup__link:focus-visible,
.bso-popup__link:focus-visible {
  outline: 2px solid #005fcc;
  outline-offset: 4px;
}

/* Bottone chiudi */
button.lr-popup__close,
button.bso-popup__close {
  position: absolute;
  top: 1vw;
  right: 1vw;
  width: 2vw;
  height: 2vw;
  border-radius: 0 !important;
  border: none;
  cursor: pointer !important;
  font-size: 1vw !important;
  line-height: 1 !important;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  padding: 0 !important;
  margin: 0 !important;
}
.lr-popup__close:hover,
.bso-popup__close:hover {
  filter: brightness(0.95);
}

/* Disabilita scroll sotto il popup */
body.lr-popup-open,
body.bso-popup-open {
  overflow: hidden;
}

/* Accessibilità: screen reader only (namespaced) */
.lr-popup__sr-only,
.bso-popup__sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive layout */
@media screen and (max-width: 1024px) {
  .lr-popup__box,
  .bso-popup__box {
    width: 60vw;
    height: 60vw;
  }
  button.lr-popup__close,
  button.bso-popup__close {
    top: 2vw;
    right: 2vw;
    width: 4vw;
    height: 4vw;
    font-size: 2vw !important;
  }
}
@media screen and (max-width: 767px) {
  .lr-popup__box,
  .bso-popup__box {
    width: 80vw;
    height: 80vw;
  }
  button.lr-popup__close,
  button.bso-popup__close {
    top: 4vw;
    right: 4vw;
    width: 8vw;
    height: 8vw;
    font-size: 4vw !important;
  }
}
