/* Stili globali */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: #bfbfbf;
  color: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.4;
}

/* Tipografia */
h1 {
  color: black;
  font-family: Roboto;
  text-align: center;
  font-weight: 400;
}

h2 {
  color: #000000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
  font-weight: 500;
}

h3 {
  margin: 0;
  padding-left: 70px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.subheadings h3 {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 400;
  margin: 4px 0 8px;
  color: black;
  padding-left: 0;
  line-height: 1.1;
}

h4 {
  color: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

h5 {
  color: #000000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: #29abe2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
  position: relative;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 10px 30px;
  flex-wrap: wrap;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-logo h6 {
  color: #333;
  margin: 0;
  font-weight: 600;
}

.navbar a {
  color: #000;
  position: relative;
  padding: 8px 12px;
  transition: color 0.3s ease;
}

.navbar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 100%;
  height: 2px;
  background-color: #29abe2;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.navbar a:hover {
  color: #29abe2;
}

.navbar a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.navbar-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar-links a {
  margin-left: 0;
  font-weight: 500;
}

/* Toggle (mobile) */
.navbar-toggle {
  display: none;
  font-size: 1.8rem;
  color: #333;
  cursor: pointer;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  background: #222;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 0 20px #29abe2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#searchInput {
  flex: 1 1 300px;
  padding: 12px 15px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  outline: none;
  background: #333;
  color: #ffffff;
}

#closeSearch {
  background: none;
  border: none;
  color: #29abe2;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

#closeSearch:hover {
  color: #6bd1ff;
}

/* Contenuti della pagina */
#dynamicBox {
  margin: 20px auto;
  transition: all 0.3s ease;
  border-radius: 10px;
}

#info {
  text-align: center;
  color: #ffffff;
  margin-top: 10px;
  font-size: 0.9rem;
  font-family: monospace;
}

.image-text-wrapper {
  width: 400px;
  margin: 0 auto;
  text-align: center;
  padding: 10px 0;
}

.image-text-wrapper img {
  display: block;
  margin: 0 auto 10px;
  max-width: 100%;
  height: auto;
}

.image-text-wrapper h3,
.image-text-wrapper h4 {
  margin: 0;
  padding: 0;
  color: #ffffff;
}

.afi-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  padding: 20px;
}

.afi-entry {
  text-align: center;
  width: 400px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #ffffff;
}

.afi-entry img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.afi-entry h3 {
  margin: 5px 0;
}

.hello-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 50vh;
  padding: 0 1rem;
  text-align: center;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.heading-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hello {
  font-size: 3rem;
  font-family: Roboto;
  color: black;
}

.hello i {
  font-size: 1.2rem;
  vertical-align: middle;
}

.subheadings h2 {
  font-size: 2rem;
  font-weight: 200;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: black;
}

.centered-img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

tr, td {
  text-align: center;
}

/* Liste (versione centrata con pallini) */
ul, ol, .lista-section .simple-list, .simple-list {
  list-style-type: disc !important;
  list-style-position: outside;
  padding-left: 1.5em !important;
  color: black;
  text-align: left;
  max-width: 900px;
  margin: 0 auto; /* Centra la lista orizzontalmente */
}

.lista-section .simple-list li, .simple-list li {
  display: list-item;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: black;
  white-space: normal;
  max-width: 100%;
  overflow-x: visible;
}

/* Note finali e donazioni */
.final-note {
  text-align: center;
  font-size: 1rem;
  margin-top: 2rem;
  color: black;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.donation-title {
  font-size: 24px;
  font-weight: 400;
  color: #000000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin-bottom: 8px;
  text-align: center;
}

.donation-subtitle {
  font-size: 16px;
  font-weight: 100;
  color: #000000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
  margin-bottom: 0.5rem;
}

.list-wrapper {
  margin: 0;
  padding: 0;
  display: block;
}

.clickable-horizontal a {
  display: inline-block;
  text-decoration: none;
  color: #0077cc;
  font-family: Arial, sans-serif;
}

.inline-img {
  vertical-align: middle;
  margin-right: 8px;
}

.inline-text {
  vertical-align: middle;
  font-size: 1rem;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: #0077cc;
  font-family: "Segoe UI", sans-serif;
  padding: 10px;
  transition: color 0.3s ease;
}

.link-box:hover {
  color: #005999;
}

.clickable-section {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  font-family: "Segoe UI", sans-serif;
}

.clickable-section img {
  flex-shrink: 0;
  border-radius: 8px;
  transform: translateY(40px);
}

.donate-text {
  font-family: Roboto;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: inherit;
}

.clickable-text:hover {
  color: #005999;
}

.donation-widget {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  text-decoration: none;
  font-family: "Segoe UI", sans-serif;
  color: #0077cc;
  box-shadow: none;
}

.clickable-text {
  font-size: 1rem;
}

.donation-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  transform: none !important;
  display: block;
}

.donation-widget:hover {
  color: #005999;
}

/* Responsive */
@media (max-width: 768px), (orientation: portrait) {
  .navbar-toggle {
    display: block;
  }

  .navbar-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #fff;
    padding: 10px 0;
  }

  .navbar-links.active {
    display: flex;
  }

  .navbar-links a {
    color: #000;
    padding: 10px 20px;
    border-top: 1px solid #eee;
  }
}