/* Tax S.A. — identidade: azul-marinho profundo, grafite, cinza claro, branco.
   Cambria nos títulos; Calibri / Segoe UI no corpo. Composição propositalmente
   assimétrica e levemente irregular, para fugir do aspecto de grade rígida. */

:root {
  --navy-900: #0F1E3D;
  --navy-700: #1E3A5F;
  --graphite: #3D3D3D;
  --gray-300: #D9D9D9;
  --gray-100: #F3F3F2;
  --white: #FFFFFF;
  --ink: #232323;
  --link: #1E3A5F;
  --sidebar-w: 288px;
  --measure: 66ch;
  --font-head: Cambria, Caladea, "Liberation Serif", Georgia, serif;
  --font-body: Calibri, Carlito, "Segoe UI", "Liberation Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy-900); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #5B8BC4; outline-offset: 2px; border-radius: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- barra lateral fixa ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--navy-900);
  color: #E8ECF3;
  padding: 2rem 1.6rem 1.5rem 1.9rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  overflow-y: auto;
  z-index: 20;
}
.wordmark { color: var(--white); text-decoration: none; display: inline-block; align-self: flex-start; }
.wordmark:hover { color: var(--white); }
.wordmark__text { font-family: var(--font-head); font-size: 2.15rem; font-weight: 700; letter-spacing: -.01em; line-height: 1; display: block; }
.wordmark__text i { font-weight: 400; font-style: italic; opacity: .85; margin-left: .05em; }
.wordmark__stroke { display: block; width: 8.6rem; height: .7rem; margin-top: .35rem; margin-left: -.1rem; color: #7FA3D1; transform: rotate(-1deg); }
.sidebar__tag { margin: 0; font-size: .95rem; line-height: 1.45; color: #B8C3D6; max-width: 20ch; }

.sidebar__label { margin: 0 0 .45rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #8FA0BB; }
.sidebar__nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar__nav li { margin: 0; }
.sidebar__nav a {
  display: block; padding: .5rem .75rem .5rem .6rem; margin-left: -.6rem;
  color: #E8ECF3; text-decoration: none; font-size: 1.02rem; line-height: 1.3;
  border-radius: 3px 14px 3px 10px;
  transition: background .15s, padding-left .15s;
}
.sidebar__nav li:nth-child(even) a { border-radius: 10px 3px 14px 3px; }
.sidebar__nav a:hover { background: rgba(255,255,255,.07); padding-left: .85rem; color: var(--white); }
.sidebar__nav a[aria-current="page"] { background: var(--navy-700); color: var(--white); }

.sidebar__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; }
.sidebar__foot a { color: #AEBBD0; text-decoration: none; }
.sidebar__foot a:hover { color: var(--white); text-decoration: underline; }

.search { position: relative; }
.search input {
  width: 100%; font: inherit; font-size: .98rem; color: var(--white);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px 16px 4px 12px; padding: .55rem .8rem;
}
.search input::placeholder { color: #9BAAC3; }
.search input:focus { outline: none; border-color: #7FA3D1; background: rgba(255,255,255,.12); }
.search__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  list-style: none; margin: 0; padding: .3rem; background: var(--white); color: var(--ink);
  border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-height: 60vh; overflow: auto; width: min(26rem, 90vw);
}
.search__results a { display: block; padding: .5rem .6rem; text-decoration: none; color: var(--ink); border-radius: 4px; line-height: 1.3; }
.search__results a:hover, .search__results a:focus { background: var(--gray-100); }
.search__results small { display: block; color: #666; font-size: .8rem; margin-top: .1rem; }

/* ---------- casca e conteúdo ---------- */
.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 3.5rem clamp(1.25rem, 5vw, 4.5rem) 2rem clamp(1.25rem, 6vw, 5.5rem); max-width: 62rem; width: 100%; }

.meta { margin: 0 0 .35rem; font-size: .88rem; color: #5A5A5A; letter-spacing: .01em; }
.meta a { color: inherit; }
.section-label {
  font-family: var(--font-body); font-weight: 700; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--navy-700); margin: 0 0 1rem;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy-900); line-height: 1.2; }

/* ---------- home ---------- */
.hero { margin-bottom: 3.5rem; }
.hero__kicker { margin: 0 0 .8rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-700); font-weight: 700; }
.hero__title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0 0 1rem; max-width: 20ch; letter-spacing: -.015em; }
.hero__title em { font-style: italic; color: var(--navy-700); background: linear-gradient(transparent 70%, rgba(30,58,95,.14) 70%); padding: 0 .08em; }
.hero__lede { font-size: 1.22rem; max-width: 52ch; color: var(--graphite); margin: 0; }

.featured { margin-bottom: 3.5rem; }
.featured__card {
  background: var(--gray-100); padding: 2rem 2.2rem 2rem 2rem;
  border-radius: 6px 28px 6px 20px; border-left: 5px solid var(--navy-700);
  margin-right: clamp(0rem, 6vw, 4rem);
}
.featured__title { font-size: clamp(1.5rem, 2.8vw, 2rem); margin: .2rem 0 .7rem; }
.featured__title a { color: var(--navy-900); text-decoration: none; }
.featured__title a:hover { text-decoration: underline; }
.featured__summary { margin: 0 0 1rem; color: var(--graphite); max-width: 56ch; }
.more { font-weight: 700; color: var(--navy-700); }

.stream { list-style: none; padding: 0; margin: 0 0 3rem; counter-reset: s; }
.stream__item { padding: 0 0 1.6rem 3rem; position: relative; max-width: var(--measure); }
.stream__item::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: .15rem; font-family: var(--font-head); font-style: italic;
  font-size: 1.3rem; color: #9AA9BF;
}
.stream__item:nth-child(even) { margin-left: 1.6rem; }
.stream__item h3 { font-size: 1.32rem; margin: 0 0 .35rem; }
.stream__item h3 a { color: var(--navy-900); text-decoration: none; }
.stream__item h3 a:hover { text-decoration: underline; }
.stream__item p:last-child { margin: 0; color: var(--graphite); }

.themes { margin: 1rem 0 3rem; }
.themes__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem; }
.themes__item a {
  display: block; height: 100%; padding: 1.2rem 1.3rem 1.1rem; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--gray-300); border-radius: 4px 20px 4px 14px;
  transition: border-color .15s, transform .15s, background .15s;
}
.themes__item:nth-child(3n+2) a { border-radius: 16px 4px 18px 4px; }
.themes__item:nth-child(3n+3) a { border-radius: 4px 14px 14px 4px; }
.themes__item:nth-child(even) { transform: translateY(.45rem); }
.themes__item a:hover { border-color: var(--navy-700); background: var(--gray-100); }
.themes__name { display: block; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--navy-900); margin-bottom: .3rem; }
.themes__desc { display: block; font-size: .96rem; line-height: 1.45; color: var(--graphite); }
.themes__count { display: block; margin-top: .6rem; font-size: .82rem; color: #6A6A6A; }

/* ---------- categoria ---------- */
.page-head { margin-bottom: 2.6rem; }
.page-head__title { font-size: clamp(2rem, 4vw, 2.9rem); margin: 0 0 .6rem; }
.page-head__lede { font-size: 1.2rem; color: var(--graphite); max-width: 52ch; margin: 0; }
.pillars { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; gap: 1.2rem; }
.pillars__item { background: var(--gray-100); padding: 1.4rem 1.6rem; border-radius: 6px 22px 6px 16px; border-left: 4px solid var(--navy-700); max-width: var(--measure); }
.pillars__item h3 { margin: 0 0 .4rem; font-size: 1.4rem; }
.pillars__item h3 a { color: var(--navy-900); text-decoration: none; }
.pillars__item h3 a:hover { text-decoration: underline; }
.pillars__item p:last-child { margin: 0; }
.empty { color: #666; font-style: italic; }

/* ---------- artigo ---------- */
.article { max-width: var(--measure); }
.article--page { max-width: 60ch; }
.crumbs { font-size: .9rem; color: #666; margin-bottom: 1.4rem; }
.crumbs a { color: #555; }
.article__head { margin-bottom: 2rem; }
.article__title { font-size: clamp(2rem, 4vw, 2.85rem); letter-spacing: -.012em; margin: .2rem 0 .9rem; }
.article__lede { font-size: 1.25rem; color: var(--graphite); margin: 0 0 1rem; line-height: 1.5; }
.draft-flag { margin-top: 1rem; padding: .6rem .9rem; background: #FFF6E0; border-left: 4px solid #C98A00; font-size: .92rem; }
.cluster-note { margin: -.6rem 0 1.6rem; font-size: .95rem; color: #555; }

.toc-box { margin: 0 0 2.2rem; padding: .9rem 1.2rem 1rem; background: var(--gray-100); border-radius: 4px 16px 4px 12px; font-size: .98rem; }
.toc-box summary { cursor: pointer; font-weight: 700; color: var(--navy-700); font-size: .88rem; letter-spacing: .1em; text-transform: uppercase; }
.toc-box ul { list-style: none; margin: .6rem 0 0; padding-left: 0; }
.toc-box ul ul { padding-left: 1.1rem; margin-top: .2rem; }
.toc-box li { margin: .25rem 0; line-height: 1.4; }
.toc-box a { text-decoration: none; }
.toc-box a:hover { text-decoration: underline; }

.prose h2 { font-size: 1.65rem; margin: 2.6rem 0 .8rem; scroll-margin-top: 1.5rem; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 .6rem; scroll-margin-top: 1.5rem; }
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  margin: 1.6rem 0; padding: .9rem 1.3rem; background: var(--gray-100);
  border-left: 4px solid var(--navy-700); border-radius: 2px 14px 14px 2px; color: var(--graphite);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: .98rem; }
.prose th, .prose td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--gray-300); vertical-align: top; }
.prose th { font-family: var(--font-head); color: var(--navy-900); background: var(--gray-100); }
.prose .footnote { font-size: .92rem; color: #555; margin-top: 3rem; }
.prose code { font-size: .92em; background: var(--gray-100); padding: .1em .35em; border-radius: 3px; }
.prose .verify { background: #FFF6E0; border-left-color: #C98A00; }

.cluster, .related { margin-top: 3rem; }
.cluster ul { padding-left: 1.2rem; margin: 0; }
.related__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.related__list li { padding: .9rem 1rem; border: 1.5px solid var(--gray-300); border-radius: 4px 14px 4px 12px; }
.related__list li:nth-child(even) { border-radius: 12px 4px 14px 4px; }
.related__list a { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--navy-900); text-decoration: none; }
.related__list a:hover { text-decoration: underline; }

/* ---------- anúncios (altura reservada para evitar salto de layout) ---------- */
.ad { margin: 2.2rem 0; min-height: 280px; background: var(--gray-100); border-radius: 4px 14px 4px 12px; padding: .4rem .6rem; text-align: center; max-width: 100%; overflow: hidden; }
.ad__label { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #8A8A8A; margin-bottom: .3rem; }
.ad--fim { margin-bottom: 1rem; }

/* ---------- captura de e-mail ---------- */
.capture {
  margin: 3rem 0; padding: 1.7rem 1.8rem 1.4rem; background: var(--navy-900); color: #E8ECF3;
  border-radius: 6px 26px 6px 20px; max-width: var(--measure);
}
.capture__title { color: var(--white); font-size: 1.45rem; margin: 0 0 .5rem; }
.capture__text { margin: 0 0 1.1rem; font-size: 1rem; color: #C9D3E3; }
.capture__form { display: flex; flex-wrap: wrap; gap: .6rem; }
.capture__form input[type="email"] { flex: 1 1 15rem; font: inherit; padding: .65rem .85rem; border: 1px solid transparent; border-radius: 4px 12px 4px 10px; background: var(--white); color: var(--ink); }
.capture__form button { font: inherit; font-weight: 700; padding: .65rem 1.2rem; border: 0; border-radius: 10px 4px 12px 4px; background: #7FA3D1; color: var(--navy-900); cursor: pointer; }
.capture__form button:hover { background: #A5C0E3; }
.capture__note { margin: .9rem 0 0; font-size: .82rem; color: #A8B5CB; }
.capture__note a { color: #D3DFF1; }
.capture-ok { margin: .8rem 0 0; font-weight: 700; color: #BFE0C6; }

/* ---------- últimas notícias ---------- */
.news { margin-bottom: 3.5rem; max-width: var(--measure); }
.news__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--navy-900); }
.news__item {
  display: grid; grid-template-columns: 6.8rem 1fr; gap: .2rem 1.4rem;
  padding: 1rem 0 1.1rem; border-bottom: 1px solid var(--gray-300);
}
.news__date { font-size: .85rem; color: #5A5A5A; letter-spacing: .02em; padding-top: .2rem; font-variant-numeric: tabular-nums; }
.news__title { font-size: 1.18rem; margin: 0 0 .25rem; }
.news__title a { color: var(--navy-900); text-decoration: none; }
.news__title a:hover { text-decoration: underline; }
.news__summary { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--graphite); }
.news__source { margin: .35rem 0 0; font-size: .82rem; color: #6A6A6A; }
.news__empty { margin: .9rem 0 0; font-size: 1rem; }
@media (max-width: 900px) {
  .news__item { grid-template-columns: 1fr; }
}

/* ---------- rodapé ---------- */
.footer { padding: 1.6rem clamp(1.25rem, 6vw, 5.5rem) 2.2rem; color: #666; font-size: .84rem; max-width: 62rem; }
.footer p { margin: 0; max-width: 70ch; }
.footer__cta {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 0 1.3rem;
  background: var(--navy-900); color: var(--white); text-decoration: none;
  border-radius: 4px 14px 4px 12px; transition: background .15s;
}
.footer__cta:hover { background: var(--navy-700); color: var(--white); }
.footer__cta svg { width: 20px; height: 20px; flex: none; }

/* ---------- mobile ---------- */
.menu-toggle { display: none; }

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: .55rem; position: fixed; top: .8rem; left: .8rem; z-index: 40;
    background: var(--navy-900); color: var(--white); border: 0; padding: .55rem .9rem; font: inherit; font-size: .95rem;
    border-radius: 4px 14px 4px 12px; cursor: pointer;
  }
  .menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; content: ""; position: relative;
  }
  .menu-toggle__bars::before { position: absolute; top: -6px; }
  .menu-toggle__bars::after { position: absolute; top: 6px; }
  .sidebar { width: min(20rem, 86vw); transform: translateX(-102%); transition: transform .22s ease; padding-top: 4.2rem; }
  .sidebar.is-open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
  .shell { margin-left: 0; }
  main { padding-top: 4.6rem; }
  .stream__item:nth-child(even) { margin-left: 0; }
  .themes__item:nth-child(even) { transform: none; }
  .featured__card { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .sidebar, .menu-toggle, .ad, .capture, .footer__cta { display: none !important; }
  .shell { margin-left: 0; }
  main { padding: 0; max-width: none; }
  body { font-size: 11pt; }
}
