/* ============================================
   Caminho Solo — CSS Base
   ============================================ */

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Tokens */
:root {
  --bg: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #0f172a;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --max-w: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

/* Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Header
   ============================================ */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-bottom: 3rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-name:hover {
  color: var(--link);
}

header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

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

/* ============================================
   Footer
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 5rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p,
footer nav a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
}

footer nav {
  display: flex;
  gap: 1rem;
}

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

/* ============================================
   Main
   ============================================ */
main {
  min-height: calc(100vh - 220px);
  padding-bottom: 3rem;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--accent);
}

h1 { font-size: 1.875rem; margin-bottom: 1rem; }
h2 { font-size: 1.375rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.4rem; }

p {
  margin-bottom: 1.25rem;
}

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

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

strong {
  font-weight: 600;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

blockquote {
  border-left: 3px solid var(--border);
  padding: 0.25rem 1.25rem;
  color: var(--text-muted);
  margin: 1.75rem 0;
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

th {
  text-align: left;
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ============================================
   Homepage
   ============================================ */
.home-hero {
  padding: 3.5rem 0 3rem;
}

.home-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.home-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.view-all {
  margin-top: 2rem;
  text-align: center;
}

.view-all a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.view-all a:hover {
  color: var(--link);
}

/* ============================================
   Post list
   ============================================ */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list .post-item:first-child {
  border-top: 1px solid var(--border);
}

.post-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.post-item-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.post-item-title a {
  color: var(--text);
  text-decoration: none;
}

.post-item-title a:hover {
  color: var(--link);
}

.post-item-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.post-item-tags {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ============================================
   Tags
   ============================================ */
.tag {
  font-size: 0.72rem;
  padding: 0.2em 0.6em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.tag:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ============================================
   Single post — legacy (kept for compatibility)
   ============================================ */
.post-header {
  padding: 1.5rem 0 2rem;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--link);
  text-decoration: none;
}

.post-header h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.post-meta time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.featured-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-top: 1rem;
  border-radius: 10px;
}

.post-content {
  padding-bottom: 2rem;
}

/* ============================================
   Article — Layout editorial
   ============================================ */
.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Breadcrumb */
.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 2rem 0 0;
  margin-bottom: 2.5rem;
}

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

.article-breadcrumb a:hover {
  color: var(--link);
}

.breadcrumb-sep {
  color: var(--border);
}

/* Category badge */
.article-category {
  margin-bottom: 1rem;
}

.article-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5A00EE;
  background: #f3eeff;
  border: 1px solid #e0cfff;
  padding: 0.25em 0.75em;
  border-radius: 999px;
}

/* Article header */
.article-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: #0a0a0f;
  margin-bottom: 1rem;
}

.article-description {
  font-size: 1.175rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* Featured cover */
.article-cover {
  margin: 0 0 3rem;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Article footer */
.article-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ============================================
   Article body — tipografia editorial
   ============================================ */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: #1c1c28;
}

.article-body p {
  margin-bottom: 1.75rem;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: #0a0a0f;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #0a0a0f;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0a0a0f;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.article-body ul {
  list-style: none;
  padding-left: 0;
}

.article-body ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.article-body ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #5A00EE;
  font-size: 0.9em;
}

.article-body ol li {
  margin-bottom: 0.5rem;
}

.article-body ol li::marker {
  color: #5A00EE;
  font-weight: 600;
}

.article-body a {
  color: #5A00EE;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(90, 0, 238, 0.35);
}

.article-body a:hover {
  text-decoration-color: #5A00EE;
}

.article-body strong {
  font-weight: 700;
  color: #0a0a0f;
}

.article-body em {
  font-style: italic;
}

.article-body blockquote {
  border-left: 3px solid #5A00EE;
  background: #f8f5ff;
  padding: 1rem 1.5rem;
  margin: 2.25rem 0;
  border-radius: 0 8px 8px 0;
  color: #374151;
  font-style: normal;
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.article-body img {
  width: 100%;
  border-radius: 10px;
  margin: 1.75rem 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* Figure com legenda */
.article-figure {
  margin: 2rem 0;
}

.article-figure img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  margin: 0;
}

.article-figure figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.625rem;
  line-height: 1.5;
}

/* ============================================
   Componentes editoriais
   ============================================ */

/* TLDR */
.tldr-block {
  background: #f8f5ff;
  border: 1px solid #e0cfff;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.75rem;
}

.tldr-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5A00EE;
  margin-bottom: 0.875rem;
}

.tldr-content p {
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.65;
}

.tldr-content ul {
  margin-bottom: 0;
}

.tldr-content ul li {
  font-size: 0.9375rem;
  color: #374151;
  margin-bottom: 0.35rem;
}

/* Callout */
.callout {
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-left: 3px solid;
}

.callout-tip {
  background: #f0fdf4;
  border-color: #22c55e;
}

.callout-warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.callout-insight {
  background: #f8f5ff;
  border-color: #5A00EE;
}

.callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
}

.callout-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.callout-tip .callout-title { color: #16a34a; }
.callout-warning .callout-title { color: #d97706; }
.callout-insight .callout-title { color: #5A00EE; }
.callout-info .callout-title { color: #2563eb; }

.callout-body p {
  margin-bottom: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #374151;
}

/* Quote editorial */
.editorial-quote {
  border: none;
  border-left: 4px solid #5A00EE;
  padding: 0.5rem 0 0.5rem 1.75rem;
  margin: 2.5rem 0;
  background: none;
}

.editorial-quote p {
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  color: #0a0a0f;
  margin-bottom: 0.5rem;
}

.editorial-quote cite {
  font-size: 0.825rem;
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   Lang switcher
   ============================================ */
.lang-switch {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.lang-switch:hover {
  border-color: var(--text-muted);
  color: var(--text);
  text-decoration: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .home-hero h1 { font-size: 1.75rem; }
  .post-header h1 { font-size: 1.5rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  header .container {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

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

  pre {
    font-size: 0.8rem;
    padding: 1rem;
  }

  /* Article mobile */
  .article-title {
    font-size: 1.75rem;
  }

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

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

  .article-body h2 {
    font-size: 1.3rem;
  }

  .article-body h3 {
    font-size: 1.1rem;
  }

  .editorial-quote p {
    font-size: 1.1rem;
  }
}
