/* ========= ACERVO — acervo.html ========= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.card-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.2rem;
}

/* ========= BOOK CARDS (Capas de Livros) ========= */
.book-card {
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease;
  max-width: 140px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.book-card:hover {
  transform: translateY(-2px);
}

.book-card-cover {
  width: 100%;
  max-width: 140px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* lombada — sugestão de página virada na borda esquerda */
.book-card-cover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3%;
  bottom: 3%;
  width: 10%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent);
  z-index: 2;
  pointer-events: none;
}

.book-card-cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
  box-shadow:
    1px 1px 0 1px #f1e9d8,
    2px 2px 0 1px #e6dac0,
    3px 3px 0 1px #dccca8,
    4px 4px 0 1px #d2be90,
    6px 8px 16px rgba(20, 12, 4, 0.35);
}

.book-card:hover .book-card-cover img {
  filter: brightness(0.86);
  transform: translateY(-5px);
  box-shadow:
    1px 1px 0 1px #f1e9d8,
    2px 2px 0 1px #e6dac0,
    3px 3px 0 1px #dccca8,
    4px 4px 0 1px #d2be90,
    8px 14px 24px rgba(20, 12, 4, 0.45);
}

.book-card-cover::after {
  content: "Detalhes";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gold);
  color: #16232f;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(208, 187, 108, 0.35);
}

.book-card:hover .book-card-cover::after {
  opacity: 1;
}

.book-card-info {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-card-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  max-width: 140px;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

/* ========= LEGACY CARDS (caso ainda existam em outras páginas) ========= */
.card {
  background: var(--bg);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(27, 58, 87, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border-color: var(--primary-soft);
}

.card img {
  width: 100%;
  height: 140px;
  border-radius: 14px 14px 0 0;
  border: 1px solid var(--border-soft);
  object-fit: cover;
  background: #e5e7eb;
  display: block;
}

.card-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.card-tagline {
  font-size: 0.88rem;
  color: var(--muted);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.card-actions .btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  border-radius: 12px;
  font-weight: 600;
}

/* ========= RESPONSIVO ========= */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .card-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }
}

@media (max-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }
  
  .book-card {
    max-width: 100%;
    /* Espaço entre a capa e o título: com o efeito de "pilha de páginas"
       (sombra deslocada pra baixo) a capa invadia o texto. */
    gap: 1rem;
  }

  .book-card-info {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

  .book-card-title {
    font-size: 0.85rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    padding: 0 0.2rem;
    margin-top: 0.2rem;
    text-align: center;
    width: 100%;
    letter-spacing: 0.01em;
  }
  
  .book-card-cover::after {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }
}
