/* ============================================================
   bec-blog.css — Blog stylesheet for BeC System
   Requires CSS variables from bec-system.css
   ============================================================ */

/* ============================================================
   0. Navbar — artigos de blog
   Azul escuro sobre a hero; transiciona para branco ao rolar
   ============================================================ */

body.blog-page #navbar {
  transition: background .35s ease, box-shadow .35s ease;
}

/* Antes de scrollar: fundo azul escuro igual ao tema do site */
body.blog-page #navbar:not(.scrolled) {
  background: rgba(10, 22, 40, .97);
  box-shadow: none;
}

/* ============================================================
   1. Blog Hero
   ============================================================ */

.blog-hero {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: #0a1628;
  position: relative;
}

.blog-hero img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.blog-hero-placeholder {
  width: 100%;
  max-height: 420px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 40px;
  background: linear-gradient(135deg, #080c14 0%, #0f172a 50%, #1e3a6e 100%);
  position: relative;
}

.blog-hero-title {
  color: #fff;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  text-align: center;
  max-width: 700px;
  line-height: 1.3;
  z-index: 1;
}

.blog-hero-logo {
  position: absolute;
  bottom: 20px;
  right: 24px;
  height: 28px;
  width: auto;
  opacity: 0.5;
}

/* ============================================================
   2. Blog Container and Article Layout
   ============================================================ */

.blog-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px;
}

.blog-article {
  background: #fff;
}

.blog-breadcrumb {
  padding: 16px 24px 0;
  max-width: 780px;
  margin: 0 auto;
}

/* Nas páginas de índice/categoria/autor — alinhar com o grid (1120px) */
.blog-breadcrumb--wide {
  max-width: 1168px;
}

.blog-breadcrumb ol {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
}

.blog-breadcrumb li {
  display: flex;
  align-items: center;
}

.blog-breadcrumb li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--faint, #586472);
}

.blog-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

/* Breadcrumb sobreposto na base da imagem hero (artigos) */
.blog-breadcrumb--hero {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100%;
  padding: 48px 32px 14px;
  background: linear-gradient(to top, rgba(5,15,35,.85) 0%, transparent 100%);
  margin: 0;
}

.blog-breadcrumb--hero ol {
  max-width: 780px;
  margin: 0 auto;
  font-size: .8rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

.blog-breadcrumb--hero a,
.blog-breadcrumb--hero li {
  color: rgba(255,255,255,.75);
  white-space: nowrap;
}

.blog-breadcrumb--hero a:hover {
  color: #fff;
}

.blog-breadcrumb--hero li + li::before {
  color: rgba(255,255,255,.4);
}

.blog-breadcrumb--hero [aria-current],
.blog-breadcrumb.blog-breadcrumb--hero [aria-current] {
  color: rgba(255,255,255,.95) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.blog-breadcrumb a:hover {
  color: var(--bec);
}

.blog-breadcrumb [aria-current] {
  color: var(--ink);
}

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

.blog-cat-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bec);
  background: var(--bec-pale, #eff6ff);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.blog-meta {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.blog-article h1 {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 24px;
}

/* ============================================================
   3. Article Content Typography
   ============================================================ */

.blog-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--slate);
}

.blog-content p {
  margin-bottom: 1.5rem;
}

.blog-content h2 {
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
}

.blog-content h3 {
  font-family: Outfit, sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  margin: 2rem 0 .75rem;
  line-height: 1.35;
}

.blog-content h4 {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin: 1.5rem 0 .5rem;
}

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

.blog-content li {
  margin-bottom: .5rem;
}

.blog-content blockquote {
  border-left: 4px solid var(--bec);
  padding: 16px 20px;
  margin: 2rem 0;
  background: var(--bec-pale, #eff6ff);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.blog-content blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--slate);
}

.blog-content strong {
  font-weight: 700;
  color: var(--ink);
}

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

.blog-content a {
  color: var(--bec);
  text-decoration: underline;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.blog-content th,
.blog-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.blog-content th {
  background: var(--surface);
  font-weight: 600;
}

.blog-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ============================================================
   4. Author Block
   ============================================================ */

.blog-author {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.blog-author img {
  border-radius: 50%;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.blog-author-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.blog-author-title {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.blog-author-link {
  font-size: .85rem;
  color: var(--bec);
  text-decoration: none;
  font-weight: 500;
}

.blog-author-link:hover {
  text-decoration: underline;
}

.blog-author-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.blog-author-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: #0a66c2;
  text-decoration: none;
  font-weight: 600;
}

.blog-author-linkedin:hover {
  text-decoration: underline;
}

.blog-author-linkedin svg {
  flex-shrink: 0;
}

/* ============================================================
   5. Related Articles
   ============================================================ */

.blog-related {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.blog-related-title {
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 24px;
}

.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .blog-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .blog-related-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   6. Blog Index Page
   ============================================================ */

.blog-index-section {
  padding: 56px 0 80px;
  background: var(--white);
}

/* Banner decorativo — imagem sem texto */
.blog-index-banner {
  height: 160px;
  background: var(--dark);
  background-size: cover;
  background-position: center;
  position: relative;
}

.blog-index-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,22,40,.4) 0%, rgba(10,22,40,.7) 100%);
}

/* Barra de categorias — sticky */
.blog-cats-sticky {
  position: sticky;
  top: 64px; /* fallback; JS ajusta para offsetHeight real do nav */
  z-index: 400;
  transition: opacity .2s ease;
  background: #0a1628;
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.blog-cats-sticky::-webkit-scrollbar { display: none; }

/* Scroll-reveal: position fixed sem ocupar espaço; aparece após hero sair da tela */
.blog-cats-sticky--reveal {
  position: fixed;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease;
}
.blog-cats-sticky--reveal.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.blog-cats-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  max-width: 1160px;
  margin: 0 auto;
  min-height: 48px;
}

.blog-cats-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .18s, background .18s;
  letter-spacing: .01em;
}

.blog-cats-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.blog-cats-link.active {
  color: #fff;
  background: var(--bec, #2563eb);
}

/* separador visual antes de "Todos" */
.blog-cats-all {
  margin-right: 8px;
  padding-right: 18px;
  border-right: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
  background: none !important;
}

.blog-cats-all.active,
.blog-cats-all:hover {
  background: none !important;
  color: #fff;
}

.blog-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 900px) {
  .blog-index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .blog-index-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   7. Blog Card
   ============================================================ */

.blog-card {
  background: #fff;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow .22s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, .10);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
  display: contents;
}

.blog-card-img {
  height: 200px;
  overflow: hidden;
  background: var(--surface);
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.blog-card:hover .blog-card-img img {
  transform: scale(1.03);
}

.blog-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #080c14, #1e3a6e);
  position: relative;
}

.blog-card-img-placeholder span {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .4);
}

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

.blog-card-cat {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bec);
  margin-bottom: 8px;
}

.blog-card-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 10px;
}

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

.blog-card-meta {
  font-size: .78rem;
  color: var(--faint, #586472);
  margin-top: auto;
}

/* ============================================================
   8. Category Page Header
   ============================================================ */

.blog-cat-header {
  background: var(--dark);
  color: #fff;
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.blog-cat-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, .55);
  z-index: 0;
}

.blog-cat-header > * {
  position: relative;
  z-index: 1;
}

.blog-cat-header .cat-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.blog-cat-header h1 {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 12px;
}

.blog-cat-header p {
  color: var(--dark-muted, #94a3b8);
  max-width: 500px;
  margin: 0 auto;
}

.blog-cat-count {
  font-size: .85rem;
  color: rgba(255, 255, 255, .4);
  margin-top: 8px;
}

/* ============================================================
   9. Author Page
   ============================================================ */

.blog-author-page {
  max-width: 1168px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Card do autor — limpo, sem background image ── */
.blog-author-card {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  padding: 48px;
  margin-bottom: 48px;
  box-shadow: 0 4px 24px rgba(10,22,40,.06);
}

.blog-author-card-photo img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid rgba(37,99,235,.15);
  display: block;
}

.blog-author-card-info {
  flex: 1;
  min-width: 0;
}

.blog-author-card-name {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--ink, #0f172a);
  margin: 0 0 6px;
  line-height: 1.2;
}

.blog-author-card-role {
  font-size: .9rem;
  font-weight: 600;
  color: var(--bec, #2563eb);
  margin-bottom: 16px;
  letter-spacing: .01em;
}

.blog-author-card-bio {
  font-size: .97rem;
  color: var(--muted, #5a6a7a);
  line-height: 1.75;
  margin-bottom: 24px;
}

.blog-author-stats {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  flex-wrap: wrap;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
}

.blog-author-stat {
  text-align: center;
  padding: 14px 24px;
  border-right: 1px solid rgba(148,163,184,.18);
}

.blog-author-stat:last-child { border-right: none; }

.blog-author-stat .n {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--bec, #2563eb);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.blog-author-stat small {
  font-size: .75rem;
  color: var(--muted, #5a6a7a);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.blog-author-card-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.blog-author-social-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--bec, #2563eb);
  color: #fff;
  transition: opacity .18s;
}

.blog-author-social-btn:hover { opacity: .85; }

.blog-author-social-btn--ghost {
  background: transparent;
  border: 1.5px solid rgba(148,163,184,.4);
  color: var(--muted, #5a6a7a);
}

.blog-author-social-btn--ghost:hover {
  border-color: var(--bec, #2563eb);
  color: var(--bec, #2563eb);
  opacity: 1;
}

.blog-author-articles-title {
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink, #0f172a);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148,163,184,.15);
}

@media (max-width: 680px) {
  .blog-author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }
  .blog-author-stats { width: 100%; }
  .blog-author-card-links { justify-content: center; }
}

/* ============================================================
   10. Article CTA Block
   ============================================================ */

.blog-cta {
  background: var(--dark);
  color: #fff;
  border-radius: var(--r-md);
  padding: 40px 36px;
  margin: 56px 0 0;
  text-align: center;
}

.blog-cta h3 {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff !important;
  margin-bottom: 10px;
}

.blog-cta p {
  color: var(--dark-muted, #94a3b8);
  font-size: .95rem;
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.blog-cta .btn {
  display: inline-block;
  background: var(--bec);
  color: #fff;
  padding: 13px 28px;
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
  transition: background .2s;
}

.blog-cta .btn:hover {
  background: var(--bec-dark, #1d4ed8);
}

/* ============================================================
   11. Responsive Adjustments
   ============================================================ */

@media (max-width: 768px) {
  .blog-container {
    padding: 32px 20px;
  }

  .blog-hero {
    max-height: 280px;
  }

  .blog-hero img {
    height: 280px;
  }

  .blog-index-grid {
    gap: 20px;
  }

  .blog-author {
    flex-direction: column;
    gap: 16px;
  }

  .blog-cta {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .blog-container {
    padding: 24px 16px;
  }

  .blog-hero img {
    height: 220px;
  }

  .blog-hero-placeholder {
    min-height: 200px;
  }

  .blog-article h1 {
    font-size: 1.55rem;
  }
}
