/* rbd26: biblioteca de livros e retrato do hero.
   Escopo deliberadamente estreito. Nao altera cores globais, tipografia global,
   navegacao, rodape nem qualquer superficie fora da biblioteca e do retrato. */

/* ---------- capas: proporcao real, sem esticar, sem cortar ---------- */

.cover-viewer {
  aspect-ratio: auto;
  background: transparent;
  overflow: visible;
  display: block;
}

.cover-viewer picture {
  display: block;
}

.book-cover-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  object-fit: contain;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 2px;
  box-shadow: 0 14px 30px rgba(31, 26, 20, .16), 0 2px 6px rgba(31, 26, 20, .10);
  transition: transform .25s ease, box-shadow .25s ease;
}

.book-card-link:hover .book-cover-card,
.book-card-link:focus-visible .book-cover-card {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px rgba(31, 26, 20, .22), 0 3px 8px rgba(31, 26, 20, .12);
}

/* ---------- grelha da biblioteca: coleccao editorial, nao vitrine ---------- */

.book-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3.4rem 2.6rem;
  align-items: start;
}

.book-card {
  display: flex;
  flex-direction: column;
}

.book-card-link {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.book-card .cover-viewer {
  margin-bottom: 1.15rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 2 / 3;
}

.book-card .cover-viewer picture {
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.book-card .book-cover-card {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
}

.book-card .eyebrow {
  margin: 0;
  font-size: .68rem;
  letter-spacing: .16em;
}

.book-card h3 {
  margin: 0;
  line-height: 1.14;
  font-size: clamp(1.18rem, 1.5vw, 1.42rem);
}

.book-card .muted {
  margin: 0;
  min-height: 0;
  font-size: .93rem;
  line-height: 1.42;
}

.book-card p:not(.muted):not(.eyebrow) {
  margin: .2rem 0 0;
  font-size: .92rem;
  line-height: 1.55;
}

.book-card .text-link {
  margin-top: .35rem;
}

.book-card-actions {
  margin-top: auto;
  padding: .7rem 0 0;
}

/* placa tipografica: so para titulos sem arte editorial localizada */
.cover-viewer .book-cover-editorial,
.book-cover-editorial {
  width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 2 / 3;
  min-height: 0;
  padding: clamp(1.1rem, 2.2vw, 1.7rem);
  background: linear-gradient(145deg, #171512, #241f19 55%, #14120f);
  box-shadow: 0 14px 30px rgba(31, 26, 20, .16);
}

.cover-viewer .book-cover-editorial strong,
.book-cover-editorial strong {
  font-size: clamp(1.05rem, 1.7vw, 1.55rem);
  max-width: 13ch;
}

/* ---------- pagina individual do livro ---------- */

.book-cover-large {
  display: block;
}

.book-cover-large .cover-viewer,
.book-cover-large picture {
  display: block;
}

.book-cover-large .book-cover-card,
.book-cover-large img {
  width: min(100%, 24rem);
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  margin-inline: auto;
  border: 0;
  background: transparent;
  box-shadow: 0 26px 54px rgba(31, 26, 20, .20), 0 3px 8px rgba(31, 26, 20, .12);
}

.book-cover-large .book-cover-editorial {
  width: min(100%, 24rem);
  aspect-ratio: 2 / 3;
  min-height: 0;
}

/* capas relacionadas no fim da pagina do livro */
.related-card-media picture {
  display: block;
}

.related-cover {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 12px 26px rgba(31, 26, 20, .16);
}

.related-cover-placeholder {
  aspect-ratio: 2 / 3;
}

/* ---------- destaque Flywheel ---------- */

.flagship-cover-wrap picture {
  display: block;
}

.flagship-cover {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

/* ---------- retrato do hero: cabeca inteira, sem esticar ---------- */

.hero-portrait-rbd17 {
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 5;
  background: #efe9df;
}

.hero-portrait-rbd17 img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center 14%;
}

/* ---------- responsivo ---------- */

@media (max-width: 1024px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.8rem 2rem;
  }
}

@media (max-width: 760px) {
  .hero-portrait-rbd17 {
    aspect-ratio: 5 / 6;
    height: auto;
    min-height: 0;
  }
  .hero-portrait-rbd17 img {
    height: 100%;
    object-position: center 12%;
  }
  .book-cover-large .book-cover-card,
  .book-cover-large img,
  .book-cover-large .book-cover-editorial {
    width: min(100%, 18rem);
  }
}

@media (max-width: 560px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.2rem 1.2rem;
  }
  .book-card p:not(.muted):not(.eyebrow) {
    display: none;
  }
  .book-card h3 {
    font-size: 1.02rem;
  }
  .book-card .muted {
    font-size: .82rem;
  }
}
