/* ============================================================
   QualiTab — Blog (versão mobile)
   Complementa ../assets/mobile/mobile.css nas páginas blog/*-mobile.html
   ============================================================ */

/* ---------- Barra de progresso de leitura (sob o header) ---------- */
.b-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; pointer-events: none; }
.b-progress span { display: block; height: 100%; width: 100%; background: var(--m-orange); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* ---------- Listagem ---------- */
.b-list-hero { background: var(--m-cream); padding: 32px var(--m-gutter) 28px; }
.b-list-hero .m-lead { font-size: 16px; }
.b-filters { padding: 18px var(--m-gutter) 4px; position: sticky; top: var(--m-header-h); z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.b-filters .m-chip-row { padding-bottom: 12px; }
.b-chip { flex-shrink: 0; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--m-line-strong); background: #fff; color: #5b5658; font-family: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 0; cursor: pointer; white-space: nowrap; }
.b-chip.is-active { background: var(--m-navy); border-color: var(--m-navy); color: #fff; }
.b-count { font-size: 13px; color: var(--m-faint); padding: 6px var(--m-gutter) 0; }
.b-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px var(--m-gutter) 48px; }
.b-empty { display: none; grid-column: 1 / -1; text-align: center; color: var(--m-muted); font-size: 15px; padding: 28px 0; }

/* Cards (mesma imagem de capa do desktop, em 2 colunas) */
.b-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--m-line); border-radius: 0; overflow: hidden; box-shadow: 0 6px 20px -14px rgba(24,41,69,.22); }
.b-card:active { border-color: var(--m-orange); transform: scale(.99); }
.b-card-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--m-navy); flex-shrink: 0; }
.b-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-card-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24,41,69,0) 45%, rgba(24,41,69,.35) 100%); pointer-events: none; }
.b-card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 12px 14px; }
.b-cat { font-size: 10.5px; font-weight: 700; color: var(--m-orange); text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; overflow-wrap: break-word; }
.b-card-title { font-size: 14.5px; font-weight: 800; color: var(--m-navy); line-height: 1.3; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
.b-card-excerpt { display: none; font-size: 15px; color: var(--m-muted); line-height: 1.6; }
.b-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #9a938e; }
.b-card .b-meta { margin-top: auto; padding-top: 2px; font-size: 12px; }
.b-meta svg { flex-shrink: 0; }
.b-readmore { display: none; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--m-orange); margin-top: 4px; }

/* Primeiro post (ou primeiro visível no filtro) em destaque, largura total */
.b-card.is-feature { grid-column: 1 / -1; border-radius: 0; }
.b-card.is-feature .b-card-thumb { aspect-ratio: 16 / 10; }
.b-card.is-feature .b-card-body { padding: 18px 18px 20px; gap: 9px; }
.b-card.is-feature .b-cat { font-size: 12px; }
.b-card.is-feature .b-card-title { font-size: 21px; line-height: 1.25; -webkit-line-clamp: unset; letter-spacing: -0.015em; }
.b-card.is-feature .b-card-excerpt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.b-card.is-feature .b-meta { font-size: 13px; margin-top: 0; }
.b-card.is-feature .b-readmore { display: inline-flex; }

/* ---------- Artigo ---------- */
.b-hero { background: var(--m-cream); padding: 18px var(--m-gutter) 26px; }
.b-crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--m-navy); margin: -6px 0 6px; }
.b-title { font-size: 28px; line-height: 1.16; font-weight: 800; color: var(--m-navy); letter-spacing: -0.02em; margin-top: 12px; }
.b-hero .b-meta { margin-top: 16px; font-size: 13.5px; color: #8a8486; flex-wrap: wrap; }
.b-cover { margin: 0; }
.b-cover-img { position: relative; aspect-ratio: 16 / 10; background: var(--m-navy); overflow: hidden; }
.b-cover-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-cover figcaption { font-size: 11px; color: #b3aca7; text-align: right; padding: 6px var(--m-gutter) 0; }
.b-cover figcaption a { color: #b3aca7; text-decoration: underline; text-underline-offset: 2px; }

.b-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px var(--m-gutter) 0; }
.b-share { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--m-line-strong); border-radius: 0; background: #fff; color: var(--m-navy); font-size: 14px; font-weight: 700; cursor: pointer; }
.b-share:active { background: var(--m-cream); }
.b-tools-label { font-size: 14px; color: var(--m-muted); }

.b-toc { margin: 16px var(--m-gutter) 0; background: var(--m-cream); }
.b-toc summary { font-size: 15px; font-weight: 700; color: var(--m-navy); }
.b-toc summary small { font-size: 13px; font-weight: 500; color: var(--m-faint); }
.b-toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; }
.b-toc li { counter-increment: toc; border-top: 1px solid var(--m-line); }
.b-toc a { display: flex; gap: 12px; padding: 12px 0; font-size: 15px; line-height: 1.4; color: var(--m-text); font-weight: 500; }
.b-toc a::before { content: counter(toc, decimal-leading-zero); flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--m-orange); padding-top: 1px; font-variant-numeric: tabular-nums; }
.b-toc a:active { color: var(--m-orange); }

.b-body { padding: 28px var(--m-gutter) 0; }
.b-body > p { font-size: 18px; line-height: 1.7; color: #4a4547; margin-top: 20px; overflow-wrap: break-word; }
.b-body > p:first-child { margin-top: 0; font-size: 19px; color: #363334; }
.b-body h2 { font-size: 23px; line-height: 1.25; font-weight: 800; color: var(--m-navy); letter-spacing: -0.015em; margin-top: 40px; scroll-margin-top: 6px; }
.b-body strong { color: var(--m-navy); }
.b-body ul { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.b-body ul li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.65; color: #4a4547; }
.b-body ul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 0; background: var(--m-orange); }

/* Tabelas com rolagem horizontal */
.b-body .qtb-table-wrap { margin: 22px calc(var(--m-gutter) * -1) 0; padding: 0 var(--m-gutter); overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.b-body .qtb-table-wrap:focus-visible { outline: 2px solid var(--m-orange); outline-offset: 2px; }
.b-table-hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--m-faint); margin-top: 22px; }
.b-table-hint + .qtb-table-wrap { margin-top: 8px; }
.b-body .qtb-table { border-collapse: separate; border-spacing: 0; min-width: 560px; width: 100%; border: 1px solid var(--m-line); border-radius: 0; overflow: hidden; }
.b-body .qtb-table th { background: var(--m-navy); color: #fff; font-size: 13px; font-weight: 700; text-align: left; padding: 12px 14px; letter-spacing: .02em; vertical-align: bottom; }
.b-body .qtb-table td { font-size: 14.5px; color: #4a4547; line-height: 1.5; padding: 12px 14px; border-top: 1px solid var(--m-line); vertical-align: top; }
.b-body .qtb-table td:first-child { font-weight: 700; color: var(--m-navy); }
.b-body .qtb-table tr:nth-child(even) td { background: var(--m-cream); }

/* CTA dentro do artigo */
.b-cta { margin: 44px var(--m-gutter) 0; background: var(--m-navy); color: #fff; border-radius: 0; padding: 28px 22px 22px; position: relative; overflow: hidden; }
.b-cta::before { content: ""; position: absolute; top: -90px; left: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(232,98,54,.25), transparent 70%); }
.b-cta::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.b-cta > * { position: relative; z-index: 1; }
.b-cta .m-eyebrow { color: var(--m-orange-soft); }
.b-cta h2 { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; margin-top: 10px; color: #fff; }
.b-cta p { font-size: 15.5px; color: #b9c1ce; line-height: 1.6; margin-top: 10px; }
.b-cta p strong { color: #fff; }
.b-cta .m-btn { margin-top: 20px; }

.b-endshare { margin: 28px var(--m-gutter) 0; padding: 18px; border: 1px dashed var(--m-line-strong); border-radius: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.b-endshare b { font-size: 15px; color: var(--m-navy); line-height: 1.35; }

/* Relacionados */
.b-related { padding: 48px var(--m-gutter) 52px; }
.b-related h2 { font-size: 22px; font-weight: 800; color: var(--m-navy); letter-spacing: -0.01em; }
.b-related .m-carousel { margin-top: 16px; }
.b-related .m-carousel > * { flex-basis: 80%; }
.b-rel { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--m-line); border-radius: 0; overflow: hidden; box-shadow: 0 4px 20px -14px rgba(24,41,69,.18); }
.b-rel .b-card-thumb { aspect-ratio: 16 / 10; border-radius: 0; }
.b-rel-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.b-rel .b-card-title { font-size: 16px; }
.b-rel-excerpt { display: none; }
.b-rel .b-meta { margin-top: auto; padding-top: 4px; }
.b-related .m-link-arrow { margin-top: 22px; }

/* ---------- Bottom sheet de demonstração (blog.js controla via style.display) ---------- */
#demoOverlay.m-sheet-overlay { opacity: 1; visibility: visible; transition: none; animation: b-fade .25s ease; }
#demoOverlay .m-sheet { transform: none; animation: b-sheet-up .32s cubic-bezier(.22,.61,.36,1); }
@keyframes b-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes b-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
#demoForm .m-input + .m-hint { margin-top: 6px; }
select.m-input { padding-right: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8486' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; }
#demoFooter { flex-direction: column; gap: 10px; }
.b-form-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--m-navy); text-align: center; }
#demoSubmit { border-radius: 0; }
#demoSubmit:disabled { box-shadow: none; cursor: not-allowed; }

/* ---------- Aviso "link copiado" ---------- */
.b-toast { position: fixed; left: 50%; bottom: calc(92px + var(--m-safe-bottom)); z-index: 300; transform: translate(-50%, 12px); background: var(--m-navy); color: #fff; font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 0; box-shadow: 0 12px 30px -12px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; white-space: nowrap; }
.b-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
