/* ==== Livre numérique : page-flip ==== */

.book-breadcrumb {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  padding: .75rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.book-breadcrumb .breadcrumb-item a { color: var(--gold, #C9A96E); text-decoration: none; }

.book-section {
  padding: 1.5rem 0 2rem;
  /* Surface sur laquelle "repose" le livre */
  background:
    radial-gradient(ellipse at center 30%, rgba(0,0,0,0) 0%, rgba(0,0,0,.04) 70%),
    linear-gradient(180deg, #ECE3D2 0%, #DCCCAE 100%);
}

/* ==== LIVRE OUVERT — taille adaptative, aspect cuir/papier ==== */
.art-book {
  display: flex;
  width: min(1050px, calc(100vw - 2rem));
  height: min(640px, calc(100vh - 220px));
  margin: 0 auto;
  position: relative;
  /* Couverture cuir foncé qui dépasse autour des pages */
  padding: 22px 26px;
  background:
    linear-gradient(135deg, #3a2418 0%, #5a3a25 50%, #3a2418 100%);
  border-radius: 6px 10px 10px 6px;
  box-shadow:
    /* Tranches de pages empilées (côté droit) */
    inset -6px 0 0 -3px rgba(0,0,0,.25),
    /* Profondeur du livre */
    0 30px 60px rgba(0,0,0,.35),
    0 12px 24px rgba(0,0,0,.18);
}
/* Reliure centrale (creux du livre) */
.art-book::before {
  content: '';
  position: absolute;
  top: 22px; bottom: 22px; left: 50%;
  width: 40px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg,
      rgba(0,0,0,0) 0%,
      rgba(0,0,0,.18) 30%,
      rgba(0,0,0,.45) 50%,
      rgba(0,0,0,.18) 70%,
      rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 6;
}
/* Tranches des pages visibles (haut, bas) */
.art-book::after {
  content: '';
  position: absolute;
  inset: 22px 26px;
  pointer-events: none;
  border-radius: 1px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    inset 1px 0 0 rgba(255,255,255,.3),
    inset -1px 0 0 rgba(0,0,0,.15);
  z-index: 4;
}

.page {
  flex: 1 1 50%;
  display: flex;
  position: relative;
  overflow: hidden;
}
/* Texture papier ancien légère */
.page-left {
  background:
    radial-gradient(ellipse at right center, rgba(120,90,40,.18) 0%, rgba(120,90,40,0) 55%),
    radial-gradient(ellipse at 20% 80%, rgba(140,100,50,.08) 0%, rgba(140,100,50,0) 60%),
    linear-gradient(180deg, #FBF6EA 0%, #F4ECD8 100%);
}
.page-right {
  background:
    radial-gradient(ellipse at left center, rgba(120,90,40,.18) 0%, rgba(120,90,40,0) 55%),
    radial-gradient(ellipse at 80% 20%, rgba(140,100,50,.08) 0%, rgba(140,100,50,0) 60%),
    linear-gradient(180deg, #FBF6EA 0%, #F4ECD8 100%);
}

.page-inner {
  padding: 1.75rem 2rem 1.75rem 2.25rem;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-right .page-inner { padding: 1.75rem 2.25rem 1.75rem 2rem; }

.page-image {
  padding: 1rem;
  align-items: center;
  justify-content: center;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Bouton loupe en haut à droite de l'image */
.zoom-trigger {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(28, 28, 30, .55);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 5;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.page-image:hover .zoom-trigger,
.zoom-trigger:focus-visible {
  opacity: 1;
  transform: translateY(0);
}
.zoom-trigger:hover {
  background: rgba(201, 169, 110, .9);
}
.page-photo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow: 0 4px 14px rgba(60,40,15,.25);
}
.placeholder-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(120,90,40,.3); font-size: 4rem;
}

.page-eyebrow {
  text-transform: uppercase;
  letter-spacing: .25em;
  font-size: .75rem;
  color: var(--gold, #C9A96E);
}
.page-title {
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 2rem;
  margin: 0 0 .5rem;
  color: var(--charcoal, #1C1C1E);
  line-height: 1.15;
}
.page-divider {
  width: 50px; height: 2px;
  background: var(--gold, #C9A96E);
  margin: .5rem 0 .75rem;
}
.page-dim { color: var(--muted, #6c757d); font-style: italic; margin-bottom: .5rem; font-size: .9rem; }
.page-desc { font-size: .95rem; line-height: 1.55; color: var(--charcoal); margin-bottom: .6rem; }
.page-long { font-size: .9rem; line-height: 1.6; color: #2b2620; margin-top: .25rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.book-nav {
  max-width: 1050px;
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.book-nav-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.book-nav-arrows { display: flex; gap: .5rem; }

.likes-bar {
  max-width: 1100px;
  margin: 3rem auto 1rem;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}
.likes-label { font-weight: 600; color: var(--charcoal); margin-right: .5rem; }
.emoji-like {
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: all .2s;
}
.emoji-like:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.emoji-like.active { background: var(--gold, #C9A96E); color: #fff; border-color: transparent; }
.emoji-like .emoji { font-size: 1.15rem; line-height: 1; }
.emoji-like .count { font-size: .85rem; font-variant-numeric: tabular-nums; }

.comments-section {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 2rem;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}
.comments-section h2 {
  font-family: var(--font-serif, 'Playfair Display', serif);
  margin-bottom: 1.5rem;
}
.comments-empty { color: var(--muted); }
.comment {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.comment:last-child { border-bottom: none; }
.comment header { margin-bottom: .35rem; display: flex; gap: .75rem; align-items: baseline; }
.comment header time { font-size: .8rem; color: var(--muted); }
.comment p { margin: .25rem 0 .5rem; line-height: 1.5; }
.btn-reply {
  background: none; border: none; color: var(--gold); cursor: pointer;
  font-size: .85rem; padding: 0;
}
.btn-reply:hover { text-decoration: underline; }
.comment-replies { margin-top: .75rem; padding-left: 1.5rem; border-left: 2px solid rgba(0,0,0,.08); }
.comment-reply { padding: .5rem 0; }

.comment-form { margin-top: 1.5rem; }
.emoji-toggle-btn {
  position: absolute;
  bottom: .5rem; right: .5rem;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 999px;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.emoji-picker-host {
  position: absolute;
  z-index: 1000;
  bottom: 50px;
  right: 0;
}
.comment-feedback {
  margin-top: .75rem;
  font-size: .9rem;
  color: #b00020;
  white-space: pre-wrap;
}
.comment-feedback.success { color: #2e7d32; }

.related-section {
  max-width: 1100px;
  margin: 4rem auto 0;
}
.related-section h2 {
  font-family: var(--font-serif, 'Playfair Display', serif);
  text-align: center;
  margin-bottom: 2rem;
}

/* Mobile : page unique empilée (image AU-DESSUS du texte) */
@media (max-width: 767px) {
  .art-book {
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 14px;
  }
  .art-book::before {
    top: auto; bottom: auto; left: 14px; right: 14px;
    top: 50%; width: auto; height: 30px;
    transform: translateY(-50%);
    background: linear-gradient(180deg,
      rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,0) 100%);
  }
  .art-book::after { inset: 14px; }
  .page-inner, .page-right .page-inner { padding: 1.5rem 1.25rem; }
  .page-title { font-size: 1.7rem; }
  .placeholder-image { min-height: 240px; }
  .page-photo { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  .emoji-like, .emoji-like:hover { transform: none; }
}
