/* Carosello foto Pop — foto rettangolari (angoli dritti) che scorrono col dito */
/* Su telefono la colonna dell'articolo è "1fr" (senza minimo): senza questo limite le foto affiancate
   la allargano a migliaia di px e il telefono rimpicciolisce tutta la pagina. */
.article-body, .entry-content { min-width: 0; max-width: 100%; }
.pop-carousel { position: relative; margin: 28px 0; clear: both; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
.pop-carousel-track {
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab;
  margin: 0; padding: 0; width: 100%; max-width: 100%;
}
.pop-carousel-track::-webkit-scrollbar { display: none; }
.pop-carousel-track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.pop-carousel-track:focus-visible { outline: 2px solid var(--purple, #6A1864); outline-offset: 2px; }

/* La specificità alta annulla la regola del tema ".entry-content img" (larghezza 100%, angoli arrotondati, margini) */
.pop-carousel .pop-carousel-slide { flex: 0 0 auto; margin: 0; padding: 0; scroll-snap-align: start; }
.entry-content .pop-carousel .pop-carousel-slide img,
.pop-carousel .pop-carousel-slide img {
  display: block; width: auto; height: 340px; max-width: 88vw; margin: 0;
  object-fit: cover; border-radius: 0; box-shadow: none;
  -webkit-user-drag: none; user-select: none;
}

/* frecce: solo dove c'è il mouse */
.pop-carousel-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pop-carousel-nav {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 38px; height: 54px; padding: 0; margin: 0; border: 0; border-radius: 0; cursor: pointer;
    background: rgba(18, 4, 73, 0.72); color: #fff; transition: opacity .2s, background .2s;
  }
  .pop-carousel-nav:hover { background: var(--purple, #6A1864); }
  .pop-carousel-nav:disabled { opacity: 0; pointer-events: none; }
  .pop-carousel-prev { left: 0; }
  .pop-carousel-next { right: 0; }
}
@media (max-width: 640px) {
  .entry-content .pop-carousel .pop-carousel-slide img,
  .pop-carousel .pop-carousel-slide img { height: 250px; }
  .pop-carousel-track { gap: 8px; }
}

/* ---- Lightbox: foto a tutto schermo con patina viola/fucsia sfocata ---- */
.pop-carousel .pop-carousel-slide { cursor: zoom-in; }
.pop-carousel .pop-carousel-slide:focus-visible { outline: 2px solid var(--purple, #6A1864); outline-offset: -2px; }
.pop-carousel-track.is-dragging .pop-carousel-slide { cursor: grabbing; }

html.pop-lb-lock { overflow: hidden; }
.pop-lb {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
  /* patina opaca: viola e fucsia POP, morbidi e sfocati */
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(214, 64, 159, 0.55) 0%, rgba(214, 64, 159, 0) 70%),
    radial-gradient(65% 55% at 88% 92%, rgba(106, 24, 100, 0.70) 0%, rgba(106, 24, 100, 0) 72%),
    radial-gradient(50% 45% at 85% 12%, rgba(214, 64, 159, 0.30) 0%, rgba(214, 64, 159, 0) 70%),
    rgba(18, 4, 73, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}
.pop-lb.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .28s ease, visibility 0s; }

.pop-lb-track {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; scrollbar-width: none;
}
.pop-lb-track::-webkit-scrollbar { display: none; }
.pop-lb-track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; user-select: none; cursor: grabbing; }
.pop-lb-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  padding: 64px 16px;
  box-sizing: border-box;
}
.pop-lb-frame { position: relative; display: inline-block; line-height: 0; max-width: 100%; box-shadow: 0 18px 60px rgba(18, 4, 73, 0.55); }
.pop-lb .pop-lb-img {
  display: block; width: auto; height: auto; margin: 0; border-radius: 0; box-shadow: none;
  max-width: min(100%, 94vw); max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px);
  -webkit-user-drag: none; user-select: none;
}
/* logo POP bianco, piccolo, in alto sulla foto (sparisce quando è già "cotto" nell'immagine) */
.pop-lb .pop-lb-logo {
  position: absolute; top: 3.4%; left: 50%; transform: translateX(-50%);
  width: 13%; min-width: 46px; max-width: 40%; height: auto; margin: 0; border-radius: 0;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.pop-lb-frame.is-baked .pop-lb-logo { display: none; }

.pop-lb-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 3; }
.pop-lb-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; margin: 0; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .2s, opacity .2s;
}
.pop-lb-btn:hover { background: rgba(214, 64, 159, 0.65); }
.pop-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pop-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: none; width: 48px; height: 48px; }
.pop-lb-prev { left: 18px; }
.pop-lb-next { right: 18px; }
.pop-lb-nav:disabled { opacity: 0; pointer-events: none; }
.pop-lb.is-single .pop-lb-nav { display: none !important; }
@media (hover: hover) and (pointer: fine) { .pop-lb-nav { display: flex; } }
.pop-lb-count {
  position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; z-index: 3;
  color: #fff; font-size: 13px; letter-spacing: .08em; text-shadow: 0 1px 6px rgba(18, 4, 73, 0.6); pointer-events: none;
}
@media (max-width: 640px) {
  .pop-lb-slide { padding: 60px 8px; }
  .pop-lb .pop-lb-img { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .pop-lb { transition: none; } }

/* ---- Solo editor: anteprima e gestione delle foto ---- */
.pop-carousel-edit { border: 1px dashed rgba(106, 24, 100, 0.45); padding: 14px; background: #fff; }
.pop-carousel-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.pop-carousel-edit-head span { color: #757575; }
.pop-carousel-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pop-carousel-edit-item { position: relative; background: #f0f0f0; }
.pop-carousel-edit-item img { display: block; width: 100%; height: 90px; object-fit: cover; border-radius: 0; margin: 0; }
.pop-carousel-edit-tools { display: flex; }
.pop-carousel-edit-tools button { flex: 1; border: 0; background: #120449; color: #fff; padding: 3px 0; font-size: 11px; cursor: pointer; line-height: 1.4; }
.pop-carousel-edit-tools button:disabled { opacity: 0.3; cursor: default; }
.pop-carousel-edit-tools button:hover:not(:disabled) { background: #6A1864; }
.pop-carousel-edit-empty { margin: 0 0 12px; font-size: 13px; color: #757575; }
