/* Canvas sfondo batteri */
#bacteria-bg {
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  pointer-events:none; /* non interferisce con click */
  z-index:-1; /* sotto tutti gli elementi */
  background:#fafafa; /* il tuo colore crema */
}


/* ========== RESET ========== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:Inter,Arial,Helvetica,sans-serif;color:#222;background:#fafafa;line-height:1.5;margin:0;padding-top:var(--header-height)}

/* ========== LAYOUT HELPERS ========== */
.container{max-width:1100px;margin:0 auto;padding: clamp(16px, 2vw, 40px);}
.section{padding: clamp(16px, 2vw, 40px);}

@media(max-width:700px){
.container{padding:20px 16px}
section{padding-left:0;padding-right:0}
}

/* ========== HEADER BASE ========== */
:root{--header-height:120px;--header-height-min:64px}
.site-header{position:fixed;top:0;left:0;width:100%;background:#086394;color:#fff;z-index:1000;box-shadow:0 2px 4px rgba(0,0,0,.1);transition:height .3s ease,height .3s ease;height:var(--header-height)}
.header-inner{max-width:1100px;margin:0 auto;padding:0 20px;height:100%;display:flex;align-items:center;gap:16px;position:relative}

/* ========== BRAND ========== */
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.2rem;color:#fff;text-decoration:none;margin:0;flex-shrink:0;order:0}
.brand-logo{height:96px;width:auto;transition:height .3s ease}
.brand .muted{font-weight:400;color:#bfe0ff;margin-left:12px;white-space:nowrap;flex-shrink:0;transition:font-size .3s ease}

/* ========== NAV DESKTOP ========== */
.main-nav{display:flex;gap:6px;white-space:nowrap;overflow:hidden;flex:1;justify-content:center;order:1}
.main-nav .nav-link{color:#e6f4ff;text-decoration:none;padding:18px 8px;display:inline-block}
.main-nav .nav-link.active{border-bottom:3px solid rgba(255,255,255,.15)}

/* ========== HEADER MINIMIZED ========== */
.site-header.minimized{height:var(--header-height-min);--header-height:var(--header-height-min)}
.site-header.minimized .brand-logo{height:48px}
.site-header.minimized .brand{font-size:1.05rem}
.site-header.minimized .brand .muted{font-size:0.95rem;display:inline-block}

/* ========== BURGER MENU ========== */
.burger{display:none;background:none;border:0;cursor:pointer;width:28px;height:22px;position:relative;flex-shrink:0;order:2;margin-left:auto}
.burger span{position:absolute;left:0;width:100%;height:2px;background:#fff;transition:.3s}
.burger span:nth-child(1){top:0}
.burger span:nth-child(2){top:10px}
.burger span:nth-child(3){top:20px}
.burger.active span:nth-child(1){transform:rotate(45deg);top:10px}
.burger.active span:nth-child(2){opacity:0}
.burger.active span:nth-child(3){transform:rotate(-45deg);top:10px}

/* ========== MOBILE NAV ========== */
.mobile-nav{position:absolute;top:100%;left:0;width:100%;background:#086394;display:flex;flex-direction:column;max-height:0;overflow:hidden;transition:max-height .3s ease}
.mobile-nav a{padding:14px 20px;color:#fff;text-decoration:none;border-top:1px solid rgba(255,255,255,.15)}
.mobile-nav.open{max-height:320px}

@media(max-width:980px){
  .main-nav{display:none}
  .burger{display:block}
}

@media(max-width:620px){.brand .muted{display:none}}
@media(max-width:480px){.site-header.minimized .brand .muted {display: none;}}

/* ========== BURGER MENU ==========
.burger{display:none;background:none;border:0;cursor:pointer;width:28px;height:22px;position:relative;flex-shrink:0}
.burger span{position:absolute;left:0;width:100%;height:2px;background:#fff;transition:.3s}
.burger span:nth-child(1){top:0}
.burger span:nth-child(2){top:10px}
.burger span:nth-child(3){top:20px}
.burger.active span:nth-child(1){transform:rotate(45deg);top:10px}
.burger.active span:nth-child(2){opacity:0}
.burger.active span:nth-child(3){transform:rotate(-45deg);top:10px}

/* ========== MOBILE NAV ==========
.mobile-nav{position:absolute;top:100%;left:0;width:auto;min-width:180px;background:#086394;display:flex;flex-direction:column;align-items:flex-start;max-height:0;overflow:hidden;transition:max-height .4s ease,padding .3s; border-radius:0 0 8px 8px;box-shadow:0 4px 12px rgba(0,0,0,.1);padding:0;z-index:1100}
.mobile-nav.open{max-height:1000px;padding:6px 12px}
.mobile-nav a{padding:8px 16px;margin:2px 0;background:#086394;color:#fff;text-decoration:none;border-radius:6px;display:inline-block;white-space:nowrap;transition:background .25s,transform .15s,width .2s}
.mobile-nav a:hover{background:#064874;transform:translateX(4px)}
.mobile-nav.collapsed a{display:none}

/* ========== RESPONSIVE ==========
@media(max-width:700px){.main-nav{display:none}.burger{display:block}}*/
 
/* ========== HERO ========== */
.hero{background:linear-gradient(180deg,#f2f6fb,white);padding:48px 0}
.hero-grid{display:grid;grid-template-columns:1fr 420px;gap:24px;align-items:center}
.hero-text h1{font-size:2.1rem;margin-bottom:12px}
.lead{color:#444;margin-bottom:16px}
.hero-media img{width:100%;height:auto;border-radius:8px}

/* ========== HOME ========== */
.home-bottom{display:flex;gap:20px;flex-wrap:wrap;align-items:stretch}
.home-left,.home-right{flex:1 1 45%;background:#fff;padding:16px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.05);display:flex;flex-direction:column;justify-content:space-between}
.home-right .btn.primary{display:block;margin:16px auto 18px;padding:10px 18px;width:auto}
.countdown-large{width:max-content;margin:12px auto 0}
.home-bottom .btn,.three-cols .btn,.home-right .btn,.home-left .btn{display:block;margin:10px auto;text-align:center;width:fit-content}
/* buttons */
.btn{display:inline-block;padding:10px 16px;border-radius:6px;text-decoration:none}
.btn.primary{background:#0051a8;color:white}
.btn.ghost{background:transparent;border:1px solid #0051a8;color:#0051a8}
.pos-actions .btn {display: inline-block;margin-bottom: 6px;}

/* ========== CARDS & 3 COLUMNS ========== */
.three-cols {display: grid;grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));;gap: 18px;margin: 0 auto;justify-content: center;text-align: center;max-width: 1000px;}
.card{background:white;padding:20px;border-radius:8px;border:1px solid #eee}
.three-cols .card {display: flex;flex-direction: column;align-items: center;justify-content: flex-start;text-align: center;}
@media (max-width:1000px){.three-cols {grid-template-columns: repeat(2,1fr);justify-content: center;}}
@media (max-width:700px){.three-cols {grid-template-columns: 1fr;justify-content: center;}}

/* ========== SPOTLIGHT / MINI NEWS ========== */
.spotlight{display:flex;gap:18px;padding:24px 0;align-items:flex-start}
.spotlight-left{flex:1}
.spotlight-right{width:280px;background:#fff;padding:14px;border-radius:8px;border:1px solid #eee}

/* ========== TEAM PREVIEW & GRID ========== */
.team-preview{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-top:16px}
.tp-card{background:#fff;padding:8px;border-radius:8px;text-align:center;border:1px solid #eee}
.tp-card img{width:100%;height:110px;object-fit:cover;border-radius:6px;margin-bottom:8px}
.tp-card h4{font-size:0.95rem;margin-bottom:4px}
/* Full team grid 3x5 */
.team-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px;margin-top:20px}
.member{position:relative;background:#fff;padding:14px;border-radius:8px;text-align:center;border:1px solid #eee;overflow:hidden;display:flex;flex-direction:column;transition:transform .25s ease,box-shadow .25s ease}
.member:hover{transform:translateY(-4px);box-shadow:0 10px 22px rgba(0,0,0,.08);border-color:#d0e2ff}
.member h4{margin-top:12px;margin-bottom:6px}
.member small{color:#666;margin-bottom:12px}
/* Project Description button */
.member .project-btn{margin-top:auto;padding:6px 12px;border-radius:6px;background:#086394;color:#fff;text-decoration:none;font-size:.9rem;transition:background-color .25s ease;width:auto;align-self:center;white-space:nowrap}
.member .project-btn:hover{background:#064874}
/* Team Modal */
.team-modal{display:none;position:fixed;inset:0;z-index:1000}
.team-modal.active{display:flex;align-items:center;justify-content:center}
.team-modal .modal-overlay{position:absolute;inset:0;background:rgba(10,20,30,0.55)}
.team-modal-box {position:relative;background:#fff;border-radius:10px;width:470px;height:750px;display:flex;flex-direction:column;overflow:hidden;padding-top:12px;}
.team-modal .modal-close{position:absolute;top:6px;right:8px;font-size:26px;background:transparent;border:none;cursor:pointer;color:#333;z-index:5}
.team-modal .modal-image{width:260px;height:260px;border-radius:50%;overflow:hidden;margin:12px auto 8px;flex-shrink:0}
.team-modal .modal-image img{width:100%;height:100%;object-fit:cover;display:block}
.team-modal h2{text-align:center;margin:6px 0 2px;font-size:1.2rem}
.team-modal .modal-project{text-align:center;color:#666;font-size:0.9rem;margin-bottom:8px}
.team-modal .modal-article{overflow-y:auto;padding:0 12px;margin-bottom:8px;flex:1}
/* LinkedIn button in basso a destra della card */
.member .linkedin-btn {position: absolute;bottom: 0px;right: 0px;width:64px;height:64px;border-radius:50%;overflow:hidden;}
.member .linkedin-btn img {width:100%;height:100%;object-fit:cover;}
/* photo + hover overlay */
.member .photo{position:relative;border-radius:8px;overflow:hidden;height:230px}
.member .photo img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s ease}
.member .photo .overlay{position:absolute;inset:0;background:linear-gradient(0deg,rgba(4,58,107,0.85),rgba(4,58,107,0.2));color:#fff;padding:16px;display:flex;align-items:center;justify-content:center;opacity:0;transform:translateY(10px);transition:all .25s ease;text-align:center}
.member:hover .photo img{transform:scale(1.07)}
.member:hover .photo .overlay{opacity:1;transform:translateY(0)}

/* ========== NEWS LIST & CARD ========== */
.news-list{display:flex;flex-direction:column;gap:18px}
.news-card{background:white;padding:18px;border-radius:10px;border:1px solid #eee;transition:transform .22s ease, box-shadow .22s ease}
.news-card:hover{transform:scale(1.01);box-shadow:0 8px 24px rgba(0,0,0,0.06)}
.news-title{font-size:1.25rem;margin-bottom:8px}
.news-card .meta{color:#666;font-size:0.9rem;margin-bottom:10px}
.share-btn{width:28px;height:28px;border:none;background:#e9f2ff;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;position:absolute;bottom:12px;right:12px;font-size:16px;}
.news-card{position:relative;}
.news-cover {width: 100%;height: 220px;overflow: hidden;border-radius: 10px 10px 0 0;}
.news-cover img {width: 100%;height: 100%;object-fit: cover;transition: transform .3s ease;}
.news-card:hover .news-cover img {transform: scale(1.05);}
.news-actions {display: flex;align-items: center;justify-content: space-between;margin-top: 14px;}
.share-btn img {width: 28px;height: 28px;display: block;transition: transform .2s ease, filter .2s ease;}
.share-btn:hover img {transform: scale(1.1);filter: brightness(1.1);}

/* ========== NEWS MODAL ========== */
.news-modal.hidden{display:none}
.news-modal .modal-overlay{position:fixed;inset:0;background:rgba(10,20,30,0.55)}
.news-modal .modal-box{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(1000px,94%);height:min(80vh,900px);z-index:1000;display:flex;align-items:center;justify-content:center;}
.modal-inner{display:flex;width:100%;height:100%;background:white;border-radius:10px;overflow:hidden;position:relative}
.modal-close{position:absolute;right:10px;top:6px;border:none;background:transparent;font-size:26px;cursor:pointer;color:#333;z-index:5}
.modal-progress{width:40px;background:#f6f9fc;display:flex;align-items:flex-start;justify-content:center;padding:8px}
.progress-bar{width:6px;background:#0051a8;border-radius:6px;height:0;transition:height .1s linear}
.modal-content{flex:1;padding:22px;overflow:hidden;display:flex;flex-direction:column}
.modal-article{overflow:auto;padding-right:12px;height:100%}
.modal-article p{margin-bottom:12px}
.modal-close-bottom{margin-top:18px;text-align:center}
/* Modal banner image */
.modal-image {width: 100%;height: 280px;overflow: hidden;border-radius: 8px 8px 0 0;margin-bottom: 16px;}
.modal-image img {width: 100%;height: 100%;object-fit: cover;display: block;}

/* ========== POSITIONS & COUNTDOWN ========== */
.cta-section{display:flex;gap:18px;align-items:center;justify-content:space-between}
.cta-left{flex:1}
.cta-right{width:320px}
.countdown, .countdown-large{display:flex;gap:8px;background:#fff;padding:12px;border-radius:8px;border:1px solid #eee;justify-content:center;width: max-content;margin: 0 auto;}
.cd-item{text-align:center;padding:6px 12px;border-radius:6px}
.cd-item span{display:block;font-weight:700;font-size:1.2rem}
.countdown-large .cd-item span{font-size:1.6rem}
/* positions list */
.positions{margin-top:20px;display:flex;flex-direction:column;gap:18px}
.position{background:#fff;padding:18px;border-radius:8px;border:1px solid #eee}
.position h3{margin-bottom:6px}
.pos-meta{color:#666;margin-bottom:8px}
.pos-actions{margin-top:10px}

/* ========== CONTACT FORM ========== */
.contact-grid{display:flex;gap:40px;flex-wrap:wrap}
.contact-list{flex:1 1 250px}
.contact-list ul{list-style:none;padding:0;margin:0}
.contact-list li{margin-bottom:.5em}
.contact-list a{color:#0051a8;text-decoration:none;cursor:pointer}
.contact-list a:hover{text-decoration:underline}
.contact-entry{margin-bottom:1.2em}
.contact-name{font-weight:700;color:#064b6f}
.contact-entry a{display:block;color:#0051a8;text-decoration:none;margin-top:0.2em}
.contact-entry a:hover{text-decoration:underline}
.contact-form-wrapper{flex:2 1 250px}
.contact-form input,.contact-form textarea{width:100%;padding:8px;margin-bottom:12px;border:1px solid #ccc;border-radius:4px;font-size:.9rem}
.contact-form button{cursor:pointer}
@media(max-width:800px){.contact-grid{flex-direction:column}}

/* ========== FOOTER ========== */
.site-footer{background:#064b6f;color:#e6f4ff;padding:40px 0 20px;font-size:.9rem;line-height:1.5}
.footer-grid{display:flex;justify-content:space-between;align-items:flex-start;gap:40px;flex-wrap:nowrap}
.footer-col{flex:1}
.footer-brand{font-size:1.2rem;font-weight:700;margin-bottom:12px}
.footer-brand .muted{font-weight:400;color:#bfe0ff;margin-left:6px}
.footer-menu{list-style:none;padding:0;margin:0 0 16px}
.footer-menu li{margin:4px 0}
.footer-menu a{color:#e6f4ff;text-decoration:none}
.footer-menu a:hover{text-decoration:underline}
/* EU box con bandiera nel testo */
.footer-eu{max-width:420px}
.eu-flag{width:140px;float:left;margin:0 12px 8px 0}
.eu-text{font-size:.85rem;color:#d8edff}
/* Trademark */
.footer-trademark{text-align:center;margin:40px auto 0;width:100%;opacity:.85;font-size:.85rem}
/* Mobile */
@media(max-width:800px){
  .footer-grid{flex-wrap:wrap}
  .footer-col{flex:1 1 100%}
  .eu-flag{float:none;display:block;margin:0 auto 12px}
}
/* Toggle batteri */
.footer-toggle {margin-top: 14px;}
.bacteria-toggle {display: flex;align-items: center;gap: 10px;cursor: pointer;font-size: 0.85rem;color: #d8edff;user-select: none;}
.bacteria-toggle input {display: none;}
.bacteria-toggle .checkmark {width: 16px;height: 16px;border: 1.5px solid #bfe0ff;border-radius: 3px;position: relative;background: transparent;}
.bacteria-toggle input:checked + .checkmark::after {content: "";position: absolute;left: 4px;top: 1px;width: 4px;height: 8px;border: solid #bfe0ff;border-width: 0 2px 2px 0;transform: rotate(45deg);}

/* ========== RESPONSIVE ========== */
@media (max-width:1000px){
  .hero-grid{grid-template-columns:1fr}
  .three-cols{grid-template-columns:repeat(2,1fr)}
  .team-preview{grid-template-columns:repeat(3,1fr)}
  .team-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:700px){
  .three-cols{grid-template-columns:1fr}
  .team-preview{grid-template-columns:repeat(2,1fr)}
  .team-grid{grid-template-columns:1fr}
  .main-nav{display:none}
  .header-inner{justify-content:space-between}}

/* ========== ACCORDION POSITIONS ========== */
.accordion{border:1px solid #ddd;border-radius:8px;overflow:hidden;background:#fff;}
.acc-header{width:100%;background:#f6f9ff;border:none;padding:16px;text-align:left;font-size:1.2rem;cursor:pointer;display:flex;justify-content:space-between;align-items:center;}
.acc-header:hover{background:#ebf2ff;}
.acc-icon{font-weight:bold;font-size:1.4rem;}
/* accordion */
.acc-body {max-height: none;overflow: hidden;padding: 0 16px;box-sizing: border-box;height: 0;}
.acc-body.open {padding: 16px;}
.acc-body ul {padding-left: 24px !important;margin-left: 8px;}
.acc-body li {margin-bottom: 6px;line-height: 1.4;}

/* ========== SCROLL TO TOP ========== */
#scroll-top{position:fixed;bottom:80px;right:calc((100% - 1200px)/2);background:#0051a8;color:#fff;border:none;border-radius:50%;width:40px;height:40px;font-size:20px;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:100;box-shadow:0 4px 10px rgba(0,0,0,.2);transition:opacity .3s ease,transform .3s ease}
#scroll-top.show{display:flex;opacity:1}
#scroll-top:hover{background:#003f7f;transform:scale(1.1)}
@media(max-width:900px){#scroll-top{right:20px}}

/* ========== NETWORK LIST ========== */
.network-list {display:flex;flex-direction:column;gap:20px;margin-top:20px}
/* Scheda principale */
.network-card {height:140px;border-radius:6px;overflow:hidden;position:relative;cursor:pointer;transition:transform .22s ease,box-shadow .22s ease}
.network-card:hover {transform:scale(1.01);box-shadow:0 10px 28px rgba(0,0,0,0.08)}
.network-card-inner {display:flex;height:100%;position:relative;align-items:stretch;border-radius:10px;overflow:hidden;z-index:2}
.network-banner {position:absolute;top:0;right:0;height:100%;width:66.66%;background-size:cover;background-position:right center;background-repeat:no-repeat;z-index:0;pointer-events:none}
.network-banner::after {content:"";position:absolute;top:0;left:0;height:100%;width:100%;background:linear-gradient(to left, rgba(250,250,250,0) 0%, #fafafa 100%);z-index:1;pointer-events:none;outline:none;-webkit-tap-highlight-color:transparent}
/* Sezione immagine quadrata a sinistra */
.network-left {flex:0 0 120px;display:flex;justify-content:center;align-items:center;padding:8px;z-index:2;background:rgba(255,255,255,0.8)}
.network-left .network-icon {width:100%;height:100%;object-fit:contain;border-radius:6px}
/* Testi centrali */
.network-center {flex:1;padding:10px 16px;display:flex;flex-direction:column;justify-content:center;z-index:2;overflow:hidden;margin-right:50px}
.network-name,.network-contact {margin:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-moz-box;-moz-box-orient:vertical;line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}
.network-name {font-size:1.3rem;font-weight:700}
.network-contact {font-size:0.95rem;color:#333}
.network-contact a {color:#0051a8;text-decoration:underline}
.network-contact a:hover {color:#003f7f}
@media (max-width:600px){.network-name {font-size:1.1rem}.network-contact {font-size:0.85rem}}
@media (max-width:450px){.network-name {font-size:1rem}.network-contact {font-size:0.8rem}}

/* Banda verticale blu solida cliccabile a destra */
.network-link {position:absolute;top:0;right:0;width:50px;height:100%;display:flex;justify-content:center;align-items:center;background:#0051a8;color:#fff;text-decoration:none;font-size:1.6rem;font-weight:bold;z-index:3;transition:background .3s ease;border-radius:6px}
.network-link:hover {background:#003f7f}
.network-link-arrow {pointer-events:none}
