:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --brand2: #2563eb; 
  --border: #e2e8f0;
  --radius: 8px;
  --max: 1140px;
}

/* --- RESET & BASE --- */
* { 
  box-sizing: border-box; 
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

/* --- LAYOUT CONTAINERS --- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- NAVIGATION --- */
.nav {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--text);
}

.brand img { 
  height: 45px; 
  width: auto;
}

.navRight { 
  display: flex; 
  align-items: center; 
  gap: 32px;
}

.menu { 
  display: flex; 
  gap: 24px;
}

.menu a { 
  font-size: 0.9rem; 
  font-weight: 500; 
  text-decoration: none; 
  color: var(--text);
}

.menu a.active { 
  color: var(--brand2);
}

.lang { 
  display: flex; 
  gap: 8px; 
  font-size: 0.8rem; 
  font-weight: 700; 
  color: var(--muted);
}

.lang a.active { 
  color: var(--text);
}

/* --- FIX DROPDOWN DEFINITIVO --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  /* Aumentiamo l'area sensibile inferiore del trigger */
  padding-bottom: 15px; 
  margin-bottom: -15px;
  display: inline-block;
}

.dropdown-menu {
  display: none; 
  position: absolute;
  /* Posizionamento subito sotto il testo */
  top: 100%; 
  left: 0;
  background-color: #ffffff;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
  z-index: 1000;
  border: 1px solid var(--border);
  border-radius: 4px;
  /* Rimosso il margin-top che causava la chiusura */
  margin-top: 0; 
}

/* Ponte invisibile: mantiene il menu aperto mentre sposti il mouse verso il basso */
.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px;
}

.dropdown-menu a {
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
}

.dropdown-menu a:hover {
  background-color: #f8fafc;
  color: var(--brand2);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* --- HERO --- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 60px 0 40px;
}

.h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 16px 0; 
  letter-spacing: -0.02em;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 24px 0;
  max-width: 580px;
}

.hero-image img {
  border-radius: var(--radius);
  filter: grayscale(1);
  width: 100%;
}

/* --- SECTIONS & GRIDS --- */
.section-full {
  width: 100%;
  background: #f8fafc;
  padding: 60px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 32px 0;
}

/* Griglia per i Progetti (a coppie) */
.grid-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Griglia standard a 3 colonne */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.card:hover { 
  transform: translateY(-3px);
}

.card h3 { 
  margin: 0 0 12px 0; 
  font-size: 1.25rem;
}

.card p { 
  color: var(--muted); 
  font-size: 0.95rem; 
  margin: 0 0 20px 0; 
  flex-grow: 1;
}

.pill {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 600;
  align-self: flex-start;
}

/* --- BUTTONS --- */
.ctaRow { 
  display: flex; 
  gap: 16px;
}

.btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.btn.primary { 
  background: var(--text); 
  color: #fff; 
  border: none;
}

/* --- FOOTER --- */
.footer {
  background: #fff;
  padding: 40px 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links { 
  display: flex; 
  gap: 12px;
}

/* --- RESPONSIVE --- */
@media (max-width: 920px) {
  .hero { 
    grid-template-columns: 1fr; 
    text-align: center; 
  }
  
  .grid3, .grid-projects { 
    grid-template-columns: 1fr; 
  }
  
  .ctaRow { 
    justify-content: center; 
  }
  
  .nav-content { 
    flex-direction: column; 
    gap: 16px; 
  }
}


.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Assicurati che su mobile torni a colonna singola per leggibilità */
@media (max-width: 768px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}