.smp-overlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  z-index: 999999;
  padding: 16px;
}

.smp-overlay.is-open{
  display: flex;
}

/*
  Modal responsive:
  - mai full screen
  - su desktop resta più piccolo (max 80vw)
  - su mobile resta più piccolo (max 80vw)
  - max width configurabile: --smp-maxw
*/
.smp-modal{
  position: relative;
  width: min(var(--smp-maxw, 920px), 80vw);
  max-height: 80vh;
  background: #111;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  overflow: hidden;
}

.smp-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.smp-close:focus{
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

.smp-content{
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Media responsive */
.smp-media{
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #000;
  max-width: 100%;
  max-height: calc(80vh - 32px); /* evita che diventi troppo alto */
  object-fit: contain;  /* mantiene proporzioni */
}

/* Per immagini (stesso principio, ma un po' più permissivo) */
.smp-image{
  max-height: calc(80vh - 32px);
}
