/* =========================================
   1. PALETTE & BASE
========================================= */
:root{
  --blue:   #0a5aa4;
  --red:    #E2231A;
  --text:   #1C1C1C;
  --muted:  #6b7280;
  --bg:     #ffffff;
  --soft:   #f4f6f8;
  --radius: 14px;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --container: 90%;
  --max: 1200px;
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  overflow-x:hidden;
}

body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Helpers layout generali */
.container{
  width: var(--container);
  max-width: var(--max);
  margin: 0 auto;
}
.narrow{ max-width: 780px; margin: 0 auto; }
.section{ padding: 64px 0; }
.section-soft{ background: var(--soft); }
.section-title{
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  text-align: center;
  margin: 0 0 28px;
}

/* =========================================
   2. HEADER & NAV
========================================= */

.site-header{
  background:#fff;
  border-bottom:1px solid #e5e7eb;
  position:sticky;
  top:0;
  z-index:1000;
}
.nav-wrap{
  max-width:1200px;
  width:90%;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap:.6rem;
  text-decoration:none;
  color:inherit;
}
.brand-logo{
  height:115px;
  width:auto;
  display:block;
}
.brand-name{
  font-weight:800;
  letter-spacing:.2px;
}

/* Hamburger (mobile) */
.nav-toggle{
  background:none;
  border:0;
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:5px;
  cursor:pointer;
}
.nav-toggle span{
  width:26px;
  height:3px;
  background:#111;
  border-radius:2px;
}

/* Overlay mobile */
.nav-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0);
  opacity:0;
  visibility:hidden;
  transition:opacity .25s ease, background .25s ease, visibility 0s linear .25s;
  z-index:1990;
}
.nav-overlay.show{
  background:rgba(0,0,0,.35);
  opacity:1;
  visibility:visible;
  transition:opacity .25s ease, background .25s ease;
}

/* Nav off–canvas (MOBILE by default) */
.main-nav{
  position:fixed;
  top:0;
  right:0;
  height:100dvh;
  width:88vw;
  max-width:420px;
  background:#fff;
  border-left:1px solid #e5e7eb;

  transform:translateX(calc(100% + 60px));
  visibility:hidden;
  pointer-events:none;
  box-shadow:none;

  transition:transform .35s ease, visibility 0s linear .35s, box-shadow .35s ease;
  z-index:2000;
  display:block;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.main-nav.is-open{
  transform:translateX(0);
  visibility:visible;
  pointer-events:auto;
  box-shadow:-24px 0 48px rgba(0,0,0,.15);
  transition:transform .35s ease, visibility 0s, box-shadow .35s ease;
}

/* blocca scroll quando menu aperto */
.no-scroll{ overflow:hidden; }

/* Lista nav (mobile) */
.nav-list{
  list-style:none;
  margin:0;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:0;
}
.nav-item{
  border-bottom:1px solid #f0f2f5;
}
.nav-item > a,
.dropdown-toggle{
  text-decoration:none;
  color:#1C1C1C;
  font-weight:600;
  background:none;
  border:0;
  padding:14px 6px;
  width:100%;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
}

/* Submenu mobile (fisarmonica) */
.submenu{
  display:none;
  list-style:none;
  margin:6px 0 6px 14px;
  padding:6px 0 6px 12px;
  border-left:2px solid rgba(0,0,0,.15);
}
.nav-item.open > .submenu{ display:block; }
.submenu a,
.submenu .dropdown-toggle{
  text-decoration:none;
  color:#1C1C1C;
  font-weight:500;
  display:block;
  padding:6px 0;
}
.arrow{
  font-size:.85rem;
  transition:transform .2s ease;
}
.nav-item.open > .dropdown-toggle .arrow{ transform:rotate(180deg); }

/* Link “Servizi” in nav */
.main-nav a[href="#servizi"]{
  text-transform:uppercase;
  font-weight:600;
}

/* ===== DESKTOP NAV ===== */
@media (min-width:1024px){
  .nav-toggle{ display:none; }

  .main-nav{
    position:static;
    transform:none;
    visibility:visible;
    pointer-events:auto;
    box-shadow:none;
    height:auto;
    width:auto;
    max-width:none;
    border-left:0;
    overflow:visible;
  }

  .nav-overlay{ display:none; }

  .nav-list{
    flex-direction:row;
    align-items:center;
    gap:24px;
    padding:0;
  }
  .nav-item{
    border:0;
    position:relative;
  }

  .nav-item > a,
  .dropdown-toggle{
    width:auto;
    padding:8px 0;
    text-transform:uppercase;
    border-bottom:2px solid transparent;
  }

  .nav-item > a:hover,
  .dropdown-toggle:hover,
  .nav-item > a.active{
    color:#0a5aa4;
    border-bottom-color:#0a5aa4;
  }

  /* Dropdown desktop */
  .submenu{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    background:#fff;
    min-width:220px;
    margin:0;
    padding:10px 14px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    border-left:0;
    box-shadow:0 18px 36px rgba(0,0,0,.14);
  }
  .submenu a{
    padding:8px 0;
    white-space:nowrap;
  }

  .nav-item.has-dropdown > .dropdown-toggle{
    position:relative;
  }
  .nav-item.has-dropdown > .dropdown-toggle::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-12px;
    height:12px; /* ponte anti-gap */
  }

  .nav-item.has-dropdown:hover > .submenu,
  .nav-item.has-dropdown:focus-within > .submenu{
    display:block;
  }

  /* submenu di secondo livello */
  .submenu .has-dropdown{ position:relative; }
  .submenu .has-dropdown .submenu{
    top:0;
    left:100%;
    margin-left:8px;
  }
}

/* =========================================
   3. HERO SLIDER (HOME)
========================================= */

.hero-slider{
  position:relative;
  width:100%;
  height:100vh;
  overflow:hidden;
  background:#000;
}
.slider-background{
  position:absolute;
  inset:0;
}
.slide{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  opacity:0;
  animation: fadeSlide 60s ease-in-out infinite;
  will-change:opacity;
  backface-visibility:hidden;
  transform:translateZ(0);
}
/* 10 slide = 6s di ritardo ciascuna */
.slide:nth-child(1){ animation-delay: 0s;  }
.slide:nth-child(2){ animation-delay: 6s;  }
.slide:nth-child(3){ animation-delay:12s;  }
.slide:nth-child(4){ animation-delay:18s;  }
.slide:nth-child(5){ animation-delay:24s;  }
.slide:nth-child(6){ animation-delay:30s;  }
.slide:nth-child(7){ animation-delay:36s;  }
.slide:nth-child(8){ animation-delay:42s;  }
.slide:nth-child(9){ animation-delay:48s;  }
.slide:nth-child(10){ animation-delay:54s; }

@keyframes fadeSlide{
  0%{opacity:0}
  6%{opacity:1}
  12%{opacity:1}
  18%{opacity:0}
  100%{opacity:0}
}
.slide:first-child{ opacity:1; }

.hero-logo{
  position:relative;
  z-index:10;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.logo-wrap{
  position:relative;
  display:inline-block;
}
.logo-wrap::before{
  content:"";
  position:absolute;
  inset:-18%;
  border-radius:50%;
  pointer-events:none;
  background:radial-gradient(
    circle,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0.7) 25%,
    rgba(255,255,255,0.35) 45%,
    rgba(255,255,255,0.0) 75%
  );
  filter:blur(8px);
  z-index:0;
}
.logo-wrap img{
  position:relative;
  z-index:1;
  width:clamp(220px, 35vw, 400px);
  filter:drop-shadow(0 6px 20px rgba(0,0,0,.45));
}

/* HERO testuale (banda blu) */
.hero{
  background:var(--blue);
  color:#fff;
  padding:clamp(56px,6vw,96px) 0;
  text-align:center;
}
.hero-content{ max-width:900px; margin:0 auto; }
.hero h1{
  margin:0 0 12px;
  line-height:1.15;
  font-size:clamp(2rem, 1.1rem + 3vw, 3.2rem);
  font-weight:800;
  letter-spacing:.2px;
}
.hero p{
  opacity:.95;
  font-size:clamp(1rem, .9rem + .4vw, 1.15rem);
  margin:0 auto 22px;
}
.btn-primary{
  display:inline-block;
  background:var(--red);
  color:#fff;
  text-decoration:none;
  padding:.85rem 1.4rem;
  border-radius:10px;
  font-weight:700;
  letter-spacing:.3px;
  transition:.2s;
  box-shadow:0 6px 14px rgba(226,35,26,.25);
}
.btn-primary:hover{
  transform:translateY(-1px);
  filter:saturate(1.1);
}

/* Mobile hero slider */
@media (max-width:768px){
  .hero-slider{
    height:60vh;
    min-height:360px;
  }
  .hero-logo img{
    width:clamp(160px,50vw,240px);
  }
}

/* =========================================
   4. CARDS SERVIZI + SHOW MORE
========================================= */

.cards{
  display:grid;
  gap:18px;
  grid-template-columns:1fr;
}
.card{
  background:#fff;
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
  text-align:center;
}
.card-icon{
  width:64px;
  height:64px;
  margin:0 auto 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f2f6fb;
  border-radius:12px;
  box-shadow:var(--shadow);
  transition:.3s;
}
.card-icon img{
  width:60%;
  height:auto;
  object-fit:contain;
  filter:brightness(0) saturate(100%) invert(22%) sepia(96%) saturate(1660%) hue-rotate(191deg) brightness(93%) contrast(95%);
}
.card:hover .card-icon{
  transform:translateY(-2px);
  background:var(--blue);
}
.card:hover .card-icon img{
  filter:brightness(100%) invert(1);
}
.card h3{ margin:6px 0 6px; font-size:1.1rem; }
.card p{ color:var(--muted); font-size:.98rem; margin:0; }

/* grid responsive */
@media (min-width:640px){ .cards{ grid-template-columns: repeat(2,1fr); } }
@media (min-width:1024px){ .cards{ grid-template-columns: repeat(3,1fr); } }

/* servizi extra */
.extra-service{ display:none; }
.cards.show-all .extra-service{ display:block; }
.show-more-wrap{
  text-align:center;
  margin-top:24px;
}
.btn-secondary{
  display:inline-block;
  padding:.8rem 1.6rem;
  border-radius:999px;
  border:1px solid var(--blue);
  background:#fff;
  color:var(--blue);
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .2s ease, color .2s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-secondary:hover{
  background:var(--blue);
  color:#fff;
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(0,0,0,.12);
}

/* =========================================
   5. CHI SIAMO – fasce orizzontali
========================================= */

.chi-siamo-list{
  display:flex;
  flex-direction:column;
  gap:24px;
  margin-top:30px;
}
.chi-siamo-row{
  background:#f9fafb;
  padding:22px 26px;
  border-radius:14px;
  box-shadow:0 8px 18px rgba(0,0,0,0.08);
  transition:transform .25s ease, box-shadow .25s ease;
}
.chi-siamo-row:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 26px rgba(0,0,0,0.12);
}
.chi-siamo-row h3{
  text-align:center;
  margin:0 0 10px;
  font-size:1.35rem;
  color:#0a5aa4;
}
.chi-siamo-row p{
  margin:0;
  line-height:1.6;
  font-size:.98rem;
  color:#333;
  text-align:justify;
}
@media (max-width:768px){
  .chi-siamo-row{ padding:18px 16px; }
  .chi-siamo-row p{ text-align:left; }
}

/* =========================================
   6. PAGINA CORSI
========================================= */

.hero.hero-inner{
  background:var(--blue);
  color:#fff;
  padding:48px 0;
  text-align:center;
}
.hero.hero-inner h1{
  margin:0 0 10px;
  font-size:clamp(2rem, 1.3rem + 1.8vw, 2.6rem);
}
.hero.hero-inner p{
  max-width:720px;
  margin:0 auto;
  font-size:1rem;
}

.course-section .course-header{
  text-align:center;
  margin-bottom:20px;
}
.course-image{
  max-width:900px;
  margin:0 auto 18px;
  position:relative;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 10px 24px rgba(0,0,0,.15);
}
.course-image img{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
}
.course-image-wip .course-badge{
  position:absolute;
  inset:50% auto auto 50%;
  transform:translate(-50%, -50%);
  background:rgba(0,0,0,.7);
  color:#fff;
  padding:.6rem 1.4rem;
  border-radius:999px;
  font-weight:700;
  letter-spacing:.08em;
  font-size:.9rem;
  text-transform:uppercase;
}
.course-text{
  max-width:900px;
  margin:0 auto;
  font-size:.98rem;
  line-height:1.7;
}
.course-text p{ margin-bottom:10px; }
.course-text ul{ margin:0; padding-left:1.2rem; }
.course-text li{ margin-bottom:4px; }

@media (max-width:768px){
  .hero.hero-inner{ padding:36px 0; }
  .course-section{ padding:40px 0; }
  .course-image{ margin-bottom:14px; }
}

/* link senza underline ma stesso colore del testo */
.hid{
  text-decoration:none;
  color:inherit;
}

/* =========================================
   7. PAGINA SETTORI
========================================= */

.sectors-layout{
  display:flex;
  gap:2rem;
  margin-top:2rem;
}
.sectors-sidebar{
  flex:0 0 260px;
  position:sticky;
  top:90px;
  align-self:flex-start;
  background:#f9f9f9;
  border-radius:8px;
  padding:1rem 1.2rem;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}
.sectors-sidebar h3{
  margin-top:0;
  text-transform:uppercase;
  font-size:.9rem;
  letter-spacing:.05em;
}
.sectors-sidebar ul{
  list-style:none;
  margin:0;
  padding:0;
}
.sectors-sidebar li{ margin:.4rem 0; }
.sectors-sidebar a{
  text-decoration:none;
  color:#333;
  transition:color .2s;
}
.sectors-sidebar a:hover{
  color:#0a5aa4;
}
.sectors-content{
  flex:1;
  max-width:850px;
}
.sectors-content section{
  margin-bottom:3rem;
}
.sectors-content h2{
  font-size:1.4rem;
  margin-bottom:.5rem;
  border-left:4px solid #0a5aa4;
  padding-left:.6rem;
}
.sectors-content h3{ margin-top:1rem; }
.sectors-content p{ text-align:justify; }

@media (max-width:900px){
  .sectors-layout{ flex-direction:column; }
  .sectors-sidebar{
    position:static;
    width:100%;
    box-shadow:none;
    background:none;
    padding:0;
  }
}

/* =========================================
   8. PAGINA LAVORI
   - sezioni alternate img/testo
   - slider a dissolvenza automatico
========================================= */

.page-main{ padding-bottom:60px; }

.works-page{ background:#f9fafb; }

.works-hero{
  padding:64px 0 32px;
  text-align:center;
}
.works-title{
  margin:0 0 8px;
  font-size:clamp(2rem,1.4rem + 1.8vw,2.6rem);
  letter-spacing:.03em;
}
.works-subtitle{
  max-width:640px;
  margin:0 auto;
  color:#4b5563;
}

/* Layout sezione singola */
.work-section{
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:40px;

  max-width:1400px;
  margin:0 auto 80px auto;
  padding:0 20px;
}
.work-media,
.work-content{
  flex:1;
  min-width:0;
}

/* Slideshow a dissolvenza */
.work-media{
  max-width:420px;
  width:100%;
  height:260px;
  border-radius:20px 0 0 20px;   /* default: img a sinistra, arrotondata a sinistra */
  overflow:hidden;
  position:relative;
  background:#f2f5f7;
}
.fade-slider{
  position:relative;
  width:100%;
  height:100%;
}
.fade-slider .slide{
  position:absolute;
  inset:0;
  opacity:0;
  transition:opacity .7s ease-in-out;
  background:#f2f5f7;
}
.fade-slider .slide img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.fade-slider .slide.is-active{
  opacity:1;
  z-index:1;
}

/* Box testo */
.work-content{
  background:#0d5f7a;
  color:#fff;
  padding:40px;
  border-radius:0 20px 20px 0;   /* default: testo a destra, arrotondato a destra */
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.work-category-header{ margin-bottom:8px; }
.section-title-left{
  margin:0 0 6px;
  font-size:1.4rem;
}
.work-text h3{
  margin:0 0 8px;
  font-size:1.15rem;
}
.work-text p{ margin:0 0 8px; }

/* === SEZIONI PARI: IMMAGINE A DESTRA, ARROTONDATA A SINISTRA === */
.work-section:nth-of-type(even){
  flex-direction:row-reverse;
}
.work-section:nth-of-type(even) .work-media{
  border-radius:0 20px 20px 0;   /* img a destra → arrotondata a destra */
}
.work-section:nth-of-type(even) .work-content{
  border-radius:20px 0 0 20px;   /* testo a sinistra → arrotondato a sinistra */
}

/* Responsive lavori */
@media (max-width:900px){
  .work-section{
    flex-direction:column !important;
    max-width:100%;
  }
  .work-media,
  .work-content{
    border-radius:20px;
  }
  .work-media{
    max-width:100%;
    height:240px;
  }
}

/* =========================================
   9. FOOTER
========================================= */

.site-footer{
  background:#0b1d4d;
  color:#fff;
  padding:50px 30px 40px;
  font-size:.95rem;
}
.footer-grid,
.footer-container{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px,1fr));
  gap:40px;
  align-items:start;
}
.footer-col h3,
.footer-col h4{
  margin-bottom:15px;
  color:#fff;
}
.footer-col p,
.footer-col a{
  margin:6px 0;
  color:#fff;
  text-decoration:none;
}
.footer-col a:hover{ text-decoration:underline; }

.footer-center{
  text-align:center;
}
.footer-logo{
  width:150px;
  margin-bottom:12px;
}
.footer-dev{ margin:6px 0; }
.footer-credits{
  font-size:.85rem;
  line-height:1.5;
  color:#ddd;
}
.footer-right{ text-align:right; }

@media (max-width:768px){
  .footer-grid,
  .footer-container{
    grid-template-columns:1fr;
    text-align:center;
  }
  .footer-right{ text-align:center; }
  .footer-col{ margin-bottom:20px; }
}


.site-header {
  color: #1C1C1C;
}

.brand-name {
  color: #1C1C1C;
  font-size: 24;
  font-size: 1.35rem;
}