/* ═══════════════════════════════════════════════════════════════════════════
   catalogo.css — componentes do catálogo da editora
   Carrossel de lançamentos e cartão de livro. Usado pela home e pelas
   páginas de categoria. Cada slide/cartão recebe as cores do próprio livro
   via variáveis inline (--acento, --acento-claro, --fundo, --papel).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Carrossel ────────────────────────────────────────────────────────────── */

.ed-launch { padding: 1.6rem 0 2.6rem; background: var(--pb-cream); }

.ed-launch-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.ed-launch-ctrl { display: flex; gap: .5rem; }
.ed-launch-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--pb-line); background: var(--pb-paper); color: var(--pb-ink);
  font-size: 1.05rem; cursor: pointer; transition: background .15s, border-color .15s;
}
.ed-launch-btn:hover { background: var(--pb-mint); border-color: var(--pb-emerald); }
.ed-launch-btn:focus-visible { outline: 2px solid var(--pb-emerald); outline-offset: 2px; }

/* A faixa alinha o primeiro slide com o .pb-wrap e deixa o próximo espiar. */
.ed-track {
  --gutter: max(1.5rem, calc((100vw - var(--pb-maxw)) / 2 + 1.5rem));
  position: relative; display: flex; gap: 1.2rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: .4rem var(--gutter) 1rem; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.ed-track::-webkit-scrollbar { display: none; }
.ed-track:focus-visible { outline: 2px solid var(--pb-emerald); outline-offset: -2px; }

.ed-slide {
  flex: 0 0 min(calc(var(--pb-maxw) - 3rem), calc(100vw - 3rem));
  scroll-snap-align: start;
  display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center;
  padding: 2.6rem 3rem; border-radius: var(--pb-radius-lg);
  min-height: 440px; position: relative; overflow: hidden;
}
.ed-slide-cover { display: block; flex: none; }
.cover-with-badge { position: relative; display: block; padding-top: 1.25rem; }
.cover-edition-badge {
  position: absolute; top: 0; right: 0; z-index: 2;
  max-width: 100%; padding: .22rem .4rem;
  background: #FED332; color: #111110;
  border: 1px solid rgba(17,17,16,.7); border-radius: 3px;
  font-family: 'Permanent Marker', var(--tk-mono, monospace);
  font-size: .62rem; line-height: 1.1; text-align: center;
}
.ed-slide-cover img {
  display: block; width: 250px; height: auto; aspect-ratio: 3/4; object-fit: contain; background: #F3F0E7;
  border-radius: 6px; transform: rotate(-2deg);
  box-shadow: 0 26px 50px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.2);
  transition: transform .25s ease;
}
.ed-slide-cover:hover img { transform: rotate(0) translateY(-4px); }

.ed-slide-body { max-width: 56ch; }
.ed-slide-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.ed-slide-cat, .ed-slide-new {
  font-family: var(--pb-sans); font-size: .7rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .32rem .7rem; border-radius: 999px;
}
.ed-slide-title { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.02; margin: 0 0 .5rem; font-weight: 700; }
.ed-slide-vol { font-size: .5em; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.ed-slide-sub { font-size: 1.12rem; margin: 0 0 1rem; font-weight: 500; }
.ed-slide-desc { font-family: var(--pb-sans); font-size: 1rem; line-height: 1.65; margin: 0 0 .5rem; }
.ed-slide-meta { font-size: .8rem; margin: 0 0 1.4rem; }
.ed-slide-actions { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; margin-top: 1.4rem; }
.ed-slide-link { font-family: var(--pb-sans); font-weight: 600; font-size: .92rem; }

/* Slide técnico: fundo da capa, tipografia de terminal, acento do livro */
.ed-slide--tech {
  background:
    radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--acento) 30%, transparent), transparent 70%),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 100% 26px,
    var(--fundo, #111);
  color: #E9E4D8;
}
.ed-slide--tech .ed-slide-title { font-family: 'Permanent Marker', var(--pb-serif); font-weight: 400; color: #fff; letter-spacing: .01em; }
.ed-slide--tech .ed-slide-vol { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--acento-claro); letter-spacing: 0; }
.ed-slide--tech .ed-slide-sub { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--acento-claro); font-size: 1rem; }
.ed-slide--tech .ed-slide-sub::before { content: "// "; opacity: .6; }
.ed-slide--tech .ed-slide-desc { color: #C7C1B3; }
.ed-slide--tech .ed-slide-meta { font-family: 'JetBrains Mono', ui-monospace, monospace; color: #8F8A7E; }
.ed-slide--tech .ed-slide-cat { background: rgba(255,255,255,.08); color: #E9E4D8; }
.ed-slide--tech .ed-slide-new { background: var(--acento); color: #fff; }
.ed-slide--tech .ed-slide-cta { background: var(--acento); color: #fff; border: 0; }
.ed-slide--tech .ed-slide-cta:hover { filter: brightness(1.12); text-decoration: none; }
.ed-slide--tech .ed-slide-link { color: var(--acento-claro); }

/* Slide editorial: papel, serifa, ouro */
.ed-slide--editorial {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(201,162,39,.22), transparent 70%),
    var(--pb-gold-wash);
  border: 1px solid var(--pb-line);
  color: var(--pb-ink);
}
.ed-slide--editorial .ed-slide-title { font-family: var(--pb-serif); font-weight: 600; }
.ed-slide--editorial .ed-slide-sub { font-family: var(--pb-serif); font-style: italic; color: var(--pb-forest); }
.ed-slide--editorial .ed-slide-desc { color: var(--pb-muted); }
.ed-slide--editorial .ed-slide-cat { background: var(--pb-mint); color: var(--pb-emerald); }
.ed-slide--editorial .ed-slide-new { background: var(--pb-gold); color: var(--pb-ink); }
.ed-slide--editorial .ed-slide-cta { background: var(--pb-emerald); color: #fff; border: 0; }
.ed-slide--editorial .ed-slide-cta:hover { background: var(--pb-accent-dk); text-decoration: none; }
.ed-slide--editorial .ed-slide-link { color: var(--pb-emerald); }

/* Slide beleza: blush, serifa, rosé (cores do próprio livro) */
.ed-slide--beleza {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(217,165,160,.35), transparent 70%),
    #FBF3EF;
  border: 1px solid #EAD7D0;
  color: #2A1E22;
}
.ed-slide--beleza .ed-slide-title { font-family: var(--pb-serif); font-weight: 600; }
.ed-slide--beleza .ed-slide-sub { font-family: var(--pb-serif); font-style: italic; color: var(--acento); }
.ed-slide--beleza .ed-slide-desc, .ed-slide--beleza .ed-slide-meta { color: #7A6267; }
.ed-slide--beleza .ed-slide-cat { background: #F3DEDA; color: var(--acento); }
.ed-slide--beleza .ed-slide-new { background: var(--acento); color: #fff; }
.ed-slide--beleza .ed-slide-cta { background: var(--acento); color: #fff; border: 0; }
.ed-slide--beleza .ed-slide-cta:hover { filter: brightness(1.1); text-decoration: none; }
.ed-slide--beleza .ed-slide-link { color: var(--acento); }

.ed-dots { display: flex; justify-content: center; gap: .5rem; margin-top: .6rem; }
.ed-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0;
  background: var(--pb-line); cursor: pointer; transition: width .25s ease, background .25s ease;
}
.ed-dot[aria-current="true"] { width: 28px; background: var(--pb-emerald); }
.ed-dot:focus-visible { outline: 2px solid var(--pb-emerald); outline-offset: 3px; }

@media (max-width: 760px) {
  .ed-launch-ctrl { display: none; }
  .ed-track { gap: .8rem; --gutter: 1rem; }
  .ed-slide {
    flex-basis: calc(100vw - 2.6rem);
    grid-template-columns: 1fr; gap: 1.4rem; padding: 1.6rem 1.3rem; min-height: 0;
    align-items: start;
  }
  .ed-slide-cover img { width: 150px; }
  .ed-slide-title { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ed-track { scroll-behavior: auto; }
  .ed-slide-cover img, .ed-dot { transition: none; }
}

/* ── Cartão de livro (grades de categoria e série) ────────────────────────── */

.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.8rem; }
.bk-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.bk-card:hover { text-decoration: none; }
.bk-card-main { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.bk-card-main:hover { color: inherit; text-decoration: none; }
.bk-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.bk-card .review-rating-link { margin-top: .7rem; }
.bk-card-cover {
  display: block; width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #F3F0E7; border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0,0,0,.22); transition: transform .2s ease, box-shadow .2s ease;
}
.bk-card:hover .bk-card-cover { transform: translateY(-5px); box-shadow: 0 22px 40px rgba(0,0,0,.28); }
.bk-card-title { font-weight: 700; font-size: 1.12rem; margin: 1rem 0 .2rem; line-height: 1.25; }
.bk-card-sub { font-size: .9rem; line-height: 1.5; margin: 0; }

.ed-combos { display: grid; gap: 1rem; margin-top: 1.4rem; }
.combo-oferta {
  display: grid; grid-template-columns: minmax(148px, 210px) minmax(0, 1fr); gap: 1.2rem; align-items: start;
  padding: 1.1rem 1.2rem; border: 1px solid var(--pb-line, var(--border)); border-radius: 14px;
  background: var(--pb-paper, #fff);
}
.combo-oferta > div:last-child { min-width: 0; }
.combo-oferta-capas {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; min-width: 0;
}
.combo-oferta-capas img {
  width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #F3F0E7;
  border-radius: 4px; margin: 0; box-shadow: 0 8px 18px rgba(0,0,0,.14);
}
.combo-oferta-kicker {
  margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--pb-gold-dk, #8A6A1F);
}
.combo-oferta h3 { font-family: var(--pb-serif, Georgia, serif); font-size: 1.35rem; margin: .2rem 0 .3rem; }
.combo-oferta h3 a { color: inherit; text-decoration: none; }
.combo-oferta p, .combo-oferta li { margin: 0; line-height: 1.5; }
.combo-oferta ul { margin: .35rem 0 .7rem; padding-left: 1.1rem; }
.combo-oferta .preco-conta {
  display: grid; gap: .15rem; margin: .75rem 0 .9rem; padding: 0;
}
.combo-oferta .preco-conta-linha {
  display: grid; grid-template-columns: minmax(7.5rem, 1fr) auto;
  gap: .35rem 1rem; align-items: baseline; margin: 0; padding: .38rem 0;
  border-top: 1px solid var(--pb-line, var(--border, #e4e0d6));
}
.combo-oferta .preco-conta dt,
.combo-oferta .preco-conta dd { margin: 0; }
.combo-oferta .preco-conta dt {
  font-size: .82rem; font-weight: 650; color: var(--pb-muted, #666);
}
.combo-oferta .preco-conta dd {
  margin: 0; font-size: 1.05rem; font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--pb-ink, inherit);
}
.combo-oferta .preco-conta-linha--pago dd { font-size: 1.35rem; }
.combo-oferta .preco-conta-linha--referencia dd {
  font-size: 1rem; font-weight: 600; color: var(--pb-muted, #666);
}
.combo-oferta-btn {
  display: inline-block; padding: .65rem 1rem; border-radius: 999px;
  background: var(--pb-emerald, #1E7A57); color: #fff; font-weight: 700; text-decoration: none;
}
.combo-oferta-btn:hover { text-decoration: none; }
@media (max-width: 720px) {
  .combo-oferta { grid-template-columns: 1fr; }
}
