/* Blog SISGR — estilos das paginas geradas por tools/build-blog.mjs.
   Usa as variaveis e os componentes do style.css (badge, btn, feature-*). */

/* ------------------------------------------------------------------ listagem */

.blog-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
  padding: 140px 24px 40px;
  text-align: center;
}

.blog-list {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.post-card {
  border: 1px solid var(--sisgr-verde-100);
  border-radius: 24px;
  overflow: hidden;
  background: var(--sisgr-branco);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(13, 26, 18, 0.08);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--sisgr-verde-100);
  overflow: hidden;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
}

.post-card-meta {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sisgr-verde-200);
}

.post-card-title {
  font-family: "SISGR";
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--sisgr-cinza-300);
}

.post-card-desc {
  font-size: 15px;
  line-height: 24px;
  color: var(--sisgr-cinza-200);
}

/* ------------------------------------------------------------------- artigo */

.post {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 130px 0 0;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 16px;
  border: 1px solid rgba(113, 131, 155, 0.25);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sisgr-cinza-300);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.post-back:hover {
  border-color: var(--sisgr-verde-300);
  color: var(--sisgr-verde-300);
  background: rgba(75, 173, 81, 0.06);
}

.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--sisgr-cinza-200);
}

.post-breadcrumb a {
  color: var(--sisgr-cinza-200);
}

.post-breadcrumb a:hover {
  color: var(--sisgr-verde-400);
}

.post-badge {
  margin-right: 8px;
}

.post-title {
  margin-top: 16px;
  font-family: "SISGR";
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  color: var(--sisgr-cinza-300);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--sisgr-cinza-200);
}

.post-cover {
  margin: 40px 0;
  border-radius: 24px;
  overflow: hidden;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* conteudo vindo do editor: estilizado por elemento, sem classes */

.post-content {
  font-size: 17px;
  line-height: 30px;
  color: var(--sisgr-cinza-300);
}

.post-content > * + * {
  margin-top: 20px;
}

.post-content h2 {
  margin-top: 48px;
  font-family: "SISGR";
  font-weight: 700;
  font-size: 28px;
  line-height: 1.25;
  color: var(--sisgr-verde-400);
}

.post-content h3,
.post-content h4 {
  margin-top: 32px;
  font-family: "SISGR";
  font-weight: 700;
  font-size: 21px;
  line-height: 1.3;
  color: var(--sisgr-cinza-300);
}

/* posts antigos usam h5/h6 como legenda ou credito de imagem */
.post-content h5,
.post-content h6 {
  margin-top: 16px;
  font-weight: 600;
  font-size: 14px;
  line-height: 22px;
  color: var(--sisgr-cinza-200);
}

.post-content a {
  color: var(--sisgr-verde-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover {
  color: var(--sisgr-laranja-500);
}

.post-content ul,
.post-content ol {
  padding-left: 24px;
  list-style: revert;
}

.post-content li + li {
  margin-top: 8px;
}

.post-content blockquote {
  padding: 8px 0 8px 24px;
  border-left: 3px solid var(--sisgr-verde-200);
  font-style: italic;
  color: var(--sisgr-cinza-200);
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
}

.post-content figure {
  margin: 32px 0;
}

.post-content figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--sisgr-cinza-200);
}

.post-content strong {
  font-weight: 700;
  color: var(--sisgr-cinza-300);
}

.post-content hr {
  border: 0;
  border-top: 1px solid var(--sisgr-verde-100);
}

/* ---------------------------------------------------------- CTA e relacionados */

.post-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 56px 0;
  padding: 32px;
  border-radius: 24px;
  background: var(--sisgr-verde-100);
}

.post-cta-text {
  flex: 1 1 320px;
  font-family: "SISGR";
  font-weight: 700;
  font-size: 20px;
  line-height: 1.35;
  color: var(--sisgr-verde-400);
}

.post-related {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 0 80px;
}

.post-related-title {
  margin-bottom: 32px;
  font-family: "SISGR";
  font-weight: 700;
  font-size: 28px;
  color: var(--sisgr-cinza-300);
}

.post-related-all {
  display: inline-block;
  margin-top: 32px;
  font-weight: 600;
  color: var(--sisgr-verde-300);
}

.post-related-all:hover {
  color: var(--sisgr-laranja-500);
}

@media (max-width: 640px) {
  .blog-hero {
    padding-top: 120px;
  }

  .post-article {
    padding-top: 110px;
  }

  .post-content {
    font-size: 16px;
    line-height: 28px;
  }

  .post-cta {
    padding: 24px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card {
    transition: none;
  }

  .post-card:hover {
    transform: none;
  }
}
