@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&display=swap');

/* --  1. REGOLAZIONI GENERALI & SFONDI -- */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url("fotoM/primaPagina.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ffffff;
}

body.page-chi-siamo {
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoSiamo.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.page-pensione {
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/pensione10.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.page-lezioni {
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoScuola.PNG");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.page-gallery {
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoGallery.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.page-contatti {
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/contatti.PNG");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}


/* -- 2. HEADER & LOGO-- */

.header-titolo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px 10px;
    width: 100%;
}

.titolo-logo-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.logo-titolo {
    width: 70px;
    height: auto;
    object-fit: contain;
    margin-right: 15px;
    filter: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    mix-blend-mode: multiply !important;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 700;
    color: #5dd8eb;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    line-height: 1.1;
    text-align: center;
}

.sottotitolo {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(12px, 2vw, 18px);
    font-weight: 700;
    color: #5dd8eb;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
    margin-bottom: 0;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5), 1px 1px 3px rgba(0, 0, 0, 0.6);
    text-align: center;
}


/* -- 3. NAVBAR & MENU DI NAVIGAZIONE -- */

.navbar {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    background: rgba(93, 216, 235, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid rgba(93, 216, 235, 0.4);
    border-bottom: 1px solid rgba(93, 216, 235, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.navbar li {
    margin: 0;
}

.navbar a {
    position: relative;
    display: block;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 3px;
    background-color: #5dd8eb;
    transition: width 0.3s ease;
}

.navbar a:hover {
    color: #5dd8eb;
    background: rgba(93, 216, 235, 0.35);
}

.navbar a:hover::after {
    width: 80%;
}


/* -- 4. STRUTTURA CONTENUTI PAGINE--*/

main {
    display: flex;
    flex-direction: row; 
    justify-content: center;
    align-items: center;
    max-width: 1200px;            
    margin: 0 auto;    
    padding: 20px 15px;
    gap: 30px;
    flex-wrap: wrap;
}

.intro {
    flex: 1;
    min-width: 280px;
}

.carosello-container {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 620px;
    width: 100%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%),
                        linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%),
                linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.carosello-slides {
    position: relative;
    width: 100%;
    height: 380px;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 18px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 10;
}

.prev:hover, .next:hover {
    background-color: #5dd8eb;
    color: #111;
    transform: translateY(-50%) scale(1.1);
}

.prev { left: 10px; }
.next { right: 10px; }


/* -- 5. LAYOUT CONTENITORI & GALLERIE SFUMATE-- */

.main-centrato {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 15px;
    width: 100%;
}

.intro-centrata {
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 30px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.titolo-sezione {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #ffffff;
    font-size: clamp(20px, 3.5vw, 32px);
    line-height: 1.3;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}

.foto-salto-sfumata {
    display: inline-block;
    width: 100%;
    max-width: 420px;
    height: 240px;
    margin: 15px auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                        linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.foto-salto-sfumata img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(1.15) contrast(1.05);
}

.galleria-chi-siamo {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.foto-sfumata-wrapper,
.logo-fise-sfumato {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 260px;
    height: 170px;
    vertical-align: middle;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                        linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.foto-sfumata-wrapper img,
.logo-fise-sfumato img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    filter: brightness(1.15) contrast(1.05);
}


/* -- 6. SEZIONE PENSIONE CAVALLO-- */

.intro-senza-riquadro {
    width: 100%;
    text-align: center;
    background: transparent !important;
    padding: 15px 0;
}

.testo-descrizione {
    color: #ffffff;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.7;
    text-align: center;
    max-width: 850px;
    margin: 0 auto 20px auto;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.intro-senza-riquadro h3 {
    color: #5dd8eb;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 12px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.intro-senza-riquadro ul {
    list-style: none;
    padding-left: 0;
    margin: 0 auto 25px auto;
    max-width: 800px;
    text-align: left;
}

.intro-senza-riquadro ul li {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.intro-senza-riquadro ul li strong {
    color: #5dd8eb;
}

.griglia-pensione-4foto {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 750px;
    margin: 25px auto 0 auto;
    justify-items: center;
    align-items: center;
}

.foto-pensione-item {
    width: 100%;
    max-width: 340px;
    height: 220px;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                        linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%),
                linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.foto-pensione-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(1.15) contrast(1.05);
}
.foto-pensione-item.foto-grande {
    width: 100% !important;
    max-width: 420px !important;
    height: 240px !important;
    margin: 0 auto !important;
}

@media (max-width: 768px) {
    .foto-pensione-item.foto-grande {
        max-width: 100% !important;
        height: 210px !important;
    }
}

/* -- 7. SEZIONE LOGHI HOME (DESKTOP)-- */

.main-loghi {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    max-width: 1200px;            
    margin: 20px auto;    
    padding: 0 15px;
    width: 100%;
}

.loghi-certificati {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 20px !important;
    margin-top: 10px !important;
    margin-left: 35px !important;
    width: 100% !important;
}

.loghi-certificati .logo-item img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    max-width: 110px !important;
    height: auto !important;
    display: block !important;
}


/* -- 8. MEDIA QUERY SMARTPHONE (SFONDO FISSO E NAVBAR AZZURRATA TRASPARENTE)--  */

@media (max-width: 768px) {
    /* 1. Disattiva lo sfondo normale sul body per evitare conflitti */
    body, body.page-chi-siamo, body.page-pensione, body.page-lezioni, body.page-gallery, body.page-contatti {
        background-image: none !important;
    }

    /* 2. Sfondo fisso indipendente a schermo intero senza tagli (copertura totale) */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -999;
        background-repeat: no-repeat !important;
        background-size: cover !important;
        background-position: center center !important;
    }

    /* 3. Associa la foto giusta a ciascuna pagina sul telefono */
    body.page-chi-siamo::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoSiamo.jpg") !important;
    }

    body.page-pensione::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/pensione10.jpg") !important;
    }

    body.page-lezioni::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoScuola.PNG") !important;
    }

    body.page-gallery::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/sfondoGallery.jpg") !important;
    }

    body.page-contatti::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/contatti.PNG") !important;
    }

    /* Sfondo di default per la Home page su mobile */
    body:not([class*="page-"])::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fotoM/primaPagina.jpg") !important;
    }

    /* 4. Navbar Classica Azzurrata e Trasparente anche su Smartphone */
    .navbar {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
        padding: 5px 0;
        background: rgba(93, 216, 235, 0.25);
    }

    .navbar li {
        margin: 0;
    }

    .navbar a {
        display: block;
        padding: 8px 10px;
        font-size: 12px;
        letter-spacing: 0.5px;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }

    .header-titolo {
        align-items: center !important;
        padding: 15px 10px 5px !important;
        text-align: center !important;
    }

    /* 5. MODIFICA LOGHI SU SMARTPHONE */
    .main-loghi {
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 10px 0 !important;
    }

    .loghi-certificati {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        margin-left: 15px !important;
        margin-top: 5px !important;
    }

    .loghi-certificati .logo-item img {
        max-width: 80px !important;
    }


    .griglia-pensione-4foto {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    
    .foto-pensione-item {
        max-width: 100%;
        height: 200px;
    }
}