/* ==========================================================
   A.R.C. — feuille de style commune
   (reprend à l'identique les styles qui étaient recopiés
   dans chaque page : une seule version à maintenir)
   ========================================================== */

/* ---------- Base ---------- */
body {
  background-color: #121212;
  color: #f0f0f0;
}
.card {
  background-color: #1e1e1e;
  border: 1px solid #2c2c2c;
}
.navbar, footer {
  background-color: #1a1a1a !important;
}
.navbar-brand img {
  height: 60px;
}
.breadcrumb a:hover {
  font-weight: bold;
  text-decoration: none;
}

/* ---------- Vignettes sagas / tomes / chapitres ---------- */
.book-card {
  position: relative;
  width: 162px;
  height: 250px;
  overflow: hidden;
  margin: 10px;
  border: none;
}
.book-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Bandeau titre toujours 2 lignes */
.book-card .card-title {
  position: absolute;
  bottom: 25px;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 5px 8px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  transition: font-weight 0.2s;
}
.book-card:hover .card-title {
  font-weight: bold;
}
/* Bandeau note + commentaires + vues */
.rating {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 3px;
  font-size: 11px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #ffd700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Bulles (note, commentaires, vues, téléchargements) ---------- */
.rate-bubble, .comment-bubble, .views-bubble, .down-bubble {
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  color: #fff;
}
.rate-bubble    { background: #ffff00; color: #000; }
.comment-bubble { background: #28a745; }
.views-bubble   { background: #007bff; }
.down-bubble    { background: #ff0000; }
.rate-bubble::before    { content: "⭐"; margin-right: 2px; }
.comment-bubble::before { content: "💬"; margin-right: 2px; }
.views-bubble::before   { content: "👁️"; margin-right: 2px; }
.down-bubble::before    { content: "📥"; margin-right: 2px; }

/* Version plus grande, sous le titre du chapitre dans la liseuse */
.reader-stats .rate-bubble,
.reader-stats .comment-bubble,
.reader-stats .views-bubble,
.reader-stats .down-bubble {
  border-radius: 15px;
  padding: 2px 10px;
  font-size: 14px;
  margin-right: 5px;
  margin-left: 5px;
}
.reader-stats .rate-bubble::before,
.reader-stats .comment-bubble::before,
.reader-stats .views-bubble::before,
.reader-stats .down-bubble::before {
  margin-right: 6px;
}

/* ---------- Accueil : fil d'actualité ---------- */
.actu-card {
  position: relative;
  background-color: #1c1c1c;
  border-radius: 10px;
  overflow: hidden;
}
.actu-img {
  max-height: 300px;
  object-fit: cover;
  height: 100%;
  max-width: 100%;
}
.actu-date {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}
.actu-title {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 0.5rem;
}
.actu-text {
  font-size: 1rem;
  color: #ddd;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  transition: max-height 0.5s ease;
  max-height: 9em;
}
.actu-text.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: 2000px;
}
.expand-btn {
  position: absolute;
  bottom: 10px;
  right: 15px;
  color: #aaa;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s;
  display: none;
  background: none;
  border: 0;
  padding: 0;
}
.expand-btn.active {
  display: block;
}
.expand-btn:hover {
  color: #fff;
  transform: scale(1.2);
}

/* ---------- Liseuse ---------- */
#reader-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
#viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  background: #111;
  padding: 20px;
  border-radius: 10px;
  max-width: 100%;
  min-height: 200px;
}
#viewer canvas {
  background: #333;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  border-radius: 5px;
  user-select: none;
  -webkit-user-drag: none;
  /* ne dépasse jamais de l'écran, sans déformer la page */
  max-width: 100%;
  height: auto;
}
#viewer.two-pages canvas {
  max-width: calc(50% - 10px);
}
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 40px;
  padding: 20px 25px;
  cursor: pointer;
  z-index: 10;
  border-radius: 5px;
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
#prevBtn { left: -70px; }
#nextBtn { right: -70px; }

/* Plein écran : les pages occupent toute la hauteur disponible */
#reader-container:fullscreen {
  background: #111;
  width: 100vw;
  height: 100vh;
}
#reader-container:fullscreen #viewer {
  padding: 10px;
  height: 100vh;
}
#reader-container:fullscreen #viewer canvas {
  max-height: calc(100vh - 20px);
  width: auto;
}
#reader-container:fullscreen #prevBtn { left: 0; }
#reader-container:fullscreen #nextBtn { right: 0; }

/* Écrans moyens : les flèches restent dans la page */
@media (max-width: 1199px) {
  #prevBtn { left: 0; }
  #nextBtn { right: 0; }
}
/* Affichage spécifique mobile */
@media (max-width: 768px) {
  #reader-container { flex-direction: column; }
  #viewer { padding: 10px; }
  #viewer canvas { width: 100% !important; height: auto !important; }
  .nav-btn { font-size: 25px; padding: 10px 15px; }
}
