:root {
  --primary-color: #4A4A4A;
  --secondary-color: #8B4513;
  --accent-color: #D2B48C;
  --bg-color: #F5F5F5;
  --text-color: #333;
}

body, html {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  scroll-behavior: smooth;
}

.hero {
  height: 100vh;
  background-image: url('background-hero.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 4em;
  margin: 0;
  letter-spacing: 2px;
}

.subtitle {
  font-style: italic;
  margin-top: 20px;
  font-size: 1.5em;
}

.hero-button {
  display: inline-block;
  background-color: #7b6240;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  margin-top: 30px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.book-section {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-bottom: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--accent-color);
}

.book-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.book-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.book-cover {
  max-width: 350px;
  margin: 0 auto 40px;
  position: relative;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.book-cover:hover img {
  transform: scale(1.05);
  filter: blur(3px);
}

.book-cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-color: rgba(0, 0, 0, 0.7);
}

.book-cover:hover .book-cover-overlay {
  opacity: 1;
}

.cover-card {
  width: 80%;
  max-width: 200px;
  height: 120px;
  margin: 10px 0;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.card-icon {
  height: 70%;
  background-color: #7b6240;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  color: white;
}

.card-text {
  height: 30%;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-text h3 {
  margin: 0;
  font-size: 0.9em;
  color: #333;
}

.cover-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.cover-card:hover .card-icon {
  background-color: var(--accent-color);
}

.book-info h2 {
  font-family: 'Playfair Display', serif;
  color: var(--secondary-color);
}

.cta-button {
  display: inline-block;
  background-color: #7b6240;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  margin-top: 30px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Centro il pulsante all'interno del container */
.book-info .cta-button {
  margin: 0 auto;
}

.cta-button:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Card per il testo "disponibile in formato kindle" */
.kindle-card {
  display: block;
  width: fit-content;
  background-color: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  margin-top: 1rem;
  margin-left: 0.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: left;
}

.green-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #4CAF50;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.kindle-text {
  font-size: 0.9em;
  color: #4CAF50;
}

.story-preview {
  background-color: white;
  padding: 40px;
  margin-top: 60px;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

footer {
  text-align: center;
  padding: 0;
  background-color: #7b6240;
  color: #F5F5F5;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

footer p {
  margin: 5px 0;
  font-size: 0.9em;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
  margin: 0 5px;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  border-radius: 1rem;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.story-page {
  padding-right: 20px;
  display: none;
}

.story-page.active {
  display: block;
}

.page-navigation {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-number {
  display: block;
  margin-bottom: 10px;
}

.button-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.page-navigation button {
  background-color: #7b6240;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 10px;
  cursor: pointer;
  border-radius: 5px;
}

.page-navigation button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.read-more {
  color: var(--secondary-color);
  cursor: pointer;
  text-decoration: underline;
}

.read-more:hover {
  color: var(--accent-color);
}

.story-page h2 {
  font-family: 'Playfair Display', serif;
  color: var(--secondary-color);
  margin-top: 0;
}

.story-page p {
  text-indent: 1.5em;
  margin-bottom: 1em;
}

.modal-open {
  overflow: hidden;
}

@media (min-width: 992px) {
  .book-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  .book-cover {
    flex: 0 0 40%;
    margin: 0;
  }
  .book-info {
    flex: 0 0 55%;
  }
  .story-preview {
    margin-top: 40px;
  }
}

@media (min-width: 768px) {
  .page-navigation {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
  }
  .page-number {
    display: inline-block;
    margin: 0 10px;
  }
  .button-container {
    width: auto;
  }
}

/* Stili specifici per mobile */
@media (max-width: 767px) {
  .modal-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 70vh;
  }
  .story-page {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 80px;
  }
  .page-navigation {
    position: static;
    margin-top: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .page-number {
    margin-bottom: 10px;
  }
  .button-container {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .page-navigation button {
    margin: 0 5px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 3em;
  }
  .subtitle {
    font-size: 1.2em;
  }
}
