* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: #fff;
  color: #000;
}

header {
  background-color: #000;
  color: #fff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.4em;
  font-weight: bold;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  transition: 0.3s;
}

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


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

nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("immagini/giornali-italiani.jpeg");
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
  z-index: -1;
}

.hero h1 {
  font-size: 2.4em;
  margin-bottom: 10px;
  color: #fff;
}

.hero h2 {
  font-size: 1.4em;
  margin-bottom: 30px;
  color: #fff;
}

.btn {
  background-color: #c00;
  color: #fff;
  padding: 12px 24px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
}

.btn:hover {
  background-color: #a00;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: #000;
  color: #fff;
  font-size: 0.9em;
}

.search-container {
  position: relative;
  margin-left: 20px;
}

#searchInput {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  background-color: black;
  border: none;
  color: white;
  width: 220px;
  box-shadow: none;
}

#searchInput:focus {
  outline: none;
}

#suggestions {
  position: absolute;
  top: 40px;
  right: 0;
  left: auto;
  width: 220px;
  background: #fff;
  border-radius: 4px;
  display: none;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  color: #000;
}

.suggestion-item:hover {
  background-color: #eee;
}

.mobile-search {
  display: none;
}

@media (max-width: 768px) {

  .mobile-search {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-top: 10px;
  }

  .mobile-search input {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: none;
    font-size: 0.9rem;
    background: black;
    color: white;
  }

  .search-container {
    display: none !important;
  }

  header {
    padding: 10px 15px !important;
    flex-direction: row;
    align-items: center;
  }

  .logo {
    font-size: 1.1rem !important;
  }

  .hamburger {
    display: flex !important;
  }

  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #000;
    text-align: center;
    padding: 10px 0;
  }


  nav#menu {
    display: none !important;
  }


  nav#menu.open {
    display: flex !important;
  }

  nav a {
    padding: 10px 0 !important;
    margin: 0 !important;
    font-size: 1rem !important;
  }

  #suggestions {
    position: fixed;
    top: 70px;
    right: 10px;
    left: auto;
    width: calc(100% - 20px);
  }

  .hero {
    min-height: 100vh !important;
    padding: 20px 10px !important;
  }

  .hero h1 {
    font-size: 1.6rem !important;
  }

  .hero h2 {
    font-size: 1rem !important;
  }

  .btn {
    padding: 8px 14px !important;
    font-size: 0.9rem !important;
  }

  footer {
    padding: 10px !important;
    font-size: 0.75rem !important;
  }
}

#backToTop {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 45px;
  background: #c00;
  color: white;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 99999;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background: #a00;
}
