/* ==========================================================================
   matricula+ | Blog (índice, categoria e artigo), gerado por scripts/blog.mjs. Reutiliza os tokens de style.css
   e os blocos de pages.css.
   ========================================================================== */

/* ---------- Categorias (chips) ---------- */
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.blog-cats a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--white); border: 1px solid rgba(255,255,255,0.18); transition: border-color 0.3s, background-color 0.3s, color 0.3s; }
.blog-cats a:hover { border-color: var(--lime); color: var(--lime); }
.blog-cats a[aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.blog-cats a small { font-weight: 500; opacity: 0.6; }
.section-sand .blog-cats a { color: var(--navy); border-color: rgba(7,20,43,0.18); }
.section-sand .blog-cats a:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Capa dos posts (arte gerada, sem foto) ---------- */
.post-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: var(--navy); color: var(--white); isolation: isolate; }
.post-cover::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 100%, rgba(16,80,216,0.75), transparent 60%), radial-gradient(70% 70% at 0% 0%, rgba(174,236,116,0.22), transparent 55%); }
.post-cover.blue { background: var(--blue); }
.post-cover.blue::before { background: radial-gradient(120% 90% at 100% 0%, rgba(7,20,43,0.7), transparent 60%), radial-gradient(60% 60% at 0% 100%, rgba(174,236,116,0.35), transparent 55%); }
.post-cover.lime { background: var(--lime); color: var(--navy); }
.post-cover.lime::before { background: radial-gradient(120% 90% at 100% 100%, rgba(16,80,216,0.35), transparent 60%); }
.post-cover.sand { background: var(--sand-2); color: var(--navy); }
.post-cover.sand::before { background: radial-gradient(100% 80% at 100% 0%, rgba(16,80,216,0.22), transparent 60%); }
.post-cover .cover-mark { position: absolute; right: -4%; top: 8%; width: 38%; height: auto; opacity: 0.9; }
.post-cover .cover-kicker { position: absolute; left: 20px; top: 18px; font-family: var(--font-display); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.post-cover .cover-num { position: absolute; z-index: 1; left: 20px; bottom: 16px; max-width: calc(100% - 40px); font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -0.04em; }
.post-cover .cover-num small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; letter-spacing: 0; opacity: 0.8; margin-top: 6px; }
.post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Destaque ---------- */
.post-feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-xl); background: var(--white); border: 1px solid rgba(7,20,43,0.06); }
.post-feature .post-cover { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); }
.post-feature h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.06; margin-top: 14px; }
.post-feature h2 a:hover { color: var(--blue); }
.post-feature p { margin-top: 14px; max-width: 48ch; color: var(--mute); font-size: 1.05rem; }

/* ---------- Seções do índice e da categoria ---------- */
.blog-hero .blog-intro { margin-top: 18px; max-width: 64ch; }
.blog-hero .blog-intro + .blog-intro { margin-top: 12px; }
.blog-feature-section { padding-top: 48px; }
.blog-feature-section + .blog-list-section, .blog-related { padding-top: 0; }
.blog-empty { color: var(--mute); }
.post-card .pill, .post-feature .pill { align-self: flex-start; }
.post-card .pill:hover, .post-feature .pill:hover { background: var(--navy); color: var(--white); }
.share-status { margin-top: 10px; font-size: 0.8rem; color: var(--mute); min-height: 1em; }

/* ---------- Metadados ---------- */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; font-size: 0.82rem; color: var(--mute); }
.post-meta .author { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-weight: 600; }
.post-meta .avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--blue); color: var(--white); font-family: var(--font-display); font-size: 0.6rem; font-weight: 700; }
.post-meta .author + time::before, .post-meta .read::before, .post-meta .updated::before { content: '·'; margin-right: 14px; opacity: 0.5; }

/* ---------- Grade de posts ---------- */
.blog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.blog-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.blog-head a { font-weight: 600; color: var(--blue); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--white); border: 1px solid rgba(7,20,43,0.06); overflow: hidden; transition: transform 0.4s var(--ease-out), box-shadow 0.4s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -40px rgba(7,20,43,0.45); }
.post-card .post-cover { border-radius: 0; }
.post-card .post-cover .cover-num { font-size: clamp(2.1rem, 2.9vw, 2.9rem); max-width: 64%; }
.post-card .post-cover .cover-mark { width: 34%; }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; flex: 1; }
.post-card h3 { font-size: 1.15rem; line-height: 1.25; }
.post-card h3 a:hover { color: var(--blue); }
.post-card p { color: var(--mute); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .post-meta { margin-top: auto; padding-top: 6px; }

/* ---------- Paginação ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 48px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.pager a:hover { background: rgba(7,20,43,0.06); }
.pager [aria-current="page"] { background: var(--navy); color: var(--white); }

/* ---------- Artigo ---------- */
.article-hero { padding-bottom: clamp(48px, 6vw, 80px); }
.article-hero .cat { margin-bottom: 14px; }
.article-hero h1 { max-width: 20ch; font-size: clamp(2rem, 4.4vw, 3.3rem); }
.article-hero .lead { max-width: 60ch; }
.article-hero .post-meta { margin-top: 26px; color: var(--mute-on-dark); }
.article-hero .post-meta .author { color: var(--white); }
.article-hero .post-meta .avatar { background: var(--lime); color: var(--navy); }
.article-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.article-cover { position: relative; }
.article-cover .post-cover { aspect-ratio: 4 / 3; width: 100%; border-radius: var(--radius-xl); box-shadow: 0 50px 100px -50px rgba(0,0,0,0.6); }
.article-cover .post-cover .cover-mark { width: auto; height: 58%; top: 10%; right: 4%; }
.article-cover .post-cover .cover-num { font-size: clamp(2.4rem, 3.8vw, 4rem); max-width: 72%; }
.article-section { padding-top: 72px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 80px); align-items: start; }
.article-body { max-width: 68ch; font-size: 1.08rem; line-height: 1.72; color: rgba(7,20,43,0.86); }
.article-body > * + * { margin-top: 1.2em; }
.article-body h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin-top: 2em; scroll-margin-top: 100px; }
.article-body h4 { font-size: 1.05rem; margin-top: 1.4em; }
.article-body code { font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: rgba(7,20,43,0.06); }
.article-body hr { border: 0; border-top: 1px solid rgba(7,20,43,0.12); margin: 2.4em 0; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.article-body h3 { font-size: 1.25rem; line-height: 1.25; margin-top: 1.6em; scroll-margin-top: 100px; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li + li { margin-top: 0.5em; }
.article-body li::marker { color: var(--blue); font-weight: 700; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote > * + * { margin-top: 0.6em; }
.article-body blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--lime); font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; line-height: 1.4; color: var(--navy); }
.article-body figure { margin: 1.8em 0; }
.article-body figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--mute); }
.article-body .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.95rem; }
.article-body th, .article-body td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(7,20,43,0.1); }
.article-body th { font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.callout { margin: 1.8em 0; padding: 22px 24px; border-radius: var(--radius-md); background: var(--white); border: 1px solid rgba(7,20,43,0.08); }
.callout .eyebrow { color: var(--blue); }
.callout > :not(.eyebrow) { margin-top: 10px; font-size: 1rem; }
.callout ul, .callout ol { padding-left: 1.2em; }
.callout.lime { background: var(--lime); border-color: transparent; }
.callout.lime .eyebrow { color: var(--navy); }

/* ---------- Lateral do artigo ---------- */
.article-side { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 18px; }
.side-card { padding: 22px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid rgba(7,20,43,0.06); }
.side-title { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.toc ol { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 6px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; color: var(--navy); border-left: 2px solid transparent; }
.toc a:hover, .toc a.is-active { background: var(--sand); border-left-color: var(--blue); }
.side-card.navy { background: var(--navy); color: var(--white); border-color: transparent; }
.side-card.navy .side-title { color: var(--lime); }
.side-card.navy p { margin-top: 10px; font-size: 0.95rem; color: var(--mute-on-dark); }
.side-card.navy .btn { margin-top: 16px; width: 100%; justify-content: center; }
.share { display: flex; gap: 8px; margin-top: 12px; }
.share a, .share button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(7,20,43,0.14); color: var(--navy); font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; }
.share svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.share a:hover, .share button:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ---------- Autor e relacionados ---------- */
.author-box { display: flex; gap: 18px; align-items: center; margin-top: 56px; padding: 24px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid rgba(7,20,43,0.06); }
.author-box .avatar { width: 56px; height: 56px; border-radius: 16px; flex: none; display: grid; place-items: center; background: var(--blue); color: var(--white); font-family: var(--font-display); font-weight: 700; }
.author-box b { display: block; font-family: var(--font-display); font-size: 0.95rem; }
.author-box p { margin-top: 4px; font-size: 0.92rem; color: var(--mute); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.tags span { padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--white); border: 1px solid rgba(7,20,43,0.1); color: var(--navy); }

@media (max-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .post-feature { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: contents; }
  .article-side .toc { order: -1; }
  .article-side .toc ol { display: flex; flex-wrap: wrap; gap: 6px; }
  .article-side .toc a { border: 1px solid rgba(7,20,43,0.12); border-left-width: 1px; border-radius: 999px; }
  .article-section { padding-top: 56px; }
  .article-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .article-cover .post-cover { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .article-cover .post-cover { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
  .article-body { font-size: 1.02rem; }
  .author-box { flex-direction: column; align-items: flex-start; }
  .post-meta .author { flex-basis: 100%; }
  .post-meta .author + time::before { content: none; }
  .article-cover .post-cover .cover-mark { height: 58%; }
}
