/* ===== Stile generale ===== */
body {
  font-family: "Courier New", Courier, monospace;
  margin: 0;
  background-color: #faf7f1; /* cream paper */
  color: #222;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ===== Navigazione ===== */
header {
  background-color: #faf7f1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background-color 0.4s ease, color 0.4s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-left a.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #111;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.nav-left a.logo:hover { color: #0070f3; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-right a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-right a:hover,
.nav-right a.active { color: #0070f3; }

/* ===== Pulsante tema ===== */
#theme-toggle {
  background-color: transparent;
  border: 1px solid #666;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

#theme-toggle:hover {
  background-color: #333;
  color: #faf7f1;
}

/* ===== Contenitore principale ===== */
.container {
  max-width: 850px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ===== Titoli e testo ===== */
h1, h2, h3 {
  font-family: "Courier New", Courier, monospace;
  font-weight: normal;
  color: #111;
}

h1 { font-size: 2.4rem; margin-bottom: 0.5rem; color: #444; }
h2 { font-size: 1.4rem; color: #333; margin-top: 2.5rem; border-bottom: 1px solid #ddd; padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; color: #333; }

p, li {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  color: #222;
}

ul li { margin-bottom: 0.6rem; }

/* ===== Link ===== */
a {
  color: #005ad6;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover { color: #003f99; text-decoration: underline; }


/* ===== Photo and Bio ===== */
.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 2rem auto 1.5rem auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.name-title {
  text-align: center;
  font-weight: bold;
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.affiliation {
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 2rem;
}

.bio {
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
  text-align: justify;
  text-justify: inter-word;
}


/* ===== Social Buttons ===== */
.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.social-btn {
  border: 1px solid #444;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  color: #222;
  font-size: 0.9rem;
  background: #f8f8f8;
  transition: all 0.25s ease;
}

.social-btn:hover {
  background-color: #0070f3;
  color: white;
  border-color: #0070f3;
}


/* ===== Footer ===== */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  margin-top: 3rem;
  padding: 2rem 0;
}


/* ===== Dark Mode ===== */
body.dark-mode {
  background-color: #000;
  color: #cacaca;
  font-family: "Courier New", Courier, monospace;
}

body.dark-mode header {
  background-color: #000;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-left a.logo { color: #a2ccf3; }
body.dark-mode .nav-right a { color: #cacaca; }
body.dark-mode .nav-right a:hover { color: #a2ccf3; }

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3 { color: #a2ccf3; }
body.dark-mode p, body.dark-mode li { color: #cacaca; }

body.dark-mode a { color: #a2ccf3; }
body.dark-mode a:hover { color: #c3e5ff; }

body.dark-mode .social-btn {
  background-color: transparent;
  border: 1px solid #a2ccf3;
  color: #a2ccf3;
}

body.dark-mode .social-btn:hover {
  background-color: #a2ccf3;
  color: #000;
}

body.dark-mode #theme-toggle {
  border-color: #a2ccf3;
  color: #a2ccf3;
}

body.dark-mode #theme-toggle:hover {
  background-color: #a2ccf3;
  color: #000;
}




/* ===== Layout Home e altre pagine ===== */

/* HOME PAGE — centrata, bio giustificata */
body.home-page .container {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

body.home-page .profile-photo {
  display: block;
  margin: 2rem auto 1.5rem auto;
}

body.home-page .affiliation {
  text-align: center;
  margin-bottom: 1.8rem;
}

body.home-page .bio {
  text-align: justify;
  text-justify: inter-word;
  margin: 0 auto 1.5rem auto;
  line-height: 1.8;
  color: inherit;
}

/* ALTRE PAGINE, testo allineato a sinistra */
body.content-page .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  text-align: left;
}

body.content-page h2 {
  margin-top: 2.5rem;
  color: inherit;
}

body.content-page p,
body.content-page ul,
body.content-page ol {
  text-align: left;
  margin-left: 0;
  padding-left: 0;
  line-height: 1.8;
}

body.content-page li {
  margin-bottom: 0.6rem;
}




/* ===== PDF Viewer ===== */
iframe {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
}

body.dark-mode iframe {
  background-color: #111;
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
}
