:root {
  --bg: #f5f0eb;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #e8272c;
  --accent2: #ffcb05;
  --accent3: #0085ff;
  --border: #e0dcd7;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main.container {
  padding-top: 32px;
}

/* ── HEADER ─────────────────────────────────────── */
.site-header {
  background: var(--accent);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(232,39,44,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
.logo-icon {
  font-size: 1.4rem;
}
.logo:hover { opacity: 0.9; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switch {
  display: flex;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
}
.lang-switch a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.lang-switch a:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.lang-active {
  color: #fff;
  background: rgba(0,0,0,0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

/* ── CARD GRID (BuzzFeed style) ─────────────────── */
.card-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 28px;
  margin-bottom: 60px;
}
.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background-color: #ddd;
}
.card-body {
  padding: 18px 20px 22px;
}
.card-body time {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-body h2 {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.3;
  margin-top: 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Hero card (primeiro post) */
.card-hero {
  grid-column: 1 / -1;
}
.card-hero .card-img {
  aspect-ratio: 21/9;
}
.card-hero .card-body h2 {
  font-size: 1.8rem;
}

.card .empty {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}

/* ── POST PAGE ──────────────────────────────────── */
.post-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
  margin: 0 0 32px 0;
  box-shadow: var(--shadow);
  background-color: #ddd;
}
.post-header {
  margin-bottom: 36px;
  max-width: 720px;
}
.post-header time {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-header h1 {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.15;
  margin-top: 8px;
  letter-spacing: -0.03em;
}
.post-content {
  max-width: 720px;
}
.post-content h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 40px 0 16px;
  color: var(--text);
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
}
.post-content p {
  margin-bottom: 20px;
  color: #333;
}
.post-content a {
  color: var(--accent3);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content ul, .post-content ol { margin: 0 0 20px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content code {
  font-family: 'Space Mono', monospace;
  background: #f0ece7;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
}
.post-content pre {
  background: #1a1a1a;
  color: #e6e1db;
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.post-content blockquote {
  border-left: 4px solid var(--accent2);
  padding-left: 20px;
  color: var(--muted);
  margin: 24px 0;
  font-style: italic;
  font-size: 1.1em;
}
.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

.back-link {
  display: inline-block;
  margin-top: 48px;
  margin-bottom: 32px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: opacity 0.15s;
}
.back-link:hover { opacity: 0.7; }

/* ── PAGINATION ─────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 40px 0 20px;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
}
.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 18px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  transition: all 0.15s;
}
.pagination a:hover {
  background: var(--accent);
  color: #fff;
}
.pg-info {
  color: var(--muted);
  font-weight: 700;
}
.pg-disabled {
  color: var(--border);
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
}

/* ── FOOTER ─────────────────────────────────────── */
.site-footer {
  border-top: 2px solid var(--border);
  margin-top: 40px;
  padding: 28px 0;
  text-align: center;
}
.footer-powered {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── UTILITIES ──────────────────────────────────── */
.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;
}
.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-hero .card-body h2 { font-size: 1.4rem; }
  .post-header h1 { font-size: 1.8rem; }
  .post-cover { max-height: 280px; border-radius: var(--radius); }
}