body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #f8f8f8;
  color: #333;
}

.container {
  max-width: 900px; /* leggermente più largo per più spazio */
  margin: 2em auto; /* centrato con margine superiore/inferiore */
  padding: 1em 2em; /* più spazio laterale e sopra/sotto */
  border-radius: 8px; /* angoli arrotondati */
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* ombre leggere */
}
header {
  background: #222;
  color: white;
  padding: 0.7em 0; /* meno padding verticale */
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: padding 0.3s ease;
}

header.shrink {
  padding: 0.35em 0;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  transform-origin: top;
  transition: padding 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

header .container {
  max-width: 900px; /* uguale al container principale */
  margin: 0 auto;
  padding: 0 1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav#nav-menu a {
  color: white;
  margin: 0 0.5em;
  text-decoration: none;
}

nav#nav-menu {
  display: flex;
  align-items: center;
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
}

/* Responsive menu for small screens */
@media (max-width: 600px) {
  nav#nav-menu {
    display: none;
    flex-direction: column;
    background: #333;
    position: absolute;
    right: 1em;
    top: 3.5em;
    width: 150px;
    border-radius: 4px;
  }
  nav#nav-menu.open {
    display: flex;
  }
  #menu-toggle {
    display: block;
  }
}

section h2 {
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

article {
  background: white;
  padding: 1em;
  margin-bottom: 1em;
  border-radius: 5px;
  box-shadow: 0 0 5px #ccc;
}

/* Section: Experience, Projects, Contact, ... */
section.container {
  background: white;
  padding: 2em 2.5em;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  margin-bottom: 3em;
}

/* Footer */
footer {
  text-align: center;
  padding: 2em 1em;
  background: #222;
  color: white;
  margin-top: 4em;
}

/* Projects Section */

/* Toggle year button */
.project-year {
  margin-bottom: 1.5em;
}

.toggle-year {
  background: none;
  border: none;
  border-bottom: 2px solid #ddd;
  padding: 0.5em 1em;
  font-size: 1.15em;
  font-weight: 600;
  color: #444;
  width: 100%;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s ease, color 0.3s ease;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between; /* align text and arrow */
  border-radius: 5px 5px 0 0;
}

/* Arrow styling */
.toggle-year::after {
  content: "▶";
  font-size: 0.85em;
  transition: transform 0.3s ease, color 0.3s ease;
  color: #999;
}

/* Rotated arrow when expanded */
.toggle-year[aria-expanded="true"]::after {
  transform: rotate(90deg);
  color: #007acc;
}

/* Hover effect */
.toggle-year:hover {
  border-color: #007acc;
  color: #007acc;
}
.toggle-year:hover::after {
  color: #007acc;
}

/* Project list container */
.project-list {
  margin-top: 0.8em;  /* space above */
}

/* Individual project article inside list */
.project-list article {
  background: white;
  border: 1px solid #e5e5e5;
  padding: 1em 1.2em;
  margin: 0.6em 0;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.05);
  transition: box-shadow 0.3s ease;
}

.project-list article:hover {
  box-shadow: 0 4px 15px rgb(0 0 0 / 0.1);
}

.project-list article h3 {
  margin: 0 0 0.3em 0;
  font-weight: 700;
  color: #222;
}

.project-list article p {
  margin: 0;
  color: #555;
  font-size: 0.95em;
  line-height: 1.4;
}

/* Source & demo links in project list */
.project-list article p a {
  color: #007acc;
  text-decoration: none;
  font-weight: 500;
  margin-right: 1em;
  transition: color 0.3s ease;
}

.project-list article p a:hover,
.project-list article p a:focus {
  text-decoration: underline;
  outline: none;
}

/* Toggle view button */
.toggle-view-btn {
  margin-bottom: 1.6em;
  padding: 0.6em 1.6em;
  font-size: 1rem;
  color: #fff;
  background-color: #007acc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 122, 204, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: background-color 0.3s ease;
}
.toggle-view-btn:hover,
.toggle-view-btn:focus {
  background-color: #005fa3;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 95, 163, 0.7);
}


/* Projects table */

.projects-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 16px;
  font-family: Arial, sans-serif;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.projects-table thead th {
  background-color: #007acc;
  color: white;
  font-weight: 700;
  padding: 14px 20px;
  text-align: left;
  border-bottom: 3px solid #005fa3;
  user-select: none;
}

.projects-table tbody tr {
  background: #fdfefe;
  transition: background-color 0.3s ease;
  cursor: default;
  border: 1px solid #ececec;
  border-radius: 8px;
}

.projects-table tbody tr:hover {
  background-color: #e6f0ff;
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.projects-table th,
.projects-table td {
  padding: 12px 18px;
  vertical-align: middle;
  font-weight: 400;
  border: none;
}

.projects-table td a {
  color: #007acc;
  text-decoration: none;
  font-weight: 600;
  transition: text-decoration 0.3s ease;
}

.projects-table td a:hover,
.projects-table td a:focus {
  text-decoration: underline;
  outline: none;
}


/* Consistency improvements for links inside articles */
a {
  color: #007acc;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: #005fa3;
  text-decoration: underline;
  outline: none;
}
