/* =========================
   Base / Reset
========================= */

:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --alt:#f8f9fa;

  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --link:#111827;
  --accent:#2563eb;
  --accent-light:#eff6ff;

  --max: 1140px;
  --content: 860px;
  --radius: 14px;
  --shadow: 0 10px 24px rgba(0,0,0,.05);
}

/* Tematização por Categoria */
.theme-geopolitica {
  --accent: #991b1b;       /* Vinho/Borgonha sério */
  --accent-light: #fef2f2;
}

.theme-dev {
  --accent: #2563eb;       /* Azul Dev padrão */
  --accent-light: #eff6ff;
}

/* Badge de Categoria */
.category-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  min-height:100vh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a{
  color: var(--link);
  text-decoration:none;
}

a:hover{
  text-decoration: underline;
}

:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.container{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.mt-4{
  margin-top: 1.5rem;
}

/* Skip link (acessibilidade) */
.skip{
  position:absolute;
  left:-9999px;
}

.skip:focus{
  left: 12px;
  top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 999;
}

/* =========================
   Layout base (footer no fim)
========================= */

.page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.main-content{
  flex:1;
  padding-bottom: 60px;
}

/* =========================
   Header / Menu
========================= */

.header{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand{
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-desktop{
  display:flex;
  gap: 16px;
  align-items:center;
}

.nav-desktop a{
  color:#374151;
}

.nav-desktop a:hover{
  color: var(--text);
}

.nav-toggle{
  display:none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:#fff;
  cursor:pointer;
}

.burger{
  display:block;
  width: 18px;
  height: 12px;
  margin: 0 auto;
  position: relative;
}

.burger::before,
.burger::after{
  content:"";
  position:absolute;
  left:0;
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
}

.burger::before{
  top: 2px;
}

.burger::after{
  bottom: 2px;
}

.nav-toggle[aria-expanded="true"] .burger::before{
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .burger::after{
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu{
  border-top: 1px solid var(--border);
  background: #fff;
}

.nav-mobile{
  display:flex;
  flex-direction:column;
  padding: 8px 0;
}

.nav-mobile a{
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nav-mobile a:last-child{
  border-bottom:none;
}

.nav-mobile a:hover{
  text-decoration:none;
}

/* =========================
   Tipografia / Layout geral
========================= */

h1{
  margin:0 0 16px;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h2{
  margin:0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ========================= 
   Card — metadados (data + tempo de leitura)
========================= */

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.card-meta time {
  font-variant-numeric: tabular-nums;
}

.card-meta .separator {
  color: var(--border);
}

/* ========================= 
   Card — tags / pills
========================= */

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #374151;
  background: var(--alt);
  transition: border-color .12s ease, background .12s ease;
}

.card-link:hover .tag-pill {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

/* ========================= 
   Card — título e descrição refinados
========================= */

.card-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.5;
}

/* =========================
   Breadcrumb
========================= */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--border);
  font-size: .9rem;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30ch;
}

/* =========================
   TOC — Tabela de Conteúdos
========================= */

.toc {
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 28px;
  max-width: 75ch;
  margin-left: auto;
  margin-right: auto;
}

.toc-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  list-style: decimal;
}

.toc li {
  margin: 4px 0;
  font-size: .88rem;
}

.toc a {
  color: #374151;
  text-decoration: none;
  transition: color .12s ease;
}

.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* =========================
   Post — tags no header
========================= */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.post-tags .tag-pill {
  font-size: .72rem;
}

/* =========================
   Home — intro text
========================= */

.home-intro {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 28px;
  max-width: 60ch;
  line-height: 1.6;
}

p{
  margin: 0 0 10px;
}

.section{
  padding: 34px 0;
}

.section-alt{
  background: var(--alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.grid-2{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* =========================
   Cards / Links clicáveis
========================= */

.cards{
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.card-body{
  padding: 16px;
}

.card-link{
  display:block;
  color: inherit;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

.card-link:hover{
  text-decoration:none;
  border-color:#cbd5e1;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.card-link:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
}

/* =========================
   Botões / Pills
========================= */

.actions{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border: 1px solid var(--border);
  background:#fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.btn:hover{
  text-decoration:none;
  border-color:#cbd5e1;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.pill:hover{
  text-decoration:none;
  border-color:#cbd5e1;
}

/* =========================
   Post (página do artigo)
========================= */

.post{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin: 22px auto 60px;
  box-shadow: var(--shadow);
  max-width: var(--content);
}

.post-header{
  max-width: 75ch;
  margin: 0 auto 18px; /* centraliza e alinha com o .prose */
}
.post-header h1,
.post-header .post-title{
  margin-left: 0;
}

.post-title{
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.post-meta{
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .95rem;
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-lead{
  margin: 0 0 22px;
  padding: 14px 18px;

  background: #111827;   /* preto elegante */
  color: #ffffff;        /* texto branco */

  border-radius: 12px;
  font-size: 1.05rem;
  line-height: 1.6;

  max-width: 75ch;
}


/* =========================
   Conteúdo Markdown
========================= */

.prose{
  max-width: 75ch;
  margin: 0 auto;
}

.prose p{
  margin: 0 0 12px;
}

.prose h2{
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.prose h3{
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.prose ul,
.prose ol{
  padding-left: 1.2rem;
  margin: 0 0 14px;
}

.prose li{
  margin: 6px 0;
}

.prose a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity .12s ease;
}

.prose a:hover{
  opacity:.8;
}

/* código */
.prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92em;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2px 6px;
}

.prose pre{
  overflow:auto;
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  margin: 14px 0 18px;
}

.prose pre code{
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* blockquote */
.prose blockquote{
  margin: 14px 0 18px;
  padding: 10px 12px;
  border-left: 4px solid var(--border);
  background: #fafafa;
  border-radius: 10px;
  color: #374151;
}

/* =========================
   Footer
========================= */

.footer{
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 18px 0 24px;
}

.footer-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-note{
  color:#374151;
}

@media (max-width: 600px){
  .footer-row{
    justify-content: center;
    text-align: center;
  }
}

/* =========================
   Responsivo
========================= */

@media (max-width: 992px){
  .grid-2{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px){
  .nav-desktop{
    display:none;
  }

  .nav-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  .post{
    padding: 18px;
  }

  .container{
    width: calc(100% - 32px);
  }
}

.prose table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d1d5db;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
}

.prose td code,
.prose th code {
  white-space: nowrap;
}

/* ===== Support no footer do blog (igual home: texto em cima, botões embaixo) ===== */

.footer.footer-blog .support{
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  gap: 10px;
}

/* texto no mesmo estilo da home */
.footer.footer-blog .support-text{
  margin: 0;
  font-size: .95rem;     /* igual home */
  color: #111827;        /* igual home */
  line-height: 1.5;
}

.footer.footer-blog .support-text strong{
  font-weight: 700;
}

.footer.footer-blog .support-text .mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color:#374151;
}

/* botões embaixo */
.footer.footer-blog .support-actions{
  display:flex;
  justify-content:center;
  gap: 10px;
  flex-wrap: wrap;
}

/* botões delicados, sem quebrar texto */
.footer.footer-blog .btn.btn-support{
  padding: 8px 12px;
  font-size: .85rem;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* msg do copiar */
.footer.footer-blog .support-small{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .9rem;
  min-height: 1.2em;
  text-align: center;
}

/* nota e copyright como você já tinha */
.footer.footer-blog .footer-note{
  margin-top: 12px;
  text-align: center;
  color: #374151;
}

.footer.footer-blog .copyright{
  display:flex;
  justify-content:center;
  margin-top: 10px;
  color: var(--muted);
  font-size: .92rem;
}

/* FIX definitivo: força o bloco de suporte a ficar centralizado no footer do blog */
footer.footer.footer-blog .container .support{
  width: 100%;
  max-width: 760px;
  margin: 16px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

footer.footer.footer-blog .container .support-text{
  width: 100%;
  text-align: center !important;
}

footer.footer.footer-blog .container .support-actions{
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-note a,
.copyright a {
  color: inherit;
  text-decoration: none;
}

.footer-note a:hover,
.copyright a:hover {
  text-decoration: underline;
}

/* onde você renderiza o markdown do post */
.post-content img,
.prose img,
article img {
  max-width: 100%;
  height: auto;
  display: block;
}

.post-content {
  overflow-x: hidden; /* opcional: evita scroll horizontal se algo escapar */
}

/* =========================
   Acessibilidade
========================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   Hero Section
========================= */

.hero-section {
  padding: 44px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.hero-name {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-bio {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 20px;
  max-width: 62ch;
  line-height: 1.65;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}

.hero-link:hover {
  text-decoration: none;
  color: var(--text);
  border-color: #9ca3af;
  background: var(--alt);
}

/* =========================
   Search Bar
========================= */

.search-form {
  margin-bottom: 18px;
}

.search-wrapper {
  position: relative;
  max-width: 560px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* remove o X nativo do Safari/Chrome */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* =========================
   Tag Filters (Details & Summary)
========================= */

.tag-filter-details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 28px;
  overflow: hidden;
  transition: box-shadow .2s ease;
}

.tag-filter-details[open] {
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.tag-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none; /* remove native arrow */
  user-select: none;
  background: var(--surface);
  transition: background .12s ease;
}

.tag-filter-summary::-webkit-details-marker {
  display: none; /* remove native arrow safari */
}

.tag-filter-summary:hover {
  background: var(--alt);
}

.tag-filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.tag-filter-title svg {
  color: var(--muted);
}

.tag-filter-action {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
  transition: transform .2s ease;
}

.tag-filter-details[open] .tag-filter-action {
  transform: rotate(45deg); /* turns + into x */
}

.tag-filter-content {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: #fafafa;
}

.cat-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: .83rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #374151;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}

.cat-pill:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
}

.cat-pill.active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* =========================
   Portal Grid (Main + Sidebar)
========================= */

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 288px;
  gap: 40px;
  align-items: start;
}

/* =========================
   Section Labels
========================= */

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label-icon {
  font-size: 1rem;
  line-height: 1;
}

/* =========================
   Card — top row (badge + meta)
========================= */

.card-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.card-top-row .category-badge {
  margin-bottom: 0;
}

.card-top-row .card-meta {
  margin: 0;
}

/* =========================
   No Results
========================= */

.no-results {
  padding: 20px 0;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================
   Portal Sidebar — Destaques
========================= */

.portal-sidebar {
  position: sticky;
  top: 72px; /* abaixo do header sticky */
}

.featured-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.featured-item {
  border-radius: 8px;
  overflow: hidden;
}

.featured-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  color: inherit;
  transition: background .12s ease;
}

.featured-link:hover {
  background: var(--alt);
  text-decoration: none;
}

.featured-cat-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 6px;
}

.theme-geopolitica .featured-cat-dot {
  background: #991b1b;
}

.featured-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.featured-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.featured-cat-badge {
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
}

/* =========================
   Responsivo — Portal
========================= */

@media (max-width: 900px) {
  .portal-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .portal-sidebar {
    position: static;
    border-top: 1px solid var(--border);
    padding-top: 28px;
  }
}

@media (max-width: 600px) {
  .hero-section {
    padding: 28px 0 24px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .search-wrapper {
    max-width: 100%;
  }
}

