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

/* =========================
   BASE + STICKY FOOTER
========================= */
body {
  font-family: 'Nunito', sans-serif;
  background-color: #FFF7FA;
  color: #4A4A4A;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
}

/* =========================
   HEADER
========================= */
.header {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #F6C1CC;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  margin: 0 auto;
  height: 80px;
}

.menu-icon {
  font-size: 28px;
  cursor: pointer;
}

/* =========================
   MENU HAMBURGER
========================= */
.menu {
  display: none;
  flex-direction: column;
  background-color: #E6B7E8;
  padding: 20px;
}

.menu a {
  text-decoration: none;
  font-weight: 600;
  color: #4A4A4A;
  margin: 10px 0;
}

/* =========================
   SEZIONI (spingono il footer)
========================= */
.sezione {
  display: none;
  padding: 60px 20px;
  text-align: center;
  flex: 1;
}

.sezione.attiva {
  display: block;
}

/* =========================
   HOME – LAYOUT
========================= */
#home.sezione.attiva {
  min-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#lista-libri {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
}

/* =========================
   CARD LIBRI – ALLINEATE
========================= */
.card {
  background-color: #FFFFFF;
  padding: 22px;
  border-radius: 28px;
  width: 230px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* CONTENITORE IMMAGINE */
.card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 15px;
}
.card h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.2;
  min-height: 72px;          /* spazio per ~4 righe */
  margin-bottom: 12px;
  text-align: center;

  display: flex;
  align-items: center;
  justify-content: center;
}

.card .btn {
  margin-top: auto;
}



/* =========================
   BOTTONI
========================= */
.btn {
  display: block;
  width: 100%;
  margin: 8px auto;
  padding: 10px;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  background-color: #C9B7E2;
  color: #FFFFFF;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

.btn.acquista {
  background-color: #F6C1CC;
}

/* =========================
   TESTI SEZIONI
========================= */
#chi-sono,
#mio-libro {
  max-width: 720px;
  margin: auto;
  line-height: 1.7;
}

#chi-sono h1,
#mio-libro h1 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 20px;
}

/* =========================
   CITAZIONE
========================= */
blockquote {
  margin-top: 30px;
  padding: 22px;
  background-color: #F6C1CC;
  border-radius: 22px;
  font-style: italic;
}

/* =========================
   COPERTINA LIBRO
========================= */
.copertina-libro {
  width: 220px;
  max-width: 90%;
  border-radius: 22px;
  margin: 25px auto;
  display: block;
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* =========================
   POPUP RECENSIONE
========================= */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.6);
  z-index: 200;
}

.popup-content {
  background-color: #FFFFFF;
  max-width: 420px;
  margin: 100px auto;
  padding: 32px;
  border-radius: 30px;
  text-align: center;
  position: relative;
}

.popup-content h2 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 15px;
}

.popup-content p {
  line-height: 1.6;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 26px;
  cursor: pointer;
}

/* =========================
   FOOTER (sempre in fondo)
========================= */
.footer {
  background-color: #FFF7FA;
  padding: 20px;
  text-align: center;
  margin-top: auto;
}

/* social */
.social {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.icon {
  width: 32px;
  height: 32px;
  fill: #4A4A4A;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.icon:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

/* copyright */
.footer-line {
  width: 100%;
  height: 1px;
  background-color: #000000;
  margin: 15px 0;
}

.footer-copy {
  margin-bottom: 8px;
  font-size: 14px;
}

.footer-powered a {
  color: #4A4A4A;
  text-decoration: none;
  font-weight: 600;
}

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

/* =========================
   TITOLO HOME (IN ALTO CENTRO)
========================= */
.home-header {
  width: 100%;
  text-align: center;
  margin-top: 0;
  margin-bottom: 40px;
}

#home.sezione.attiva {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
}

.home-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  color: #4A4A4A;
}

.home-header h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: #F6C1CC;
  margin: 12px auto 0;
  border-radius: 3px;
}
/* =========================
   BARRA RICERCA HOME
========================= */
.search-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.search-bar input {
  width: 100%;
  max-width: 360px;
  padding: 12px 18px;
  border-radius: 30px;
  border: none;
  outline: none;

  font-family: 'Nunito', sans-serif;
  font-size: 15px;

  background-color: #FFFFFF;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.search-bar input::placeholder {
  color: #999;
}


/* =========================
   RESPONSIVE
========================= */
@media (max-width: 600px) {
  .logo {
    height: 65px;
  }

  .card {
    width: 90%;
  }

  #lista-libri {
    gap: 25px;
  }

  .popup-content {
    margin: 60px 15px;
  }
}
@media (max-width: 600px) {
  .home-header h1 {
    font-size: 22px;
  }
}


.home-header h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: #F6C1CC;
  margin: 12px auto 0;
  border-radius: 3px;
}


/* =========================
   POPUP RECENSIONE (SCROLL MOBILE OK)
========================= */
.popup {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.6);
  z-index: 200;

  display: none;
  justify-content: center;
  align-items: center;
}


.popup-content {
  background-color: #FFFFFF;
  width: 90%;
  max-width: 420px;
  max-height: 80vh;

  padding: 28px;
  border-radius: 30px;
  text-align: center;
  position: relative;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.popup-content h2 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 15px;
}

.popup-content p {
  line-height: 1.6;
  text-align: left;
}

.close {
  position: sticky;
  top: 0;
  float: right;
  font-size: 26px;
  cursor: pointer;
  background: #fff;
  padding-left: 10px;
}

@media (max-width: 600px) {
  .card {
    width: 90%;
    max-width: 320px;
  }

  .card img {
    height: 360px;
  }
}


/* SCROLLBAR POPUP – GROSSA, CORTA, DENTRO IL RIQUADRO */
.popup-content {
  overflow-y: auto;

  /* Firefox */
  scrollbar-width: auto;
  scrollbar-color: #c9b7e2 transparent;

  padding-right: 20px; /* spazio tra testo e scrollbar */
  

}

/* Chrome / Edge / Safari */
.popup-content::-webkit-scrollbar {
  width: 16px;              /* GROSSA */
}

.popup-content::-webkit-scrollbar-track {
  background: transparent;
  padding: 12px 0;          /* la accorcia SENZA uscire */
}

.popup-content::-webkit-scrollbar-thumb {
  background-color: #c9b7e2;
  border-radius: 20px;
}
