@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap");

/* Tipografia e tema — blog Vilmar Ribeiro / vilmar.me */

:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --text: #e7e9ea;
  --text-muted: #8b98a5;
  --accent: #1d9bf0;
  --accent-hover: #47a8f5;
  --border: #38444d;
  --radius: 10px;
  --sidebar-w: 260px;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Sidebar */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-inner {
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-brand-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.site-name {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.site-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.side-nav {
  margin-top: 2rem;
  flex: 1;
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav li {
  margin-bottom: 0.35rem;
}

.side-nav a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-hover);
}

.side-nav a[aria-current="page"] {
  background: rgba(29, 155, 240, 0.12);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
}

.domain-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Main */
.main {
  flex: 1;
  min-width: 0;
  padding: 2rem 1.75rem 3rem;
  max-width: 760px;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 42rem;
}

/* Lista por mês */
.month-group {
  margin-bottom: 2.5rem;
}

.month-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-card {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.article-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.article-card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.35rem 0 0;
  line-height: 1.35;
}

.article-card-title a {
  color: var(--text);
  text-decoration: none;
}

.article-card-title a:hover {
  color: var(--accent);
}

.article-card-summary {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.empty-state {
  color: var(--text-muted);
}

.empty-state code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Artigo — diagramação */
.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

.article-body {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Prose (Markdown) */
.prose {
  --prose-max: 40rem;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose > p:first-child {
  font-size: 1.08em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.75em 0 0.65em;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.2rem;
}

.prose h4 {
  font-size: 1.05rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose blockquote {
  margin: 1.25em 0;
  padding: 0.5em 0 0.5em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.92em;
  margin: 1.25em 0;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5em 0.75em;
  text-align: left;
}

.prose th {
  background: var(--bg-elevated);
  font-weight: 600;
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.82em;
  line-height: 1.55;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1.25em 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose .toc {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5em;
}

.prose .toc ul {
  margin: 0.5em 0 0;
}

.page-body.prose {
  max-width: var(--prose-max);
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Menu mobile */
.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 160;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-overlay.is-visible {
  opacity: 1;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-overlay:not([hidden]) {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(300px, 88vw);
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

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

  .main {
    padding: 4.5rem 1.15rem 2.5rem;
    max-width: none;
  }

  .article-body {
    font-size: 1.05rem;
  }
}

@media (min-width: 769px) {
  .main {
    margin-left: 0;
  }
}
