/* ======================================================
   LIGHT NOVEL CAROUSEL
   ====================================================== */

.light-novel-carousel {
  max-width: 900px;
  margin: 1.5rem auto;
}

.light-novel-carousel__title {
  margin: 0 0 1rem;
  line-height: 1.25;
}


/* ======================================================
   PANNEAU DESCRIPTIF
   ====================================================== */

.light-novel-panel {
  min-height: 0;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.light-novel__title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.light-novel__full-title {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.light-novel__description p {
  margin: 0 0 0.75rem;
}

.light-novel__description p:last-child {
  margin-bottom: 0;
}


/* ======================================================
   ZONE DES COUVERTURES
   ====================================================== */

.light-novel-carousel__viewport {
  max-width: 100%;
  overflow: hidden;
}

.light-novel-carousel__track {
  display: flex;
  gap: 12px;
  max-width: 100%;
  min-height: 240px;
  padding: 8px 2px 16px;

  visibility: visible !important;
  opacity: 1 !important;

  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.light-novel {
  flex: 0 0 150px;
  min-width: 150px;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  scroll-snap-align: start;
}

.light-novel__cover-link {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.light-novel__cover {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  width: 100%;
  height: auto;
  max-width: 150px;

  position: static;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


/* ======================================================
   SURVOL, SÉLECTION ET CLAVIER
   ====================================================== */

.light-novel:hover .light-novel__cover,
.light-novel:focus .light-novel__cover,
.light-novel.is-active .light-novel__cover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.light-novel:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}


/* ======================================================
   LIENS D’ACHAT
   ====================================================== */

.light-novel__purchase-links {
  margin-top: 1rem;
}

.light-novel__purchase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  margin-top: 0.4rem;
}

.light-novel__purchase-label {
  font-weight: 700;
}

.light-novel__purchase-link {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  text-decoration: none;
}

.light-novel__purchase-link:hover,
.light-novel__purchase-link:focus {
  text-decoration: underline;
}


/* ======================================================
   GRANDS ÉCRANS
   ====================================================== */

@media (min-width: 901px) {
  .light-novel-carousel__track {
    justify-content: center;
  }
}


/* ======================================================
   TABLETTES
   ====================================================== */

@media (max-width: 900px) {
  .light-novel {
    flex-basis: 145px;
    min-width: 145px;
  }

  .light-novel__cover {
    max-width: 145px;
  }
}


/* ======================================================
   TÉLÉPHONES
   ====================================================== */

@media (max-width: 520px) {
  .light-novel {
    flex-basis: 135px;
    min-width: 135px;
  }

  .light-novel__cover {
    max-width: 135px;
  }

  .light-novel-panel {
    min-height: 0;
  }
}


/* ======================================================
   ACCESSIBILITÉ
   ====================================================== */

@media (prefers-reduced-motion: reduce) {
  .light-novel__cover {
    transition: none;
  }

  .light-novel:hover .light-novel__cover,
  .light-novel:focus .light-novel__cover,
  .light-novel.is-active .light-novel__cover {
    transform: none;
  }
}


/* ======================================================
   LÉGENDE DE LA GALERIE
   ====================================================== */

.book-gallery {
  position: relative;
}

.book-gallery::after {
  content: "Original English Light Novel Series — ISEKAI: The Otherworlder's Heir by Jean-Louis Vill.";
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  opacity: 0.75;
}
/* ======================================================
   CORRECTIONS DE POSITIONNEMENT DU CARROUSEL
   ====================================================== */

/* Organisation verticale :
   1. titre
   2. couvertures
   3. panneau descriptif
*/
.light-novel-carousel {
  display: flex;
  flex-direction: column;
}

.light-novel-carousel__title {
  order: 1;
}

.light-novel-carousel__viewport {
  order: 2;
}

.light-novel-panel {
  order: 3;
  margin-top: 1rem;
  margin-bottom: 0;
}


/* Empêche la première couverture d’être coupée */
.light-novel-carousel__track {
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 0;
  scroll-padding-inline: 0;
}


/* Centre les couvertures seulement lorsqu’elles tiennent réellement */
@media (min-width: 901px) {
  .light-novel-carousel__track {
    justify-content: safe center;
  }
}