:root {
  --bg:           #FFFFFF;
  --bg-2:         #FAFAF7;
  --surface:      #FFFFFF;
  --ink-title:    #161900;
  --ink-body:     #2A2E15;
  --ink-muted:    rgba(22,25,0,0.62);
  --ink-dim:      rgba(22,25,0,0.42);
  --accent:       #3E4700;
  --primary:      #E6FF00;
  --link:         #3E4700;
  --link-hover:   #161900;
  --rule:         #E2E8F0;
  --rule-soft:    rgba(22, 25, 0, 0.06);
  --active-bg:    rgba(62, 71, 0, 0.08);
  --page-bg:      #FFFFFF;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  background: var(--page-bg);
  color: var(--ink-body);
  line-height: 1.75;
  min-height: 100vh;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--primary); color: var(--ink-title); }

/* ── Post container ─────────────────────────────────────────────── */
.post {
  max-width: 1440px;
  margin: 0 auto;
  padding: 56px 48px 140px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(360px, 720px);
  gap: clamp(40px, 5vw, 80px);
  justify-content: center;
}

.post-aside {
  align-self: start;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  margin: 0 6px;
  padding: 28px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
}

.post-aside::-webkit-scrollbar { width: 4px; }
.post-aside::-webkit-scrollbar-track { background: transparent; }
.post-aside::-webkit-scrollbar-thumb { background: rgba(22,25,0,0.15); border-radius: 2px; }

.post-meta {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin-bottom: 24px;
}
.post-meta span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--ink-dim);
}

.post-title {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  color: var(--ink-title);
  margin-bottom: 40px;
  overflow-wrap: break-word;
  hyphens: auto;
}
.post-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* ── TOC desktop ───────────────────────────────────────────────── */
.toc {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.toc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toc-link {
  position: relative;
  display: block;
  padding: 8px 12px 8px 22px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.toc-link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  transition: opacity 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.toc-link:hover { color: var(--ink-body); }
.toc-link:hover::before { opacity: 0.55; }

.toc-link.active {
  color: var(--ink-title);
  background: var(--active-bg);
  font-weight: 500;
}
.toc-link.active::before {
  opacity: 1;
  background: var(--primary);
  transform: translateY(-50%) scale(1.2);
  box-shadow: 0 0 0 3px rgba(230, 255, 0, 0.32);
}

/* ── TOC mobile ───────────────────────────────────────────── */
.toc-mobile { display: none; }
.toc-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: background 0.2s;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary:hover { background: var(--active-bg); }
.toc-mobile summary .chev {
  width: 16px; height: 16px;
  transition: transform 0.2s;
}
.toc-mobile[open] summary .chev { transform: rotate(180deg); }
.toc-mobile .toc-list { padding: 14px 8px 8px; }

/* ── Coluna direita ───────────────────────────────────────── */
.post-body {
  max-width: 680px;
  padding-top: 28px;
}
.post-body > .post-title { margin-bottom: 32px; }

.post-body > p,
.post-body > section > p {
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  margin-bottom: 1.4em;
  color: var(--ink-body);
  font-weight: 400;
}

.post-body h2 {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.85rem, 2.8vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink-title);
  margin: 3.2em 0 1em;
}

.post-body [id] { scroll-margin-top: 96px; }
.post-body h2:first-child { margin-top: 0; }

.post-body a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.post-body a:hover { color: var(--link-hover); }

.post-body em { font-style: italic; color: var(--accent); }
.post-body strong { font-weight: 700; color: var(--ink-title); }

/* Lead — primeiro parágrafo ligeiramente maior */
.post-lead {
  font-size: 19px !important;
  line-height: 1.7 !important;
  color: var(--ink-body) !important;
  font-weight: 400;
  margin-bottom: 1.8em !important;
}

/* ── Figures ────────────────────────────────────────────────────── */
.post-body figure { margin: 2.4em -8px; }
.post-body figure .img-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  display: block;
}
.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
}
.post-body figcaption {
  margin-top: 14px;
  padding: 0 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  font-style: italic;
}

/* ── Subheadings (h3) ───────────────────────────────────────── */
.post-body h3 {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--ink-title);
  margin: 2.2em 0 0.8em;
}

/* ── Lists ──────────────────────────────────────────────────── */
.post-body ul,
.post-body ol {
  margin: 0 0 1.4em 1.4em;
  padding: 0;
  color: var(--ink-body);
  font-size: 17px;
  line-height: 1.78;
}
.post-body li { margin-bottom: 0.5em; }
.post-body li::marker { color: var(--accent); }

/* ── Tables ─────────────────────────────────────────────────────── */
.post-table-wrap {
  margin: 1.6em -8px 2em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
.post-table th,
.post-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.post-table thead th {
  font-weight: 700;
  color: var(--ink-title);
  background: rgba(62, 71, 0, 0.04);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.post-table tbody tr:last-child td { border-bottom: none; }
.post-table tbody td:first-child {
  color: var(--ink-title);
  font-weight: 600;
}

/* ── Code blocks ────────────────────────────────────────────────── */
.post-code {
  margin: 1.6em -8px 2em;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--ink-title);
  overflow: hidden;
}
.post-code pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #E6EDF3;
  white-space: pre;
}

/* ── Footer do post ───────────────────────────────────────── */
.post-footer {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.post-footer a {
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.post-footer a:hover { color: var(--ink-title); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .post {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 32px 22px 80px;
  }

  .post-aside {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 28px 24px 24px;
    margin: 0 0 32px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 14px;
  }

  .toc-desktop { display: none; }
  .toc-mobile  { display: block; border-top: none; padding-top: 0; }

  .post-title {
    font-size: 2.4rem;
    margin-bottom: 28px;
  }

  .post-body {
    max-width: none;
    padding-top: 0;
  }

  .post-body figure {
    margin: 2em 0;
  }
}

@media (max-width: 520px) {
  .post { padding: 24px 18px 60px; }
  .post-title { font-size: 2.05rem; }
  .post-body > p,
  .post-body > section > p { font-size: 16px; }
  .post-lead { font-size: 17.5px !important; }
  .post-body ul,
  .post-body ol { font-size: 16px; }
  .post-table { font-size: 14px; }
  .post-table th,
  .post-table td { padding: 10px 12px; }
  .post-code code { font-size: 12px; }
}

/* ── Blog index (listagem) ──────────────────────────────────────── */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child  { border-bottom: none; padding-bottom: 0; }

.post-card-title {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink-title);
  margin: 0 0 10px;
}
.post-card-title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--primary), var(--primary));
  background-size: 0% 0.45em;
  background-repeat: no-repeat;
  background-position: 0 88%;
  transition: background-size 0.3s ease, color 0.15s;
}
.post-card-title a:hover {
  color: var(--ink-title);
  background-size: 100% 0.45em;
}
.post-card-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.post-card-dates {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.post-card-dates span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--ink-dim);
}
.post-card-dates .post-card-updated {
  color: var(--ink-body);
}

.post-card-summary {
  font-family: 'Roboto', sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-body);
  margin: 0 0 18px;
  max-width: 60ch;
}
.post-card-summary strong {
  font-weight: 700;
  color: var(--ink-title);
}

.post-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.post-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: 'Roboto', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-title);
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 9999px;
}

.post-card-readtime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.post-card-readtime i {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
  opacity: 0.7;
}

.post-aside .index-lead {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-body);
  margin: 0 0 24px;
}
.post-aside .index-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin: 0 0 14px;
}
.post-aside .post-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  margin-bottom: 22px;
}

.author-box {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.author-box strong {
  font-weight: 700;
  color: var(--ink-title);
}
.author-box a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.author-box a:hover { color: var(--link-hover); }

@media (max-width: 940px) {
  .post-aside .post-title {
    font-size: 1.85rem;
    margin-bottom: 18px;
  }
}

@media (max-width: 520px) {
  .post-card { padding: 22px 0 26px; }
  .post-card-title { font-size: 1.4rem; }
  .post-card-summary { font-size: 15.5px; }
  .author-box { margin-top: 36px; }
}
