:root {
  /* Neutral Warm Palette */
  --primary-bg: #404040;       /* Charcoal Gray - Header/Footer */
  --hover-bg: #6d6d5e;         /* Taupe Gray - Hover states */
  --secondary-bg: #5a5a4b;     /* Warm Medium Gray - Secondary elements */
  --primary-text: #333333;     /* Dark Gray - Main text */
  --light-text: #f5f5eb;       /* Soft Ivory - Text on dark */
  --accent-color: #404040;     /* Dark Gray - Buttons/Borders */
  --accent-hover: #5a5a4b;     /* Medium Taupe - Button hover */
  --active-color: #6d6d5e;     /* Warm Gray - Active links */
  --visited-color: #5a5a4b;    /* Matching secondary color */
  --background: #f0f0e6;       /* Warm Off-White - Page background */
  --link-default: #4a4a4a;     /* Slightly lighter than primary text */
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  min-height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  background: var(--background);
  color: var(--primary-text);
}
main {
  flex: 1 0 auto;
}

/* HEADER */
.main-header {
  background: var(--primary-bg);
  color: var(--light-text);
  padding: 1rem;
  text-align: center;
}
.main-header img {
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.main-header h1 {
  margin-bottom: 0.5rem;
}

/* NAVIGAZIONE */
.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.main-nav ul li a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: bold;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
  background: var(--hover-bg);
}

/* CONTENITORE GENERALE */
.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* FOOTER */
.main-footer {
  background: var(--primary-bg);
  color: var(--light-text);
  text-align: center;
  padding: 1rem;
  flex-shrink: 0;
}
.main-footer a {
  color: var(--light-text); 
  text-decoration: none; 
}

.main-footer a:hover {
  text-decoration: underline; 
  color: var(--light-text); 
}


/* SEZIONE CONTATTI E CHI-SIAMO */
.section-contact h2,
.section-chi-siamo h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-bg);
  margin-bottom: 1.5rem;
}

/* GRIGLIA TEAM (BIG e 3x2) */
.team-big-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.team-big-cards .card {
  background: var(--light-text);
  border: 1px solid #ddd;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  max-width: 100%;
  font-size: 1.1rem;
}
.team-big-cards .card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-bg);
  text-align: center;
  font-size: 1.3rem;
}
.team-big-cards .card p {
  margin-bottom: 0.5rem;
  color: #555;
}
.team-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.team-grid-3x2 .card {
  background: var(--light-text);
  border: 1px solid #ddd;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  max-width: 300px;
}
.team-grid-3x2 .card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-bg);
  text-align: center;
}
.team-grid-3x2 .card p {
  margin-bottom: 0.5rem;
  color: #555;
}
.team-grid-3x2 .card a {
  color: var(--primary-bg);
  text-decoration: none;
  transition: color 0.2s;
}
.team-grid-3x2 .card a:hover {
  text-decoration: underline;
  color: var(--hover-bg);
}

/* SEZIONE GLOSSARIO */
.section-glossary {
  margin-top: 2rem;
}
.alphabet-nav {
  text-align: center;
  margin: 1.5rem 0 2rem;
}
.alphabet-nav a {
  display: inline-block;
  margin: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--primary-bg);
  border: 2px solid var(--primary-bg);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}
.alphabet-nav a:hover {
  background: var(--primary-bg);
  color: var(--light-text);
}
.alphabet-nav a:visited {
  background: transparent;
  color: var(--primary-bg);
  border: 2px solid var(--primary-bg);
}
.letter-section {
  margin-bottom: 2rem;
}
.letter-section h2 {
  font-size: 1.5rem;
  color: var(--primary-bg);
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}
.letter-section dl {
  margin-left: 1rem;
}
.letter-section dt {
  font-weight: bold;
  margin-top: 1rem;
  color: var(--primary-text);
}
.letter-section dd {
  margin: 0 0 1rem 1rem;
  line-height: 1.5;
  color: #555;
}

/* SEZIONE DOCUMENTI (Candidatura, RTB, PB, …) */
.section-doc h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-bg);
}
.section-doc .intro {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
}
.doc-grid-release {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.doc-grid-release .doc-card {
  width: 100%;
  text-align: center;
  background: var(--light-text);
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.doc-grid-archive {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.doc-grid-archive .doc-card {
  width: 100%;
  text-align: center;
  background: var(--light-text);
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.doc-grid-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.doc-card {
  background: var(--light-text);
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.doc-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-bg);
  text-align: center;
}
.doc-card p {
  margin-bottom: 0.5rem;
  color: #555;
}
.doc-card a {
  color: var(--primary-bg);
  text-decoration: none;
  transition: color 0.2s;
}
.doc-card a:hover {
  text-decoration: underline;
  color: var(--hover-bg);
}
.doc-subblock {
  margin-bottom: 1rem;
}
.doc-subblock h4 {
  margin-bottom: 0.5rem;
  color: var(--primary-text);
}
.doc-subblock ul {
  list-style: inside square;
  margin-left: 1rem;
  margin-top: 0.5rem;
}

/* SEZIONE HERO (HOME) */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  /* background: #dadada; */
  margin-bottom: 2rem;
}
.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-bg);
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--primary-text);
}
.hero a {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  background: var(--primary-bg); /* Usa il colore principale */
  color: var(--light-text);
  text-decoration: none;
  border-radius: 0.3rem;
  transition: background 0.3s, transform 0.1s;
  border: 1px solid var(--primary-bg); /* Bordo per visibilità */
}

.hero a:hover {
  background: var(--hover-bg); /* Stesso comportamento dei bottoni sotto */
  color: var(--light-text);
  transform: scale(1.05);
}

.hero a:active {
  background: var(--secondary-bg); /* Leggermente più scuro quando cliccato */
  color: var(--light-text);
  transform: scale(0.98);
}


/* HOME: CARD ORIZZONTALI */
.home-cards-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}
.horizontal-card {
  display: flex;
  align-items: center;
  background: var(--light-text);
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1.5rem;
}
.horizontal-card .card-badge {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  background: var(--primary-bg);
  border-radius: 50%;
  color: var(--light-text);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
}
.horizontal-card .card-content {
  flex: 1;
}
.horizontal-card .card-content h3 {
  margin-bottom: 0.3rem;
  color: var(--primary-bg);
  font-size: 1.6rem;
}
.horizontal-card .card-content .last-update {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 0.7rem;
}
.horizontal-card .card-content p {
  margin-bottom: 0.7rem;
  color: #555;
  line-height: 1.4;
}
.horizontal-card .card-content a.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--accent-color);
  color: var(--light-text);
  text-decoration: none;
  border-radius: 0.3rem;
  transition: background 0.3s;
}
.horizontal-card .card-content a.btn:hover {
  background: var(--accent-hover);
}

/* SEZIONE CONTATTI (GRADIENT) */
.contact-section {
  background: linear-gradient(135deg, #8e8e8e, #c2c2c2);
  padding: 3rem 1rem;
  color: var(--light-text);
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}
.contact-section h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #f5f5f5;
}
.contact-form {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-column {
  flex: 1 1 calc(50% - 1rem);
  display: flex;
  flex-direction: column;
}
.contact-form label {
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #f5f5f5;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
contact-form textarea {
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  outline: none;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  background: #f5f5f5;
  color: #333;
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}
.submit-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  color: #f5f5f5;
  background: var(--accent-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.3s;
  margin-top: 0.5rem;
}
.submit-btn:hover {
  opacity: 0.9;
}
/* LINK GLOBALI */
a {
  color: var(--link-default);
  transition: color 0.3s;
}
nav a.clicked {
  color: var(--active-color);
}
a:hover {
  color: var(--hover-bg);
}
a:visited {
  color: var(--visited-color);
}
a:active {
  color: var(--active-color);
}
.company-logo {
  max-width: 80%; /* Adatta la dimensione alla card */
  height: auto;
  display: block;
  margin: 1rem auto 0 auto; /* Centra il logo */
  max-height: 100px; /* Imposta un’altezza massima per evitare che diventi troppo grande */
  object-fit: contain; /* Mantiene la proporzione senza distorsioni */
}


.company-logo:hover {
  opacity: 1;  /* Rende il logo pienamente visibile al passaggio del mouse */
}
