/* BARRA LINK SOPRA LE CARD */
.top-links {
 background-color: #222;
  display: flex;
  justify-content: flex-end; /* allinea tutto a destra */
  gap: 15px;                 /* distanza tra i link */
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.top-links a {
  color: #0055aa;
  text-decoration: none;
  font-weight: bold;
}

.top-links a:hover {
  text-decoration: underline;
}


/* BODY & SFONDO LATERALE */

html, body {
  height: 100%;
  margin: 0;
  overflow-y: auto;    /* forza una sola scrollbar verticale */
  overflow-x: hidden;  /* elimina quella orizzontale */
}

body {
  background-color: #00008b; /* sfondo laterale */
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;

  min-height: 100vh;
  display: flex;
  flex-direction: column;

}

/* HEADER */

/* Header fisso sotto top-links */
header {
  position: fixed;
  top: 20px;             /* altezza della top-links */
  width: 100%;
 /* VECCHIO SFONDO background-color: #222; */

/*NUOVO SFONDO */
 background-color: rgba(244, 244, 244, 0.85); 
/* colore chiaro con 85% di opacità */


  z-index: 999;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;        /* centrato */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 20px;
}

.header-container .logo img {
  max-height: 60px;
  height: auto;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  text-decoration: none;
  color: #ffffff;
  font-weight: bold;
}

/* Spazio dal top per il body */
body {
  padding-top: 100px;  /* altezza top-links + header */
}

/* CONTENITORE CENTRALE */
.page-wrapper {
  background-color: #ffffff;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* CARD */

/* CARD CON SFONDO E TESTO LEGGIBILE */
.background-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-image: url('/img/resident_img.jpg'); /* cambia immagine se vuoi */
  background-size: cover;
  background-position: center;
  color: #fff;                  
  min-height: 250px;            
  display: flex;
  align-items: center;          
  justify-content: center;
  padding: 1rem;
}

/* Overlay scuro sull’intera card */
.background-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); /* overlay semi-trasparente */
  z-index: 0;
}

/* Contenuto sopra l’overlay */
.background-card .card-content {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.4); /* sfondo leggermente scuro dietro il testo */
  padding: 15px 20px;
  border-radius: 6px;
  max-width: 90%; /* non occupa tutta la card */
  text-align: center;
}

/* Testo con ombra per maggiore leggibilità */
.background-card .card-content h3,
.background-card .card-content p {
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

/* Bottone */
.background-card .btn {
  margin-top: 10px;
  align-self: center;
  color: #fff;
  background-color: #0055aa;
  padding: 8px 15px;
  border-radius: 4px;
  text-decoration: none;
}

.background-card .btn:hover {
  background-color: #003366;
}

.background-card .card-content h3,
.background-card .card-content p,
.background-card .card-content a {
  color: #fff !important;      /* sempre bianco */
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8); /* migliora la leggibilità */
}

.background-card .card-content a:hover {
  color: #ffd700 !important; /* ad esempio dorato al passaggio del mouse */
}




.card {
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:nth-child(odd) { background-color: #f9f9f9; }
.card:nth-child(even) { background-color: #e6f0ff; }

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Video dentro la card */
.card video {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  display: block;
}

/* Titoli con effetto ombra */
.card h3 {
  color: #003366;
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
  transition: text-shadow 0.3s;
}

.card:hover h3 {
  text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* Paragrafi con hover */
.card p {
  color: #333;
  font-size: 1rem;
  line-height: 1.5;
  transition: color 0.3s, transform 0.3s;
}

.card:hover p {
  color: #0055aa;
  transform: translateY(-2px);
}

/* Bottoni */
.card .btn {
  background: linear-gradient(90deg, #003366, #0055aa);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}

.card .btn:hover {
  background: linear-gradient(90deg, #0055aa, #003366);
  transform: translateY(-2px);
}

/* Su mobile: assicurati che ciascun pulsante prenda tutta la larghezza */
@media (max-width: 768px) {
  .card-button .btn {
    flex: 1 1 100%;
    min-width: 100%;
  }
}


/* Card laterale con immagine a sinistra e testo a destra */
.card.laterale {
  display: flex !important;       /* forza flexbox */
  flex-direction: row;            /* orizzontale: immagine + testo */
  align-items: flex-start;        /* allineamento verticale in alto */
  gap: 20px;                      /* spazio tra immagine e testo */
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  background-color: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Immagine della card laterale */
.card.laterale .card-image {
  width: 200px;                   /* larghezza immagine */
  height: auto;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;                 /* evita che l'immagine si riduca troppo */
}

/* Contenuto della card laterale */
.card.laterale .card-content {
  flex: 1;                        /* prende tutto lo spazio rimanente */
}

/* Titolo e testo */
.card.laterale h3 {
  margin-top: 0;
  color: #003366;
  font-size: 1.4rem;
}

.card.laterale p {
  color: #333;
  font-size: 1rem;
  line-height: 1.5;
}



.card-with-image {
  display: flex;
  align-items: flex-start;   /* allinea in alto testo e immagine */
  gap: 20px;                 /* spazio fra immagine e testo */
  margin-bottom: 20px;       /* distacco fra le card */
  scroll-margin-top: 100px; /* altezza dell'header */
  
}

.card-with-image .card-image {
  width: 40%;                /* immagine occupa il 40% */
  border-radius: 8px;        /* opzionale, angoli arrotondati */
}

.card-with-image .card-text {
  width: 60%;                /* testo occupa il 60% */
}

.card-with-video {
  display: flex;
  align-items: center;
  gap: 20px; /* spazio tra video e testo */
  margin-bottom: 2rem;
}

.card-media, .card-text {
  flex: 1;
}

.card-video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}



.site-footer {
  background-color: #222;
  color: #f1f1f1;
  padding: 40px 20px 20px;
  position: relative;   /* <--- era fixed, ora normale */
  bottom: auto;         /* reset */
  left: 0;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.4);
  font-size: 14px;
}


/* Container a colonne */
.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
}

/* Colonne */
.footer-column {
  flex: 1;
  min-width: 250px;
  margin: 0 20px;
}

.footer-column h3 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 16px;
}

.footer-column p, 
.footer-column a {
  color: #ccc;
  text-decoration: none;
}

.footer-column a:hover {
  color: #fff;
}

/* Lista link */
.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 8px;
}

/* Parte inferiore */
.footer-bottom {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid #444;
  padding-top: 10px;
  font-size: 12px;
  color: #aaa;
}


.footer-content {
  position: relative;
  text-align: center;
}

/* Icone ingranaggi */
.cog {
  position: absolute;
  color: rgba(255,255,255,0.08); /* trasparenza leggera */
  z-index: 0;
}

/* Primo ingranaggio */
.cog1 {
  font-size: 120px;
  top: 10px;
  left: 20%;
  animation: spin 40s linear infinite;
}

/* Secondo ingranaggio */
.cog2 {
  font-size: 90px;
  top: -5px;
  left: 50%;
  
}

/* Terzo ingranaggio */
.cog3 {
  font-size: 70px;
  top: 20px;
  right: 15%;
  
}

/* Testo sopra le icone */
.footer-content p {
  position: relative;
  z-index: 1;
}

/* Animazioni */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}





/* Font per titoli */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* Font per testo normale */
body, p, a, li, span {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
}

a, a:visited {
  color: #0073e6;   /* stesso colore per link normali e visitati */
  text-decoration: none; /* opzionale: rimuove la sottolineatura */
}

a:hover {
  color: #005bb5;   /* colore leggermente più scuro al passaggio del mouse */
}


/* FORM DEI CONTATTI */

.contact-form {
  max-width: 500px;
  margin: 30px auto;
  padding: 25px;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  font-family: 'Open Sans', sans-serif;
}

.contact-form h2 {
  text-align: center;
  margin-bottom: 20px;
  font-family: 'Montserrat', sans-serif;
  color: #003366;
}

.contact-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border 0.3s, box-shadow 0.3s;
  background-color: #fff;
  font-family: 'Open Sans', sans-serif;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: #0055aa;
  box-shadow: 0 0 5px rgba(0,85,170,0.3);
  outline: none;
}

.contact-form button,
.contact-form input[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: #0055aa;
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.contact-form button:hover,
.contact-form input[type="submit"]:hover {
  background-color: #003366;
  transform: translateY(-2px);
}

.timeline {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  position: relative;
}

.timeline h2 {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 40px;
}

/* Linea verticale */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background-color: #0055aa;
}

/* Singolo evento */
.timeline-event {
  position: relative;
  margin: 20px 0;
  width: 50%;
  padding: 10px 20px;
}

/* Eventi a sinistra e destra alternati */
.timeline-event:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-event:nth-child(even) {
  left: 50%;
  text-align: left;
}

/* Cerchio sull’anno */
.timeline-year {
  display: inline-block;
  background-color: #0055aa;
  color: #fff;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 50%;
  position: relative;
  top: 0;
  z-index: 1;
}

/* Contenuto evento */
.timeline-content {
  background-color: #e6f0ff;
  padding: 10px 15px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 10px;
}

/* Dispositivi piccoli / tablet */
@media (max-width: 1280px) {
  .site-footer {
    position: relative; /* diventa parte del flusso normale */
    bottom: auto;
  }
  body {
    padding-bottom: 20px; /* padding normale su tablet/mobile */
  }
}

/* Barra link in cima al sito */

/* Barra superiore top-links */
.top-links-container {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #222;
  z-index: 1000;

}

.top-links {
  max-width: 1200px;      /* stessa larghezza del contenitore centrale */
  margin: 0 auto;         /* centrata */
  display: flex;
  justify-content: flex-end;
  padding: 5px 20px;
  color: #fff;
}

.top-links a {
  color: #fff;
  text-decoration: none;
  margin-left: 20px;
}

/* Spazio per non coprire il contenuto */
body {
  padding-top: 35px;  /* altezza top-links + header */
}
/* Contenitore logo + testo */
.logo-text {
  display: flex;
  align-items: center; /* allinea verticalmente logo e testo */
  gap: 10px;           /* distanza tra logo e testo */
}

.logo-text img {
  max-height: 60px;
  height: auto;
}

.logo-text .tagline {
  font-size: 1rem;
  font-weight: 400;
  color: #ffffff;
  white-space: nowrap; /* impedisce il ritorno a capo */
}

/* SLIDER CSS-ONLY */
#landing-slider .slide {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slideAnimation 30s infinite;
}

#landing-slider .slide:nth-child(1) { animation-delay: 0s; }
#landing-slider .slide:nth-child(2) { animation-delay: 10s; }
#landing-slider .slide:nth-child(3) { animation-delay: 20s; }

@keyframes slideAnimation {
  0% { opacity: 1; }
  20% { opacity: 1; }
  23% { opacity: 0; }
  46% { opacity: 0; }
  49% { opacity: 1; }
  69% { opacity: 1; }
  72% { opacity: 0; }
  95% { opacity: 0; }
  100% { opacity: 1; }
}

.slider-text h1 {
  font-size: 3rem;
  margin: 0;
}

.slider-text p {
  font-size: 1.2rem;
  margin: 10px 0 0 0;
}

/* Contenitore flex per i box */
.slider-boxes {
  display: flex;
  justify-content: space-between; /* spazio tra i box */
  gap: 20px;                     /* margine tra i box */
  flex-wrap: wrap;               /* i box passano a capo su schermi piccoli */
  margin: 40px auto;
  max-width: 1200px;
}

/* Singolo box */
.slider-box {
  flex: 1;
  min-width: 250px;             /* mantiene dimensione minima */
  background-color: #f5f5f5;
  border-radius: 8px;
  text-align: center;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.slider-box img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 15px;
}

.slider-box h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.slider-box p {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: #333;
}

/* Wrapper solo per la pagina contatti */
.contact-wrapper {
  max-width: 100%;          /* occupa tutta la larghezza */
  margin: 0;
  padding: 40px 0;          /* un po’ di respiro sopra e sotto */
  background: url("/img/facciata1.jpg") center/cover no-repeat;
  position: relative;
}

/* Overlay trasparente sopra l'immagine */
.contact-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.6); /* bianco con trasparenza */
  z-index: 1;
}

/* Porta il contenuto sopra l’overlay */
.contact-wrapper .container {
  position: relative;
  z-index: 2;
}

/* La card rimane stretta e leggibile */
.contact-wrapper .card {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.footer-logo {
  max-width: 210px;   /* dimensione massima, regolabile */
  height: auto;
  margin-bottom: 10px;
  display: block;
}

.key-metrics {
  background: #f9f9f9;
  padding: 60px 20px;
}

.metrics-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap; /* Mobile responsive */
}

.metrics-icon {
  flex: 1;
  text-align: center;
}

.metrics-container {
  flex: 2;
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  text-align: center;
}

.metric h2 {
  font-size: 3rem;
  color: #003366;
  margin-bottom: 10px;
}

.metric p {
  font-size: 1.2rem;
  color: #555;
  margin: 0;
}


.card.service-box ul {
  list-style-type: disc;    /* Puntini classici */
  margin: 10px 0 0 20px;    /* Rientro dalla sinistra */
  padding: 0;
}

.card.service-box ul li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #444;              /* testo leggermente più scuro */
}

.team-skills {
  list-style: none;
  padding: 0;
  margin: 1em 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.team-skills li {
  background: #f0f4ff;
  border-left: 4px solid #2a5bd7;
  padding: 10px 15px;
  font-weight: 600;
  border-radius: 6px;
}

.full-width-card {
  width: 100% !important;   /* forza la larghezza completa */
  max-width: none !important; /* rimuove eventuali limiti */
  flex: none !important;     /* se usi flex, evita che sia ridotta */
}

/* CSS TAG CLOUD - versione compatta e multi-colore */

/* Contenitore della tag cloud */
.tag-cloud-wrapper {
  background-color: #f9f9f9;  /* stesso dello sfondo key metrics */
  padding: 30px 0;
  text-align: center;
}

/* Titolo della tag cloud */
.tag-cloud-title {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  color: #003366;
  margin-bottom: 15px;
  font-size: 1.6rem;
}

/* Area dei tag, più stretta per dare effetto nuvola */
.tag-cloud {
  display: inline-block;
  max-width: 600px;   /* larghezza più contenuta */
  text-align: center;
}

/* Tag singolo come link */
.tag-cloud a {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9rem;  /* font più piccolo */
  margin: 5px;
  transition: transform 0.2s, color 0.2s;
  font-weight: 600;
}

/* 8 colori diversi, leggibili su sfondo chiaro, senza usare arancio */
.tag-cloud a.color1 { color: #003366; }
.tag-cloud a.color2 { color: #0055aa; }
.tag-cloud a.color3 { color: #0077cc; }
.tag-cloud a.color4 { color: #0099ff; }
.tag-cloud a.color5 { color: #336699; }
.tag-cloud a.color6 { color: #339966; }
.tag-cloud a.color7 { color: #66cc99; }
.tag-cloud a.color8 { color: #669966; }

.tag-cloud a.tag-small { font-size: 0.8rem; }
.tag-cloud a.tag-medium { font-size: 0.95rem; }
.tag-cloud a.tag-large { font-size: 1.1rem; }

/* Hover */
.tag-cloud a:hover {
  transform: scale(1.2);
  color: #ff6600;  /* evidenza al passaggio */
  cursor: pointer;
}

/* Box sizing globale */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Tablet (esempio: max 1280px) */
@media (max-width: 1280px) {
  html {
    scroll-padding-top: 140px; /* header più alto */
  }
}

.welcome-intro {
  background: #f9fbfd;
  padding: 20px 40px; /* meno padding verticale, più orizzontale */
  margin: 30px auto;
  border-radius: 8px;
  text-align: center;
  max-width: 1200px; /* più largo */
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.welcome-intro h2 {
  font-size: 1.6rem;
  color: #003366;
  margin-bottom: 8px;
  line-height: 1.4;
}

.welcome-intro h2 {
  font-size: 1.8rem;
  color: #003366;
  margin-bottom: 0;
  line-height: 1.3;
}

.welcome-intro h3 {
  font-size: 1.1rem;
  color: #444;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* --- Header generale --- */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: relative;
}

header nav {
  display: none; /* nascosto di default */
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

header nav ul li a {
  display: block;
  padding: 10px 15px;
  color: #003366;
  text-decoration: none;
}

header nav ul li a:hover {
  background-color: #e0e0e0;
}

/* Toggle generici */
.menu-toggle, 
.menu-toggle-desktop {
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

/* Menu aperto (mobile e desktop) */
.menu-toggle.active + nav,
.menu-toggle-desktop.active + nav,
header nav.open {
  display: flex;
  flex-direction: column; /* voci verticali */
  gap: 2px;               /* distanza ravvicinata tra voci */
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f8f8f8;
  padding: 10px;
  z-index: 999;
  width: 100%;
}

/* --- Mobile --- */
@media (max-width: 991px) {
  .menu-toggle {
    display: block;
  }

  .menu-toggle-desktop {
    display: none;
  }

  /* Nasconde la tagline su mobile */
  .logo-text .tagline {
    display: none;
  }
}

/* --- Desktop --- */
@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }

  .menu-toggle-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    height: 100%;        /* alto quanto l’header */
    padding: 0 20px;     /* copre bene la larghezza del testo */
    font-size: 18px;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
    
  }

  /* Effetto hover */
  .menu-toggle-desktop:hover,
  .menu-toggle-desktop:focus,
  .menu-toggle-desktop:active {
    background-color: #111;
    color: #fff;
    transform: scale(1.05);
  }
}