

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;
}

/* --- categories  ( horizontal) --- */

.category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  margin-top: 20px;
}

.category-link {
  background-color: #f4f4f4;
  border-radius: 20px;
  padding: 10px 20px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.category-link:hover {
  background-color: #ffe9b3;
  color: #000;
  transform: translateY(-2px);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
  justify-items: center;
}

.book-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.book-card:hover {
  transform: scale(1.03);
}

.book-card img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  max-height: 220px;
}

.book-title {
  margin-top: 10px;
  font-weight: bold;
  font-size: 0.95rem;
  color: #222;
}

.book-author {
  font-size: 0.85rem;
  color: #666;
}


/* --- 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: 230px;
  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-item img {
  width: 150px;
  height: 180px;
  object-fit: cover;
  border-radius: 5px;
}

.book-item span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: bold;
}

.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);
}

/* --- 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;
}

/* --- Iframe chapitre --- */
#chapter-frame {
  width: 100%;
  height: 500px;
  border: none;
  margin-top: 20px;
  border-radius: 10px;
}

/* --- Scroll to top --- */
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 40px;
  left: 40px;
  z-index: 100;
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
}

#scrollTopBtn:hover {
  background-color: #0056b3;
}


/* --- Classes utilitaires --- */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

/* --- Responsive mobile --- */
@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;
  }

  .author-item-rect {
    font-size: 13px;
    padding: 6px 12px;
  }

  .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;
  }

  .book-cover {
    max-width: 95%;
  }

  #chapter-frame {
    height: 400px;
  }

  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  .nav-extra-links {
    display: none !important;
  }

  #menu-btn {
    display: inline-block;
  }

  #nav-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  #nav-menu.show {
    display: flex;
  }
}



        