/* RBD-27 — capas consistentes e audio sem mensagens de erro intrusivas.
   O frame e fixo; a arte editorial NUNCA e cortada ou deformada. */
.book-grid .book-card .cover-viewer.cover-viewer-card {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eeeae3;
  box-shadow: 0 14px 30px rgba(31, 26, 20, .15);
}
.book-grid .book-card .cover-viewer.cover-viewer-card > picture {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.book-grid .book-card .cover-viewer.cover-viewer-card .book-cover-card {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.book-grid .book-card .cover-viewer.cover-viewer-card .book-cover-editorial {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  padding: clamp(.7rem, 1.8vw, 1.5rem);
}
.book-grid .book-card .book-card-link:hover .cover-viewer .book-cover-card,
.book-grid .book-card .book-card-link:focus-visible .cover-viewer .book-cover-card {
  box-shadow: none;
}
/* Paginas individuais: mesma relacao 2:3 e nenhuma imagem estoura o container. */
.book-cover-large {
  display: flex;
  justify-content: center;
  min-width: 0;
  margin: 0;
}
.book-cover-large .cover-viewer {
  display: block;
  width: min(100%, 24rem);
  height: auto;
  aspect-ratio: 2 / 3;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eeeae3;
  box-shadow: 0 18px 40px rgba(31, 26, 20, .15);
}
.book-cover-large .cover-viewer > picture {
  display: block;
  width: 100%;
  height: 100%;
}
.book-cover-large .cover-viewer .book-cover-card,
.book-cover-large .cover-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.book-cover-large .cover-viewer .book-cover-editorial {
  width: 100%;
  height: 100%;
  padding: clamp(.75rem, 1.8vw, 1.5rem);
}
/* Relacionados: corrigir também capas nas paginas especiais, sem cortar. */
.related-card-media {
  overflow: hidden;
  aspect-ratio: 2 / 3;
}
.related-card-media > picture {
  display: block;
  width: 100%;
  height: 100%;
}
.related-card-media .book-cover-card,
.related-card-media .related-cover {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
  padding: 0;
  border: 0;
}
.related-card-media .book-cover-editorial {
  padding: .65rem;
}
/* Audiodescricao: botao tem rótulo curto; sem suporte = oculto, nunca erro-CTA. */
.audio-button[hidden] {
  display: none !important;
}
.page-hero-book .actions {
  align-items: stretch;
  gap: .75rem;
}
.page-hero-book .actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 3rem;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
@media (max-width: 760px) {
  .book-cover-large .cover-viewer {
    width: min(100%, 18rem);
  }
  .page-hero-book .actions .button {
    flex: 1 1 12rem;
  }
}

/* EC-EPUB20 — extensão de leitura mensurada, sem confundir com livro impresso. */
.book-page-extent,
.book-reading-metadata {
  margin: .9rem 0 1.2rem;
  padding: .75rem .95rem;
  border-left: 2px solid #9f6f1f;
  background: rgba(159, 111, 31, .055);
  color: #272522;
  font-size: .95rem;
  line-height: 1.5;
}
.book-page-extent strong,
.book-reading-metadata strong { font-weight: 700; }
.book-page-extent span,
.book-reading-metadata small {
  display: block;
  color: #655e52;
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.5;
  margin-top: .2rem;
}
@media (max-width: 760px) {
  .book-page-extent, .book-reading-metadata { font-size: .88rem; }
}

/* Audio accessibility: readable fallback when a device has no male Portuguese voice. */
.audio-inline-notice {
  display: inline-block;
  flex: 1 1 100%;
  color: #655e52;
  font-size: .85rem;
  line-height: 1.45;
  max-width: 45rem;
}

/* Six-locale selector: accessible in desktop navigation and mobile menu. */
.rbd-language-control { display:inline-flex; align-items:center; flex-shrink:0; margin-inline:.4rem; }
.rbd-language-control select { width:5.25rem; padding:.45rem .35rem; border:1px solid #a99e8b; border-radius:.3rem; background:#fff; color:#222; font:inherit; font-size:.82rem; cursor:pointer; }
.rbd-language-control select:focus-visible { outline:3px solid #9f6f1f; outline-offset:2px; }
.mobile-menu .rbd-language-control { padding:.35rem 0; width:max-content; }

/* AI narration must always be visibly disclosed in every locale. */
.audio-ai-disclosure { display: inline-block; align-self: center; margin-inline-start: .25rem; font-size: .77rem; line-height: 1.3; color: #655e52; }
