/* =========================================================
   EXTRA – Lightbox divisioni, zoom immagini, ecc.
   ========================================================= */

/* ================
   LIGHTBOX DIVISIONI
   ================ */

/* Backdrop scuro del dialog */
.lightbox::backdrop {
    background: rgba(0, 0, 0, .75);
  }
  
  /* Dialog a pieno schermo senza margini strani */
  .lightbox {
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    background: transparent;
    max-width: none;
    z-index: 9999;
    display: none;        /* nascosto di base */
  }
  
  /* Quando [open] diventa visibile */
  .lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Nascondi il dialog quando non è open (per browser vecchi) */
  .lightbox:not([open]) {
    display: none !important;
  }
  
  /* Contenuto centrato */
  .lightbox-inner {
    position: relative;
    text-align: center;
    max-width: 90vw;
  }
  
  /* Immagine ingrandita */
  .lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    background: #000;
  }
  
  /* Didascalia sotto immagine */
  .lightbox .caption {
    margin-top: .5rem;
    color: var(--muted-foreground, #ddd);
    text-align: center;
    font-size: .95rem;
    text-wrap: balance;
  }
  
  /* Pulsante chiusura (visibile solo quando [open]) */
  .lightbox[open] .lightbox-close {
    display: flex;
  }
  .lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    color: #fff;
    background: rgba(0, 0, 0, .7);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background .2s ease;
  }
  .lightbox-close:hover {
    background: rgba(0, 0, 0, .8);
  }
  
  /* Tema scuro preferito (fallback) */
  @media (prefers-color-scheme: dark) {
    .lightbox .caption {
      color: #ccc;
    }
  }
  
  /* =========================
     OVERLAY "LENTE" SULLE MINIATURE
     ========================= */
  
  .zoom-wrap {
    position: relative;
    display: block;
  }
  .zoom-wrap .zoom-lens {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.9);
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
  }
  .zoom-wrap:hover .zoom-lens,
  .zoom-wrap:focus-within .zoom-lens {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .zoom-wrap .zoom-lens::before {
    content: "";
    width: 26px;
    height: 26px;
    display: block;
    background: center / contain no-repeat
      url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'>\
  <path d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5L20.49 19l-5-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/></svg>");
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
  }
  
  /* Miniature cliccabili */
  .division-img {
    cursor: zoom-in;
    transition: transform .15s ease;
  }
  .division-img:hover {
    transform: scale(1.02);
  }
  