/* BARRA LINK SOPRA LE CARD */
.top-links {
  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;
}

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: 35px;             /* altezza della top-links */
  width: 100%;
  background-color: #f4f4f4;
  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: 10px 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: #333;
  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);
}

/* 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;
}




.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 {
  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;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #0055aa;
  box-shadow: 0 0 5px rgba(0,85,170,0.3);
  outline: none;
}

.contact-form button {
  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 {
  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: 100px;  /* 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: #333;
  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;
}


