/* =========================================================
   CID Explorer — Blog styles
   Estende o design system de styles.css (carregado antes)
   ========================================================= */

/* ---------- Layout base do blog ---------- */
.blog-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.blog-intro {
  padding: 72px 0 40px;
  max-width: 48rem;
}

.blog-intro h1 {
  margin: 18px 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.blog-intro p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0;
}

/* ---------- Filtros de categoria (tags) ---------- */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 34px;
}

.blog-filters .filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
  cursor: pointer;
}

.blog-filters .filter-pill:hover {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: rgba(13, 95, 184, 0.22);
}

.blog-filters .filter-pill.is-active {
  background: linear-gradient(135deg, #0d5fb8 0%, #0f8ab1 100%);
  border-color: transparent;
  color: var(--white);
}

/* ---------- Grid de posts (listagem) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.post-grid.has-featured {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--text);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(20, 49, 78, 0.14);
  border-color: rgba(13, 95, 184, 0.2);
}

.post-card.is-featured {
  grid-row: span 2;
  background: linear-gradient(180deg, rgba(13, 95, 184, 0.12), rgba(255, 255, 255, 0.82));
  padding: 28px;
}

.post-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #0d5fb8 0%, #0f8ab1 60%, #00a389 100%);
  display: flex;
  align-items: flex-end;
  padding: 18px;
}

.post-card.is-featured .post-cover {
  aspect-ratio: 16 / 10;
}

.post-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 184, 77, 0.4), transparent 40%),
    radial-gradient(circle at 12% 90%, rgba(0, 163, 137, 0.45), transparent 44%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

.post-cover .cover-code {
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: -0.02em;
  text-shadow: 0 4px 24px rgba(13, 37, 65, 0.35);
}

.post-cover .cover-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.post-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
}

.post-card h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.15rem, 1.4vw, 1.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.post-card.is-featured h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.post-card .read-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.94rem;
}

.post-card .read-more::after {
  content: "→";
  transition: transform 200ms ease;
}

.post-card:hover .read-more::after {
  transform: translateX(4px);
}

/* ---------- Página de artigo individual ---------- */
.article-shell {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.article-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.article-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.article-crumbs a {
  color: var(--accent);
  text-decoration: none;
}

.article-crumbs a:hover {
  text-decoration: underline;
}

.article-header h1 {
  margin: 0 0 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.article-dek {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.article-meta-row .tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 95, 184, 0.09);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Artigo: tipografia de leitura confortável */
.article-body {
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--text);
}

.article-body > * + * {
  margin-top: 1.2em;
}

.article-body h2 {
  margin-top: 2.2em;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.article-body h3 {
  margin-top: 1.8em;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-body p {
  color: #1c3750;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.article-body strong {
  color: var(--text);
  font-weight: 800;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li {
  margin-bottom: 0.5em;
}

.article-body li::marker {
  color: var(--accent);
  font-weight: 800;
}

.article-body blockquote {
  margin: 2em 0;
  padding: 22px 26px;
  border-left: 4px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.56);
  font-size: 1.08rem;
  color: #1c3750;
  font-style: italic;
}

.article-body code {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(13, 95, 184, 0.09);
  border: 1px solid rgba(13, 95, 184, 0.12);
  color: var(--accent);
  font-family: "JetBrains Mono", "Space Grotesk", monospace;
  font-size: 0.92em;
  font-weight: 700;
}

.article-body .callout {
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 95, 184, 0.1), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(13, 95, 184, 0.16);
}

.article-body .callout h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.article-body .callout p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.article-body figure {
  margin: 2.2em 0;
}

.article-body figure img {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.article-body figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* Tabela de conteúdo (TOC) lateral/inline */
.article-toc {
  padding: 22px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  margin: 32px 0 40px;
}

.article-toc strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-toc ol {
  margin: 0;
  padding-left: 1.1em;
  color: var(--muted);
  font-weight: 600;
}

.article-toc a {
  color: var(--text);
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--accent);
}

/* Rodapé do artigo — CTA de download */
.article-cta {
  margin-top: 64px;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(160deg, #17354f 0%, #24506d 100%);
  color: var(--white);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.article-cta h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  line-height: 1.15;
}

.article-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.6;
}

/* Posts relacionados */
.article-related {
  margin-top: 64px;
}

.article-related h2 {
  margin: 0 0 22px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Responsividade */
@media (max-width: 980px) {
  .post-grid,
  .post-grid.has-featured {
    grid-template-columns: 1fr 1fr;
  }

  .post-card.is-featured {
    grid-row: auto;
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .post-grid,
  .post-grid.has-featured,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card.is-featured {
    grid-column: auto;
  }

  .article-cta {
    grid-template-columns: 1fr;
  }

  .article-shell {
    padding: 18px 16px 52px;
  }
}
