/* ============================================================
   EGS · Blog (listagem + post) — casa com styles.css
============================================================ */

/* ---------- Cabeçalho da seção de blog ---------- */
.blog-head {
  background: var(--navy-deeper);
  color: var(--white);
  padding: 140px 0 64px;
  position: relative;
  overflow: hidden;
}
.blog-head .hero-chevron {
  position: absolute; inset: 0;
  background-image: url('/uploads/pattern-chevron.webp');
  background-size: 480px auto; background-repeat: repeat;
  opacity: 0.12; mix-blend-mode: screen; filter: invert(1);
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 75%);
  pointer-events: none;
}
.blog-head-inner { position: relative; z-index: 2; }
.blog-head .section-tag { margin-bottom: 20px; }
.blog-head h1 {
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.05;
  max-width: 14ch;
}
.blog-head p.blog-lede {
  margin-top: 18px; max-width: 56ch;
  color: rgba(255,255,255,0.72); font-size: 16px; line-height: 1.6;
}

/* ---------- Grade de posts ---------- */
.blog-section { padding: 72px 0 96px; background: var(--paper); }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out), border-color 260ms var(--ease-out);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--copper-12); }
.post-card-media { position: relative; aspect-ratio: 16/10; background: var(--gray-100); overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms var(--ease-out); }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-cat {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--copper-dark); font-weight: 500;
}
.post-card-title { font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--navy-deeper); letter-spacing: -0.3px; }
.post-card-excerpt { font-size: 14px; line-height: 1.6; color: var(--gray-500); flex: 1; }
.post-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.post-card-date { font-size: 12.5px; color: var(--gray-400); }
.post-card-link { font-size: 13px; font-weight: 600; color: var(--copper-dark); }

/* ---------- Estados (loading / vazio / erro) ---------- */
.blog-state {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px;
  color: var(--gray-500); font-size: 15px;
}
.blog-state .spinner {
  width: 30px; height: 30px; margin: 0 auto 16px;
  border: 3px solid var(--gray-200); border-top-color: var(--copper);
  border-radius: 50%; animation: blogspin 800ms linear infinite;
}
@keyframes blogspin { to { transform: rotate(360deg); } }

/* ---------- Paginação / carregar mais ---------- */
.blog-more { display: flex; justify-content: center; margin-top: 48px; }
.blog-more[hidden] { display: none; }

/* ============================================================
   POST único
============================================================ */
.post-wrap { background: var(--paper); padding-bottom: 96px; }
.post-hero {
  background: var(--navy-deeper); color: var(--white);
  padding: 132px 0 48px; position: relative; overflow: hidden;
}
.post-hero .hero-chevron {
  position: absolute; inset: 0;
  background-image: url('/uploads/pattern-chevron.webp');
  background-size: 480px auto; background-repeat: repeat;
  opacity: 0.10; mix-blend-mode: screen; filter: invert(1);
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 75%);
  pointer-events: none;
}
.post-hero-inner { position: relative; z-index: 2; max-width: 800px; }
.post-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,0.7); text-decoration: none;
  margin-bottom: 24px; transition: color 200ms ease;
}
.post-back:hover { color: var(--copper-light); }
.post-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12.5px; }
.post-meta .post-cat {
  font-family: var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--copper-light); font-weight: 500;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.4); }
.post-meta .post-date, .post-meta .post-author { color: rgba(255,255,255,0.65); }
.post-title {
  font-size: clamp(30px, 4vw, 48px); font-weight: 800; line-height: 1.1;
  letter-spacing: -0.8px;
}

.post-cover {
  max-width: 920px; margin: -36px auto 0; padding: 0 32px; position: relative; z-index: 3;
}
.post-cover img {
  width: 100%; border-radius: var(--radius-lg); display: block;
  box-shadow: var(--shadow-lg); aspect-ratio: 16/8; object-fit: cover;
}

/* ---------- Corpo do post (prose) ---------- */
.post-content {
  max-width: 720px; margin: 48px auto 0; padding: 0 24px;
  color: var(--gray-700); font-size: 17px; line-height: 1.75;
}
.post-content > * + * { margin-top: 1.25em; }
.post-content h2 { font-size: 28px; font-weight: 800; color: var(--navy-deeper); letter-spacing: -0.5px; margin-top: 1.8em; line-height: 1.2; }
.post-content h3 { font-size: 21px; font-weight: 700; color: var(--navy-dark); margin-top: 1.5em; }
.post-content p { color: var(--gray-700); }
.post-content a { color: var(--copper-dark); text-decoration: underline; text-underline-offset: 2px; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li { margin-top: 0.5em; }
.post-content img, .post-content figure img { max-width: 100%; height: auto; border-radius: var(--radius-md); display: block; }
.post-content figure { margin: 1.6em 0; }
.post-content figcaption { font-size: 13px; color: var(--gray-400); margin-top: 8px; text-align: center; }
.post-content blockquote {
  border-left: 3px solid var(--copper); padding: 4px 0 4px 22px;
  color: var(--gray-600); font-style: italic;
}
.post-content strong { color: var(--navy-deeper); }
.post-content hr { border: 0; border-top: 1px solid var(--gray-200); margin: 2em 0; }

.post-footer-nav {
  max-width: 720px; margin: 56px auto 0; padding: 32px 24px 0;
  border-top: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ============================================================
   Responsivo
============================================================ */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .blog-head { padding: 120px 0 48px; }
  .blog-section { padding: 56px 0 72px; }
  .post-hero { padding: 112px 0 40px; }
  .post-cover { padding: 0 20px; margin-top: -24px; }
  .post-content { font-size: 16px; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
}
