/* ===============================
   BASE
================================ */
* {
  box-sizing: border-box;
  font-family: Georgia, serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #f6f2e8; /* giallino editoriale */
  color: #111;
  display: flex;
  flex-direction: column;
}

/* ===============================
   MENU
================================ */
.menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 50px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.menu .logo {
  font-size: 20px;
  letter-spacing: 4px;
  font-weight: 600;
}

.menu ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
}

.menu li {
  cursor: pointer;
}

.menu-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #000;
  stroke-width: 1.6;
}

/* ===============================
   HERO / LOGO
================================ */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-logo {
  max-width: 160px;   /* logo più piccolo */
  width: 60%;
}

/* ===============================
   GALLERY
================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 35px;
  padding: 40px 50px;
  justify-items: center;
  flex: 1;
}

/* ===============================
   CARD
================================ */
.card {
  width: 300px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 34px; /* spazio per il cuore */
}

/* COPERTINA */
.card img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  padding: 12px;
}

/* ===============================
   HEART (FUORI DALL’IMMAGINE)
================================ */
.heart {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  z-index: 2;
}

.heart svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #000;
  stroke-width: 1.6;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
}

.heart.active svg {
  fill: #000;
  stroke: #000;
}

/* ===============================
   CARD CONTENT
================================ */
.card-content {
  padding: 20px 22px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* titolo libro */
.card-content h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 6px 0;
}

/* autore */
.author {
  font-size: 14px;
  color: #555;
  font-style: italic;
  margin-bottom: 18px;
}

/* ===============================
   ACTIONS
================================ */
.card-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

/* bottone dettagli */
.details-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #000;
  font-size: 13px;
  cursor: pointer;
  color: #000;
}

.details-btn:hover {
  background: #000;
  color: #fff;
}

/* bottone acquista */
.buy-btn {
  padding: 8px 14px;
  border: 1px solid #000;
  font-size: 13px;
  text-decoration: none;
  background: #000;
  color: #fff;
}

.buy-btn:hover {
  background: transparent;
  color: #000;
}

/* ===============================
   MODAL
================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  width: 420px;
  max-width: 90%;
  max-height: 90vh;
  padding: 26px;
  border-radius: 14px;
  overflow-y: auto;
  position: relative;
}

.modal-content img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  margin-bottom: 16px;
}

.modal-content h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.modal-meta {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

.modal-buy {
  display: inline-block;
  margin-top: 20px;
}

.close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 22px;
  cursor: pointer;
}

/* ===============================
   FOOTER
================================ */
.site-footer {
  text-align: center;
  padding: 30px 20px 40px;
}

.footer-line {
  width: 60%;
  height: 1px;
  background: #000;
  margin: 0 auto 16px;
}

.site-footer p {
  font-size: 13px;
  color: #444;
  letter-spacing: 1px;
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {

  .menu {
    padding: 16px 20px;
  }

  .hero {
    padding: 40px 0 30px;
  }

  .hero-logo {
    max-width: 130px;
  }

  .gallery {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .card {
    width: 100%;
  }

  .card img {
    height: 240px;
  }
}
