/* =========================================================
   Controle o Bolso — Blog (usa home.css como base)
   ========================================================= */

/* ---------- Blog hero ---------- */
.blog-hero { position: relative; padding: 140px 0 56px; overflow: hidden; isolation: isolate; text-align: center; }
.blog-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(77, 194, 1, .16), transparent 65%),
    linear-gradient(180deg, #f8fcf4 0%, #fff 100%);
}
.blog-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(11,26,16,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(11,26,16,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 20%, #000 30%, transparent 75%);
}
.blog-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; margin: 18px auto 16px; max-width: 760px; }
.blog-hero p { font-size: 1.12rem; color: var(--muted); max-width: 580px; margin: 0 auto; }

.breadcrumb { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb span[aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Layout ---------- */
.blog-main { padding: 24px 0 112px; }
.blog-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 72px 0 28px; }
.blog-section-title h2 { font-size: 1.6rem; font-weight: 800; }
.blog-section-title span { color: var(--muted); font-size: .9rem; }

/* ---------- Common bits ---------- */
.post-thumb { position: relative; overflow: hidden; background: var(--brand-50); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.post-thumb.no-img,
.post-thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, #5ad40a, #2f8a00); color: rgba(255,255,255,.9);
}
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta svg { opacity: .7; }
.post-author { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.post-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center; font-size: .72rem; font-weight: 800;
}
.read-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-700); font-size: .92rem; }
.read-more svg { transition: transform .2s ease; }

/* stretched link: the whole card is clickable */
.post-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-link:focus-visible { outline: none; }
.post-card:has(.post-link:focus-visible), .featured:has(.post-link:focus-visible) { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ---------- Featured ---------- */
.featured {
  position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow .3s ease, transform .3s ease;
}
.featured:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.featured:hover .post-thumb img { transform: scale(1.04); }
.featured:hover .read-more svg { transform: translateX(4px); }
.featured .post-thumb { min-height: 380px; }
.featured-body { padding: 44px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.featured-tag {
  align-self: flex-start; background: var(--brand-50); color: var(--brand-700);
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 6px 12px; border-radius: 999px;
}
.featured h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; }
.featured h2 a:hover { color: var(--brand-700); }
.featured p { color: var(--muted); font-size: 1.04rem; }

/* ---------- Grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d7e2da; }
.post-card:hover .post-thumb img { transform: scale(1.05); }
.post-card:hover .read-more svg { transform: translateX(4px); }
.post-card .post-thumb { aspect-ratio: 16 / 10; }
.post-card-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post-card h3 { font-size: 1.18rem; font-weight: 700; line-height: 1.3; }
.post-card p {
  color: var(--muted); font-size: .95rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .read-more { margin-top: 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 64px; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: .92rem; color: var(--ink-2);
  border: 1px solid var(--line); background: #fff; transition: background .2s, border-color .2s, color .2s;
}
.pagination a:hover { border-color: #cfd8d2; background: var(--bg-soft); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { border: 0; background: none; min-width: 24px; padding: 0; color: var(--muted); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 72px 24px; border: 1px dashed #d3dcd6; border-radius: 24px; background: var(--bg-soft); }
.empty .t-ico { margin: 0 auto 18px; }
.empty h2 { font-size: 1.5rem; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 24px; }

/* ---------- CTA box ---------- */
.blog-cta {
  position: relative; overflow: hidden; margin-top: 96px; border-radius: 28px; padding: 56px;
  background: var(--ink); color: #c6d1ca;
  display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; isolation: isolate;
}
.blog-cta::before { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -160px; top: -220px; background: radial-gradient(circle, rgba(77,194,1,.4), transparent 65%); }
.blog-cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.blog-cta p { margin-top: 10px; color: #9fb0a6; font-size: 1.04rem; }
.blog-cta .hero-actions { margin-top: 0; }

/* =========================================================
   Página do artigo (post.php)
   ========================================================= */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70;
  background: var(--brand); transform-origin: 0 50%; transform: scaleX(0);
}

.article-hero { position: relative; padding: 136px 0 40px; text-align: center; isolation: isolate; overflow: hidden; }
.article-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 340px at 50% 0%, rgba(77, 194, 1, .14), transparent 65%), linear-gradient(180deg, #f8fcf4 0%, #fff 100%);
}
.article-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; max-width: 860px; margin: 18px auto 18px; }
.article-lead { font-size: 1.18rem; color: var(--muted); max-width: 680px; margin: 0 auto 24px; }
.article-hero .post-meta { justify-content: center; font-size: .9rem; }

.article-cover { max-width: 1040px; margin: 8px auto 0; border-radius: 28px; aspect-ratio: 16 / 8; box-shadow: var(--shadow); }

.article-layout {
  display: grid; grid-template-columns: 56px minmax(0, 720px) 260px; gap: 48px;
  justify-content: center; align-items: start; margin-top: 56px;
}

/* Share */
.article-share { position: sticky; top: 110px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.share-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 6px; }
.share-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.share-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); }
.share-btn.copied { background: var(--brand); border-color: var(--brand); color: #fff; }

/* CTA lateral */
.article-side { position: sticky; top: 110px; }
.side-cta { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 22px; padding: 24px; }
.side-cta img { border-radius: 12px; margin-bottom: 14px; }
.side-cta h3 { font-size: 1.1rem; margin-bottom: 6px; }
.side-cta p { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }

/* Tipografia do conteúdo */
.prose { font-size: 1.1rem; line-height: 1.8; color: var(--text); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.75rem; font-weight: 800; margin-top: 2em; line-height: 1.25; }
.prose h3 { font-size: 1.35rem; font-weight: 700; margin-top: 1.8em; line-height: 1.3; }
.prose h4 { font-size: 1.12rem; font-weight: 700; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--brand-700); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(77,194,1,.45); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand-700); }
.prose strong, .prose b { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--brand-600); font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--brand); background: var(--brand-50); border-radius: 0 16px 16px 0;
  padding: 18px 24px; color: var(--ink-2); font-style: italic;
}
.prose img { border-radius: 18px; height: auto; margin: 1.6em auto; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.prose code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--ink); }
.prose > :first-child { margin-top: 0; }

.article-main { min-width: 0; }
.article-footer { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.blog-section-title .read-more { font-size: .92rem; }
.blog-section-title .read-more:hover svg { transform: translateX(4px); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .article-layout { grid-template-columns: 56px minmax(0, 720px); }
  .article-side { display: none; }
}
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
  .featured .post-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-cta { grid-template-columns: 1fr; text-align: center; }
  .blog-cta .hero-actions { justify-content: center; }
}
@media (max-width: 720px) {
  .blog-hero { padding: 112px 0 40px; }
  .post-grid { grid-template-columns: 1fr; gap: 20px; }
  .featured-body { padding: 26px; }
  .blog-section-title { margin-top: 56px; }
  .blog-cta { padding: 40px 24px; margin-top: 72px; }
  .pagination .num:not(.current) { display: none; }
  .pagination .gap { display: none; }
}
@media (max-width: 860px) {
  .article-hero { padding: 108px 0 28px; }
  .article-cover { border-radius: 20px; aspect-ratio: 16 / 10; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 36px; }
  .article-share { position: static; flex-direction: row; justify-content: flex-start; order: 2; padding-top: 24px; border-top: 1px solid var(--line); }
  .share-label { writing-mode: horizontal-tb; transform: none; margin: 0 8px 0 0; }
  .prose { font-size: 1.04rem; }
  .prose h2 { font-size: 1.45rem; }
  .article-footer { margin-top: 32px; padding-top: 0; border-top: 0; }
}

/* ==========================================================
   PÁGINAS LEGAIS (termos.html / consentimento.html)
========================================================== */
.legal-hero { padding-bottom: 44px; }
.legal-hero h1 { margin-bottom: 14px; }
.legal-meta { display: flex; justify-content: center; align-items: center; gap: 10px 22px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.legal-meta span { display: inline-flex; align-items: center; gap: 6px; }
.legal-meta a { color: var(--brand-700); font-weight: 600; }

.legal-layout {
  display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 56px;
  justify-content: center; align-items: start; margin-top: 40px; padding-bottom: 96px;
}
.legal-toc { position: sticky; top: 104px; }
.legal-toc summary {
  list-style: none; cursor: pointer; font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.legal-toc a {
  display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent;
  font-size: .9rem; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s;
}
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.is-active { color: var(--brand-700); border-left-color: var(--brand); font-weight: 600; }

.legal-prose { font-size: 1.04rem; }
.legal-prose h2 { font-size: 1.45rem; scroll-margin-top: 100px; }
.legal-prose h3 { font-size: 1.12rem; }
.legal-prose table { display: table; }
.legal-prose td, .legal-prose th { vertical-align: top; }

.legal-resumo {
  scroll-margin-top: 100px; padding: 24px 26px; border-radius: 20px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
}
.legal-resumo h2 { margin-top: 0 !important; font-size: 1.15rem; color: var(--brand-700); }
.legal-resumo ul { margin-top: .8em; }

.legal-contato {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 3em !important; padding: 22px 24px; border-radius: 20px; background: var(--bg-soft); border: 1px solid var(--line);
}
.legal-contato div { display: flex; flex-direction: column; gap: 2px; }
.legal-contato span { font-size: .95rem; color: var(--muted); }
.legal-contato .btn { text-decoration: none; color: #fff; }

@media (max-width: 1023px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 8px; }
  .legal-toc { position: static; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
  .legal-toc summary { margin-bottom: 0; display: flex; justify-content: space-between; align-items: center; }
  .legal-toc summary::after { content: "+"; font-size: 1.1rem; color: var(--ink); }
  .legal-toc details[open] summary { margin-bottom: 10px; }
  .legal-toc details[open] summary::after { content: "−"; }
  .legal-prose table { display: block; overflow-x: auto; }
}

/* ==========================================================
   PÁGINA DO APP (/app)
========================================================== */
.app-hero { position: relative; padding: 128px 0 72px; overflow: hidden; isolation: isolate; }
.app-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(760px 420px at 85% 10%, rgba(77, 194, 1, .16), transparent 65%), linear-gradient(180deg, #f8fcf4 0%, #fff 100%);
}
.app-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.app-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 800; line-height: 1.1; margin: 16px 0 18px; }
.app-hero .highlight { white-space: normal; }
.app-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }
.app-actions .store-btn { color: #fff; text-decoration: none; }
.app-checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .92rem; color: var(--muted); }
.app-checks li { display: inline-flex; align-items: center; gap: 7px; }
.app-checks li::before { content: "✓"; color: var(--brand-600); font-weight: 800; }

.app-shots { position: relative; height: 560px; }
.app-shot { position: absolute; border-radius: 30px; box-shadow: var(--shadow-lg); border: 6px solid #0b0d0c; background: #0b0d0c; }
.app-shot--front { width: 300px; left: 50%; top: 10px; transform: translateX(-50%); z-index: 2; }
.app-shot--back  { width: 250px; left: 2%;  top: 70px; transform: rotate(-7deg); opacity: .95; }
.app-shot--side  { width: 250px; right: 2%; top: 70px; transform: rotate(7deg); opacity: .95; }

.app-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.app-feature { padding: 26px; border-radius: 22px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.app-feature__ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-50); font-size: 1.3rem; }
.app-feature h3 { margin: 16px 0 6px; font-size: 1.1rem; }
.app-feature p { color: var(--muted); font-size: .95rem; }

.app-web { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.app-web h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; margin: 12px 0 8px; }
.app-web p { color: var(--muted); max-width: 520px; }
.app-web__actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1023px) {
  .app-hero { padding-top: 112px; }
  .app-hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .app-hero .hero-lead { margin: 0 auto; }
  .app-actions, .app-checks { justify-content: center; }
  .app-shots { height: 440px; }
  .app-shot--front { width: 230px; }
  .app-shot--back, .app-shot--side { width: 190px; top: 60px; }
  .app-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .app-shots { height: 400px; }
  .app-shot--back { left: -4%; } .app-shot--side { right: -4%; }
  .app-features { grid-template-columns: minmax(0, 1fr); }
  .app-web { text-align: center; justify-content: center; }
  .app-web__actions { justify-content: center; }
}
@media (max-width: 1023px) { .app-shots { height: 480px; } .app-shot--front { top: 0; } }
@media (max-width: 560px)  { .app-shots { height: 450px; } }
