/* ============================================================
   BLOG + PORTFÓLIO — Alfa Dash v3
   ============================================================ */

/* ---------- Topo do blog ---------- */
.blog-hero { padding: 56px 0 28px; background: radial-gradient(700px 300px at 90% 0%, rgba(124, 58, 237, .09), transparent 70%), radial-gradient(700px 300px at 0% 0%, rgba(31, 111, 235, .10), transparent 70%), var(--bg); }
.blog-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.blog-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.blog-hero p { color: var(--muted); margin-top: 10px; max-width: 560px; font-size: 1.05rem; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 6px 6px 18px; width: min(380px, 100%); box-shadow: var(--shadow-sm); }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 111, 235, .12); }
.search-box input { border: none; outline: none; flex: 1; font: inherit; font-size: .95rem; background: transparent; color: var(--ink); min-width: 0; }
.search-box button { border: none; background: var(--primary); color: #fff; border-radius: 999px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.blog-cats { margin-top: 28px; }
.blog-cats .chip { text-decoration: none; }

/* ---------- Destaques ---------- */
.featured-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; margin-bottom: 56px; }
.featured-main { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow var(--transition), transform var(--transition); }
.featured-main:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.featured-main .post-card-img { aspect-ratio: 1200 / 630; }
.featured-main .fm-body { padding: 26px 28px 28px; display: grid; gap: 12px; }
.featured-main h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.22; }
.featured-main h2 a { color: var(--ink); }
.featured-main h2 a::after { content: ''; position: absolute; inset: 0; }
.featured-main p { color: var(--muted); }
.featured-side { display: grid; gap: 16px; align-content: start; }
.side-post { position: relative; display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition); }
.side-post:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.side-post img { width: 132px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; }
.side-post h3 { font-size: .98rem; line-height: 1.35; margin-top: 6px; }
.side-post h3 a { color: var(--ink); }
.side-post h3 a::after { content: ''; position: absolute; inset: 0; }
.side-post .post-meta { margin-top: 6px; }

/* ---------- Layout com sidebar ---------- */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.blog-layout .grid-2 { gap: 22px; }
.list-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.list-title h2 { font-size: 1.4rem; }
.list-title small { color: var(--muted); }

.sidebar { display: grid; gap: 20px; position: sticky; top: 92px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.widget h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.widget .search-box { width: 100%; box-shadow: none; }
.cat-list a { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; color: var(--ink); font-weight: 600; font-size: .93rem; border-bottom: 1px solid var(--line); }
.cat-list a:last-child { border-bottom: none; }
.cat-list a:hover, .cat-list a.active { color: var(--primary); }
.cat-list a span { font-size: .78rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.recent-list a { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 8px 0; color: var(--ink); font-weight: 600; font-size: .88rem; line-height: 1.35; }
.recent-list a:hover { color: var(--primary); }
.recent-list img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; }
.widget-cta { background: linear-gradient(160deg, #0b1b33, #1d3a7a); border: none; color: #c7d4ea; }
.widget-cta h4 { color: #9db8ff; }
.widget-cta h3 { color: #fff; font-size: 1.15rem; margin-bottom: 8px; }
.widget-cta p { color: #c7d4ea; font-size: .9rem; margin-bottom: 16px; }
.widget-cta .btn { width: 100%; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { font-size: .8rem; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.tag-cloud a:hover { background: var(--primary-50); color: var(--primary); }

/* ---------- Artigo ---------- */
.article-head { padding: 48px 0 32px; background: radial-gradient(700px 300px at 85% 0%, rgba(124, 58, 237, .08), transparent 70%), radial-gradient(700px 300px at 0% 0%, rgba(31, 111, 235, .09), transparent 70%), var(--bg); }
.article-head .inner { max-width: 820px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.article-head h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin: 14px 0 16px; }
.article-head .lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.author-row { display: flex; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); flex-shrink: 0; }
.avatar.has-photo { overflow: hidden; background: var(--surface-2); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-row .who strong { display: block; color: var(--ink); font-size: .95rem; }
.author-row .who span { font-size: .83rem; color: var(--muted); }
.article-cover { margin-top: -4px; }
.article-cover img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 1200 / 630; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: 220px minmax(0, 720px) 1fr; gap: 48px; padding: 48px 0 24px; }
.toc { position: sticky; top: 96px; align-self: start; font-size: .86rem; }
.toc h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; padding: 6px 0 6px 12px; color: var(--muted); border-left: 2px solid var(--line); line-height: 1.35; font-weight: 500; }
.toc a.lvl-3 { padding-left: 24px; font-size: .82rem; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 700; }
.share-col { position: sticky; top: 96px; align-self: start; display: grid; gap: 10px; justify-items: start; }
.share-col small { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.share-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: all var(--transition); }
.share-btn:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.share-btn.wa:hover { background: var(--wa); border-color: var(--wa); }

/* Tipografia de leitura */
.prose { font-size: 1.08rem; line-height: 1.8; color: #2b3a4f; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 1.6rem; margin-top: 2.1em; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.25rem; margin-top: 1.8em; scroll-margin-top: 96px; }
.prose p { color: #2b3a4f; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.6em; }
.prose ul > li::before { content: ''; position: absolute; left: .35em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--primary); font-weight: 800; }
.prose li + li { margin-top: .5em; }
.prose blockquote { border-left: 4px solid var(--primary); background: var(--primary-50); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); font-style: italic; }
.prose img { border-radius: var(--radius); }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .85rem; }
.prose tr:last-child td { border-bottom: none; }
.prose .formula { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; font-weight: 700; color: var(--ink); text-align: center; box-shadow: var(--shadow-sm); }
.prose .frac { display: inline-flex; flex-direction: column; align-items: center; font-weight: 600; }
.prose .frac span:first-child { border-bottom: 2px solid var(--ink); padding: 0 8px 4px; }
.prose .frac span:last-child { padding: 4px 8px 0; }
.prose .sources { margin-top: 2.6em; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: .88rem; line-height: 1.6; }
.prose .sources h2 { font-size: .8rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.prose .sources ul > li { padding-left: 1.2em; }
.prose .sources ul > li::before { width: 5px; height: 5px; top: .62em; left: 0; background: var(--line-strong); }
.prose .sources a { color: var(--text); text-decoration: none; }
.prose .sources a:hover { color: var(--primary); text-decoration: underline; }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; }
.post-tags a { font-size: .82rem; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.post-tags a:hover { background: var(--primary-50); color: var(--primary); }

.author-box { display: flex; gap: 18px; align-items: flex-start; margin-top: 40px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.author-box .avatar { width: 60px; height: 60px; font-size: 1.3rem; }
.author-box h4 { margin-bottom: 4px; }
.author-box p { font-size: .93rem; color: var(--muted); }
.author-box .btn { margin-top: 14px; }

.inline-cta { margin-top: 36px; padding: 28px; border-radius: var(--radius); background: linear-gradient(135deg, #0b1b33, #1d3a7a); color: #c7d4ea; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.inline-cta h3 { color: #fff; font-size: 1.2rem; }
.inline-cta p { color: #c7d4ea; font-size: .95rem; margin-top: 4px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.post-nav a { display: block; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 700; line-height: 1.35; font-size: .95rem; transition: border-color var(--transition), box-shadow var(--transition); }
.post-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-nav small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.post-nav .next { text-align: right; }

.reading-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 200; transition: width .08s linear; }

/* ---------- Portfólio ---------- */
.pf-filters { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pf-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition); }
.pf-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pf-card[hidden] { display: none; }
.pf-thumb { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--surface-2); }
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pf-card:hover .pf-thumb img { transform: scale(1.05); }
.pf-type { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: .74rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); z-index: 2; }
.pf-play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, transparent 40%, rgba(11, 27, 51, .45)); }
.pf-play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .95); display: grid; place-items: center; color: var(--primary); box-shadow: var(--shadow-lg); transition: transform var(--transition); }
.pf-card:hover .pf-play span { transform: scale(1.1); }
.pf-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pf-body h3 { font-size: 1.1rem; line-height: 1.35; }
.pf-body h3 a, .pf-body h3 button { color: var(--ink); background: none; border: none; padding: 0; text-align: left; cursor: pointer; font: inherit; font-family: var(--font-head); font-weight: 700; }
.pf-body h3 a::after, .pf-body h3 button::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pf-body p { font-size: .92rem; color: var(--muted); }
.pf-result { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; font-weight: 600; color: var(--teal); background: var(--teal-50); padding: 8px 12px; border-radius: 10px; }
.pf-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.pf-tech span { font-size: .74rem; font-weight: 700; padding: 4px 9px; border-radius: 6px; background: var(--surface-2); color: var(--text); }

.pf-modal { position: fixed; inset: 0; z-index: 400; background: rgba(11, 27, 51, .78); display: none; align-items: center; justify-content: center; padding: 16px; }
.pf-modal.open { display: flex; animation: fadeUp .2s ease; }
.pf-modal-inner { width: min(1000px, 100%); position: relative; }
.pf-modal .video-wrap { max-width: none; }
.pf-modal-close { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff; color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.pf-modal h3 { color: #fff; margin-top: 14px; }

.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding: 48px 0; align-items: start; }
.case-facts { display: grid; gap: 14px; }
.case-facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.case-facts dd { color: var(--ink); font-weight: 600; margin-bottom: 6px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 200px; }
  .share-col { display: none; }
  .toc { order: 2; }
}
@media (max-width: 980px) {
  .featured-grid, .blog-layout, .case-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  .toc { display: none; }
}
@media (max-width: 640px) {
  .blog-layout .grid-2, .pf-grid { grid-template-columns: 1fr; }
  .side-post { grid-template-columns: 104px 1fr; }
  .side-post img { width: 104px; }
  .prose { font-size: 1.02rem; }
  .post-nav { grid-template-columns: 1fr; }
  .author-box { flex-direction: column; }
  .search-box { width: 100%; }
}

/* Newsletter no blog */
.widget-nl { background: linear-gradient(160deg, #eaf2ff, #f3edff); border-color: #dbe6fb; }
.widget-nl h3 { font-size: 1.08rem; margin-bottom: 14px; }
.widget-nl .nl-row { flex-direction: column; }
.widget-nl .btn { width: 100%; }
.nl-inline { margin-top: 36px; padding: 28px; border-radius: var(--radius); background: linear-gradient(120deg, #eaf2ff, #f3edff); border: 1px solid #dbe6fb; display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: center; }
.nl-inline h3 { font-size: 1.2rem; }
.nl-inline p { color: var(--muted); font-size: .93rem; margin-top: 4px; }
@media (max-width: 760px) { .nl-inline { grid-template-columns: 1fr; } }
