/* ─── Vecta Blog — Artigo (post individual) ─────────────────────────────────
   Portado do BlogArticleLayout.astro do site Astro — mantém identidade 1:1.
   Tokens: variáveis de :root em global.css.
   ────────────────────────────────────────────────────────────────────────── */

/* ─── Página do artigo ───────────────────────────────────────────────────── */

.article-main {
  background: var(--bg);
  min-height: 100vh;
}

/* ─── Cabeçalho ─────────────────────────────────────────────────────────── */

.article-head {
  padding-top: 120px;
  padding-bottom: 8px;
  max-width: calc(650px + 48px);
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .article-head { padding-top: 140px; }
}

/* Breadcrumb */
.article-breadcrumb {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.article-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur-sm) var(--ease);
}
.article-breadcrumb a:hover { color: var(--brand); }
.article-breadcrumb-sep { color: var(--muted-2); }

/* Categoria eyebrow */
.article-eyebrow,
.article-head .wp-block-post-terms {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brand);
  margin: 0 0 18px;
}
.article-eyebrow a,
.article-head .wp-block-post-terms a {
  color: var(--brand);
  text-decoration: none;
}

/* Título */
.article-title,
.article-head .wp-block-post-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 16px;
}

/* Subtítulo/excerpt em Fraunces italic */
.article-subtitle,
.article-head .wp-block-post-excerpt {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0 0 24px;
}
.article-head .wp-block-post-excerpt p { margin: 0; }
.article-head .wp-block-post-excerpt__more-text { display: none; }

/* Meta */
.article-meta {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 32px;
}
.article-meta-author,
.article-meta .wp-block-post-author-name {
  font-weight: 500;
  color: var(--ink-2);
}
.article-meta-sep { color: var(--muted-2); }
.article-meta-readtime { color: var(--muted); }
.article-meta-date,
.article-meta .wp-block-post-date { color: var(--muted); }

/* ─── Capa 16:9 ─────────────────────────────────────────────────────────── */

.article-cover,
.article-main .wp-block-post-featured-image {
  max-width: 700px;
  margin: 0 auto 48px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--bg-soft) 0%, var(--bg) 100%);
  display: block;
}
.article-cover img,
.article-main .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75) contrast(1.05) saturate(0.9);
}
@media (min-width: 768px) {
  .article-cover,
  .article-main .wp-block-post-featured-image { margin-bottom: 64px; }
}

/* ─── TOC (gerado via JS) ────────────────────────────────────────────────── */

.article-toc {
  max-width: calc(650px + 48px);
  margin: 0 auto 48px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.article-toc-label {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}
.article-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.article-toc-list li {
  counter-increment: toc;
  margin: 6px 0;
  padding-left: 26px;
  position: relative;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
}
.article-toc-list li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.article-toc-list a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--dur-sm) var(--ease);
}
.article-toc-list a:hover { color: var(--brand); }

/* ─── Corpo do artigo ────────────────────────────────────────────────────── */

.article-body,
.article-body .wp-block-post-content {
  max-width: calc(650px + 48px);
  margin: 0 auto;
  font-family: Lora, Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* Parágrafo */
.article-body p,
.article-body .wp-block-paragraph {
  margin: 0 0 24px;
}

/* Lede (primeiro parágrafo) */
.article-body .article-lede,
.article-body .wp-block-post-content > p:first-of-type {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

/* Headings dentro do corpo */
.article-body h2,
.article-body .wp-block-heading[data-level="2"],
.article-body h2.wp-block-heading {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 56px 0 20px;
  scroll-margin-top: 96px;
}
.article-body h3,
.article-body .wp-block-heading[data-level="3"],
.article-body h3.wp-block-heading {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
  margin: 40px 0 14px;
  scroll-margin-top: 96px;
}
.article-body h4,
.article-body h4.wp-block-heading {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 32px 0 10px;
}

/* Listas */
.article-body ul,
.article-body ol {
  margin: 0 0 28px;
  padding-left: 24px;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li {
  margin: 8px 0;
  padding-left: 4px;
  font-size: 18px;
}
.article-body li::marker { color: var(--brand); }
.article-body ol li::marker { color: var(--muted); font-weight: 600; }
.article-body li > ul,
.article-body li > ol { margin: 8px 0 4px; }
.article-body li > p { margin: 0 0 6px; }

/* Bold */
.article-body strong,
.article-body b {
  font-weight: 700;
  color: var(--ink);
}

/* Italic */
.article-body em { font-style: italic; color: var(--ink); }

/* Links inline */
.article-body a:not(.btn-primary) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(200, 0, 24, 0.5);
  text-underline-offset: 3px;
  transition:
    text-decoration-color var(--dur-sm) var(--ease),
    color var(--dur-sm) var(--ease);
}
.article-body a:not(.btn-primary):hover {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

/* Blockquote */
.article-body blockquote,
.article-body .wp-block-quote {
  margin: 36px 0;
  padding: 20px 24px 18px;
  background: var(--bg-soft);
  border-left: 2px solid var(--brand);
  border-radius: 0 8px 8px 0;
}
.article-body blockquote p,
.article-body .wp-block-quote p {
  font-style: italic;
  color: var(--ink);
  margin: 0 0 10px;
}
.article-body blockquote cite,
.article-body .wp-block-quote cite,
.article-body .wp-block-quote footer {
  font-family: 'Sora', sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

/* Imagens inline */
.article-body figure,
.article-body .wp-block-image {
  margin: 40px -24px;
  max-width: 700px;
  width: calc(100% + 48px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-soft);
}
@media (max-width: 720px) {
  .article-body figure,
  .article-body .wp-block-image {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
.article-body figure img,
.article-body .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity var(--dur-sm) var(--ease);
}
.article-body figure img:hover,
.article-body .wp-block-image img:hover { opacity: 0.9; }
/* figcaption fora do frame */
.article-body figure:has(figcaption),
.article-body .wp-block-image:has(figcaption) {
  aspect-ratio: auto;
  overflow: visible;
  background: transparent;
}
.article-body figure:has(figcaption) img,
.article-body .wp-block-image:has(figcaption) img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}
.article-body figcaption,
.article-body .wp-block-image figcaption {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin: 12px auto 0;
  max-width: 620px;
  line-height: 1.55;
}

/* Vídeo embed (YouTube, Vimeo via WP oEmbed) */
.article-body .wp-block-embed {
  margin: 36px 0;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
}
.article-body .wp-block-embed__wrapper { height: 100%; }
.article-body .wp-block-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Tabelas */
.article-body .wp-block-table,
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.article-body table thead tr {
  border-bottom: 2px solid var(--brand);
}
.article-body table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--brand);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.article-body table td {
  padding: 14px 16px;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.article-body table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.5);
}
.article-body table tbody tr:hover td {
  background: rgba(200, 0, 24, 0.04);
}
.article-body table tbody td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* Code blocks */
.article-body pre,
.article-body .wp-block-code {
  margin: 32px 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: 'SF Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  position: relative;
}
.article-body pre code,
.article-body .wp-block-code code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: 0;
}

/* Inline code */
.article-body :not(pre) > code {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  padding: 3px 7px;
  background: rgba(135, 131, 120, 0.15);
  border: 1px solid rgba(135, 131, 120, 0.2);
  border-radius: 4px;
  color: var(--ink);
}

/* Divisor */
.article-body hr,
.article-body .wp-block-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}
.article-divider {
  text-align: center;
  color: var(--muted-2);
  letter-spacing: 1em;
  margin: 48px 0 32px;
  font-family: 'Sora', sans-serif;
  border: none;
}

/* CTA inline */
.article-cta-inline {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

/* ─── Newsletter box ─────────────────────────────────────────────────────── */

.article-newsletter {
  max-width: calc(650px + 48px);
  margin: 80px auto 40px;
  padding: 32px 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.article-newsletter-eyebrow {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 10px;
}
.article-newsletter-title {
  font-family: 'Sora', sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 8px;
}
.article-newsletter-desc {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 20px;
}
.article-newsletter-form {
  display: flex;
  gap: 8px;
  flex-direction: column;
}
@media (min-width: 500px) {
  .article-newsletter-form { flex-direction: row; }
}
.article-newsletter-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--dur-sm) var(--ease);
  min-width: 0;
  /* min 16px no mobile para evitar zoom no iOS */
  font-size: 16px;
}
@media (min-width: 768px) {
  .article-newsletter-input { font-size: 14px; }
}
.article-newsletter-input:focus { border-color: var(--brand); }
.article-newsletter-input::placeholder { color: var(--muted-2); }
.article-newsletter-hint {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ─── Card do autor ──────────────────────────────────────────────────────── */

.article-author-rich,
.article-main .wp-block-post-author {
  max-width: calc(650px + 48px);
  margin: 48px auto 32px;
  padding: 32px 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

/* Avatar */
.article-main .wp-block-post-author__avatar img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--brand);
}
/* Fallback sem foto — círculo brand com iniciais (via WP Gravatar) */
.article-main .wp-block-post-author__avatar img[src*="gravatar.com"] {
  filter: none;
}

.article-main .wp-block-post-author__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.article-main .wp-block-post-author__name {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  text-decoration: none;
}
.article-main .wp-block-post-author__bio {
  font-family: 'Sora', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  max-width: 520px;
}

/* ─── Artigos relacionados ───────────────────────────────────────────────── */

.article-related {
  max-width: calc(880px + 48px);
  margin: 40px auto 0;
  padding-bottom: 80px;
}
.article-related-eyebrow {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 20px;
  text-align: center;
}

/* Grid */
.article-related-grid,
.article-related ul.wp-block-post-template {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 600px) {
  .article-related-grid,
  .article-related ul.wp-block-post-template { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Card relacionado */
.article-related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  box-shadow: var(--shadow-card);
}
.article-related-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px -12px rgba(0,0,0,0.18),
    0 28px 56px -16px rgba(0,0,0,0.12),
    0 0 60px rgba(200, 0, 24, 0.04);
}

/* Capa relacionado */
.article-related-cover,
.article-related-card .wp-block-post-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background:
    radial-gradient(ellipse 60% 55% at 25% 35%, rgba(200, 0, 24, 0.10), transparent 55%),
    linear-gradient(145deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.article-related-cover img,
.article-related-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.70) contrast(1.05) saturate(0.9);
  transition: transform 420ms var(--ease), filter 420ms var(--ease);
}
.article-related-card:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
  filter: brightness(0.78) contrast(1.05) saturate(0.95);
}

/* Corpo relacionado */
.article-related-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 22px 20px;
}
.article-related-category,
.article-related-card .wp-block-post-terms {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 8px;
}
.article-related-category a,
.article-related-card .wp-block-post-terms a { color: var(--brand); }
.article-related-title,
.article-related-card .wp-block-post-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-related-title a,
.article-related-card .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-sm) var(--ease);
}
.article-related-card:hover .wp-block-post-title a { color: var(--brand); }
.article-related-meta,
.article-related-card .wp-block-post-date {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin: auto 0 0;
}

/* ─── Lightbox (aberto via JS) ───────────────────────────────────────────── */

.article-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.article-lightbox.is-open {
  display: flex;
  opacity: 1;
}
.article-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.article-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-sm) var(--ease);
}
.article-lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }
