/* =========================
   MIDIA.CSS (limpo e consolidado)
   =========================
   Correções feitas:
   - Removidas duplicações (.image-wrap .overlay, .image-wrap img,
     .book-excerpt p 3x, .book-info .book-description)
   - Consolidados 4 blocos @media (max-width: 800px) em um único
   - Removidos !important desnecessários
   - Substituídas cores hardcoded por variáveis CSS
   - Movido @keyframes pulseShadow para fora do @media
   - Corrigida indentação inconsistente
   - Removidas regras pertencentes ao home.css (linhas 375-420)
   - Corrigido conflito de scale duplo (gallery-item + image-wrap)
*/
/* ==================== SEÇÕES DE MÍDIA ==================== */
.media-section {
  margin-top: 60px;
  margin-bottom: 60px;
}
.section-title {
  font-family: 'BrolinkDemo', serif;
  font-size: 25px;
  text-align: left;
  margin-bottom: 30px;
  background: linear-gradient(90deg, var(--accent), #ffffff, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 14s linear infinite;
}

  .section-title::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 12px;

  background: linear-gradient(
    90deg,
    rgba(166,124,82,0) 0%,
    rgba(166,124,82,0.65) 20%,
    rgba(255,255,255,0.9) 50%,
    rgba(166,124,82,0.65) 80%,
    rgba(166,124,82,0) 100%
  );

  opacity: 0.9;
}
/* ==================== VÍDEOS ==================== */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  justify-content: center;
}
.video-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}
.video-card img {
  width: 100%;
  display: block;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}
.video-card span {
  display: block;
  padding: 10px;
  font-weight: 600;
  color: var(--text);
}
.video-card:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(166, 124, 82, 0.4),
              0 0 15px rgba(166, 124, 82, 0.2);
}
/* ==================== MODAL DE VÍDEO ==================== */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow-y: auto;
  padding: 20px 0;
}
.video-content {
  max-width: 600px;
  width: 90%;
  position: relative;
  margin: auto;
}
.video-content video {
  width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 8px;
  display: block;
}
.video-modal .close {
  position: absolute;
  top: -40px;
  right: 0;
  color: var(--card);
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.2s;
}
.video-modal .close:hover {
  transform: scale(1.2);
}
/* ==================== PERSONAGENS / GALERIA ==================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.gallery-item {
  text-align: center;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}
/* Removido transform: scale do gallery-item para evitar scale composto com image-wrap */
.gallery-item:hover {
  box-shadow: 0 12px 40px rgba(166, 124, 82, 0.4),
              0 0 15px rgba(166, 124, 82, 0.2);
}
.image-wrap {
  position: relative;
  overflow: hidden;
}
/* Consolidado: .image-wrap img (era duplicado) */
.image-wrap img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.image-wrap:hover img {
  transform: scale(1.05);
}
/* Consolidado: .image-wrap .overlay (era duplicado com transition diferente) */
.image-wrap .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: var(--card);
  padding: 10px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.4s ease;
  z-index: 2;
}
.image-wrap:hover .overlay {
  opacity: 1;
  transform: translateY(0);
}
/* Mostrar/ocultar texto por clique (classe aplicada via JS) */
.image-wrap .overlay.show {
  opacity: 1;
  transform: translateY(0);
}
.image-wrap.active img {
  transform: scale(1.3);
  position: relative;
  z-index: 1;
}
.image-wrap.active .overlay {
  opacity: 1;
  transform: translateY(0);
}
.description {
  padding: 10px;
  font-weight: bold;
  color: var(--text);
}
/* ==================== ÁUDIOS ==================== */
.audios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.audio-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
  padding-bottom: 10px;
}
.audio-card img {
  width: 100%;
  display: block;
}
.audio-card span {
  display: block;
  padding: 10px;
  font-weight: 600;
  color: var(--text);
}
.audio-card audio {
  width: 90%;
  margin-top: 8px;
}
.audio-card:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(166, 124, 82, 0.4),
              0 0 15px rgba(166, 124, 82, 0.2);
}
/* ==================== PDF MOBILE ==================== */
.pdf-mobile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 55vh;
  border-radius: 14px;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.08));
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  border: 1px dashed rgba(0, 0, 0, 0.15);
}
/* ==================== ANIMAÇÕES ==================== */
/* Movido para fora do @media para melhor compatibilidade */
@keyframes pulseShadow {
  from {
    box-shadow: 0 0 15px 3px rgba(166, 124, 82, 0.4);
  }
  to {
    box-shadow: 0 0 25px 7px rgba(166, 124, 82, 0.7);
  }
}

/* ==================== RESPONSIVO: 800px (CONSOLIDADO) ==================== */
@media (max-width: 800px) {

  /* Galeria mobile */
  .image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text);
  }
  .image-wrap img {
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    margin: 0 auto;
  }

  /* AUMENTO DO TEXTO DA DESCRIÇÃO (SOMENTE MOBILE) */
  .image-wrap .overlay {
    font-size: 15px; /* era 14px no desktop */
  }

  /* Desativa hover em touch, mas NÃO atrapalha quando estiver ativo (clique) */
  .image-wrap:not(.active):hover .overlay {
    opacity: 0;
    transform: translateY(100%);
  }

  /* Garante prioridade do clique no mobile (evita “hover preso” matar o texto) */
  .image-wrap.active .overlay {
    opacity: 1;
    transform: translateY(0);
  }

  /* Personagens - zoom por clique */
  .gallery .image-wrap img.enlarged {
    transform: scale(1.3);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
  }

  /* Capa do livro - efeito pulsante */
  .book-cover img {
    width: 80%;
    max-width: 220px;
    height: auto;
    box-shadow: 0 0 20px 5px rgba(166, 124, 82, 0.5);
    animation: pulseShadow 2s infinite alternate;
  }
}

/* ==================== RESPONSIVO: 700px ==================== */
@media (max-width: 700px) {
  .section-title {
    font-size: 28px;
  }
  .video-modal .close {
    top: -25px;
    font-size: 24px;
  }
}

/* ==================== RESPONSIVO: 600px ==================== */
@media (max-width: 600px) {
  .video-content {
    max-width: 100%;
    padding: 0 10px;
  }
  .video-content video {
    max-height: 60vh;
  }
}
@media (max-width: 560px){
  .book-cover img,
  .book-feature__cover img{
    width: 100%;
    max-width: 220px;
  }
}
