*{
    box-sizing:border-box;
    margin:0;
    padding:0;
    font-family:Arial, Helvetica, sans-serif;
}

body{
    background:#f5f7fa;
    color:#222;
    line-height:1.6;
}

header{
    background:#ffffff;
    padding:20px 40px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

header img{
    height:80px;
}

nav a{
    margin-left:25px;
    text-decoration:none;
    font-weight:bold;
    color:#0b4f8a;
    position:relative;
    padding-bottom:6px;
}

nav a::after{
    content:"";
    position:absolute;
    left:0;
    bottom:0;
    width:0;
    height:3px;
    background:#0b4f8a;
    transition:width 0.3s ease;
}

nav a:hover::after{
    width:100%;
}

/* --- HERO MODIFICATO: IMMAGINI NATURALI, BOTTONE TRASPARENTE --- */
.hero{
    position: relative;
    overflow: hidden;
    color:white;
    padding:100px 40px; 
    text-align:center;
    transition: transform 0.6s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position:center;
    background-repeat: no-repeat;
    transition: opacity 1.5s ease-in-out; 
    opacity: 0;
}

/* RIMOSSO L'OVERLAY BLU: ora solo un velo nero leggero per leggibilità testi */
.hero-bg::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* nero 30%, nessun blu */
    pointer-events: none;
}

.hero-bg-1 {
    background-image: url('hero_1.webp');
}

.hero-bg-2 {
    background-image: url('hero_2.webp');
}

.hero-bg.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1{
    font-size:2.5rem;
    margin-bottom:20px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    color: white;
}

.hero p{
    font-size:1.2rem;
    margin-bottom:30px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
    color: white;
}

/* Bottone trasparente con bordo bianco e hover moderno */
.hero button{
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero button:hover{
    background: white;
    color: #0b4f8a;
    border-color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

section{
    padding:60px 40px;
    max-width:1200px;
    margin:auto;
}

section h2{
    color:#0b4f8a;
    margin-bottom:20px;
    text-align:center;
}

/* STILE PER LO SLIDER CARD */
.services-slider-container {
    position: relative;
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.services-slider-wrapper {
    flex: 1;
    overflow: hidden;
}

.services-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 30px;
}

.service-card {
    flex: 0 0 calc(33.333% - 20px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.6s ease forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.service-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e9ecef;
}

.service-card-content {
    padding: 20px;
}

.service-card-caption {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.service-card-link {
    display: inline-block;
    color: #e0461a;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
}

.service-card-link::after {
    content: "→";
    margin-left: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.service-card-link:hover {
    color: #0b4f8a;
}

.service-card-link:hover::after {
    transform: translateX(5px);
}

/* Frecce laterali */
.slider-arrow {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    color: #0b4f8a;
    font-size: 28px;
    font-weight: bold;
    border: none;
    flex-shrink: 0;
}

.slider-arrow:hover {
    background: #0b4f8a;
    color: white;
    transform: scale(1.1);
}

.slider-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.slider-arrow:disabled:hover {
    background: white;
    color: #0b4f8a;
}

/* Dots indicator */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.slider-dot.active {
    background: #e0461a;
    width: 25px;
    border-radius: 10px;
}

.slider-dot:hover {
    background: #0b4f8a;
}

/* RESPONSIVE - BASATO SU LARGHEZZA, NON ORIENTAMENTO */

/* Tablet e desktop grande: 3 card */
@media (min-width: 769px) {
    .service-card {
        flex: 0 0 calc(33.333% - 20px);
    }
    .slider-arrow {
        display: flex;
    }
}

/* Tablet piccolo e landscape mobile: 2 card */
@media (max-width: 768px) and (min-width: 481px) {
    .service-card {
        flex: 0 0 calc(50% - 15px);
    }
    .slider-arrow {
        display: flex !important;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .services-slider {
        gap: 20px;
    }
    .services-slider-container {
        gap: 10px;
    }
}

/* Mobile verticale (meno di 480px): layout a colonna */
@media (max-width: 480px) {
    .services-slider-container {
        display: block;
    }
    
    .slider-arrow {
        display: none !important;
    }
    
    .services-slider-wrapper {
        overflow: visible;
    }
    
    .services-slider {
        display: flex;
        flex-direction: column;
        gap: 25px;
        transform: none !important;
    }
    
    .service-card {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .slider-dots {
        display: none;
    }
}

.about{
    background:#ffffff;
    border-radius:20px;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
    padding:40px;
    opacity:0;
    transform:translateY(50px);
    transition:all 0.8s ease-out;
}

.about.visible{
    opacity:1;
    transform:translateY(0);
}

footer{
    background:#0b4f8a; 
    color:white;
    padding:30px 40px;
    text-align:center;
    margin-top:60px;
}

footer p{
    margin-bottom:10px;
}

.modal{
    display:none;
    position:fixed;
    z-index:999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.6);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    position: relative;
    animation: fadeIn 0.4s ease;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal input,
.modal select{
    width:100%;
    padding:10px;
    margin:10px 0;
    border-radius:8px;
    border:1px solid #ccc;
}

.modal button{
    background:#0b4f8a;
    color:white;
    padding:12px;
    border:none;
    border-radius:20px;
    cursor:pointer;
    width:100%;
}

.close{
    position:absolute;
    right:15px;
    top:10px;
    font-size:25px;
    cursor:pointer;
}

#slot-container {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    margin:15px 0;
}

.btn-slot {
    padding:10px;
    border:1px solid #0b4f8a;
    border-radius:8px;
    background:white;
    color:#0b4f8a;
    cursor:pointer;
    text-align:center;
    font-weight:bold;
    font-size:0.9rem;
    transition: 0.2s;
}

.btn-slot:hover:not(.occupied) {
    background:#0b4f8a;
    color:white;
}

.btn-slot.selected {
    background:#e0461a !important;
    color:white !important;
    border-color:#e0461a;
}

.btn-slot.occupied {
    background:#eee !important;
    color:#bbb !important;
    border-color:#ddd !important;
    cursor:not-allowed;
}

.lang-dropdown{
    position:relative;
}

.lang-btn{
    border:none;
    background:#e6eef7;
    color:#0b4f8a;
    padding:6px 14px;
    border-radius:20px;
    font-size:0.8rem;
    font-weight:bold;
    cursor:pointer;
}

.lang-menu{
    display:none;
    position:absolute;
    top:35px;
    left:0;
    background:white;
    border-radius:10px;
    box-shadow:0 4px 12px rgba(0,0,0,0.1);
    overflow:hidden;
    min-width:150px;
    z-index:1000;
}

.lang-menu div{
    padding:10px;
    cursor:pointer;
}

.lang-menu div:hover{
    background:#f0f4f8;
}

.lang-dropdown.active .lang-menu{
    display:block;
}

.partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.partner-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 350px; 
    height: 180px;
}

.partner-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.partner-card img {
    max-width: 90%;  
    max-height: 90%; 
    object-fit: contain; 
}

.section-divider {
    border: 0;
    height: 3px; 
    background: #0b4f8a;
    width: 150px; 
    margin: 15px auto 40px; 
}

.service-card-title {
    color: #e0461a;
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: bold;
}

/* Sezione Comunicazioni */
.comunicazioni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.comunicazione-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Forza altezza uniforme */
}   

.comunicazione-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Stile per immagine cliccabile */
.comunicazione-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    position: relative;
}

.comunicazione-card img:hover {
    transform: scale(1.02);
    filter: brightness(0.95);
}

/* Tooltip testuale per invitare al click (appare solo su hover) */
.comunicazione-card img {
    position: relative;
}

.comunicazione-card img::after {
    content: "🔍 Clicca per ingrandire";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.comunicazione-card img:hover::after {
    opacity: 1;
}

/* Lightbox moderna */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: bold;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background: rgba(0,0,0,0.8);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.comunicazione-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 260px; /* Mantieni altezza minima */
}

.comunicazione-card .data {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.comunicazione-card h3 {
    min-height: 3em; /* Mantiene i titoli allineati */
    color: #e0461a;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* Testo espandibile */
.comunicazione-card .testo-breve {
    display: block;
}

.comunicazione-card .testo-completo {
    display: none;
}

.comunicazione-card.expanded .testo-breve {
    display: none;
}

.comunicazione-card.expanded .testo-completo {
    display: block;
}

.comunicazione-card .testo-breve p,
.comunicazione-card .testo-completo p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.comunicazione-card .testo-completo p {
    white-space: pre-line;
}

/* Pulsante Leggi tutto / Mostra meno */
.read-more-btn {
    background: none;
    border: none;
    color: #e0461a;
    cursor: pointer;
    font-weight: bold;
    margin-top: auto; /* Spinge il tasto in fondo */
    padding: 10px 0;
}

.read-more-btn:hover {
    background: none;
    color: #0b4f8a;
}

.read-more-btn::after {
    content: "▼";
    font-size: 10px;
    transition: transform 0.3s ease;
}

.read-more-btn.collapsed::after {
    content: "▲";
}

/* Link esterno */
.comunicazione-card a {
    color: #0b4f8a;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 15px;
}

.comunicazione-card a:hover {
    color: #e0461a;
}

/* Pulsante toggle comunicazioni (stile simile al bottone hero) */
.btn-toggle-comunicazioni {
    background: transparent;
    color: #0b4f8a;
    border: 2px solid #0b4f8a;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 30px auto 0;
    text-align: center;
    width: auto;
}

.btn-toggle-comunicazioni:hover {
    background: #0b4f8a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}

input::placeholder,
textarea::placeholder {
    color: #555 !important;   
    opacity: 1;              
}

@keyframes fadeIn{
    from{opacity:0; transform:translateY(-20px);}
    to{opacity:1; transform:translateY(0);}
}

@media (max-width: 1024px) {
    section{
        padding:50px 30px;
    }
    header{
        padding:20px;
    }
}

@media (max-width: 768px) {

    footer {
        padding-bottom: 60px !important; 
    }

    .modal-content {
        margin: 10px auto;
        padding: 20px;
    }

    header {
        padding: 15px;
    }

    header > div {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
    }

    header > div > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    header img {
        height: 60px;
    }

    .lang-dropdown {
        margin-left: auto;
    }

    nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 0;
    }

    nav a {
        margin: 0 !important;
        width: 100%;
        text-align: center;
    }

    section{
        padding:40px 20px;
    }

    #slot-container {
        grid-template-columns:repeat(2,1fr);
    }
    
    .hero {
        min-height: 350px;
    }
}

@media (max-width: 480px) {

    footer {
        padding-bottom: 60px !important; 
    }
    
    header img{
        height: 55px;
    }

    header > div > div:first-child {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .lang-dropdown {
        margin-left: auto;
        flex-shrink: 0;
    }

    section h1{
        font-size:1.8rem;
    }
    .partner-card {
        width: 100%; 
        height: auto; 
        max-width: 300px; 
        aspect-ratio: 16 / 9; 
        margin-bottom: 20px; 
    }
    
    .partners-grid {
        gap: 0; 
    }
    
    .hero {
        min-height: 300px;
        padding: 80px 20px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}


