/* Bannière animée Noël 2026 - Book-e-Book
   Toutes les tailles sont en cqw (1 % de la largeur de la bannière) : la bannière garde
   ses proportions quelle que soit la largeur de la colonne. Deux mises en page :
   large (>= 600 px) et portrait (< 600 px). */

@font-face {
  font-family: "BN Oswald";
  src: url("fonts/oswald-variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}

.beb-noel {
  container-type: inline-size;
  width: 100%;
  margin: 0 0 1rem 0;
}

.beb-noel *,
.beb-noel *::before,
.beb-noel *::after {
  box-sizing: border-box;
}

.bn-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1110 / 260;
  border-radius: 0.6cqw;
  font-family: "BN Oswald", "Oswald", "Arial Narrow", sans-serif;
  color: #fff;
  line-height: 1.1;
  background: #0b1a30;
  isolation: isolate;
}

:where(.bn-stage) p {
  margin: 0;
  padding: 0;
}

/* Lien vers la fiche du tome 2 : couche transparente sur toute la bannière, au-dessus du décor et des textes */
.bn-lien {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  border-radius: inherit;
}

.bn-lien:focus-visible {
  outline: 3px solid #f4c84a;
  outline-offset: -3px;
}

/* ---------- Décor ---------- */

.bn-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38% 120% at 4% 105%, rgba(176, 52, 138, 0.55), transparent 70%),
    radial-gradient(30% 90% at 30% -10%, rgba(40, 150, 160, 0.35), transparent 70%),
    radial-gradient(45% 110% at 100% 0%, rgba(18, 112, 124, 0.55), transparent 70%),
    radial-gradient(40% 90% at 72% 115%, rgba(40, 70, 170, 0.45), transparent 70%),
    linear-gradient(115deg, #0a1530 0%, #0b2140 45%, #0c2c42 100%);
}

/* Halo doré et rayons, dans l'esprit de la couverture du tome 2 */
.bn-glow {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 34cqw;
  height: 34cqw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 206, 92, 0.62) 0%, rgba(255, 178, 60, 0.28) 30%, rgba(255, 160, 40, 0) 66%);
  pointer-events: none;
}

.bn-rays {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 60cqw;
  height: 60cqw;
  margin: -30cqw 0 0 -30cqw;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 140, 0.2) 0deg 5deg, rgba(255, 220, 140, 0) 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, rgba(0, 0, 0, 0.55) 26%, transparent 52%);
  mask-image: radial-gradient(circle, #000 8%, rgba(0, 0, 0, 0.55) 26%, transparent 52%);
  pointer-events: none;
}

.bn-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bn-fx-front {
  z-index: 3;
}

/* ---------- Livres ---------- */

.bn-books {
  position: absolute;
  left: 0;
  top: 0;
  width: 36%;
  height: 100%;
  z-index: 2;
}

.bn-book {
  position: absolute;
  aspect-ratio: 525 / 900;
}

.bn-book1 {
  left: 18%;
  top: 9%;
  height: 80%;
}

.bn-book2 {
  left: 45%;
  top: 11%;
  height: 84%;
}

.bn-float,
.bn-tilt {
  width: 100%;
  height: 100%;
}

.bn-book1 .bn-tilt {
  transform: perspective(40cqw) rotateY(16deg) rotate(-6deg);
}

.bn-book2 .bn-tilt {
  transform: perspective(40cqw) rotateY(-12deg) rotate(4deg);
}

.bn-tilt {
  position: relative;
  border-radius: 0.25cqw 0.45cqw 0.45cqw 0.25cqw;
  box-shadow:
    0 1.4cqw 2.6cqw rgba(0, 0, 0, 0.55),
    0 0.3cqw 0.6cqw rgba(0, 0, 0, 0.45);
}

.bn-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.bn-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pli du dos et tranche */
.bn-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(255, 255, 255, 0.28) 2.2%, rgba(0, 0, 0, 0.18) 4.5%, rgba(0, 0, 0, 0) 9%);
}

/* Reflet qui balaie la couverture */
.bn-cover::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-120%) skewX(-12deg);
  opacity: 0;
}

/* ---------- Textes ---------- */

.bn-text {
  position: absolute;
  left: 37.5%;
  right: 2.5%;
  top: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bn-kicker {
  font-size: 1.42cqw;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f6cd5a;
}

.bn-title {
  margin-top: 0.2cqw;
  font-size: 3.9cqw;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0.2cqw 1.2cqw rgba(0, 0, 0, 0.45);
}

.bn-offers {
  display: flex;
  align-items: stretch;
  gap: 2.2cqw;
  margin-top: 1.3cqw;
}

.bn-offer {
  flex: 1 1 0;
  min-width: 0;
}

.bn-port {
  padding-left: 1.4cqw;
  border-left: 0.22cqw solid rgba(246, 205, 90, 0.85);
}

.bn-label {
  font-size: 1.35cqw;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.bn-price {
  font-size: 5.1cqw;
  font-weight: 700;
  line-height: 1;
  color: #f6cd5a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform-origin: 0 60%;
}

.bn-price.bn-counting {
  color: #fff;
}

.bn-sub {
  font-size: 1.5cqw;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}

.bn-sub2 {
  margin-top: 0.35cqw;
  font-size: 1.3cqw;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.78);
}

/* Bulle jaune, reprise de la bulle "Tome 2 !" de la couverture */
.bn-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.9cqw;
  padding: 0.7cqw 1.5cqw 0.75cqw 1.2cqw;
  border-radius: 1cqw;
  background: #f3c534;
  color: #14212c;
  font-size: 3cqw;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0.5cqw 1.4cqw rgba(0, 0, 0, 0.35);
  transform-origin: 12% 100%;
}

.bn-bubble::after {
  content: "";
  position: absolute;
  left: 2.2cqw;
  bottom: -1cqw;
  border-style: solid;
  border-width: 1.05cqw 0.9cqw 0 0.4cqw;
  border-color: #f3c534 transparent transparent transparent;
}

.bn-gift {
  width: 2.5cqw;
  height: 2.5cqw;
  flex: none;
  transform-origin: 50% 90%;
}

.bn-ebook .bn-sub {
  margin-top: 1.55cqw;
}

.bn-code {
  display: inline-block;
  position: relative;
  overflow: hidden;
  margin-top: 0.6cqw;
  padding: 0.25cqw 0.9cqw 0.3cqw;
  border: 0.13cqw dashed rgba(246, 205, 90, 0.9);
  border-radius: 0.4cqw;
  font-size: 1.45cqw;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9);
}

.bn-code b {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f6cd5a;
}

.bn-code::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-150%);
}

/* ---------- Mise en page portrait (mobile) ---------- */

@container (max-width: 599px) {
  .bn-stage {
    aspect-ratio: 360 / 560;
    border-radius: 2cqw;
  }

  .bn-glow {
    left: 50%;
    top: 21%;
    width: 110cqw;
    height: 110cqw;
  }

  .bn-rays {
    left: 50%;
    top: 21%;
    width: 170cqw;
    height: 170cqw;
    margin: -85cqw 0 0 -85cqw;
  }

  .bn-books {
    width: 100%;
    height: 42%;
  }

  .bn-book1 {
    left: 21%;
    top: 9%;
    height: 82%;
  }

  .bn-book2 {
    left: 46%;
    top: 11%;
    height: 86%;
  }

  .bn-book1 .bn-tilt {
    transform: perspective(120cqw) rotateY(16deg) rotate(-6deg);
  }

  .bn-book2 .bn-tilt {
    transform: perspective(120cqw) rotateY(-12deg) rotate(4deg);
  }

  .bn-tilt {
    border-radius: 0.8cqw 1.4cqw 1.4cqw 0.8cqw;
    box-shadow:
      0 4cqw 7cqw rgba(0, 0, 0, 0.55),
      0 1cqw 2cqw rgba(0, 0, 0, 0.45);
  }

  .bn-text {
    left: 6%;
    right: 6%;
    top: 43%;
    bottom: 3.5%;
    justify-content: flex-start;
    text-align: center;
    align-items: center;
  }

  .bn-kicker {
    font-size: 3.6cqw;
    letter-spacing: 0.14em;
  }

  .bn-title {
    margin-top: 0.6cqw;
    font-size: 8.1cqw;
    white-space: nowrap;
  }

  .bn-offers {
    flex-direction: column;
    align-items: center;
    gap: 4.2cqw;
    margin-top: 3.6cqw;
    width: 100%;
  }

  .bn-offer {
    flex: none;
    width: 100%;
  }

  .bn-port {
    padding-left: 0;
    border-left: 0;
  }

  .bn-label {
    font-size: 3.6cqw;
  }

  .bn-price {
    font-size: 13.5cqw;
    transform-origin: 50% 60%;
  }

  .bn-sub {
    font-size: 4.1cqw;
  }

  .bn-sub2 {
    margin-top: 0.8cqw;
    font-size: 3.6cqw;
  }

  .bn-bubble {
    gap: 2.4cqw;
    padding: 2cqw 4cqw 2.1cqw 3.2cqw;
    border-radius: 2.8cqw;
    font-size: 7.6cqw;
    transform-origin: 50% 100%;
  }

  .bn-bubble::after {
    left: 50%;
    bottom: -2.8cqw;
    margin-left: -1.6cqw;
    border-width: 3cqw 1.6cqw 0 1.6cqw;
  }

  .bn-gift {
    width: 7cqw;
    height: 7cqw;
  }

  .bn-ebook .bn-sub {
    margin-top: 4cqw;
  }

  .bn-code {
    margin-top: 1.6cqw;
    padding: 0.8cqw 2.6cqw 0.9cqw;
    border-width: 0.35cqw;
    border-radius: 1.2cqw;
    font-size: 4cqw;
  }
}

/* ---------- Animations (seulement quand le script a démarré) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .bn-anim:not(.bn-go) .bn-e {
    opacity: 0;
  }

  .bn-anim.bn-go .bn-e {
    animation: bn-in 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) var(--d, 0s) both;
  }

  .bn-anim.bn-go .bn-bg {
    animation: bn-fade 0.8s ease-out both;
  }

  .bn-anim.bn-go .bn-glow {
    animation:
      bn-fade 1.2s ease-out 0.2s both,
      bn-pulse 4.5s ease-in-out 1.4s infinite;
  }

  .bn-anim.bn-go .bn-rays {
    animation:
      bn-fade 1.6s ease-out 0.3s both,
      bn-spin 90s linear infinite;
  }

  .bn-anim.bn-go .bn-book.bn-e {
    animation: bn-book-in 0.95s cubic-bezier(0.22, 1.25, 0.4, 1) var(--d, 0s) both;
  }

  .bn-anim.bn-go .bn-book1 .bn-float {
    animation: bn-float 5.5s ease-in-out 1.2s infinite;
  }

  .bn-anim.bn-go .bn-book2 .bn-float {
    animation: bn-float 6.5s ease-in-out 1.6s infinite reverse;
  }

  .bn-anim.bn-go .bn-book1 .bn-cover::after {
    animation: bn-sheen 8s ease-in-out 2.6s infinite;
  }

  .bn-anim.bn-go .bn-book2 .bn-cover::after {
    animation: bn-sheen 8s ease-in-out 2.9s infinite;
  }

  .bn-anim.bn-go .bn-bubble.bn-e {
    animation:
      bn-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) var(--d, 0s) both,
      bn-wiggle 7s ease-in-out calc(var(--d, 0s) + 3s) infinite;
  }

  .bn-anim.bn-go .bn-gift {
    animation: bn-gift 7s ease-in-out 4.6s infinite;
  }

  .bn-anim.bn-go .bn-code::after {
    animation: bn-code-sheen 7s ease-in-out 4.2s infinite;
  }

  .bn-price.bn-pop {
    animation: bn-price-pop 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both;
  }
}

@keyframes bn-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bn-in {
  from { opacity: 0; transform: translateY(1.2cqw); }
  to { opacity: 1; transform: none; }
}

@keyframes bn-book-in {
  0% { opacity: 0; transform: translateY(40%) rotate(-8deg) scale(0.85); }
  45% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

@keyframes bn-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3.5%) rotate(0.8deg); }
}

@keyframes bn-sheen {
  0% { opacity: 0; transform: translateX(-120%) skewX(-12deg); }
  4% { opacity: 1; }
  22% { opacity: 1; transform: translateX(420%) skewX(-12deg); }
  23%, 100% { opacity: 0; transform: translateX(420%) skewX(-12deg); }
}

@keyframes bn-pulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.82; transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes bn-spin {
  to { transform: rotate(360deg); }
}

@keyframes bn-pop {
  0% { opacity: 0; transform: scale(0.4) rotate(-6deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes bn-wiggle {
  0%, 86%, 100% { transform: none; }
  89% { transform: rotate(-3deg) scale(1.04); }
  92% { transform: rotate(2.5deg) scale(1.04); }
  95% { transform: rotate(-1.2deg); }
}

@keyframes bn-gift {
  0%, 84%, 100% { transform: none; }
  88% { transform: translateY(-14%) rotate(-8deg); }
  92% { transform: translateY(0) rotate(6deg); }
  95% { transform: rotate(-3deg); }
}

@keyframes bn-code-sheen {
  0%, 70% { transform: translateX(-150%); }
  85%, 100% { transform: translateX(350%); }
}

@keyframes bn-price-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
