/* --- LAYOUT GLOBALE PC & TABLET (Allineato, centrato e foto integre) --- */

@media (min-width: 768px) {
    header, main {
        max-width: 80rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box;
    }

    header {
        width: 100% !important;
        border-radius: 0 0 1rem 1rem;
        margin-bottom: 1.5rem;
    }
}

/* --- GESTIONE FOTO GALLERIA E COPERTINA (Niente tagli, proporzioni originali) --- */

/* Le foto della galleria mostrano l'immagine intera senza tagli (object-contain con sfondo scuro) */
#autoGallery img {
    object-fit: contain !important;
    background-color: #0d0e11;
}

/* Immagine di copertina hero intera e proporzionata su PC */
.relative.w-full.h-52 img, 
.relative.w-full.h-64 img {
    object-fit: cover !important; /* Mantiene la copertura ma senza tagliare i dettagli importanti */
    object-position: center !important;
}

/* Abilita il pull-to-refresh nativo sui browser mobile */
html, body {
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Nascondi scrollbar per carosello galleria */
#autoGallery {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#autoGallery::-webkit-scrollbar {
    display: none;
}

/* Splash Screen Caricamento Iniziale */
#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #18181b;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.4s ease, visibility 0.4s;
}
#splashScreen.fade-out {
    opacity: 0;
    visibility: hidden;
}
.splash-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    border: 3px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}
.splash-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(251, 191, 36, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spinSplash 0.8s linear infinite;
}
@keyframes spinSplash {
    to { transform: rotate(360deg); }
}

/* Modal Popup Installazione */
.pwa-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
}
.pwa-banner-card {
    position: relative;
    background: #18181b;
    color: #ffffff;
    padding: 24px;
    border-radius: 16px;
    max-width: 360px;
    width: 88%;
    text-align: center;
    border: 1px solid #27272a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.pwa-close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #a1a1aa;
    font-size: 24px;
    cursor: pointer;
}
.pwa-card-logo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    margin-bottom: 12px;
    object-fit: cover;
    border: 2px solid #fbbf24;
}
.pwa-banner-card h3 {
    margin: 0;
    color: #fbbf24;
    font-size: 1.15rem;
}
.pwa-banner-card p {
    color: #a1a1aa;
    font-size: 0.9rem;
    margin: 12px 0 20px;
    line-height: 1.4;
}
.pwa-banner-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-pwa-confirm {
    background: #fbbf24;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
}
.btn-pwa-dismiss {
    background: #27272a;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
}

/* Disabilita la selezione del testo e il cursore anomalo su tutta l'app */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 e IE 11 */
    user-select: none; /* Standard syntax */
}

/* Riabilita la selezione del testo SOLO dove serve scriverci dentro (campi di testo) */
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}
