/* ─── BLOG STYLES ─────────────────────────────────────────────────
   Shared across blog listing and individual posts.
   Design tokens inherited from henriquesantana.work main site.
   ─────────────────────────────────────────────────────────────── */

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

:root {
  --bg:       #F5F2EC;
  --bg-alt:   #EDEAE0;
  --bg-dark:  #1A1814;
  --text:     #1A1814;
  --text-mid: #4A4540;
  --muted:    #564F47;
  --accent:   #7A5018;
  --accent-lt:#946A22;
  --border:   #C4BDB0;
  --border-lt:#DDD7CB;

  --font-display: 'Cormorant Garant', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 72px;
  --max-w: 1100px;
  --pad:   clamp(1.5rem, 5vw, 4rem);
}

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; }
a { color: inherit; }

/* ─── SCROLL ANIMATIONS ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── NAV ────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(245, 242, 236, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-lt);
  display: flex;
  align-items: center;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }

/* ─── BLOG LISTING ───────────────────────────────────────────── */
.blog-header {
  padding: clamp(4rem, 8vw, 7rem) var(--pad) clamp(2rem, 4vw, 3rem);
  max-width: var(--max-w);
  margin: 0 auto;
}
.blog-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--text);
}
.blog-header p {
  margin-top: 1rem;
  color: var(--text-mid);
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.8;
}

.blog-rss {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
.blog-rss:hover { color: var(--accent-lt); }
.blog-rss svg { flex-shrink: 0; }

.blog-list {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 6vw, 6rem);
}
.blog-post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.blog-post-item:first-child {
  border-top: 1px solid var(--border);
}
.blog-post-item a {
  text-decoration: none;
  display: block;
}
.blog-post-item a:hover .blog-post-title {
  color: var(--accent);
}
.blog-post-meta {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.blog-post-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s;
  margin-bottom: 0.5rem;
}
.blog-post-description {
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 640px;
}

/* ─── ARTICLE (individual post) ──────────────────────────────── */
.article-header {
  padding: clamp(4rem, 8vw, 7rem) var(--pad) 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 1rem;
}
.article-meta {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem var(--pad) clamp(4rem, 6vw, 6rem);
}

/* Prose rhythm */
.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-mid);
  margin-bottom: 1.5rem;
}
.article-body p strong {
  color: var(--text);
  font-weight: 500;
}
.article-body p em {
  font-style: italic;
}
.article-body p a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.article-body p a:hover {
  border-color: var(--accent);
}

/* Headings within article */
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin: 3rem 0 1rem;
  line-height: 1.25;
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  line-height: 1.3;
}

/* Blockquotes */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-alt);
}
.article-body blockquote p {
  color: var(--text);
  font-style: italic;
  margin-bottom: 0;
}

/* Code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  border: 1px solid var(--border-lt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--text);
}
.article-body pre {
  background: var(--bg-dark);
  color: #e8e4de;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.85rem;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Lists (rare, but supported) */
.article-body ul, .article-body ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}
.article-body li {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

/* Interactive HTML embed container */
.demo-embed {
  margin: 2.5rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.demo-embed-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.demo-embed-body {
  padding: 1.5rem;
}

/* ─── BACK LINK ──────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--accent); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--pad);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.footer-copy strong { color: var(--text-mid); font-weight: 500; }

.footer-rss {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-rss:hover { color: var(--accent-lt); }
.footer-rss svg { flex-shrink: 0; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-post-title { font-size: 1.2rem; }
  .article-body { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (max-width: 520px) {
  .nav-links { display: none; }
  .blog-post-meta { flex-direction: column; gap: 0.25rem; align-items: flex-start; }
}
