/* livres.css - Mémoire retrouvée > Livres et ouvrages - Ventabren.info */

.livres-page,
.livre-fiche-page {
  background: #f7f5f0;
  color: #2f2f2f;
  position: relative;
  overflow: hidden;
}

.livres-page::after,
.livre-fiche-page::after {
  content: "";
  position: fixed;
  top: 0%;
  right: -400px;
  width: 1800px;
  height: 1800px;
  background-image: url("/images/olivier2.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right top;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.livres-page > *,
.livre-fiche-page > * {
  position: relative;
  z-index: 1;
}

/* --- LISTE : ÉTAGÈRE --- */
.livres-intro {
  max-width: 760px;
  margin: 175px auto 60px;
  padding: 0 30px;
  text-align: center;
}

.livres-accroche {
  font-family: 'Caveat', cursive;
  font-size: 30px;
  color: #b68b52;
  margin: 0 0 4px;
  transform: rotate(-1.2deg);
}

.livres-intro h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 500;
  margin: 0 0 16px;
  line-height: 1.15;
}

.livres-intro p {
  font-size: 18px;
  line-height: 1.6;
  color: #6a6258;
  margin: 0;
}

.livres-etagere-section {
  position: relative;
  max-width: 1180px;
  margin: 0 auto 130px;
  padding: 40px 46px 0;
  border-radius: 14px;
}

/* fond bois très discret + montants latéraux, cantonnés à la zone
   de l'étagère (pas le reste de la page) */
.livres-etagere-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 14px;
  background-image:
    /* montant gauche */
    linear-gradient(
      to right,
      #5f4322 0px, #8f6a3b 4px, #b68b52 12px, #8f6a3b 20px, #5f4322 24px,
      rgba(0,0,0,.24) 24px, transparent 44px
    ),
    /* montant droit */
    linear-gradient(
      to left,
      #5f4322 0px, #8f6a3b 4px, #b68b52 12px, #8f6a3b 20px, #5f4322 24px,
      rgba(0,0,0,.24) 24px, transparent 44px
    ),
    /* halo chaud discret derrière les livres */
    radial-gradient(ellipse at 50% 25%, rgba(182,139,82,.07), transparent 62%),
    /* grain de bois très léger */
    repeating-linear-gradient(
      95deg,
      rgba(110,79,40,.03) 0px,
      rgba(110,79,40,.03) 1px,
      transparent 1px,
      transparent 7px
    );
  background-position: left top, right top, center, center;
  background-size: 44px 100%, 44px 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}

/*
  Grille en étagères successives.
  Chaque "rangée" a une hauteur fixe et connue, ce qui permet de dessiner
  une planche en bois sous CHAQUE rangée (et non plus seulement sous la
  dernière) via un dégradé répété en arrière-plan.

  Calcul (desktop) :
    couverture .......... 270px
    marge titre .......... 16px
    bloc titre ............ 70px
    ---------------------------- = 356px (H, hauteur d'un livre + titre)
    espace avant la planche . 30px
    planche ................. 16px  -> 386px à 402px
    ombre portée (2 temps) .. 26px  -> 402px à 428px
    respiration avant la rangée suivante .. 40px
    ---------------------------- = 468px (C, cycle complet d'une rangée)
    consoles : juste sous la planche, 402-416px + ombre courte,
      placées à 68px du bord gauche et 68px du bord droit
*/
.livres-etagere {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 200px));
  justify-items: center;
  justify-content: center;
  align-content: flex-start;
  column-gap: 46px;
  row-gap: 112px;
  padding-bottom: 112px; /* laisse la place à la planche de la dernière rangée */
  background-image:
    /* console gauche */
    linear-gradient(
      to bottom,
      transparent 0,
      transparent 402px,
      #8f6a3b 402px,
      #6e4f28 412px,
      #6e4f28 416px,
      rgba(0,0,0,.20) 416px,
      transparent 426px,
      transparent 468px
    ),
    /* console droite */
    linear-gradient(
      to bottom,
      transparent 0,
      transparent 402px,
      #8f6a3b 402px,
      #6e4f28 412px,
      #6e4f28 416px,
      rgba(0,0,0,.20) 416px,
      transparent 426px,
      transparent 468px
    ),
    /* planche */
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 386px,
      #e3c6a4 386px,
      #b68b52 392px,
      #8f6a3b 400px,
      #6e4f28 402px,
      rgba(0,0,0,.26) 402px,
      rgba(0,0,0,.09) 414px,
      transparent 428px,
      transparent 468px
    );
  background-position: left 68px top 0, right 68px top 0, top center;
  background-size: 22px 468px, 22px 468px, 100% 468px;
  background-repeat: repeat-y, repeat-y, repeat-y;
}

.livre-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #2f2f2f;
  transition: transform .3s ease;
}

/* légère rotation aléatoire pour casser l'alignement trop parfait,
   comme des livres réellement posés sur une étagère */
.livre-item:nth-child(5n+1) { transform: rotate(-1.1deg); }
.livre-item:nth-child(5n+2) { transform: rotate(0.8deg); }
.livre-item:nth-child(5n+3) { transform: rotate(-0.4deg); }
.livre-item:nth-child(5n+4) { transform: rotate(1deg); }
.livre-item:nth-child(5n)   { transform: rotate(-0.7deg); }

.livre-item:hover {
  transform: translateY(-8px) rotate(0deg);
}

.livre-couverture {
  position: relative;
  height: 270px;
  display: flex;
  align-items: flex-end;
}

/* ombre de contact au pied du livre, pour qu'il ait l'air posé
   sur l'étagère plutôt que collé au fond */
.livre-couverture::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -6px;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.30), transparent 72%);
  filter: blur(2px);
  z-index: 0;
}

.livre-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(182,139,82,.92);
  color: #fff;
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1.3;
}

/* version discrète pour les ouvrages standards, pour ne pas
   concurrencer les badges "publication municipale / religieuse" */
.livre-badge--discret {
  background: rgba(255,255,255,.85);
  color: #8f6a3b;
  border: 1px solid rgba(182,139,82,.35);
  font-weight: 600;
}

.livre-couverture img {
  position: relative;
  z-index: 1;
  height: 100%;
  width: auto;
  max-width: 220px;
  mix-blend-mode: multiply;
  box-shadow: 0 18px 30px rgba(0,0,0,.22);
  display: block;
  transition: box-shadow .3s ease;
}

.livre-item:hover .livre-couverture img {
  box-shadow: 0 26px 40px rgba(0,0,0,.30);
}

.livre-item-info {
  margin-top: 16px;
  text-align: center;
  max-width: 200px;
  height: 70px;
  overflow: hidden;
}

.livre-item-info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 25px;
  font-weight: 500;
  margin: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.livre-item-info p {
  font-size: 13px;
  color: #6a6258;
  margin: 4px 0 0;
}

/* l'ancienne planche unique n'est plus nécessaire : chaque rangée a
   désormais la sienne via le fond répété de .livres-etagere ci-dessus */
.livres-etagere-planche {
  display: none;
}

.livres-etagere-note {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 0;
  padding-top: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: #8f6a3b;
}

.livres-empty {
  text-align: center;
  padding: 60px 30px 120px;
  color: #6a6258;
}

/* --- FICHE DÉTAIL --- */
.livre-hero {
  max-width: 1300px;
  margin: 175px auto 0;
  padding: 0 30px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 60px;
  align-items: center;
}

.livre-hero-couverture {
  aspect-ratio: 2 / 3;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  box-shadow:
    -10px 0 0 rgba(0,0,0,.06) inset,
    0 30px 60px rgba(0,0,0,.22);
}

.livre-hero-couverture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.livre-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b68b52;
  font-weight: 700;
  margin-bottom: 14px;
}

.livre-hero-info h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 42px;
  color: #2f2f2f;
  margin: 0 0 10px;
  line-height: 1.15;
}

.livre-auteur {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: #5a4a36;
  margin: 0 0 28px;
}

.livre-fiche-technique {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 16px 40px;
  padding: 24px 0;
  border-top: 1px solid #e2d5c2;
  border-bottom: 1px solid #e2d5c2;
  margin-bottom: 28px;
}

.livre-ft-item span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b68b52;
  font-weight: 700;
  margin-bottom: 4px;
}

.livre-ft-item strong {
  font-size: 17px;
  color: #2f2f2f;
  font-weight: 600;
}

.livre-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.livre-achat-btn {
  display: inline-block;
  padding: 13px 30px;
  background: #b68b52;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all .25s ease;
}

.livre-achat-btn:hover {
  background: #9c7440;
}

.livre-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  background: #fff;
  border: 1px solid rgba(182,139,82,.35);
  color: #b68b52;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all .25s ease;
}

.livre-pdf-btn:hover {
  background: rgba(182,139,82,.08);
  border-color: rgba(182,139,82,.60);
}

.livre-body {
  max-width: 860px;
  margin: 70px auto 0;
  padding: 0 30px;
}

.livre-chapo-hero {
  margin-top: 24px;
}

.livre-chapo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.6;
  color: #5a4a36;
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid #e2d5c2;
}

.livre-chapo p {
  margin: 0;
}

.livre-texte {
  font-size: 19px;
  line-height: 1.85;
  color: #3a3a3a;
}

.livre-texte p {
  margin: 0 0 22px;
}

/* --- NAVIGATION --- */
.livre-nav-module {
  max-width: 860px;
  margin: 64px auto 0;
  padding: 40px 40px 36px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 16px 44px rgba(0,0,0,.06);
}

.livre-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.livre-nav-link {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  background: #f7f5f0;
  border-radius: 16px;
  text-decoration: none;
  color: #2f2f2f;
  transition: transform .2s ease, background .2s ease;
}

.livre-nav-link:hover {
  transform: translateY(-3px);
  background: rgba(182,139,82,.10);
}

.livre-nav-next {
  text-align: right;
  align-items: flex-end;
}

.livre-nav-link span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b68b52;
  font-weight: 700;
  margin-bottom: 6px;
}

.livre-nav-link strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
}

.livre-nav-disabled {
  visibility: hidden;
}

/* --- RETOUR --- */
.livre-back-link {
  text-align: center;
  margin: 60px 0 100px;
}

.livre-back-link a {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid rgba(182,139,82,.35);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #b68b52;
  transition: all .25s ease;
}

.livre-back-link a:hover {
  background: rgba(182,139,82,.08);
  border-color: rgba(182,139,82,.60);
}

/* --- RESPONSIVE --- */
@media (max-width: 800px) {
  .livres-intro {
    margin: 190px auto 40px;
    padding: 0 22px;
  }

  .livres-intro h1 {
    font-size: 32px;
  }

  .livres-accroche {
    font-size: 24px;
  }

  .livres-etagere-section {
    padding: 28px 26px 0;
  }

  .livres-etagere-section::before {
    background-image:
      linear-gradient(
        to right,
        #5f4322 0px, #8f6a3b 3px, #b68b52 8px, #8f6a3b 13px, #5f4322 16px,
        rgba(0,0,0,.22) 16px, transparent 30px
      ),
      linear-gradient(
        to left,
        #5f4322 0px, #8f6a3b 3px, #b68b52 8px, #8f6a3b 13px, #5f4322 16px,
        rgba(0,0,0,.22) 16px, transparent 30px
      ),
      radial-gradient(ellipse at 50% 25%, rgba(182,139,82,.07), transparent 62%),
      repeating-linear-gradient(
        95deg,
        rgba(110,79,40,.03) 0px,
        rgba(110,79,40,.03) 1px,
        transparent 1px,
        transparent 7px
      );
    background-size: 30px 100%, 30px 100%, 100% 100%, 100% 100%;
  }

  /*
    Même logique que la version desktop, à l'échelle mobile :
      couverture ... 210px | marge 14px | titre 60px = 284px (H)
      espace avant la planche . 23px
      planche .................. 12px  -> 307px à 319px
      ombre portée (2 temps) ... 20px  -> 319px à 339px
      respiration avant la rangée suivante .. 31px
      ---------------------------- = 370px (C)
      consoles : 319-330px + ombre courte, à 32px des bords
  */
  .livres-etagere {
    grid-template-columns: repeat(auto-fit, minmax(130px, 150px));
    column-gap: 26px;
    row-gap: 86px;
    padding-bottom: 86px;
    background-image:
      linear-gradient(
        to bottom,
        transparent 0,
        transparent 319px,
        #8f6a3b 319px,
        #6e4f28 326px,
        #6e4f28 330px,
        rgba(0,0,0,.18) 330px,
        transparent 338px,
        transparent 370px
      ),
      linear-gradient(
        to bottom,
        transparent 0,
        transparent 319px,
        #8f6a3b 319px,
        #6e4f28 326px,
        #6e4f28 330px,
        rgba(0,0,0,.18) 330px,
        transparent 338px,
        transparent 370px
      ),
      repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 307px,
        #e3c6a4 307px,
        #b68b52 312px,
        #8f6a3b 317px,
        #6e4f28 319px,
        rgba(0,0,0,.24) 319px,
        rgba(0,0,0,.08) 328px,
        transparent 339px,
        transparent 370px
      );
    background-position: left 32px top 0, right 32px top 0, top center;
    background-size: 16px 370px, 16px 370px, 100% 370px;
    background-repeat: repeat-y, repeat-y, repeat-y;
  }

  .livre-couverture {
    height: 210px;
  }

  .livre-item-info {
    margin-top: 14px;
    height: 60px;
  }

  .livre-item-info h3 {
    font-size: 21px;
  }

  .livre-hero {
    grid-template-columns: 1fr;
    margin: 110px auto 0;
    padding: 0 22px;
    gap: 30px;
  }

  .livre-hero-couverture {
    max-width: 220px;
    margin: 0 auto;
  }

  .livre-hero-info {
    text-align: center;
  }

  .livre-fiche-technique {
    justify-content: center;
    text-align: left;
  }

  .livre-hero-info h1 {
    font-size: 30px;
  }

  .livre-body {
    margin-top: 44px;
    padding: 0 22px;
  }

  .livre-nav-module {
    margin: 44px 22px 0;
    padding: 28px 24px;
    border-radius: 18px;
  }

  .livre-nav {
    grid-template-columns: 1fr;
  }

  .livre-nav-next {
    text-align: left;
    align-items: flex-start;
  }
}
