/* Carrossel circular 3D dos e-books (home) — par de assets/ebooks-carousel.js */

/* Quando o carrossel está ativo, a lista original fica só como fonte de dados */
.ebooks--carousel .ebook__list,
.ebooks--carousel .ebooks__more { display: none; }

.ec {
  --ec-w: clamp(150px, 16vw, 200px);
  --ec-h: calc(var(--ec-w) * 1.75);   /* capas 760×1330 */
  --ec-arc: 0;                        /* >0: cards em arco largo (lido pelo JS) */
  margin-top: 56px;
  outline: none;
}
.ec:focus-visible .ec__stage {
  outline: 1px solid rgba(232, 201, 122, 0.5);
  outline-offset: 4px;
  border-radius: 18px;
}

/* Palco: ocupa a largura toda da tela para os lados sumirem na borda */
.ec__stage {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: calc(var(--ec-h) + 150px);
  perspective: 1500px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.ec.is-dragging .ec__stage { cursor: grabbing; }

.ec__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.ec__card {
  --dim: 0;
  position: absolute;
  top: calc(var(--ec-h) / -2);
  left: calc(var(--ec-w) / -2);
  width: var(--ec-w);
  height: var(--ec-h);
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #1A0F0A;
  border: 1px solid rgba(232, 201, 122, 0.32);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.8);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
  cursor: inherit;
}
.ec__card.is-active { cursor: pointer; }
.ec.is-dragging .ec__card { cursor: grabbing; }
.ec__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
/* Escurece os cards conforme se afastam da frente */
.ec__card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #0F0805;
  opacity: var(--dim);
  pointer-events: none;
}

/* Setas + bolinhas */
.ec__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: -22px;
  position: relative;
}
.ec__arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 122, 0.35);
  background: transparent;
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.ec__arrow:hover,
.ec__arrow:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: #1A0F0A;
  outline: none;
}
.ec__dots { display: flex; align-items: center; gap: 2px; }
.ec__dot {
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}
.ec__dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: rgba(232, 201, 122, 0.28);
  transition: background 0.3s, transform 0.3s;
}
.ec__dot.is-active::before { background: var(--gold-soft); transform: scale(1.35); }
.ec__dot:focus-visible { outline: 1px solid var(--gold-soft); border-radius: 6px; }

/* Texto do e-book que está na frente */
.ec__info {
  max-width: 560px;
  min-height: 250px;
  margin: 26px auto 0;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ec__info.is-swapping { opacity: 0; transform: translateY(6px); }
.ec__tag {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 500;
  margin-bottom: 10px;
}
.ec__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 12px;
}
.ec__desc {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-mute);
  margin-bottom: 22px;
}
.ec__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}
.ec__price {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.9rem;
  color: var(--gold);
}

/* Computador: capas maiores e anel mais aberto, ocupando as laterais */
@media (min-width: 1100px) {
  .ec { --ec-w: clamp(200px, 14vw, 260px); --ec-arc: 22; }
  .ec__stage { perspective: 1900px; }
}

@media (max-width: 600px) {
  .ec { --ec-w: 42vw; margin-top: 36px; }
  .ec__stage { height: calc(var(--ec-h) + 130px); perspective: 1000px; }
  .ec__nav { margin-top: -28px; }
  .ec__info { min-height: 270px; margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ec__info { transition: none; }
}
