/* Palette */
:root {
  --page-bg: #ffffff;          /* bianco interno */
  --outer-bg: #f5f5f2;         /* bianco sporco esterno */
  --text: #111111;             /* testo scuro */
  --header_bianco: #fbfbfb;  /* bianco titolo/footer */
  --black_title: #000000;     /* nero titolo/footer */
  --white: #ffffff;            /* bianco testo su sfondi scuri */
  --accent: #0a84ff;           /* accento focus/hover */
  --menu-hover-bg: #313131;    /* evidenziazione hover menu */
  --black: #1a1a1a;            /* nero menu attivo */
  --bg-section: #f9f9f9;      /* sfondo sezioni */
}

/* Reset tipografico minimo */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  background: var(--outer-bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

/* Contenitore pagina centrato e responsivo */
.page {
  max-width: 1024px;
  margin: 0 auto;
  background: var(--page-bg);
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* header, nav, main flessibile, footer */
  /* opzionale: leggero distacco dal bordo */
  min-height: 100vh;
}

/* Titolo (header) */
header {
  background: var(--header_bianco);
  color: var(--black_title);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 100px 1fr 100px; /* tre colonne: logo, titolo, spazio */
  align-items: center;
  gap: 16px;
}
.site-logo {
  width: 100px;
  height: 80px;
  justify-self: start;
}
.site-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.2px;
  justify-self: center;
}

/* Menu (nav) */
nav {
  background: var(--header_bianco);
  border-bottom: 1px solid #e6e6e6;
}
.menu {
  display: flex;
  gap: 0;
  padding: 0;
  list-style: none;
  margin: 0;
  align-items: center; /* allineati verticalmente */
  justify-content: center; /* centrati orizzontalmente */
  flex-wrap: wrap;
}
.menu a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.menu a:hover {
  background: var(--menu-hover-bg);
  color: var(--white);
}
.menu a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,132,255,0.35);
  background: var(--menu-hover-bg);
}
.menu a.active {
  background: var(--black);
  color: var(--white);
}
.menu a.active:hover {
  background: #222222;
}

/* Zona centrale (main) */
main {
  padding: 40px 24px;
}

/* Sezioni */
.section {
  margin-bottom: 50px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  padding: 30px 24px 24px;
  position: relative;
  background: var(--bg-section);
}
.section-title {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  margin: 0;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  color: var(--text);
  position: absolute;
  top: -14px;
  left: 20px;
}

/* Contenitore riquadri */
.cards-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 24px;
  flex-wrap: wrap;
}

/* Singolo riquadro */
.card {
  flex: 0 1 280px;
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Placeholder immagine */
.card-image {
  width: 120px;
  height: 80px;
  margin: 0 auto 16px;
  background: #e74c3c;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 4px;
}

/* Titolo riquadro */
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

/* Contenuto riquadro */
.card-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin: 0;
}

/* Footer */
footer {
  background: var(--black);
  color: var(--white);
  padding: 20px;
}
.footer-block {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  line-height: 1.4;
}
.footer-left,
.footer-right {
  flex: 1;
}
.footer-left {
  text-align: left;
}
.footer-right {
  text-align: right;
}
.footer-block p {
  margin: 0 0 6px 0;
}
@media (max-width: 640px) {
  .footer-block {
    flex-direction: column;
    gap: 20px;
  }
  .footer-left,
  .footer-right {
    text-align: center;
  }
}

/* Piccola ottimizzazione per schermi molto grandi: respira intorno alla pagina */
@media (min-width: 1100px) {
  body { padding: 16px 0; }
}

/* Pagina Contatti */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 20px;
}
@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info h3 {
  font-size: 1.5rem;
  margin: 0 0 24px 0;
  color: var(--black_title);
}

.contact-block {
  margin-bottom: 24px;
}

.contact-block h4 {
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  color: var(--text);
  font-weight: 600;
}

.contact-block p {
  margin: 4px 0;
  line-height: 1.6;
}

.contact-block a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease;
}

.contact-block a:hover {
  color: #0b3d91;
  text-decoration: underline;
}

.contact-map {
  min-height: 450px;
}

.contact-map iframe {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
