/* Reset e base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
}

html, body {
  width: 100%;
  background-color: #fff;
}

/* Layout geral */
.container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.conteudoPrincipal { flex: 2; }
.barraLateral { flex: 1; }

/* Cabeçalho */
#topo {
  background-color: #02A28F;
  color: white;
  padding: 1.5rem 5%;
  font-size: 2rem;
}

/* Imagens */
.img, #predio, .post-card img, .card-popular img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}
#predio {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#predio:hover {
  transform: scale(1.03);
  box-shadow: 0 0.5em 1.5em rgba(0, 0, 0, 0.15);
}

/* Títulos e barras */
.barraAzul, .section-header h2 {
  background-color: #02A28F;
  color: white;
  font-weight: 600;
  padding: 0.5em 1em;
  border-radius: 0.5em;
  display: inline-block;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
  margin-bottom: 1em;
  font-size: 1rem;
}
.barraAzulFull {
  background-color: #02A28F;
  color: white;
  padding: 0.75em 1.2em;
  border-radius: 0.5em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
}
.barraAzulFull h2 {
  margin: 0;
  font-size: 1.1rem;
}
.barraAzulFull a, .section-header a, .link-vermais {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  color: white;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.section-header a {
  color: #02A28F;
  text-decoration: none;
}

/* Categorias */
.listaCategorias li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.nomeCategoria { color: #000; flex: 1; }
.contador { color: #666; font-size: 0.95rem; margin-left: 1rem; }

/* Posts */
.recent-posts {
  padding: 2rem 1rem;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background-color: white;
  border-radius: 1em;
  box-shadow: 0 0.3em 1em rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0.5em 1.5em rgba(0, 0, 0, 0.15); 
}
.post-content {
  padding: 1rem;
}
.categoria {
  color: #02A28F;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.post-content h3 {
  font-size: 1.1rem;
  margin: 0.2rem 0;
}
.post-content p {
  font-size: 0.95rem;
  margin: 0.3rem 0;
}
.post-content .data {
  color: #777;
  font-size: 0.85rem;
}

/* Populares */
.populares {
  margin-top: 2rem;
}
.card-popular {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  padding: 10px;
  margin-bottom: 1rem;
  gap: 1rem;
  transition: transform 0.2s;
}
.card-popular img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
}

.texto-popular {
  flex: 1;
  overflow: hidden;
}
.card-popular:hover {
  transform: scale(1.02);
}
.texto-popular h3, .texto-popular p {
  font-size: 0.85rem;
  margin: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* Rodapé */
footer {
  background-color: #f2f2f2;
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
}
#barraFinal { background-color: #02A28F; color: white; }

/* Responsivo geral */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 2rem 2rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    flex-direction: column;
  }

  .barraLateral {
    width: 100%;
  }

  .barraAzul { font-size: 0.9rem; padding: 0.4em 2em; }
  #topo { font-size: 1.6rem; padding: 1rem 2rem; }
}

/* Responsivo 320px */
@media (max-width: 320px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
  }

  .post-card img {
    width: 80px;
    height: auto;
    flex-shrink: 0;
  }

  .post-content {
    padding: 0.5rem;
    flex: 1;
  }

  .post-content h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    margin: 0;
  }

  .post-content p {
    font-size: 0.85rem;
  }
}
