/* public/css/modal.css */ /* =============================== MODAL OVERLAY FOTO E VIDEO =============================== */ .modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.8); overflow: hidden; opacity: 0; z-index: 9999; transition: opacity 160ms ease-out; } .modal.open { display: flex; opacity: 1; } /* Effetto vetro opzionale */ @supports (backdrop-filter: blur(4px)) { .modal { backdrop-filter: blur(4px); } } /* =============================== CONTENITORE CONTENUTI Disponibile anche se nell'HTML attuale il media è figlio diretto del modal. =============================== */ .modal-content { position: relative; width: 90vw; height: 90vh; max-width: 1200px; max-height: 90vh; display: flex; align-items: center; justify-content: center; transform: scale(0.98); transition: transform 160ms ease-out; } .modal.open .modal-content { transform: scale(1); } /* =============================== CONTENITORE FOTO E VIDEO =============================== */ #modalMediaContainer { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; z-index: 1; } /* * Il selettore > limita queste regole * all'immagine o al video direttamente * inseriti nel modal. */ #modalMediaContainer > img, #modalMediaContainer > video { position: relative; width: 100%; height: 100%; display: block; object-fit: contain; background: #000; z-index: 1; } /* =============================== PULSANTE CHIUSURA =============================== */ .modal-close { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); min-width: 44px; height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 22px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); cursor: pointer; font-size: 26px; font-weight: 700; line-height: 1; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; z-index: 10001; } /* Area clic più ampia senza cambiare l'aspetto */ .modal-close::after { content: ""; position: absolute; inset: -8px; } .modal-close:hover { background: rgba(0, 0, 0, 0.5); } .modal-close:active { transform: translateY(1px); } .modal-close:focus-visible { outline: 2px solid #4c9ffe; outline-offset: 2px; } /* =============================== PULSANTE INFO =============================== */ .modal-info-btn { position: absolute; right: 16px; bottom: 12px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: #000; background: #fff; border: 1px solid #d0d0d0; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: pointer; font-size: 20px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; z-index: 10000; } .modal-info-btn:hover { background: #f7f7f7; } .modal-info-btn:active { transform: scale(0.95); } .modal-info-btn:focus-visible { outline: 2px solid #4c9ffe; outline-offset: 2px; } .modal-info-btn.active { background: #f7f7f7; border-color: #cfcfcf; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); transform: none; } /* =============================== LINK APRI ORIGINALE =============================== */ .modal-open-original { position: absolute; top: 8px; right: 56px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: #000; background: rgba(255, 255, 255, 0.95); border: 1px solid #d0d0d0; border-radius: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: pointer; font-size: 13px; text-decoration: none; z-index: 10000; } .modal-open-original:hover { background: #fff; } .modal-open-original:focus-visible { outline: 2px solid #4c9ffe; outline-offset: 2px; } /* =============================== FRECCE DI NAVIGAZIONE =============================== */ .modal-nav-btn { position: fixed; top: calc(50% + env(safe-area-inset-top)); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 22px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); cursor: pointer; font-size: 22px; line-height: 1; transform: translateY(-50%); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: background-color 150ms ease, transform 50ms ease; z-index: 10000; } .modal-nav-btn:hover { background: rgba(0, 0, 0, 0.5); } .modal-nav-btn:active { transform: translateY(-50%) translateY(1px); } .modal-nav-btn:focus-visible { outline: 2px solid #4c9ffe; outline-offset: 2px; } .modal-nav-btn.prev { left: calc(12px + env(safe-area-inset-left)); } .modal-nav-btn.next { right: calc(12px + env(safe-area-inset-right)); } .modal-nav-btn.hidden { display: none !important; } /* =============================== MODAL SU MOBILE =============================== */ @media (max-width: 768px) { .modal-content { width: 100vw; height: 100vh; max-width: none; max-height: none; } .modal-open-original { top: calc(8px + env(safe-area-inset-top)); } } /* =============================== STATI GENERALI =============================== */ body.no-scroll { overflow: hidden; } /* =============================== CONTRASTO E ACCESSIBILITÀ =============================== */ @media (prefers-contrast: more) { .modal { background: rgba(0, 0, 0, 0.9); } .modal-close, .modal-info-btn, .modal-open-original { border-color: #fff; box-shadow: none; } } /* Riduzione animazioni */ @media (prefers-reduced-motion: reduce) { .modal, .modal-content { transition: none !important; } }