/* ============================================
   CR Engenharia - Blog
   Herda variáveis e utilitários de style.css
   ============================================ */

/* ============ HERO DO BLOG ============ */
.blog-hero {
  position: relative;
  padding: 160px 0 64px;
  background-color: #f7f8fa;
  background-image:
    linear-gradient(rgba(245,168,0,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.10) 1px, transparent 1px);
  background-size: 80px 80px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.blog-hero-inner {
  max-width: 820px;
}

.blog-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  color: var(--black);
  line-height: 1.2;
  margin: 14px 0 16px;
}

.blog-hero p {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: #555;
  max-width: 680px;
}

/* ============ BREADCRUMBS ============ */
.breadcrumbs {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumbs a {
  color: var(--gray);
  transition: var(--transition);
}
.breadcrumbs a:hover { color: var(--orange); }
.breadcrumbs .separator { color: #bbb; }
.breadcrumbs .current { color: var(--black); font-weight: 600; }

/* ============ SEÇÃO DE CATEGORIAS (no hub) ============ */
.categories-section {
  padding: 64px 0 32px;
}

.categories-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.category-card {
  background: linear-gradient(135deg, var(--black) 0%, var(--dark2) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.category-card::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  background: rgba(245,168,0,0.15);
  border-radius: 50%;
  transition: var(--transition);
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.category-card:hover::before {
  background: rgba(245,168,0,0.25);
  transform: scale(1.2);
}

.category-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(245,168,0,0.15);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.category-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  position: relative;
  z-index: 1;
}

.category-card p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  flex: 1;
  position: relative;
  z-index: 1;
}

.category-card-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--orange);
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.category-card.upcoming {
  background: linear-gradient(135deg, #f7f8fa 0%, #eaeaea 100%);
  color: var(--gray);
  cursor: not-allowed;
}
.category-card.upcoming::before { background: rgba(245,168,0,0.06); }
.category-card.upcoming h3 { color: var(--gray); }
.category-card.upcoming p { color: #888; }
.category-card.upcoming .category-card-icon { background: rgba(245,168,0,0.10); }
.category-card.upcoming .category-card-link { color: #aaa; }

/* ============ LISTAGEM DE POSTS (HUB / CATEGORIA) ============ */
.blog-list {
  padding: 32px 0 96px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.blog-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--orange);
}

.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  position: relative;
  overflow: hidden;
}
.blog-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,168,0,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}
.blog-card-img svg {
  position: relative;
  z-index: 1;
}

.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 10px;
}

.blog-card h2,
.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.35;
  margin-bottom: 12px;
}
.blog-card h2 a,
.blog-card h3 a { transition: var(--transition); }
.blog-card h2 a:hover,
.blog-card h3 a:hover { color: var(--orange); }

.blog-card-excerpt {
  font-size: 0.94rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: #888;
  border-top: 1px solid #f0f0f0;
  padding-top: 14px;
  margin-top: auto;
}
.blog-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ============ ARTIGO (POST) ============ */
.post-wrapper {
  padding: 48px 0 96px;
  background: var(--white);
}

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

.post-header { margin-bottom: 40px; }

.post-category {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 14px;
}

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 18px;
}

.post-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--gray);
  padding-bottom: 24px;
  border-bottom: 1px solid #e8e8e8;
}
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta strong { color: var(--black); }

.post-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #333;
  font-weight: 400;
  margin: 32px 0;
  padding-left: 20px;
  border-left: 4px solid var(--orange);
}

/* ============ CONTEÚDO DO POST ============ */
.post-content { font-size: 1.05rem; line-height: 1.75; color: #2a2a2a; }

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--black);
  margin: 48px 0 18px;
  line-height: 1.3;
  scroll-margin-top: 130px;
}
.post-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--black);
  margin: 32px 0 14px;
  line-height: 1.35;
  scroll-margin-top: 130px;
}
.post-content h4 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--black);
  margin: 24px 0 10px;
}

.post-content p { margin: 0 0 18px; }
.post-content strong { color: var(--black); font-weight: 700; }
.post-content em { font-style: italic; }

.post-content a {
  color: var(--orange-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: var(--transition);
}
.post-content a:hover { color: var(--orange); }

.post-content ul,
.post-content ol { margin: 0 0 22px 24px; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; }
.post-content li::marker { color: var(--orange); }

.post-content blockquote {
  background: #fafafa;
  border-left: 4px solid var(--orange);
  padding: 18px 24px;
  margin: 28px 0;
  border-radius: 0 8px 8px 0;
  color: #444;
  font-style: italic;
}

.post-content img {
  border-radius: var(--radius);
  margin: 28px 0;
  box-shadow: var(--shadow);
}

.post-content figure { margin: 28px 0; }
.post-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-top: 10px;
  font-style: italic;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.post-content thead {
  background: var(--black);
  color: var(--white);
}
.post-content th,
.post-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.post-content tbody tr:nth-child(even) { background: #fafafa; }

/* ============ CAIXA DE CTA INLINE ============ */
.post-cta-box {
  background: linear-gradient(135deg, var(--black), var(--dark2));
  color: var(--white);
  border-radius: 14px;
  padding: 32px;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}
.post-cta-box::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  background: rgba(245,168,0,0.12);
  border-radius: 50%;
}
.post-cta-box h3 {
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
}
.post-cta-box p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  position: relative;
}
.post-cta-box .btn-primary { position: relative; }

/* ============ BOX DE INFORMAÇÃO ============ */
.info-box {
  background: rgba(245,168,0,0.08);
  border: 1px solid rgba(245,168,0,0.3);
  border-left: 4px solid var(--orange);
  padding: 20px 24px;
  border-radius: 8px;
  margin: 28px 0;
}
.info-box strong { color: var(--black); }

/* ============ FAQ ============ */
.post-faq { margin: 48px 0; }
.post-faq h2 { margin-bottom: 20px; }

.faq-item {
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
  transition: var(--transition);
}
.faq-item[open] {
  border-color: var(--orange);
  box-shadow: 0 4px 16px rgba(245,168,0,0.08);
}

.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--black);
  list-style: none;
  position: relative;
  padding-right: 56px;
  font-size: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--orange);
  font-weight: 300;
  transition: var(--transition);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq-answer {
  padding: 0 22px 20px;
  color: #444;
  line-height: 1.7;
}

/* ============ COMPARTILHAR ============ */
.post-share {
  margin: 48px 0 32px;
  padding: 24px 0;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.post-share strong { color: var(--black); font-size: 0.95rem; }
.share-buttons { display: flex; gap: 10px; }
.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  transition: var(--transition);
}
.share-btn:hover { background: var(--orange); color: var(--black); }

/* ============ AUTOR ============ */
.post-author {
  background: var(--light-gray);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.post-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.post-author-info strong { display: block; color: var(--black); margin-bottom: 4px; }
.post-author-info p { color: var(--gray); font-size: 0.9rem; line-height: 1.5; margin: 0; }

/* ============ POSTS RELACIONADOS ============ */
.related-posts {
  padding: 64px 0;
  background: var(--light-gray);
}
.related-posts h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 24px;
}

/* ============ POST NAV (anterior/próximo) ============ */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.post-nav a {
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-nav a:hover {
  border-color: var(--orange);
  background: #fff;
  box-shadow: var(--shadow);
}
.post-nav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  font-weight: 700;
}
.post-nav-title { color: var(--black); font-weight: 600; font-size: 0.95rem; }
.post-nav .next { text-align: right; }

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .blog-hero { padding-top: 140px; }
  .post-cta-box { padding: 24px 20px; }
}
