/* Fit4MedRob-inspired institutional style */
:root {
  --primary-blue: #0066b3;
  --secondary-blue: #009fe3;
  --background: #fff;
  --text: #222;
  --header-height: 64px;
  --font-family: 'Segoe UI', 'Arial', sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text);
}

header {
  background: var(--primary-blue);
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  height: 42px;
  margin-right: 2.0rem;
}

nav {
  margin-left: auto;
}
nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 2rem;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
}
nav a:hover,
nav a.active {
  color: var(--secondary-blue);
  text-decoration: underline;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1, h2, h3, h4 {
  color: var(--primary-blue);
  font-family: var(--font-family);
}

ul {
  padding-left: 1.5rem;
}

footer {
  background: #f4f4f4;
  color: #222;
  text-align: center;
  padding: 1.5rem 0 0.5rem 0;
  font-size: 0.95rem;
  margin-top: 3rem;
  border-top: 1px solid #e0e0e0;
}

/* Contenitore loghi */
.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

/* Menu Desktop */
#main-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto; /* Spinge il menu a destra */
}

/* Pulsante menu mobile */
.menu-toggle {
  display: none; /* Nascosto di default */
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 1rem;
  color: #333;
}

/* Stile per mobile */
@media (max-width: 768px) {
  header {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    position: relative;
  }
  
  /* Nascondi il menu normale su mobile */
  #main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    flex-direction: column;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    z-index: 1000;
  }
  
  /* Mostra il menu quando attivo */
  #main-nav.active {
    display: flex;
  }
  
  /* Stile dei link del menu */
  #main-nav a {
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
  }
  
  #main-nav a:last-child {
    border-bottom: none;
  }
  
  #main-nav a:hover {
    background-color: #f8f8f8;
  }
  
  /* Mostra il pulsante menu su mobile */
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  
  /* Regola le dimensioni dei loghi su mobile */
  .logo {
    height: 36px;
  }
  
  /* Assicura che il pulsante menu sia sempre visibile */
  .menu-toggle {
    z-index: 1001;
  }
}

.footer-greenbar {
  background: #009b4e; /* Verde istituzionale */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-greenbar img {
  height: 70px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.2s;
  display: inline-block;
  vertical-align: middle;
  margin: 0 15px;
}

.footer-greenbar img:hover {
  opacity: 1;
}

/* Stile per mobile */
@media (max-width: 768px) {
  .footer-greenbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    gap: 1.5rem 1rem;
    padding: 1.2rem 0.5rem;
  }
  
  .footer-greenbar img {
    height: 50px;
    max-width: 180px;
    margin: 10px auto;
  }
  
  /* Allinea i loghi in due righe da due */
  .footer-greenbar img:nth-child(odd) {
    justify-self: end;
    margin-right: 0.5rem;
  }
  
  .footer-greenbar img:nth-child(even) {
    justify-self: start;
    margin-left: 0.5rem;
  }
}
