/* ═══════════════════════════════════════════════
   ZP Media — Blog Styles
   Segue o design system do site principal:
   - Font: Visby cf, sans-serif
   - Cores: #000, #fff, #004adb, #f5f5f5, gray
   - Containers: container-large + padding-global
   ═══════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   Seção Blog no index.html
   ───────────────────────────────────────────── */

.blog_section {
  background-color: #fff;
}

/* Grid de 4 cards na home */
.blog_carousel--home {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

/* ─────────────────────────────────────────────
   Blog Card (compartilhado entre home e blog.html)
   ───────────────────────────────────────────── */

.blog_card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background-color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.blog_card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Imagem de capa */
.blog_card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #0042cf 0%, #065ef9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blog_card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.blog_card:hover .blog_card-img-wrap img {
  transform: scale(1.04);
}

/* Placeholder quando não há imagem */
.blog_card-img-placeholder {
  font-family: 'Visby cf', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 4px;
}

/* Corpo do card */
.blog_card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Categoria */
.blog_card-cat {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #004adb;
  line-height: 1;
}

/* Título */
.blog_card-title {
  font-family: 'Visby cf', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
  letter-spacing: 0.5px;
}

/* Descrição com limite de 3 linhas */
.blog_card-desc {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  color: #555;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Rodapé do card */
.blog_card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
}

.blog_card-date {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.75rem;
  color: gray;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Botão "Ver mais" */
.blog_card-btn {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #004adb;
  border: 1.5px solid #004adb;
  padding: 0.45rem 1.1rem;
  text-decoration: none;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.blog_card-btn:hover {
  background-color: #004adb;
  color: #fff;
}

/* Botão "Ver todos" centralizado */
.blog_ver-todos {
  display: flex;
  justify-content: center;
}

.blog_btn-ver-todos {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #004adb;
  border: 2px solid #004adb;
  padding: 0.75rem 2.5rem;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: inline-block;
}

.blog_btn-ver-todos:hover {
  background-color: #004adb;
  color: #fff;
}

/* ─────────────────────────────────────────────
   Loading / Empty state
   ───────────────────────────────────────────── */

.blog_loading,
.blog_empty {
  font-family: 'Visby cf', sans-serif;
  font-size: 1rem;
  color: gray;
  text-align: center;
  padding: 3rem 0;
  width: 100%;
  grid-column: 1 / -1;
}

.blog_loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #004adb;
  border-top-color: transparent;
  border-radius: 50%;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: blog-spin 0.7s linear infinite;
}

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

/* ═══════════════════════════════════════════════
   blog.html — Página de Listagem
   ═══════════════════════════════════════════════ */

.blog-page .main-wrapper {
  min-height: 60vh;
}

/* Hero da página de blog */
.blog-hero {
  background-color: #fff;
  padding-top: 6rem;
}

.blog-hero_inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.blog-hero_back {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #004adb;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.blog-hero_back:hover {
  opacity: 0.7;
}

/* Grid de posts na listagem */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Sentinel para infinite scroll */
.blog-sentinel {
  height: 1px;
  margin-top: 2rem;
}

/* Botão "Carregar mais" (fallback) */
.blog-load-more {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.blog-load-more-btn {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #004adb;
  border: 2px solid #004adb;
  padding: 0.75rem 2.5rem;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-load-more-btn:hover {
  background-color: #004adb;
  color: #fff;
}

.blog-load-more-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ═══════════════════════════════════════════════
   post.html — Página de Leitura
   ═══════════════════════════════════════════════ */

.post-page .main-wrapper {
  min-height: 60vh;
}

/* Hero do post */
.post-hero {
  background-color: #fff;
  padding-top: 6rem;
}

.post-hero_back {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #004adb;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  transition: opacity 0.2s ease;
}

.post-hero_back:hover {
  opacity: 0.7;
}

.post-hero_category {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #004adb;
  margin-bottom: 1rem;
}

.post-hero_title {
  font-family: 'Visby cf', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.05;
  color: #000;
  letter-spacing: 0.5px;
  max-width: 50rem;
  margin-bottom: 1.5rem;
}

.post-hero_meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-hero_author {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.5px;
}

.post-hero_date {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.875rem;
  color: gray;
  font-weight: 500;
}

.post-hero_divider {
  color: rgba(0, 0, 0, 0.2);
}

/* Imagem de capa do post */
.post-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
  margin-bottom: 0;
}

.post-cover-placeholder {
  width: 100%;
  aspect-ratio: 21 / 9;
  background: linear-gradient(135deg, #0042cf 0%, #065ef9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-cover-placeholder span {
  font-family: 'Visby cf', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 6px;
}

/* Grid de leitura com sidebar */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

/* Conteúdo do post */
.post-content {
  font-family: 'Visby cf', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #000;
  letter-spacing: 0.3px;
}

.post-content p {
  margin-bottom: 1.5rem;
  font-family: 'Visby cf', sans-serif;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: 'Visby cf', sans-serif;
  font-weight: 700;
  color: #000;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-content h2 { font-size: 2rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.post-content strong {
  font-weight: 700;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid #004adb;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
}

.post-content a {
  color: #004adb;
  text-decoration: underline;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}

/* Sidebar de compartilhamento */
.post-sidebar {
  position: sticky;
  top: 6rem;
}

.post-sidebar_title {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: gray;
  margin-bottom: 1.25rem;
}

.post-share-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-share-btn {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1.5px solid #000;
  color: #000;
  background: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: block;
}

.post-share-btn:hover {
  background-color: #000;
  color: #fff;
}

.post-share-btn.is-linkedin { border-color: #0a66c2; color: #0a66c2; }
.post-share-btn.is-linkedin:hover { background-color: #0a66c2; color: #fff; }

.post-share-btn.is-whatsapp { border-color: #25d366; color: #25d366; }
.post-share-btn.is-whatsapp:hover { background-color: #25d366; color: #fff; }

/* Tags do post */
.post-tags {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.post-tags_label {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: gray;
  margin-bottom: 1rem;
}

.post-tags_list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tag {
  font-family: 'Visby cf', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #004adb;
  border: 1px solid #004adb;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.5px;
}

/* Posts relacionados */
.post-related {
  background-color: #f5f5f5;
}

.post-related_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ─────────────────────────────────────────────
   Loading state para post.html
   ───────────────────────────────────────────── */

.post-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 1rem;
  font-family: 'Visby cf', sans-serif;
  font-size: 1rem;
  color: gray;
}

.post-loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #004adb;
  border-top-color: transparent;
  border-radius: 50%;
  animation: blog-spin 0.7s linear infinite;
}

.post-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 1.5rem;
  font-family: 'Visby cf', sans-serif;
  color: #000;
  text-align: center;
}

/* ═══════════════════════════════════════════════
   Responsivo
   ═══════════════════════════════════════════════ */

@media screen and (max-width: 991px) {
  .blog_carousel--home {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-hero_title {
    font-size: 2.25rem;
  }

  .post-sidebar {
    position: static;
    order: -1;
  }

  .post-share-links {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .post-related_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .blog_carousel--home {
    grid-template-columns: 1fr;
  }

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

  .blog-hero_inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-hero_title {
    font-size: 1.75rem;
  }

  .post-hero_meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .post-cover {
    aspect-ratio: 16 / 9;
  }

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

@media screen and (max-width: 479px) {
  .blog_card-body {
    padding: 1.25rem;
  }

  .post-hero_title {
    font-size: 1.5rem;
  }
}
