/* --- CENTRALIZAÇÃO GLOBAL --- */
.page-wrap{
  width:100%;
  display:flex;
  justify-content:center;
  padding:24px 0;
  background:#fff;
}
.centered{
  width:100%;
  max-width:1180px;
  margin:0 auto;
  padding:0 20px;
}

/* Título da página */
.page-title{
  margin:0 0 16px 0;
  text-align:left;
  color:#123b2b;
  font-size: 2rem;
  font-weight: 700;
}

/* ==========================
   TÍTULO DE CATEGORIA
========================== */
.titulo {
  background: linear-gradient(90deg, var(--primary-color) 50%, rgba(16,137,87,0) 100%);
  color: white;
  width: fit-content;
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 8px 158px 8px 16px;
  font-weight: 800;
  font-size: larger;
}

/* ==========================
   FILTROS (mesmo estilo licitações)
========================== */
.filter-form {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: end;
  margin: 0 0 18px 0;
}
.filter-form input[type="text"],
.filter-form select {
  height: 40px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fff;
}
.filter-form button {
  height: 40px; padding: 0 16px; border: none; border-radius: 10px; cursor: pointer;
  background: #1f4b3b; color: #fff; font-weight: 600;
}
.filter-form button:hover { filter: brightness(1.05); }

/* --- LISTA DE CARTILHAS --- */
.cartilhas-list{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ==========================
   CARD NOVO DESIGN
========================== */
.cartilha-card {
  display: flex;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  overflow: hidden;
  border: 1px solid #e4e4e4;
  min-height: 220px;
}

/* --- Capa (imagem da primeira página) --- */
.cartilha-capa {
  width: 190px;
  min-width: 190px;
  flex-shrink: 0;
  overflow: hidden;
  background: #e6f1ea;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartilha-capa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cartilha-capa-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 220px;
  color: #1a7a45;
  font-size: 3.5rem;
  opacity: 0.5;
}

/* --- Área de informações --- */
.cartilha-info {
  flex: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Badge de categoria */
.cartilha-badge {
  color: #1a7a45;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 2px solid #1a7a45;
  display: inline-block;
  padding-bottom: 2px;
  margin-bottom: 10px;
  width: fit-content;
}

/* Título */
.cartilha-titulo {
  margin: 0 0 6px 0;
  color: #1a1a2e;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Autor / Organização */
.cartilha-autor {
  margin: 0 0 10px 0;
  color: #c8a000;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Data de publicação */
.cartilha-data {
  margin: 0 0 14px 0;
  font-size: 0.88rem;
  color: #333;
}

.cartilha-data strong {
  font-weight: 700;
}

/* Empurra o botão para o final */
.cartilha-spacer {
  flex: 1;
}

/* Linha de botões */
.cartilha-botoes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botão Visualizar */
.btn-visualizar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a7a45;
  color: #fff;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.btn-visualizar:hover {
  background: #145e35;
  color: #fff;
  text-decoration: none;
}

/* Botão Download */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #1a7a45;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid #1a7a45;
  transition: background 0.2s, color 0.2s;
}

.btn-download:hover {
  background: #1a7a45;
  color: #fff;
  text-decoration: none;
}

/* --- ESTADO VAZIO --- */
.empty-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:60px 20px;
  text-align:center;
}
.empty-state i {
  font-size:4rem;
  color:#cbd5e0;
  margin-bottom:16px;
}
.empty-state p {
  margin:0;
  font-size:1.1rem;
  color:#718096;
}

/* --- Responsivo --- */
@media (max-width: 900px) {
  .cartilhas-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cartilha-card {
    flex-direction: column;
  }
  .cartilha-capa {
    width: 100%;
    min-width: 0;
    max-height: 220px;
  }
  .cartilha-capa img {
    max-height: 220px;
    object-fit: cover;
  }
  .cartilha-capa-placeholder {
    min-height: 120px;
  }
}
