
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f5f7fa;
  color: #222;
  direction: rtl;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 750px;
  margin: auto;
  padding: 20px;
  box-sizing: border-box;
}

h1, h2 {
  font-size: 1.5rem;
  text-align: center;
  color: #2d3748;
  margin: 1rem 0;
}

/* --- Auteurs par lettre --- */
.letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.letter-item {
  background: #fff;
  color: #38a169;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 128, 0, 0.15);
  transition: all 0.3s ease;
}
.letter-item:hover {
  background-color: #38a169;
  color: #fff;
}

/* --- Liste des auteurs --- */
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 15px;
}

.author-item-rect {
  background: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  color: #2c5282;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}
.author-item-rect:hover {
  background-color: #2b6cb0;
  color: white;
}

/* --- Présentation des livres (défilement horizontal) --- */
.books {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding: 10px 0;
  scroll-snap-type: x mandatory;
}
.book-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 10px;
  width: 130px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-decoration: none;
  color: #2c7a7b;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  background-color: #edfdfd;
}

.book-cover {
  display: block;
  margin: 20px auto;
  max-width: 450px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.book-item img {
  width: 90px;
  height: 130px;
  object-fit: cover;
  border-radius: 5px;
}
.book-item span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: bold;
}

/* --- Responsive auteur header --- */
.author-header {
  text-align: center;
  margin: 25px 0;
}
.author-header img.author-photo {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}

/* --- Bouton retour --- */
.back-link {
  display: block;
  background-color: #38a169;
  color: white;
  text-align: center;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  max-width: 200px;
  margin: 30px auto;
  transition: background 0.3s;
}
.back-link:hover {
  background-color: #2f855a;
}

/* --- CHAPTER iframe adaptatif --- */
#chapter-frame {
  width: 100%;
  height: 500px;
  border: none;
  margin-top: 20px;
  border-radius: 10px;
}

#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: #ffbf00;
  color: white;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none; /* caché par défaut */
  transition: opacity 0.3s ease;
}
#scrollTopBtn:hover {
  background-color: #e6a800;
}


@media screen and (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 20px 10px;
  }

  h1, h2 {
    font-size: 20px;
    margin: 15px 0;
    text-align: center;
  }

  .letters {
    gap: 12px;
    justify-content: center;
    padding: 10px 0;
  }

  .letter-item {
    width: 42px;
    height: 42px;
    font-size: 16px;
    padding: 10px;
    border-radius: 50%;
  }

  .author-item-rect {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
  }

  .authors {
    gap: 10px;
    margin-top: 15px;
  }

  .book-item {
    width: 120px;
    padding: 8px;
  }

  .book-item img {
    width: 80px;
    height: 110px;
  }

  .book-item span {
    font-size: 13px;
  }

  .author-header img.author-photo {
    width: 140px;
    height: 180px;
  }

 @media (max-width: 600px) {
  .book-cover {
    max-width: 95%;
  }

  #chapter-frame {
    height: 400px;
  }
}


        