:root {
  /* Fundo principal (sépia, igual ao extra.css original) */
  --color-bg: #f4ecd8;
  --color-bg-raised: #f8f1e3;
  --color-bg-dim: #e8dcc2;
  --color-text-header: #ffffff;

  /* Texto sobre fundo claro */
  --color-text: #2a2a2a;
  --color-heading: #1c1c1e;
  --color-muted: #6b6255;

  /* Links — cor fria pra contraste com o sépia quente */
  --color-accent: #3e5c76;
  --color-accent-light: #6c8ca3;
  --color-accent-hover: #2a4a63;

  --color-border: #c2b8a3;

  /* Selo/carimbo (ex: "feito sem IA") */
  --color-seal-bg: #e8dcc2;
  --color-seal-border: #1f2937;
  --color-seal-text: #2a2a2a;
  --color-seal-accent: #0f766e;

  --max-width: 1200px;
  --font-body: Roboto, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;

  --sidebar-width: 230px;

  --breakpoint-tablet: 48rem;
  /* 768px — mesmo valor já usado pelas colunas ODT */
  --breakpoint-phone: 30rem;
  /* 480px */
}

/* 2. Font face
   ========================================================================== */

@font-face {
  font-display: swap;
  /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/roboto-v51-latin_latin-ext_math-regular.29a04bbc7e.woff2') format("woff2");
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  text-align: justify;
  /* volta a left-align abaixo de --breakpoint-tablet*/
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-body);
  color: var(--color-heading);
  line-height: 1.25;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-light);
}

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

.site-menu a,
.sidebar-toc a,
.sidebar-nav a,
.breadcrumbs a,
.post-list a,
.term-list a,
.post-nav a,
.social-link,
.tag,
.category {
  text-decoration: none;
}

.site-menu a:hover,
.sidebar-toc a:hover,
.sidebar-nav a:hover {
  text-decoration: none;
}

/* Trava o scroll da página quando um drawer está aberto */
body.drawer-open {
  overflow: hidden;
}

/* Utilitário de acessibilidade: some visualmente, mas continua legível
   por leitores de tela. Usado nos rótulos dos botões de drawer. */
.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;
}

.site-header {
  background: var(--color-heading);
  color: var(--color-text-header);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  font-size: 2.5rem;
  line-height: 1.2;
  margin-left: 1rem;
}

.custom-header-monocerus {
  font-size: 3rem;
  line-height: 1.2;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
}

.title-box {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.title-box:hover {
  color: var(--color-text-header);
}

.site-title,
.site-title:visited,
.site-title:hover,
.site-title:active,
.site-title:focus {
  color: inherit;
  text-decoration: none;
}

.site-menu ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.site-menu a {
  color: var(--color-text-header);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-menu a:hover {
  color: var(--color-accent-light);
}

/* O menu do site e o seletor de idioma vivem juntos dentro de
   .site-menu-drawer: lado a lado no desktop, e viram um painel
   deslizante em telas pequenas (ver media query abaixo). */
.site-menu-drawer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* O seletor de idioma não tinha estilo próprio antes — sem isso,
   renderiza como uma lista com marcadores. */
.lang-switcher ul {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switcher a,
.lang-switcher__current {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.lang-switcher a:hover {
  color: var(--color-accent);
}

.lang-switcher__current {
  font-weight: 700;
  color: var(--color-accent);
}

/* Botão hamburguer: some no desktop, aparece na media query mobile */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  cursor: pointer;
}

.menu-toggle:hover {
  color: var(--color-accent);
}

.menu-toggle__icon {
  width: 24px;
  height: 24px;
}

/* Botão que abre a barra lateral (nav/TOC) em telas pequenas */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--color-nav-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.sidebar-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Botão de fechar dos drawers — some no desktop */
.drawer__close {
  display: none;
  align-self: flex-end;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0.25rem;
}

.drawer__close:hover {
  color: var(--color-accent);
}

/* Camada escura atrás dos drawers, some no desktop por padrão
   (só existe posicionamento fixo dentro da media query) */
.drawer__overlay {
  background: rgba(0, 0, 0, 0.45);
}

.drawer__overlay[hidden] {
  display: none;
}

.site-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.site-content {
  flex: 1;
  min-width: 0;
}

/* Sidebar *******************************/

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-shrink: 0;
}

.sidebar-toc {
  width: 220px;
  flex-shrink: 0;
  font-size: 0.9rem;
  position: sticky;
  top: 1rem;
}

.sidebar-toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.sidebar-toc ul {
  list-style: none;
  padding-left: 0.75rem;
  margin: 0;
}

.sidebar-toc>ul {
  padding-left: 0;
}

.sidebar-toc a {
  color: var(--color-text);
  text-decoration: none;
  display: block;
  padding: 0.15rem 0;
  text-align: left;
}

.sidebar-toc a:hover {
  color: var(--color-accent);
}

.sidebar-nav {
  width: 240px;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.sidebar-nav h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.sidebar-nav ul {
  list-style: none;
  padding-left: 0.9rem;
  margin: 0;
}

.sidebar-nav>ul {
  padding-left: 0;
}

.sidebar-nav a,
.sidebar-nav .nav-section {
  display: block;
  padding: 0.2rem 0;
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-nav .nav-section {
  color: var(--color-muted);
  font-weight: 600;
}

.sidebar-nav a:hover {
  color: var(--color-accent);
}

.sidebar-nav li.active>a {
  color: var(--color-accent);
  font-weight: 600;
}

.sidebar-nav details {
  margin: 0;
}

.sidebar-nav summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.2rem 0;
  list-style: none;
}

.sidebar-nav summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.7em;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

.sidebar-nav details[open]>summary::before {
  transform: rotate(90deg);
}

.sidebar-nav summary a {
  display: inline;
  padding: 0;
}

.sidebar-nav .nav-section-title {
  color: var(--color-text);
  font-weight: 600;
}

/* breadcrumbs *******************************/

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--color-muted);
}

.breadcrumbs__sep {
  margin: 0 0.4rem;
}

.breadcrumbs__current {
  color: var(--color-text);
}

/* post-list *******************************/

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list a {
  font-weight: 700;
}

.post-list time,
.post-list span {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

li time+span::before {
  content: "•";
  margin-right: 0.5rem;
}

.post-list__excerpt {
  margin: 0.3rem 0 0;
  color: var(--color-muted);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.term-list {
  list-style: none;
  padding: 0;
}

.term-count {
  color: var(--color-muted);
  font-size: 0.85rem;
}

a.tag,
a.category {
  display: inline-block;
  background: var(--color-bg-dim);;
  color: var(--color-accent);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-right: 0.4rem;
  text-decoration: none;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-nav-border);
  font-size: 0.9rem;
}

.asteria-embed {
  display: block;
  margin: 1.5rem 0;
  border-radius: 6px;
  max-width: 100%;
}

/* Document *********************************************/
.document__title {
  font-size: 1.9rem;
  font-weight: 800;
  border-bottom: 3px solid var(--color-border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.document__meta {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.document__body img,
.document__body video {
  max-width: 100%;
  height: auto;
}

.document__body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 6px;
}

.document__body table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
}

.document__body iframe {
  max-width: 100%;
}

th {
  background: var(--color-bg-dim);
  text-align: left;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

th,
td {
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.7rem;
}

dl {
  margin: 1.25rem 0;
}

dt {
  font-weight: 800;
  color: var(--color-heading);
}

dd {
  margin: 0 0 0.9rem;
  color: var(--color-text);
}

blockquote {
  background: var(--color-bg-raised);
  border-left: 3px solid var(--color-accent);
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  color: var(--color-text);
}

pre,
code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

code {
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
}

pre code {
  border: none;
  padding: 0;
  background: none;
}

.asteria-embed {
  display: block;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
}

.site-footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.footer-elements {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.social-link {
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.social-link img {
  filter: brightness(0);
}

/* Aplica o tamanho fixo tanto para a imagem quanto para as iniciais */
.social-link img,
.social-link .social-initials {
  width: 24px;
  height: 24px;
  display: block;
}

/* Estilo específico do círculo para as iniciais customizadas */
.social-link .social-initials {
  border-radius: 50%;
  background-color: var(--color-text);
  color: var(--color-bg);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  /* Garante que o texto fique centralizado perfeitamente */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  color: var(--color-accent);
}

#asteria-link,
#asteria-link:visited {
  color: var(--color-accent);
  text-decoration: none;
}

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

@media (max-width: 768px) {
  .site-header__inner {
    padding: 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  /* Menu do site + idioma viram um painel deslizando da direita */
  .site-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(80vw, 300px);
    background: var(--color-bg);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 50;
    overflow-y: auto;
  }

  .site-menu-drawer.is-open {
    transform: translateX(0);
  }

  .site-menu-drawer .drawer__close {
    display: block;
  }

  .site-menu ul {
    flex-direction: column;
    gap: 0.25rem;
  }

  .site-menu a {
    display: block;
    padding: 0.4rem 0;
  }

  .lang-switcher ul {
    flex-direction: column;
    gap: 0.4rem;
  }

  #menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
  }

  /* Nav/TOC lateral vira um painel deslizando da esquerda */
  .site-layout {
    flex-direction: column;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-column {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 300px);
    background: var(--color-bg);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
    overflow-y: auto;
  }

  .sidebar-column.is-open {
    transform: translateX(0);
  }

  .sidebar-column .drawer__close {
    display: block;
  }

  .sidebar-nav,
  .sidebar-toc {
    width: auto;
    position: static;
  }

  #sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.1rem;
  }

  .post-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}