/* --- Estilos para o Grid de Relacionados (v9 - Regras Explícitas) --- */

.ct-related-grid-title {
  font-size: 24px;
  margin-bottom: 25px;
  font-weight: bold;
  text-align: center;
}

/* O contentor principal que expande */
.ct-related-grid-wrapper {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 20px 25px;
  box-sizing: border-box;
  margin-top: 40px;
  position: relative;
}

/* Loading Spinner */
.ct-loading-spinner {
  display: none;
  width: 50px;
  height: 50px;
  margin: 20px auto;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #3498db;
  animation: spin 0.8s ease-in-out infinite;
  -webkit-animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@-webkit-keyframes spin {
  to { -webkit-transform: rotate(360deg); }
}

.ct-loading-spinner.visible {
  display: block;
}

/* Mensagem quando os posts acabarem */
.ct-finished-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #333;
  font-size: 24px;
  font-weight: bold;
  margin-top: 40px;
  background-color: #f9f9f9;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  min-height: 100px;
  text-align: center;
}

.ct-related-grid {
  display: grid;
  /* Colunas de exatamente 340px */
  grid-template-columns: repeat(auto-fit, 340px);
  gap: 25px;
  justify-content: center;
  /* Alinha todos os itens pelo topo para consistência */
  align-items: center;
  max-width: 1800px; 
  margin: 0 auto;
}

/* --- ESTILOS PARA O CARTÃO DE POST --- */
.ct-related-item {
  width: 340px; /* Largura fixa */
  aspect-ratio: 1 / 1.4; /* Altura calculada automaticamente */
  
  background-color: #FFFFFF;
  border: 1px solid #EAEAEA;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 10px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  box-sizing: border-box; /* Garante que o padding não aumente a largura */
}

.ct-related-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.ct-related-item a {
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

.ct-related-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

