/* =====================================================================
   ECOMULTI — Blog (listagem, artigo, cartões da página inicial)
   Usa as variáveis e componentes de style.css
   ===================================================================== */

/* ---------- Cabeçalho do blog ---------- */
.b-hero { padding-bottom: 88px; }
.b-hero .hero-grid { grid-template-columns: 1.2fr 0.8fr; align-items: center; }
.b-hero h1 { font-size: clamp(2rem, 3.6vw + .5rem, 3.2rem); }
.b-search { position: relative; margin-top: 26px; max-width: 560px; }
.b-search input { width: 100%; min-height: 56px; padding: 0 70px 0 52px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); font-size: 1.02rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.b-search input:focus { outline: 3px solid var(--aqua); outline-offset: 2px; }
.b-search .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.b-search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 0.78rem/1 ui-monospace, Consolas, monospace; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; pointer-events: none; }
.b-hero-card { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-lg); padding: 26px; backdrop-filter: blur(6px); }
.b-hero-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 8px; }
.b-hero-card p { color: #c3cdeb; font-size: 0.95rem; }
.b-hero-card .btn { width: 100%; }

/* ---------- Barra de categorias ---------- */
.b-bar { padding: 28px 0 0; }
.b-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.b-bar-top h2 { font-size: 1.3rem; margin: 0; }
.b-contador { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.b-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.b-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--text); font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.b-chip b { font-size: 0.76rem; background: var(--bg-soft); color: var(--muted); border-radius: 999px; padding: 1px 8px; }
.b-chip:hover { border-color: var(--blue); color: var(--blue); }
.b-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.b-chip[aria-pressed="true"] b { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ---------- Cartões ---------- */
.b-sec { padding: 28px 0 80px; }
.b-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.b-grid:empty { display: none; }
.b-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s; animation: rowIn 0.5s var(--ease) both; animation-delay: var(--d, 0s); }
.b-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.b-card-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.b-card-link:focus-visible { outline: 3px solid var(--aqua); outline-offset: -3px; }
.b-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.b-card h3 { font-size: 1.15rem; line-height: 1.3; margin: 10px 0 8px; transition: color 0.2s; }
.b-card:hover h3 { color: var(--blue); }
.b-card p { color: var(--muted); font-size: 0.95rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.b-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.b-meta.on-dark { color: #aab5da; margin-top: 18px; }
.b-pill { align-self: flex-start; display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; color: hsl(var(--h) 65% 38%); background: hsl(var(--h) 90% 95%); }
.b-pill.on-dark { color: var(--aqua-200); background: rgba(95, 201, 216, 0.14); border: 1px solid rgba(95, 201, 216, 0.3); margin-bottom: 16px; }

/* capa gerada (sem imagem) */
.b-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; color: #fff; isolation: isolate;
  background: radial-gradient(circle at 85% 0%, hsl(calc(var(--h) + 35) 85% 62% / 0.85), transparent 55%), linear-gradient(135deg, hsl(var(--h) 70% 26%), hsl(calc(var(--h) + 20) 75% 42%)); }
.b-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.3px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(135deg, #000, transparent 70%); mask-image: linear-gradient(135deg, #000, transparent 70%); }
.b-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.b-card:hover .b-cover img { transform: scale(1.05); }
.b-cover-ico { width: 54px; height: 54px; stroke-width: 1.5; opacity: 0.92; transition: transform 0.4s var(--ease); }
.b-card:hover .b-cover-ico { transform: scale(1.1) rotate(-4deg); }
.b-cover-cat { position: absolute; left: 14px; bottom: 12px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.b-cover img ~ .b-cover-ico, .b-cover img ~ .b-cover-cat { display: none; }

/* destaque */
.b-destaque { margin-bottom: 22px; }
.b-destaque:empty { display: none; }
.b-card-hero { flex-direction: row; }
.b-card-hero .b-cover { flex: 1.1; aspect-ratio: auto; min-height: 320px; }
.b-card-hero .b-cover-ico { width: 84px; height: 84px; }
.b-card-hero .b-card-body { flex: 1; justify-content: center; padding: 36px 38px; }
.b-card-hero h3 { font-size: clamp(1.4rem, 1.6vw + 0.8rem, 2rem); letter-spacing: -0.02em; }
.b-card-hero p { font-size: 1.04rem; -webkit-line-clamp: 4; flex: 0 1 auto; }
.b-card-hero .b-pill::after { content: " · Em destaque"; }

.b-mais { display: flex; justify-content: center; margin-top: 34px; }
.b-vazio { text-align: center; padding: 50px 10px; }
.b-vazio .ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.b-vazio p { color: var(--muted); }

/* esqueleto enquanto carrega */
.b-skel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.b-skel i { display: block; height: 330px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--bg-soft) 25%, #fff 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; }
[aria-busy="false"] .b-skel, #blogApp:not([aria-busy="true"]) .b-skel { display: none; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- Página inicial: últimas notícias ---------- */
.b-latest-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.b-latest-head .section-head { margin: 0; text-align: left; }

/* ---------- Artigo ---------- */
.b-progress { position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 210; background: transparent; pointer-events: none; }
.b-progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }
.b-art-hero h1 { font-size: clamp(1.9rem, 3.2vw + 0.5rem, 3rem); max-width: 860px; }
.b-art-hero .lead { max-width: 760px; }
.b-art-sec { padding: 56px 0 72px; }
.b-art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 56px; align-items: start; }
.b-art-img { margin: 0 0 30px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.b-art-img img { width: 100%; }
.b-prose { font-size: 1.08rem; line-height: 1.8; color: var(--text); }
.b-prose > :first-child { margin-top: 0; }
.b-prose h2 { font-size: 1.6rem; margin: 2em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 16px); }
.b-prose h3 { font-size: 1.25rem; margin: 1.6em 0 0.5em; scroll-margin-top: calc(var(--header-h) + 16px); }
.b-prose p { margin: 0 0 1.2em; }
.b-prose a { color: var(--blue); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(42, 80, 216, 0.35); text-underline-offset: 3px; }
.b-prose a:hover { text-decoration-color: currentColor; }
.b-prose ul, .b-prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.b-prose ul { list-style: disc; }
.b-prose ol { list-style: decimal; }
.b-prose li { margin-bottom: 0.5em; padding-left: 4px; }
.b-prose li::marker { color: var(--blue); font-weight: 700; }
.b-prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--aqua); background: var(--bg-soft); border-radius: 0 14px 14px 0; font-size: 1.12rem; font-style: italic; color: var(--ink); }
.b-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.b-prose figure { margin: 1.6em 0; }
.b-prose img { border-radius: 14px; box-shadow: var(--shadow-sm); }
.b-prose code { font: 0.92em ui-monospace, Consolas, monospace; background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.b-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.b-tags a { font-size: 0.86rem; font-weight: 700; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 5px 12px; transition: all 0.2s; }
.b-tags a:hover { background: var(--blue-50); color: var(--blue); }

.b-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 30px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.b-share-t { font-weight: 800; color: var(--ink); margin-right: 6px; }
.b-share-b { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: all 0.2s; }
.b-share-b:hover { border-color: var(--blue); color: var(--blue); }
.b-share-b.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.b-share-b.wa:hover { background: #178a45; color: #fff; }
.b-util { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: 22px; padding: 18px 20px; border-radius: 16px; background: var(--bg-soft); }
.b-util strong { color: var(--ink); }
.b-util div { display: flex; gap: 8px; }
.b-util button { border: 1.5px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 7px 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.b-util button:hover { border-color: var(--blue); }
.b-util button[aria-pressed="true"] { background: var(--blue-50); border-color: var(--blue); color: var(--blue-700); }
.b-util-msg { flex: 1 1 100%; margin: 0; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.b-util-msg:empty { display: none; }
.b-util-msg a { color: var(--blue); text-decoration: underline; }

.b-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }
.b-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.b-toc h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.b-toc ol { display: grid; gap: 2px; counter-reset: t; }
.b-toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--line); font-size: 0.92rem; font-weight: 600; color: var(--text); line-height: 1.35; transition: all 0.2s; }
.b-toc .n3 a { padding-left: 22px; font-weight: 500; font-size: 0.88rem; }
.b-toc a:hover { color: var(--blue); }
.b-toc a.on { border-left-color: var(--blue); color: var(--blue); background: var(--blue-50); border-radius: 0 8px 8px 0; }
.b-aside-nl { padding: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.b-aside-nl h3 { font-size: 1.1rem; }
.b-aside-wa { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: #e9f8ef; border: 1px solid #c4ebd2; color: #14653a; transition: transform 0.2s, box-shadow 0.2s; }
.b-aside-wa:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.b-aside-wa .icon { width: 30px; height: 30px; color: #1fa855; }
.b-aside-wa strong { display: block; color: #0f4d2c; }
.b-aside-wa small { font-size: 0.84rem; color: #2c7a50; }
.b-rel { padding: 72px 0; }
.b-notfound { padding: 96px 20px; max-width: 560px; }

/* ---------- Newsletter dentro do blog ---------- */
.b-nl-sec { padding: 80px 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .b-art-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 36px; }
}
@media (max-width: 960px) {
  .b-hero .hero-grid { grid-template-columns: 1fr; }
  .b-hero-card { display: none; }
  .b-grid, .b-skel { grid-template-columns: 1fr 1fr; }
  .b-card-hero { flex-direction: column; }
  .b-card-hero .b-cover { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .b-card-hero .b-card-body { padding: 24px 22px; }
  .b-art-grid { grid-template-columns: 1fr; }
  .b-aside { position: static; }
  .b-toc { order: -1; }
  .b-art-sec { padding: 40px 0 56px; }
}
@media (max-width: 640px) {
  .b-grid, .b-skel { grid-template-columns: 1fr; }
  .b-prose { font-size: 1.02rem; }
  .b-share-b span { display: none; }
  .b-share-b { padding: 0 13px; }
  .b-share-b.wa span { display: inline; }
  .b-search input { min-height: 52px; padding-right: 20px; }
  .b-search kbd { display: none; }
  .b-latest-head .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .b-card { animation: none; } .b-skel i { animation: none; } }
