/* =========================
   ESTILO GERAL
========================= */
body {
  background-color: #000;
  color: #e5e7eb;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* =========================
   MENU
========================= */
.navbar-brand {
  font-weight: bold;
  font-size: 1.2rem;
}

.nav-link {
  color: #fff !important;
}

.nav-link:hover {
  color: #0d6efd !important;
}

/* =========================
   IMAGENS
========================= */
.cover-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.autor-img {
  max-width: 150px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  margin-top: 20px;
}

/* =========================
   SINOPSE
========================= */
.sinopse {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: 10px;
}

/* =========================
   TEXTO
========================= */
.subtitulo {
  color: #d1d5db;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

h1, h2, h3 {
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

strong {
  color: #fff;
}

em {
  color: #e5e7eb;
  font-style: italic;
}

/* =========================
   AMOSTRA
========================= */
.amostra-livro {
  margin-top: 40px;
  padding: 30px;
  background-color: #0f1f1a;
  border-radius: 10px;
  text-align: center;
}

.amostra-livro h2 {
  color: #fff;
  margin-bottom: 15px;
}

.amostra-livro p {
  color: #cfcfcf;
  font-size: 16px;
  margin-bottom: 25px;
}

.btn-amostra {
  display: inline-block;
  padding: 14px 30px;
  background-color: #1fa97a;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 30px;
  transition: background 0.3s;
}

.btn-amostra:hover {
  background-color: #168a63;
}

/* =========================
   CARDS GRID
========================= */
.card-item {
  cursor: pointer;
}

.img-wrapper {
  width: 100%;
  aspect-ratio: 1122 / 2000;
  overflow: hidden;
  position: relative;
}

.img-wrapper img,
.img-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* botão som */
.btn-som {
  position: absolute;
  bottom: 90px;
  left: 20%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 5px;
  z-index: 2;
}

/* =========================
   OVERLAY / MODAL
========================= */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 1000;
}

#cardExpandido {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  display: none;
  z-index: 1001;
  transition: 0.3s ease;
}

/* =========================
   MODAL - MOBILE FIRST
========================= */
#cardExpandido img,
#videoExpandido {
  width: 90vw;
  max-width: 320px;
  height: auto;
  border-radius: 8px;
}

/* vídeo extra */
#videoExpandido {
  padding-bottom: 40px;
  background: #000;
}

/* =========================
   BOTÃO FECHAR
========================= */
#fecharCard {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 1002;
}

/* =========================
   CONTROLES VÍDEO
========================= */
.controles-video {
  position: absolute;
  bottom: 10px;
  width: 100%;
  justify-content: center;
  gap: 10px;
  display: none;
}

.controles-video button {
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 576px) {

  .cover-img {
    max-width: 70%;
    margin: 0 auto;
    display: block;
  }

  .sinopse {
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
  }

  .sinopse h3 {
    text-align: center;
  }

  .navbar-brand {
    font-size: 1rem;
  }
}

/* =========================
   TABLET / DESKTOP
========================= */
@media (min-width: 768px) {

  .row.g-2 {
    max-width: 600px;
    margin: 0 auto;
    background-color: #000;
    padding: 10px;
    border-radius: 10px;
  }

  .img-wrapper {
    max-width: 160px;
    margin: 0 auto;
  }

  /* 🔥 AQUI RESOLVE O ESTOURO */
  #cardExpandido img,
  #videoExpandido {
    max-height: 80vh;
    width: auto;
    max-width: 260px;
  }

  .card {
    background-color: #000;
    border: none;
  }
}

/* =========================
   DESKTOP GRANDE
========================= */
@media (min-width: 1200px) {

  .row.g-2 {
    max-width: 700px;
  }

  .img-wrapper {
    max-width: 180px;
  }

  #cardExpandido img,
  #videoExpandido {
    max-width: 320px;
  }
}