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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  /* uguale o più dell’altezza del tuo header fisso */
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  font-size: 1em;
  color: #2c3e50;
  /*background: #f7f7f2;*/
}

header {
  /*background: #f7f7f2;*/
  background: white;
  text-align: center;
  border-bottom: 1px solid #e0e0d5;
}

#site-header {
  position: fixed;
  top: 0;
  width: 100%;
  /*background-color: #f7f7f2;*/
  align-items: center;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#logo {
  height: 140px;
  transition: height 0.3s ease;
}

#site-header.shrink #logo {
  height: 80px;
}


nav ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: #5d6f5f;
  padding: 10px;
  transition: color 0.2s;
  display: block;
  padding: 10px 16px;
  white-space: normal;
}

nav a:hover {
  color: #a49352;
}

nav a.active {
  color: #a49352;
}

/* --- Sottomenu --- */
nav li ul {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

/* Sottomenu secondario */
nav li ul li ul {
  left: 100%;
  top: 0;
}

/* --- Hover attivo SOLO su desktop --- */
@media (hover: hover) and (pointer: fine) {
  nav li:hover>ul {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s, 0s;
  }

  nav ul ul li a:hover {
    background-color: #e6e3d2;
    transition: background-color 0.2s ease;
  }
}

/* --- Mobile toggle attivo --- */
nav li.show>ul {
  visibility: visible;
  opacity: 1;
}

main {
  padding-top: 183px;
}

/* Info Banner */
.info-banner {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  background: linear-gradient(to right, #e6e3d2, #d5cda7);
  text-align: center;
}

.info-box {
  flex: 1 1 200px;
  margin: 10px;
  padding: 10px;
  color: #2c3e50;
}

.info-box h3 {
  font-size: 0.9em;
  color: #7b8584;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-box p {
  font-weight: bold;
}

section {
  text-align: center;
}

main h2,
section h2 {
  text-align: center;
  color: #2c3e50;
  font-family: "Arial", serif;
  font-optical-sizing: auto;
  font-weight: bold;
  font-size: 2.6em;
  font-style: normal;
}

section p {
  margin: 20px auto;
  font-size: 1.0em;
  line-height: 1.5em;
  text-align: justify;
}

section#nav2 {
  padding: 20px 0;
}

/* Buttons (like Publications, People, etc.) */
section#nav2 ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

section#nav2 ul li {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}


section#nav2 ul li a {
  background: #5d6f5f;
  color: white;
  padding: 5px 10px;
  border-radius: 10px;
  border-bottom: 1px solid #4a5a4c;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 400;
  gap: 5px;
}

section#nav2 ul li a:hover {
  background: #7b8584;
}

/* Search bar */
.search-bar {
  text-align: left;
  border-radius: 30px;
  background-color: #d5cda7;
  border: 6px solid #d5cda7;
  width: 250px;
  position: relative;
  display: flex;
}

.search-bar input[type=text] {
  padding-left: 15px;
  border-radius: 30px;
  border: 0px;
  width: 250px;
  background-color: rgba(255, 255, 255, 0.64);
  color: #7a7a7a;
  line-height: 45px;
  height: 45px;
  font-size: 14px;
}

.search-bar i {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 30px;
  background-color: #a49352;
  color: #fff;
  position: absolute;
  right: 0;
  height: 100%;
  top: 0;
  z-index: 2;
  height: 45px;
  width: 45px;
  transition: all 0.2s ease-in;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  background: linear-gradient(#d5cda7, #e6e3d2);
  padding: 10px 20px;
  text-align: center;
}

.info-card {
  background: transparent;
  padding: 0px;
  color: #2c3e50;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.info-card a {
  color: #7b8584;
  text-decoration: underline;
  font-weight: normal;
}


.info-card .icon {
  color: #fff;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.text-block h3 {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #7b8584;
  letter-spacing: 1px;
  margin: 5px 0;
  text-align: left;
}

.text-block p {
  margin: 0;
  color: #7b8584;
  font-size: 0.85rem;
}

.text-block h3 a {
  font-weight: bold;
  text-decoration: none;
}

.text-block p a {
  font-weight: normal;
  text-decoration: underline;
}

#description {
  margin: auto;
  width: 80%;
  max-width: 80%;
  margin-top: 30px;
  text-align: center;
}

#unipi_logo {
  width: 14em;
  margin-top: 20px;
}

.diagonal-divider {
  background-color: #f0f0e8;
  height: 100px;
  clip-path: polygon(0 0, 100% 100%, 100% 100%, 0 100%);
}

#contacts {
  background-color: #f0f0e8;
  text-align: center;
}

#contacts_logo {
  width: 10em;
  margin: 20px;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 10px 20px;
  text-align: center;
  margin: 40px auto;
  margin-bottom: 0px;
  width: 85%;
  max-width: 85%;
  padding-bottom: 50px;
}

.user-card {
  background: transparent;
  padding: 0px;
  color: #2c3e50;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.user-card a {
  color: #5d6f5f;
  text-decoration: none;
  font-weight: normal;
}

.user-card a:hover {
  text-decoration: underline;
}


.user-card .icon {
  color: #2c3e50;
  font-size: 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-card .text-block h3 {
  margin: 0 0 4px 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #2c3e50;
  letter-spacing: 1px;
  margin: 5px 0;
  text-align: left;
  padding: 2px 0 0 0;
  position: relative;
  margin: 0 0 16px 0;
  clear: none;
  letter-spacing: 1px;
  font-size: 1.25em;
  font-weight: 500;
}

.user-card .text-block p {
  margin: 0;
  color: #7b8584;
  font-size: 1rem;
}

#backToTop {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #2c3e50;
  transition: background 0.2s;
}

#backToTop:hover {
  background: #e6e3d2;
}

#backToTop i {
  pointer-events: none;
}

/* Footer */
footer {
  padding: 15px 0 30px 0;
  padding-bottom: 0px;
  text-align: center;
  font-size: 0.9em;
  background-color: #5d6f5f;
  color: #dddddd;
}

footer div.space {
  padding: 50px 50px;
  clear: both;
}

footer a {
  color: #ffffff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

footer div.policy {
  font-size: 11px;
  margin-top: -1px;
  z-index: 1;
  background-color: #2c3e50;
  color: #eeeeee;
  clear: both;
  position: relative;
  border-top-style: solid;
  border-top-width: 1px;
  border-color: #4a5a4c;
  display: block;
  box-sizing: border-box;
}

footer div.policy p {
  width: 85%;
  max-width: 85%;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  float: none;
  padding-top: 15px;
  padding-bottom: 15px;
  text-align: left;
}

.bigicon {
  font-size: 48px;
  display: flex;
  justify-content: center;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #2c3e50;
  color: #fff;
  padding: 15px;
  text-align: center;
  font-size: 14px;
  z-index: 9999;
}

.cookie-banner a {
  color: white;
  text-decoration: underline;
  margin: 0 5px;
}

.cookie-banner button {
  background-color: #f7f7f2;
  color: #2c3e50;
  border: none;
  padding: 8px 12px;
  margin-left: 10px;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  padding: 12px;
}

/*Publications*/
#publications,
#dissemination_participation_events,
#dissemination_organization_events,
#open-access-datasets,
#people,
#open-position,
#media-coverage,
#media-coverage-events,
#media-coverage-news {
  max-width: 800px;
  margin: auto;
  font-family: sans-serif;
  margin-top: 25px;
}

#media-coverage {
  max-width: 80%;
  margin: auto;
  font-family: sans-serif;
}

#publications_title,
#participation_events,
#organization_events,
#open-access-datasets_title,
#people_title,
#open-position_title,
#media-coverage_title,
#media-coverage-events_title,
#media-coverage-news_title {
  font-family: 'Arial', serif;
  color: #a49352;
  font-weight: 300;
  height: 250px;
  padding: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-size: cover !important;
  background-color: rgba(0, 0, 0, 0.7);
  background-blend-mode: overlay;
  background-position: center center;
}

#publications_title {
  background-image: url('/img/publications.jpg');
}

#participation_events {
  background-image: url('/img/participation_events.jpeg');
}

#organization_events {
  background-image: url('/img/organization_events.jpg');
}

#open-access-datasets_title {
  background-image: url('/img/datasets.jpeg');
}

#people_title {
  background-image: url('/img/people.jpg');
}

#open-position_title {
  background-image: url('/img/open_position.jpg');
}

#media-coverage_title {
  background-image: url('/img/media_coverage.jpg');
}

#media-coverage-events_title {
  background-image: url('/img/media_coverage_events.jpeg');
}

#media-coverage-news_title {
  background-image: url('/img/media_coverage_news.jpeg');
}

.year-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2em;
  gap: 32px;
  text-align: left;
}

.year-group h3,
.year-group h4 {
  background: linear-gradient(to right, #a49352, #d5cda7);
  padding: 15px 50px;
  border-radius: 0px;
  margin-bottom: 30px;
  text-align: center;
  color: white;
  font-size: 2em;
  font-weight: 100;
}

.year-group .publications-list {
  flex: 1;
  margin: 0;
  padding: 0;
}

@media (max-width: 600px) {
  .year-group {
    flex-direction: column;
    gap: 0;
  }

  .year-group h3 {
    text-align: left;
    margin-bottom: 10px;
  }
}

.publications-list {
  list-style: none;
}

.publication-item {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e8e8e8;
  transition: all 0.3s ease;
}

.publication-item:last-child {
  border-bottom: none;
}

.authors {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.4;
}

.title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 8px;
  margin-bottom: 8px;
  line-height: 1.3;
  text-decoration: none;
}

.journal {
  font-style: italic;
  color: #666;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.links {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.conference {
  color: #666;
  margin-bottom: 10px;
  font-size: 0.90rem;
  font-weight: bold;
  margin-top: 5px;
}

.date {
  color: #a49352;
  font-weight: bold;
  font-size: 0.9em;
}

.type {
  font-weight: bold;
  font-size: 0.9em;
}

.download-link,
.doi-link {
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.download-link {
  color: #5d6f5f;
}

.doi-link {
  color: black;
}

.doi-link:hover {
  font-weight: bold;
}

#people h3,
#people h4 {
  background: linear-gradient(to right, #a49352, #d5cda7);
  padding: 15px 50px;
  border-radius: 0px;
  margin-bottom: 30px;
  text-align: center;
  color: white;
  font-size: 2em;
  font-weight: 100;
}

#people h4 {
  font-size: 1.5em;
  width: 78%;
  padding: 10px;
  margin-left: 11%;
}

#people li {
  list-style-type: none;
}

#people .icon {
  text-align: left;
  margin-left: 15%;
  margin-bottom: 4%;
}

#people i {
  font-size: 1.5em;
  margin-right: 5px;
}

#people a {
  text-decoration: none;
  text-transform: uppercase;
  color: black;
}

#people p {
  font-size: 0.9em;
  color: #555;
  margin: 5px 0;
}

#open-position p,
#media-coverage-events p,
#media-coverage-news p {
  font-style: italic;
}

#dissemination_participation_events h3,
#dissemination_organization_events h3 {
  background-color: #d1d1d1;
  background-image: linear-gradient(to right, #d1d1d1, #cccccc);
  padding: 18px 50px;
  border-radius: 0px;
  margin-bottom: 30px;
  text-align: center;
  color: #a49352;
  font-size: 1.5em;
  font-weight: 100;
}

/* Media Coverage */
.flex_column_table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  margin-top: 30px;
  margin-bottom: 30px;
}

.flex_column {
  flex: 1;
  min-width: 300px;
  background-color: #e6e3d2;
  background: linear-gradient(to right, #e6e3d2, #f7f7f2);
  border: 1px solid #d5cda7;
  box-shadow: 0 0 10px 0 #b2b2b2;
  padding: 30px;
  border-radius: 10px;
  margin: 15px;
  position: relative;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flex_column:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px 0 #999999;
}

.flex_column.av_one_half {
  width: 48%;
  max-width: 550px;
}

.flex_column>a.av-screen-reader-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

.av-special-heading {
  padding-bottom: 10px;
  color: #a49352;
  font-size: 30px;
  text-align: center;
}

.av-special-heading-tag {
  margin: 0;
  font-size: 1em;
  font-weight: 100;
  text-decoration: none;
}

.avia-image-container {
  margin: 20px auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avia-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Content Slider (Dynamic Version) */
.avia-content-slider-element-container {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 15px 20px;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.avia-content-slider-inner {
  width: 100%;
  text-align: center;
  position: relative;
  height: 100px;
  overflow: hidden;
}

.slide-entry-wrap {
  padding: 5px 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.slide-entry-wrap.active-slide {
  opacity: 1;
  visibility: visible;
}

.slide-entry-title {
  font-size: 1.1em;
  margin-bottom: 5px;
  color: #2c3e50;
}

.slide-entry-excerpt p {
  margin: 1px 0;
  font-size: 0.9em;
  color: #555;
}

.slide-entry-excerpt a {
  margin: 1px 0;
  font-size: 0.9em;
  color: #555;
  text-decoration: none;
}

.slide-entry-excerpt p:last-child {
  font-size: 0.75em;
  color: #777;
  margin-top: 5px;
}

.avia-slideshow-dots {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.avia-slideshow-dots a {
  display: block;
  width: 10px;
  height: 10px;
  background-color: #a49352;
  border-radius: 50%;
  margin: 0 4px;
  text-indent: -9999px;
  overflow: hidden;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.avia-slideshow-dots a.active {
  background-color: #7b8584;
}


/*Menù reattivo*/
/* Nasconde il pulsante hamburger su schermi grandi */
#menu-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #2c3e50;
}

/* Il menu desktop è visibile su schermi grandi */
#main-menu {
  display: flex;
}

/* Stili di base per il menu a comparsa */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

/* Stili per il menu verticale */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 70%;
  max-width: 300px;
  height: 100%;
  background-color: white;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1001;
  padding-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
}

.mobile-menu .menu-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #2c3e50;
}

/* Mostra il menu e l'overlay quando la classe è attiva */
.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-menu-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Stili per il menu hamburger, visibile solo su schermi piccoli */
@media (max-width: 1090px) {

  main {
    padding-top: 141px;
  }

  #menu-toggle {
    display: block;
  }

  #main-menu {
    display: none;
  }

  #site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-menu ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding-left: 0;
  }

  .mobile-menu ul li a {
    display: block;
    padding: 0.5rem 1rem;
  }

  .mobile-menu ul ul {
    padding-left: 2rem;
  }

  .mobile-menu .has-submenu>ul {
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    left: 0;
    box-shadow: none;

  }
}