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

body.bg {
  font-family: "Comic Sans MS", "Comic Neue", Poppins, system-ui, sans-serif;
  color: #333;
  min-height: 100vh;
  background: linear-gradient(#aee3ff, #d9f4ff);
}

/* HEADER E MENU */

.site-header {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: #ffffffcc;
  border-bottom: 4px solid #8dd7ff;
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 90px;
  width: auto;
  display: block;
}

.nav-toggle {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: none;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #a35b00;
  margin: 4px 0;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav a {
  text-decoration: none;
  font-size: 18px;
  padding: 6px 14px;
  background: #ffe28a;
  border-radius: 15px;
  border: 2px solid #ffcc4d;
  color: #a35b00;
}

.nav a[aria-current="page"] {
  background: #ffdf70;
}

.nav a:hover {
  background: #ffdf70;
}

/* LAYOUT GENERALE */

.container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px 30px 20px;
}

/* HERO HOME */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  background: #fff;
  border-radius: 24px;
  border: 4px solid #ffecb3;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  padding: 24px;
}

.hero-text {
  flex: 2 1 260px;
}

.title {
  font-size: 2.4rem;
  margin-bottom: 8px;
  color: #c44e00;
}

.subtitle {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 14px;
}

.note {
  flex: 1 1 220px;
  background: #fffdf3;
  border-radius: 20px;
  border: 3px dashed #ffd54f;
  padding: 14px;
  font-size: 0.98rem;
}

/* CONTROLLI RICERCA */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.controls input[type="search"],
.controls select {
  padding: 10px 14px;
  min-width: 220px;
  border: 2px solid #8dd7ff;
  border-radius: 999px;
  background: #fff;
  font-size: 0.98rem;
}

.button {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
}

.button:hover {
  filter: brightness(1.05);
}

/* LISTA ARTICOLI HOME */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.card {
  grid-column: span 6;
  background: #fff;
  border-radius: 22px;
  border: 4px solid #ffecb3;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  transition: transform 0.15s ease-out;
}

.card .thumb {
  width: 100px;
  min-width: 100px;
  aspect-ratio: 1 / 1;
  background: #fff7ed;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card .thumb img {
  width: 80%;
  height: auto;
}

.card h3 {
  margin: 6px 0 4px 0;
  font-size: 1.05rem;
  color: #c44e00;
}

.card p {
  margin: 0;
  color: #555;
  font-size: 0.94rem;
}

.pills {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: #e0f2fe;
  border-radius: 999px;
  border: 2px solid #8dd7ff;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #2563eb;
}

/* PAGINE ARTICOLO */

.article {
  max-width: 840px;
  margin: 20px auto 30px auto;
}

.article .hero-figure {
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.article .hero-figure img {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.article h1 {
  margin-bottom: 8px;
  color: #c44e00;
}

.article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.article article {
  background: #fff;
  border-radius: 22px;
  border: 4px solid #ffecb3;
  padding: 20px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  line-height: 1.7;
  font-size: 0.98rem;
}

.article article p + p {
  margin-top: 10px;
}

.pdf-note {
  margin-top: 10px;
  color: #555;
  font-size: 0.9rem;
}

.pdf-note a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.pdf-note a:hover {
  text-decoration: underline;
}

/* PAGINA PROFILO */

.profile {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-top: 10px;
  background: #fff;
  padding: 24px;
  border-radius: 24px;
  border: 4px solid #ffecb3;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.profile-photo {
  flex: 1 1 260px;
  text-align: center;
}

.profile-photo img {
  width: 100%;
  max-width: 260px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.profile-text {
  flex: 2 1 320px;
  font-size: 1rem;
  line-height: 1.7;
}

.profile-text .title {
  font-size: 2rem;
}

/* FOOTER */

.site-footer {
  text-align: center;
  padding: 16px 10px 24px 10px;
  color: #555;
  font-size: 0.95rem;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  .grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .card {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .brand-logo {
    height: 70px;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 10px;
    padding: 10px;
    background: #ffffffee;
    border-radius: 16px;
    border: 2px solid #8dd7ff;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-left: 0;
    display: none;
  }

  .nav.nav-open {
    display: flex;
  }

  .nav a {
    font-size: 16px;
  }

  .container {
    margin-top: 20px;
    padding: 0 14px 24px 14px;
  }

  .hero {
    padding: 18px;
  }

  .profile {
    padding: 18px;
  }

  .profile-photo img,
  .article .hero-figure img {
    max-width: 220px;
  }
}

@media (max-width: 480px) {
  .site-header {
    flex-direction: row;
    gap: 8px;
  }

  .brand-logo {
    height: 60px;
  }

  .controls input[type="search"],
  .controls select {
    min-width: 100%;
  }
}
