/* [gite_livre] : le livre de photos de Saint-Amand */
.livre { --papier: #f7f2e8; margin: 1.6rem auto 2rem; outline: none; }
.livre.livre { max-width: 840px; } /* plus fort que la largeur imposée par WordPress aux blocs */
.livre:focus-visible .livre-scene { outline: 3px solid var(--ocre, #e9b97f); outline-offset: 6px; }
.livre-sans-js img { width: 100%; height: auto; display: block; }
.livre-scene { position: relative; perspective: 2400px; aspect-ratio: 2 / 1; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.lp { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--papier); overflow: hidden; }
.lp.gauche { left: 0; border-radius: 6px 0 0 6px; box-shadow: -8px 14px 30px rgba(0, 0, 0, .35); }
.lp.droite { right: 0; border-radius: 0 6px 6px 0; box-shadow: 8px 14px 30px rgba(0, 0, 0, .35); }
/* le creux de la reliure */
.lp.gauche::after, .lp.droite::after, .face::after { content: ''; position: absolute; top: 0; bottom: 0; width: 36px; pointer-events: none; z-index: 2; }
.lp.gauche::after { right: 0; background: linear-gradient(to left, rgba(60, 40, 20, .28), transparent); }
.lp.droite::after, .recto::after { left: 0; background: linear-gradient(to right, rgba(60, 40, 20, .32), transparent); }
.verso::after { right: 0; background: linear-gradient(to left, rgba(60, 40, 20, .28), transparent); }
.lp img, .face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp img.haute, .face img.haute { object-position: 50% 35%; }

/* La page de légende */
.lp-texte { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; padding: 1.7rem 2rem 1.3rem; color: #2a2a22;
  background: radial-gradient(ellipse at 30% 20%, #fbf8f1, var(--papier) 70%); }
.lp-texte .lp-livre { margin: 0; font: italic .9rem/1.3 var(--wp--preset--font-family--titre, serif); color: #8a7a5c; letter-spacing: .02em; }
.lp-texte .lp-num { margin: auto 0 .4rem; font-size: .8rem; letter-spacing: .12em; color: #a5432a; }
.lp-texte h3 { margin: 0 0 .6rem; font: 1.7rem/1.15 var(--wp--preset--font-family--titre, serif); color: #1f4437; }
.lp-texte .lp-legende { margin: 0 0 auto; font-size: 1rem; line-height: 1.6; max-width: 30em; }
.lp-texte .lp-credit { margin: 1.2rem 0 0; font-size: .72rem; color: #7a7466; }
.livre .lp-texte .lp-credit a { color: inherit; text-decoration-color: rgba(122, 116, 102, .5); }

/* La feuille qui tourne */
.feuille { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; transform-origin: left center; transform-style: preserve-3d; z-index: 5; pointer-events: none; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--papier); overflow: hidden; }
.recto { border-radius: 0 6px 6px 0; }
.verso { transform: rotateY(180deg); border-radius: 6px 0 0 6px; }

/* Boutons */
.livre-nav { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin-top: 1.1rem; }
.livre-bouton { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); background: transparent; color: inherit; font: 28px/1 serif; cursor: pointer; padding: 0 0 4px; }
.livre-bouton:hover:not(:disabled), .livre-bouton:focus-visible { background: var(--ocre, #e9b97f); border-color: var(--ocre, #e9b97f); color: #1f4437; }
.livre-bouton:disabled { opacity: .3; cursor: default; }
.livre-compte { font-size: .9rem; min-width: 4em; text-align: center; opacity: .85; }

/* Téléphone : une seule page, photo puis légende */
.livre:not(.double) .livre-scene { aspect-ratio: auto; height: min(150vw, 640px); }
.livre:not(.double) .lp.gauche { width: 100%; border-radius: 6px; box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.livre:not(.double) .lp.gauche::after, .livre:not(.double) .lp.droite { display: none; }
.lp-simple { display: flex; flex-direction: column; height: 100%; }
.lp-simple img { height: 58%; flex: none; }
.lp-simple .lp-texte { flex: 1; height: auto; padding: 1.1rem 1.3rem 1rem; }
.lp-simple .lp-texte .lp-num { margin-top: .5rem; }
.lp-simple .lp-texte h3 { font-size: 1.45rem; }
.lp-simple .lp-texte .lp-legende { font-size: .98rem; }
.feuille.seule { left: 0; width: 100%; }
.feuille.seule .recto { border-radius: 6px; }
.feuille.seule .recto::after { display: none; }
