/* ==========================================================================
   Blog do Sorteador — folha única.
   Editorial e limpo, com identidade: linha laranja no topo, logo + "Blog"
   em serifa, faixa de marca no topo do índice. Laranja só em acentos,
   estados ativos e foco. Inter (texto/UI) + Source Serif 4 600 (títulos).
   Tema: tokens em :root; escuro via [data-theme=dark] (escolha manual) ou
   prefers-color-scheme quando não há escolha salva. Pares de texto ≥ AA.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-600.woff2") format("woff2");
}
/* Fallbacks com métricas próximas: a troca de fonte quase não desloca o texto */
@font-face { font-family: "Inter Fallback"; src: local("Arial"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "Serif Fallback"; src: local("Georgia"); size-adjust: 103%; ascent-override: 92%; descent-override: 26%; line-gap-override: 0%; }

:root {
  --sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif", "Serif Fallback", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --max: 1180px;
  --wide: 1040px;
  --measure: 680px;
  --gutter: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --accent-line: 3px;
  --header-total: calc(var(--header-h) + var(--accent-line));

  --brand: #ff5a1f;       /* laranja da marca (linha do topo, logo, foco, ativos) */

  /* Claro */
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --surface: #ffffff;
  --text: #17171a;
  --text-body: #2a2a2e;
  --muted: #5f5f67;
  --border: #ebebed;
  --border-strong: #d9d9de;
  --link: #c2410c;        /* texto laranja sobre branco: 5.2:1 */
  --tint: #fff1e9;
  --on-tint: #b23c0b;     /* sobre tint: 5.4:1 */
  --focus: #e5541c;
  --code-bg: #f3f3f4;
  --code-text: #27272a;
  --pre-bg: #17171a;
  --pre-text: #e4e4e7;
  --shadow: 0 1px 2px rgb(24 24 27 / .05), 0 14px 36px -14px rgb(24 24 27 / .16);
  --header-glass: rgb(255 255 255 / .78);
  --glow: rgb(255 90 31 / .13);
  --dots: rgb(255 90 31 / .16);
  color-scheme: light;
}

/* Escuro — mesma lista nos dois seletores (escolha manual / sistema) */
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --bg-soft: #17171a;
  --surface: #151518;
  --text: #f4f4f5;
  --text-body: #dcdce0;
  --muted: #a1a1aa;
  --border: #25252a;
  --border-strong: #36363c;
  --link: #ff9b70;
  --tint: #2b1a11;
  --on-tint: #ffa47f;
  --focus: #ff8a5c;
  --code-bg: #1f1f23;
  --code-text: #e4e4e7;
  --pre-bg: #08080a;
  --pre-text: #e4e4e7;
  --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 14px 36px -14px rgb(0 0 0 / .7);
  --header-glass: rgb(14 14 16 / .72);
  --glow: rgb(255 106 51 / .12);
  --dots: rgb(255 122 69 / .14);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10;
    --bg-soft: #17171a;
    --surface: #151518;
    --text: #f4f4f5;
    --text-body: #dcdce0;
    --muted: #a1a1aa;
    --border: #25252a;
    --border-strong: #36363c;
    --link: #ff9b70;
    --tint: #2b1a11;
    --on-tint: #ffa47f;
    --focus: #ff8a5c;
    --code-bg: #1f1f23;
    --code-text: #e4e4e7;
    --pre-bg: #08080a;
    --pre-text: #e4e4e7;
    --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 14px 36px -14px rgb(0 0 0 / .7);
    --header-glass: rgb(14 14 16 / .72);
    --glow: rgb(255 106 51 / .12);
    --dots: rgb(255 122 69 / .14);
    color-scheme: dark;
  }
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-total) + 20px); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--text); margin: 0; line-height: 1.2; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.icon { flex-shrink: 0; vertical-align: middle; }
kbd { font-family: var(--sans); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px;
  background: var(--text); color: var(--bg); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.kicker {
  display: inline-flex; align-items: center; min-height: 24px;
  font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--link);
}
.kicker--link { text-decoration: none; min-height: 32px; }
.kicker--link:hover { text-decoration: underline; text-underline-offset: 3px; }
.badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--tint); color: var(--on-tint); font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

.section-title {
  font-family: var(--sans); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 28px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: .875rem; color: var(--muted); }
.meta__dot { opacity: .7; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; transition: opacity .15s ease;
}
.button:hover { opacity: .86; }
.button--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .9375rem; font-weight: 500; color: var(--text); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-top: var(--accent-line) solid var(--brand);
  border-bottom: 1px solid var(--border);
  transition: background-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgb(0 0 0 / .18); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header.is-scrolled {
    background: var(--header-glass);
    -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  }
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); min-width: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; flex: none; }
.logo { display: block; color: var(--brand); fill: currentColor; }
.brand .logo { height: 30px; width: auto; }
@media (min-width: 768px) { .brand .logo { height: 34px; } }
.brand__word {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1; letter-spacing: -.02em;
  color: var(--text); padding-left: 10px; border-left: 2px solid var(--brand); margin-top: 2px;
}
@media (min-width: 768px) { .brand__word { font-size: 1.625rem; } }

/* Nav: ocupa o espaço que sobra; nunca empurra as ações (min-width: 0) */
.desk-nav { display: none; flex: 1 1 auto; min-width: 0; }
.desk-nav__list { list-style: none; display: flex; align-items: center; gap: 2px; min-width: 0; }
.desk-nav__list > li { flex: none; }
.desk-nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 11px;
  border-radius: 999px; font-size: .9375rem; font-weight: 500; color: var(--text); text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background-color .15s ease;
}
.desk-nav__link:hover { background: var(--bg-soft); }
.desk-nav__link[aria-current] { color: var(--link); }
.desk-nav__link[aria-current]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--brand);
}
/* Priority+: o JS marca .is-hidden; o CSS dá o padrão seguro por largura */
.nav-cat.is-hidden, .more-cat.is-hidden { display: none; }
.more-cat--0, .more-cat--1 { display: none; }                 /* já estão na barra a partir de 1100px */
@media (max-width: 1279.98px) {
  .nav-cat--2 { display: none; }                              /* 1100–1279: só 2 categorias na barra */
}
@media (min-width: 1280px) {
  .more-cat--2 { display: none; }
  .more-menu--mid-only { display: none; }                     /* 3 categorias cabem todas na barra */
}
.more-cat.is-shown { display: list-item; }
.more-menu.is-forced { display: list-item; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.desk-search, .icon-btn.theme-toggle--desk, .site-link { display: none; }
.site-link {
  align-items: center; gap: 4px; min-height: 44px; padding: 0 2px 0 6px; white-space: nowrap;
  font-size: .875rem; font-weight: 500; color: var(--muted); text-decoration: none;
}
.site-link:hover { color: var(--text); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  cursor: pointer; transition: border-color .15s ease;
}
.icon-btn:hover { border-color: var(--border-strong); }
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}
html:not(.js) .theme-toggle { visibility: hidden; } /* sem JS: segue o sistema; espaço reservado (sem CLS) */

@media (min-width: 1100px) {
  .desk-nav { display: block; }
  .icon-btn.theme-toggle--desk { display: inline-flex; }
  .menu-pop { display: none; }
}
@media (min-width: 1280px) {
  .desk-search { display: block; flex: 0 1 220px; min-width: 150px; }
  .search-pop { display: none; }
  .site-link { display: inline-flex; }
}

/* Pop-overs (<details>): menu "Mais", busca e menu no mobile */
.pop { position: relative; }
.pop > summary { -webkit-user-select: none; user-select: none; }
.pop__chevron { transition: transform .2s ease; }
.pop[open] .pop__chevron { transform: rotate(180deg); }
.pop__panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; min-width: 220px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.more-menu .pop__panel { left: 0; right: auto; }
.menu-list { list-style: none; }
.menu-list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  font-size: .9375rem; color: var(--text); text-decoration: none; transition: background-color .15s ease;
}
.menu-list a:hover { background: var(--bg-soft); }
.menu-list a[aria-current] { color: var(--link); font-weight: 600; }
.menu-pop__close { display: none; }
.menu-pop[open] .menu-pop__open { display: none; }
.menu-pop[open] .menu-pop__close { display: inline-flex; }
.menu-pop__open, .menu-pop[open] .menu-pop__close { display: inline-flex; }

/* Folha (sheet) do mobile: ocupa a largura toda logo abaixo do header */
.sheet {
  position: fixed; left: 0; right: 0; top: var(--header-total); min-width: 0;
  max-height: calc(100svh - var(--header-total)); overflow-y: auto;
  padding: 16px var(--gutter) 24px; border-radius: 0 0 var(--radius) var(--radius); border-width: 0 0 1px;
}
.search-sheet { padding-top: 12px; padding-bottom: 12px; }
@media (min-width: 768px) {
  .search-sheet { position: absolute; left: auto; right: 0; top: calc(100% + 10px); width: 380px; border-width: 1px; border-radius: var(--radius); padding: 10px; }
}
.sheet__title { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px 12px; }
.menu-list--sheet a { min-height: 48px; font-size: 1rem; }
.sheet__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px 0;
  border-top: 1px solid var(--border); font-weight: 500; color: var(--text);
}
.sheet__site {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-top: 8px; padding: 0 12px;
  border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text); font-weight: 500; text-decoration: none;
}

/* --- Busca --------------------------------------------------------------- */

.search-form { position: relative; display: flex; align-items: center; gap: 8px; }
.search-form__icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-form__input {
  width: 100%; min-height: 44px; padding: 0 16px 0 42px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: .9375rem; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease;
}
.search-form__input::placeholder { color: var(--muted); opacity: 1; }
.search-form__input:hover { border-color: var(--border-strong); }
.search-form__input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.search-form__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-form__kbd {
  position: absolute; right: 10px; display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 600; pointer-events: none;
}
.search-form__input:focus ~ .search-form__kbd { display: none; }
.search-form__submit {
  flex-shrink: 0; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--text); color: var(--bg); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
}
.desk-search .search-form__input { min-width: 0; }
.desk-search .search-form__submit { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }
.desk-search .search-form__input { padding-right: 40px; }
.search-page__form { margin-top: 28px; max-width: 560px; }

/* --- Faixa de marca (topo do índice e categorias) ----------------------- */

.band {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 120% at 88% -10%, var(--glow), transparent 70%),
    radial-gradient(40% 80% at 0% 110%, var(--glow), transparent 70%),
    var(--bg);
}
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 75%); mask-image: linear-gradient(115deg, transparent 35%, #000 75%);
}
.band > .container { position: relative; }

.masthead { padding-top: 48px; padding-bottom: 32px; }
@media (min-width: 768px) { .masthead { padding-top: 72px; padding-bottom: 40px; } }
.masthead__title {
  font-family: var(--serif); font-weight: 600; font-size: 2.5rem; line-height: 1.06; letter-spacing: -.025em;
  max-width: 20ch; text-wrap: balance;
}
@media (min-width: 768px) { .masthead__title { font-size: 3.75rem; } }
.masthead__page { color: var(--muted); }
.masthead__lead { margin-top: 14px; max-width: 42rem; font-size: 1.125rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
@media (min-width: 768px) { .masthead__lead { font-size: 1.25rem; } }
.masthead__count { margin-top: 12px; font-size: .9375rem; font-weight: 500; color: var(--text); }
.masthead .kicker { margin-bottom: 8px; }

.breadcrumbs { margin-bottom: 18px; font-size: .875rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs__sep { margin: 0 6px; opacity: .6; }
.breadcrumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }

/* Barra de categorias: rola na horizontal no mobile (sem barra visível) */
.catbar { margin-top: 28px; margin-inline: calc(-1 * var(--gutter)); }
.catbar__list {
  list-style: none; display: flex; gap: 8px; padding: 2px var(--gutter);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.catbar__list::-webkit-scrollbar { display: none; }
.catbar__list > li { flex-shrink: 0; scroll-snap-align: start; }
@media (min-width: 768px) { .catbar { margin-inline: 0; } .catbar__list { flex-wrap: wrap; overflow: visible; padding-inline: 0; } }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: .9375rem; font-weight: 500; white-space: nowrap; text-decoration: none; transition: border-color .15s ease;
}
.chip:hover { border-color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #1a0a03; font-weight: 600; }

.listing { padding-top: 48px; padding-bottom: 96px; }
.listing > .section-title { margin-top: 72px; }

.grid { list-style: none; display: grid; gap: 44px 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 56px 36px; } }
.grid > li { display: flex; min-width: 0; }

/* --- Cards: o card inteiro é UM link ------------------------------------ */

.card { display: flex; width: 100%; }
.card__link { display: flex; flex-direction: column; gap: 18px; width: 100%; color: inherit; text-decoration: none; border-radius: var(--radius); }
.card__link:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }
.card__media {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius);
  background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--border);
}
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card__labels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card__title {
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem; line-height: 1.25; letter-spacing: -.01em;
  text-wrap: balance; text-decoration-thickness: 1px; text-underline-offset: 4px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card__link:hover .card__title { text-decoration-line: underline; }  /* único efeito de hover */
.card__excerpt {
  color: var(--muted); font-size: .9375rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { margin-top: 2px; font-size: .8125rem; }

.card--hero .card__link { gap: 24px; }
.card--hero .card__title { font-size: 1.875rem; line-height: 1.15; -webkit-line-clamp: 5; }
.card--hero .card__excerpt { font-size: 1.0625rem; }
@media (min-width: 900px) {
  .card--hero .card__link { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 56px; }
  .card--hero .card__media { aspect-ratio: 4 / 3; }
  .card--hero .card__title { font-size: 2.5rem; letter-spacing: -.02em; }
  .card--hero .card__body { gap: 14px; }
}

.card--compact .card__link { flex-direction: row; align-items: center; gap: 16px; padding: 16px 0; border-radius: var(--radius-sm); }
.card--compact .card__media { width: 72px; height: 72px; flex-shrink: 0; aspect-ratio: 1; border-radius: var(--radius-sm); }
.card--compact .card__title { font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; -webkit-line-clamp: 2; }
.card--compact .card__body { gap: 4px; }

/* Artigos Temáticos (#publi): lista compacta, só na última página do índice */
.themed { margin-top: 88px; }
.themed__list { list-style: none; display: grid; grid-template-columns: 1fr; column-gap: 48px; }
.themed__list > li { display: flex; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .themed__list { grid-template-columns: repeat(2, 1fr); } }

/* --- Paginação ----------------------------------------------------------- */

.pagination { margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--border); }
.pagination__status { text-align: center; font-size: .875rem; color: var(--muted); margin-bottom: 14px; }
.pagination__controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pagination__pages { list-style: none; display: flex; align-items: center; gap: 6px; }
.pagination__num, .pagination__step {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 48px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--text);
  transition: border-color .15s ease;
}
.pagination__num:hover, .pagination__step:hover { border-color: var(--brand); }
.pagination__num.is-current { background: var(--brand); border-color: var(--brand); color: #1a0a03; }
.pagination__step.is-disabled { opacity: .4; pointer-events: none; }
.pagination__gap { color: var(--muted); padding: 0 2px; }
@media (max-width: 480px) { .pagination__step span { display: none; } .pagination__step { padding: 0; } }

.empty { padding: 56px 0 24px; text-align: center; color: var(--muted); }
.empty h2 { font-family: var(--serif); font-size: 1.625rem; color: var(--text); margin: 14px 0 8px; }
.empty .catbar__list { justify-content: center; }
.empty__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%;
  background: var(--tint); color: var(--on-tint);
}
.empty__back { margin-top: 24px; }

/* --- Artigo -------------------------------------------------------------- */

.progress { position: fixed; left: 0; right: 0; top: var(--header-total); z-index: 41; height: 3px; pointer-events: none; }
.progress__bar { height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

.article { padding-bottom: 80px; }
.article-layout { position: relative; }
.article-header { width: min(var(--measure), 100% - 2 * var(--gutter)); margin-inline: auto; padding-top: 32px; }
@media (min-width: 768px) { .article-header { padding-top: 56px; } }
.article-header .kicker { margin-bottom: 10px; }
.article-title {
  font-family: var(--serif); font-weight: 600; font-size: 2.125rem; line-height: 1.12; letter-spacing: -.02em;
  text-wrap: balance; overflow-wrap: break-word;
}
@media (min-width: 768px) { .article-title { font-size: 3rem; } }
.article-lead { margin-top: 18px; font-size: 1.1875rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
@media (min-width: 768px) { .article-lead { font-size: 1.3125rem; } }
.article-updated { margin-top: 16px; }

.byline { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.byline__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.byline__avatar--brand { padding: 7px; background: var(--tint); }
.byline__avatar--initials { display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--on-tint); font-weight: 600; }
.byline__name { font-weight: 600; font-size: .9375rem; color: var(--text); }
.byline .meta { font-size: .8125rem; }

.article-cover { width: min(var(--wide), 100%); margin: 36px auto 0; }
@media (min-width: 768px) { .article-cover { width: min(var(--wide), 100% - 2 * var(--gutter)); margin-top: 44px; } }
.article-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); }
@media (min-width: 768px) { .article-cover img { border-radius: var(--radius); } }
.article-cover figcaption { margin-top: 10px; padding-inline: var(--gutter); font-size: .875rem; color: var(--muted); text-align: center; }

.toc__list { list-style: none; counter-reset: toc; }
.toc__list li { counter-increment: toc; }
.toc__list a { display: flex; gap: 12px; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .9375rem; line-height: 1.35; }
.toc__list a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; font-size: .8125rem; color: var(--link); }
.toc__list a:hover, .toc__list a.is-active { color: var(--text); }
.toc--inline { width: min(var(--measure), 100% - 2 * var(--gutter)); margin: 36px auto 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.toc--inline summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; font-weight: 600; font-size: .9375rem; color: var(--text); cursor: pointer; }
.toc__chevron { margin-left: auto; transition: transform .2s ease; }
.toc--inline[open] .toc__chevron { transform: rotate(180deg); }
.toc--inline .toc__list { padding: 0 16px 12px; }
.article-aside { display: none; }
.toc__title { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }

/* Desktop largo com sumário: coluna de leitura + sumário fixo ao lado */
@media (min-width: 1280px) {
  .article-layout.has-toc {
    display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px;
    max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  }
  .article-layout.has-toc .article-main { --gutter: 0px; --wide: 100%; }
  .article-layout.has-toc .toc--inline { display: none; }
  .article-layout.has-toc .article-aside { display: block; }
  .toc--side { position: sticky; top: calc(var(--header-total) + 32px); margin-top: 120px; padding-left: 18px; border-left: 2px solid var(--border); }
  .toc--side .toc__list a { font-size: .875rem; min-height: 38px; }
  .toc--side .toc__list a.is-active { color: var(--text); font-weight: 500; }
}

.article-footer {
  width: min(var(--measure), 100% - 2 * var(--gutter)); margin: 56px auto 0;
  display: flex; flex-direction: column; gap: 24px; padding-top: 24px; border-top: 1px solid var(--border);
}
.disclosure { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: .8125rem; color: var(--muted); letter-spacing: .01em; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  font-size: .875rem; font-weight: 500; text-decoration: none; transition: border-color .15s ease;
}
.tag:hover { border-color: var(--brand); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.share__title { font-size: .9375rem; font-weight: 600; color: var(--text); }
.share__list { list-style: none; display: flex; gap: 8px; }
.share__btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); cursor: pointer;
  transition: border-color .15s ease;
}
.share__btn:hover { border-color: var(--brand); }
.share__btn[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: .75rem; font-weight: 500;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.share__btn:hover::after, .share__btn:focus-visible::after { opacity: 1; }
html:not(.js) .share__copy-item { display: none; }
.share__icon-done { display: none; }
.share__btn.is-copied .share__icon-default { display: none; }
.share__btn.is-copied .share__icon-done { display: inline-flex; color: var(--link); }
.share__icon-default { display: inline-flex; }

.article-footer__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.tool-note { font-size: .9375rem; color: var(--muted); }
.tool-note a { color: var(--link); text-underline-offset: 3px; }

.related { padding: 72px 0 96px; background: var(--bg-soft); border-top: 1px solid var(--border); }
.related__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.related__head .section-title { margin: 0; border: 0; }
.related .card__media { background: var(--bg); }

/* --- Prose: HTML do Ghost -------------------------------------------------
   Grade com linhas nomeadas: texto na coluna de leitura; .kg-width-wide,
   galerias e embeds saem para "wide"; .kg-width-full ocupa a tela. */

.prose {
  --content: min(var(--measure), 100% - 2 * var(--gutter));
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [content-start] var(--content) [content-end]
    minmax(0, calc((var(--wide) - var(--measure)) / 2)) [wide-end]
    minmax(var(--gutter), 1fr) [full-end];
  margin-top: 44px;
  font-size: 1.0625rem; line-height: 1.75; color: var(--text-body); overflow-wrap: break-word;
}
@media (min-width: 768px) { .prose { font-size: 1.125rem; } }
.prose > * { grid-column: content; min-width: 0; }
.prose > * + * { margin-top: 1.4em; }
.prose > .kg-width-wide, .prose > .kg-gallery-card, .prose > .kg-embed-card, .prose > .kg-video-card { grid-column: wide; }
.prose > .kg-width-full { grid-column: full; }

.prose h2, .prose h3, .prose h4 { color: var(--text); text-wrap: balance; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: 1.75rem; line-height: 1.25; letter-spacing: -.015em; margin-top: 2.2em; }
.prose h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; margin-top: 1.9em; }
.prose h4 { font-size: 1.0625rem; font-weight: 600; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
@media (min-width: 768px) { .prose h2 { font-size: 2rem; } .prose h3 { font-size: 1.375rem; } }
.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin-inline: 0; padding-left: 22px; border-left: 2px solid var(--brand);
  font-family: var(--serif); font-weight: 600; font-size: 1.3125rem; line-height: 1.5; color: var(--text);
}
.prose blockquote.kg-blockquote-alt { border: 0; padding: 8px 0; text-align: center; font-size: 1.625rem; }
.prose hr { border: 0; margin-block: 3em; height: 1px; background: var(--border); }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose figure img { margin-inline: auto; }
.prose figcaption { margin-top: 10px; font-size: .875rem; line-height: 1.5; color: var(--muted); text-align: center; }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--code-bg); color: var(--code-text); padding: .15em .4em; border-radius: 6px; }
.prose pre {
  font-family: var(--mono); font-size: .875rem; line-height: 1.65; tab-size: 2;
  background: var(--pre-bg); color: var(--pre-text); padding: 20px 22px; border-radius: var(--radius-sm);
  overflow-x: auto; border: 1px solid var(--border);
}
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
/* Tabelas: região rolável no mobile, cabeçalho, zebra, números à direita.
   Inclui as do import do WordPress (.has-fixed-layout). */
.prose .table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.prose .table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose .table-wrap > table { min-width: 100%; }
@media (max-width: 639px) { .prose .table-wrap > table { min-width: 520px; } }
.prose table.has-fixed-layout { table-layout: fixed; }
@media (max-width: 639px) { .prose table.has-fixed-layout { table-layout: auto; } }
.prose th, .prose td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose thead th, .prose thead td, .prose tr > th:only-child {
  background: var(--bg-soft); color: var(--text); font-weight: 600; font-size: .8125rem; letter-spacing: .02em;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.prose tbody tr:nth-child(even) > td { background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }
.prose tbody tr:last-child > td { border-bottom: 0; }
.prose td.num, .prose th.num { text-align: right; white-space: nowrap; }
.prose figure.wp-block-table { margin-inline: 0; }
.prose iframe { display: block; width: 100%; border: 0; border-radius: var(--radius-sm); }
.prose iframe[src*="youtube"], .prose iframe[src*="vimeo"] { aspect-ratio: 16 / 9; height: auto; }
/* Resíduos comuns do WordPress */
.prose .aligncenter, .prose .wp-block-image.aligncenter { margin-inline: auto; text-align: center; }
.prose .alignleft, .prose .alignright { float: none; margin-inline: 0; }
.prose [style*="width"] { max-width: 100%; }

/* Cards do editor do Ghost (.kg-*) */
.prose > .kg-card { margin-top: 2.2em; }
.prose > .kg-card + * { margin-top: 2.2em; }
.prose .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.prose .kg-embed-card > * { max-width: 100%; }
.prose .kg-image-card img, .prose .kg-width-wide img, .prose .kg-width-full img { width: 100%; }
.prose .kg-width-full img { border-radius: 0; }

.prose .kg-gallery-container { display: flex; flex-direction: column; gap: 10px; }
.prose .kg-gallery-row { display: flex; gap: 10px; }
.prose .kg-gallery-image { flex: 1 1 0%; min-width: 0; }
.prose .kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.prose .kg-callout-card {
  display: flex; gap: 12px; padding: 18px 22px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border); font-size: 1rem; line-height: 1.65;
}
.prose .kg-callout-card-accent, .prose .kg-callout-card-yellow { background: var(--tint); border-color: transparent; }
.prose .kg-callout-card-blue { box-shadow: inset 3px 0 0 #3b82f6; }
.prose .kg-callout-card-green { box-shadow: inset 3px 0 0 #10b981; }
.prose .kg-callout-card-red { box-shadow: inset 3px 0 0 #ef4444; }
.prose .kg-callout-card-pink { box-shadow: inset 3px 0 0 #ec4899; }
.prose .kg-callout-card-purple { box-shadow: inset 3px 0 0 #8b5cf6; }
.prose .kg-callout-emoji { display: none; } /* a UI do blog não usa emoji */
.prose .kg-callout-text { color: var(--text-body); }

.prose .kg-toggle-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 18px; }
.prose .kg-toggle-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; cursor: pointer; }
.prose .kg-toggle-heading-text { margin: 0; font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.prose .kg-toggle-card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -12px;
  border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 14px; flex-shrink: 0;
}
.prose .kg-toggle-card-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform .2s ease; }
.prose .kg-toggle-content { padding-bottom: 18px; }
.prose .kg-toggle-content > * + * { margin-top: 1em; }
.js .prose .kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }
.js .prose .kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon svg { transform: rotate(180deg); }

.prose .kg-bookmark-card a.kg-bookmark-container {
  display: flex; flex-direction: column-reverse; text-decoration: none; color: var(--text-body);
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
  transition: border-color .15s ease;
}
.prose .kg-bookmark-card a.kg-bookmark-container:hover { border-color: var(--border-strong); }
@media (min-width: 560px) { .prose .kg-bookmark-card a.kg-bookmark-container { flex-direction: row; } }
.prose .kg-bookmark-content { flex: 1; padding: 18px 20px; min-width: 0; }
.prose .kg-bookmark-title { font-weight: 600; font-size: 1rem; color: var(--text); line-height: 1.4; }
.prose .kg-bookmark-description { margin-top: 6px; font-size: .875rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prose .kg-bookmark-metadata { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; font-size: .8125rem; color: var(--muted); }
.prose .kg-bookmark-icon { width: 18px; height: 18px; border-radius: 4px; }
.prose .kg-bookmark-publisher::before { content: "·"; margin-right: 6px; }
.prose .kg-bookmark-thumbnail { position: relative; aspect-ratio: 16 / 9; flex-shrink: 0; }
@media (min-width: 560px) { .prose .kg-bookmark-thumbnail { width: 32%; aspect-ratio: auto; min-height: 140px; } }
.prose .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.prose .kg-button-card { display: flex; }
.prose .kg-button-card.kg-align-center { justify-content: center; }
.prose a.kg-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 24px;
  border-radius: 999px; background: var(--text); color: var(--bg); font-size: 1rem; font-weight: 600;
  text-decoration: none; transition: opacity .15s ease;
}
.prose a.kg-btn:hover { opacity: .86; }
.prose .kg-header-card { padding: 48px 24px; border-radius: var(--radius); background: var(--bg-soft); text-align: center; }
.prose .kg-product-card-container, .prose .kg-file-card-container { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; text-decoration: none; }
.prose .kg-video-card video, .prose .kg-audio-card audio { width: 100%; }

.yt-facade { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
.yt-facade__play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); background: rgb(0 0 0 / .72); border-radius: 12px; transition: background-color .15s ease; }
.yt-facade__play::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt-facade:hover .yt-facade__play { background: #e00; }

/* --- Erro ---------------------------------------------------------------- */

.error-page { padding-top: 72px; padding-bottom: 24px; }
.error-page .empty__icon { margin-bottom: 18px; }
.error-page__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* --- Footer -------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9375rem; background: var(--bg); }
.footer-inner { display: grid; gap: 40px; padding-top: 56px; padding-bottom: 40px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { max-width: 22rem; }
.footer-col__title { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin-bottom: 8px; }
.footer-col ul { list-style: none; }
.footer-col a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--border); font-size: .8125rem; }
.footer-site { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; }
.footer-site:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
