:root {
  --primario: #1565c0;
  --link: #1565c0;
  --testo: #2b2b2b;
  --testo-grigio: #717171;
  --sfondo: #ffffff;
  --sfondo-grigio: #f7f7f7;
  --nav-sfondo: #ffffff;
  --bordo: #e6e6e6;
  --titolo-contatti: #404040;
}

/* Tema scuro esplicito */
:root[data-theme="dark"] {
  --primario: #64b5f6;
  --link: #8ab4f8;
  --testo: #d6d6d6;
  --testo-grigio: #9a9a9a;
  --sfondo: #1e2127;
  --sfondo-grigio: #181a1f;
  --nav-sfondo: #23262d;
  --bordo: #33363d;
  --titolo-contatti: #c4c4c4;
}

/* Tema automatico: segue il sistema */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --primario: #64b5f6;
    --link: #8ab4f8;
    --testo: #d6d6d6;
    --testo-grigio: #9a9a9a;
    --sfondo: #1e2127;
    --sfondo-grigio: #181a1f;
    --nav-sfondo: #23262d;
    --bordo: #33363d;
    --titolo-contatti: #c4c4c4;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--testo);
  background: var(--sfondo);
  line-height: 1.65;
  font-size: 1.05rem;
  transition: background .2s, color .2s;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Navbar — sticky, come Wowchemy */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-sfondo);
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.11);
}
.site-header nav { display: flex; align-items: center; height: 4.4rem; }
.brand {
  color: var(--testo); text-decoration: none;
  font-size: 1.35rem; font-weight: 700;
  margin-right: 2.5rem;
}
.nav-links { flex: 1; }
.nav-links a {
  color: var(--testo-grigio); text-decoration: none; margin-right: 1.6rem;
  font-size: 1rem; font-weight: 500;
}
.nav-links a.active, .nav-links a:hover { color: var(--primario); }

/* Interruttore tema (chiaro / scuro / automatico) e hamburger */
#theme-toggle, #nav-burger {
  background: none; border: none; cursor: pointer;
  color: var(--testo-grigio); padding: .4rem; line-height: 0;
}
#nav-burger { display: none; }
#nav-burger svg { width: 1.35rem; height: 1.35rem; }
#nav-burger span { display: none; }
#nav-burger[aria-expanded="false"] .ni-bars { display: inline; }
#nav-burger[aria-expanded="true"] .ni-close { display: inline; }
#nav-burger:hover { color: var(--primario); }
#theme-toggle:hover { color: var(--primario); }
#theme-toggle svg { width: 1.25rem; height: 1.25rem; }
#theme-toggle span { display: none; }
:root[data-theme="auto"] #theme-toggle .ti-auto { display: inline; }
:root[data-theme="light"] #theme-toggle .ti-sun { display: inline; }
:root[data-theme="dark"] #theme-toggle .ti-moon { display: inline; }

/* Sezione about — due colonne come il widget Wowchemy */
.about {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 3rem;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}
.about-left { text-align: center; }
.avatar {
  width: 270px; height: 270px; max-width: 100%;
  border-radius: 50%; object-fit: cover;
}
.about-left h1 {
  margin-top: 1.5rem;
  font-size: 2.1rem; font-weight: 400; letter-spacing: .01em;
}
.role { font-size: 1.15rem; color: var(--testo-grigio); }
.org a { color: var(--link); text-decoration: none; }
.org a:hover { text-decoration: underline; }
.social { margin-top: 1.2rem; }
.social a { display: inline-block; margin: 0 .5rem; color: var(--primario); }
.social svg { width: 2rem; height: 2rem; }
.social a:hover { opacity: .8; }

.bio { margin-bottom: 1.4rem; }

.columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  margin-top: 2rem;
}
.columns h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: .9rem; }
ul.interessi { padding-left: 1.4rem; }
ul.interessi li { padding: .15rem 0; }
ul.edu { list-style: none; }
ul.edu li { display: flex; gap: .9rem; align-items: flex-start; padding: .2rem 0; }
.edu-icon svg { width: 1.7rem; height: 1.7rem; color: var(--testo); margin-top: .3rem; }
.edu-title { display: block; }
.edu-inst { display: block; color: var(--testo-grigio); font-size: .92rem; }

/* Collaboratori — righe: foto a sinistra, testo a destra (come il profilo in home) */
.people { padding-top: 3.5rem; padding-bottom: 4rem; }
.page-title {
  font-size: 2.1rem; font-weight: 400;
  margin-bottom: 2.5rem;
}
.people-list { display: flex; flex-direction: column; gap: 3rem; }
.person {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--bordo);
}
.person:last-child { border-bottom: none; padding-bottom: 0; }
.person-left { text-align: center; }
.person-photo {
  width: 220px; height: 220px; max-width: 100%;
  border-radius: 50%; object-fit: cover;
}
.person-iniziali {
  width: 220px; height: 220px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sfondo-grigio); border: 2px solid var(--bordo);
  color: var(--primario); font-size: 3.4rem; font-weight: 500; letter-spacing: .04em;
}
.person h2 { font-size: 1.6rem; font-weight: 500; }
.person .role { margin-bottom: .9rem; }
.person-bio { max-width: 46rem; }
.person-sito { margin-top: .5rem; }
.person-sito a { color: var(--link); text-decoration: none; font-weight: 500; }
.person-sito a:hover { text-decoration: underline; }
.person-contatti { margin-top: .6rem; }
.person-contatti p { margin: .15rem 0; }
.person-contatti a { color: var(--link); text-decoration: none; }
.person-contatti a:hover { text-decoration: underline; }
.person-orari { color: var(--testo-grigio); font-size: .95em; }
.person .social { margin-top: 1rem; }
.person .social a { margin: 0 1rem 0 0; }
.person .social svg { width: 1.6rem; height: 1.6rem; }
@media (max-width: 700px) {
  .person { grid-template-columns: 1fr; gap: 1.2rem; }
  .person-right { text-align: center; }
  .person .social a { margin: 0 .5rem; }
}

/* Contatti — titolo grande a sinistra, righe a icone */
.contact { background: var(--sfondo-grigio); border-top: 1px solid var(--bordo); }
.contact-inner {
  display: grid; grid-template-columns: 1fr 2fr; gap: 3rem;
  padding-top: 4rem; padding-bottom: 4rem;
}
.contact-title { font-size: 3rem; font-weight: 300; color: var(--titolo-contatti); }
.contact-list { list-style: none; }
.contact-list li {
  display: flex; align-items: flex-start; gap: 1.1rem;
  margin-bottom: 1.3rem;
}
.c-icon svg { width: 1.6rem; height: 1.6rem; color: var(--testo); margin-top: .15rem; }
.contact-list a { color: var(--link); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.map iframe {
  width: 100%; height: 400px; border: 1px solid var(--bordo);
  display: block; background: #e9e9e9;
}
:root[data-theme="dark"] .map iframe { filter: brightness(.8) contrast(1.05); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .map iframe { filter: brightness(.8) contrast(1.05); }
}
.map-note { font-size: .85rem; margin-top: .35rem; }
.map-note a { color: var(--link); text-decoration: none; }

/* Footer */
.site-footer {
  background: var(--nav-sfondo); border-top: 1px solid var(--bordo);
  padding: 1.5rem 0; text-align: center;
  font-size: .9rem; color: var(--testo-grigio);
}
.site-footer a { color: var(--link); text-decoration: none; }

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-title { font-size: 2.2rem; }
}
@media (max-width: 640px) {
  .columns { grid-template-columns: 1fr; }
}

/* Menu hamburger su mobile */
@media (max-width: 700px) {
  #nav-burger { display: block; margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute; top: 4.4rem; left: 0; right: 0;
    background: var(--nav-sfondo);
    border-bottom: 1px solid var(--bordo);
    box-shadow: 0 .5rem .75rem rgba(0,0,0,.1);
    padding: .4rem 1.25rem .8rem;
  }
  .nav-links.open { display: block; }
  .nav-links a {
    display: block; margin: 0; padding: .7rem 0;
    border-bottom: 1px solid var(--bordo);
    font-size: 1rem;
  }
  .nav-links a:last-child { border-bottom: none; }
}
