/* ===========================================================================
   TCN Blog — design alinhado ao site React (src/index.css / tailwind.config.ts)
   =========================================================================== */

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --muted: #f1f5f9;
  --muted-foreground: #666666;
  --border: #e5e5e5;
  --card: #ffffff;
  --primary: #212121;          /* 0 0% 13% */
  --primary-foreground: #ffffff;
  --accent: #0a6cff;           /* 214 100% 45% */
  --accent-soft: rgba(10, 108, 255, 0.1);
  --destaque: #5aa2f7;         /* 215 93% 65% */
  --radius: 0.75rem;

  --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.2);
  --shadow-primary: 0 20px 60px -15px rgba(37, 99, 235, 0.3);

  --container: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "liga" 1, "calt" 1;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------- Botões ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
}
.btn-primary:hover { box-shadow: var(--shadow-glow); transform: scale(1.03); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: rgba(255, 255, 255, 0.9); transform: scale(1.03); }

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: all 0.3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 229, 229, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.site-header .logo img { width: 180px; height: auto; }
.site-header:not(.scrolled) .logo img { filter: brightness(0) invert(1); }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
  position: relative;
  font-weight: 500;
  color: var(--primary-foreground);
  transition: color 0.3s ease;
}
.site-header.scrolled .main-nav a { color: var(--foreground); }
.main-nav a:hover { color: var(--accent); }
.main-nav a.active { color: var(--accent); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-cta { display: flex; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--primary-foreground);
}
.site-header.scrolled .nav-toggle { color: var(--foreground); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--foreground); font-weight: 500; }

/* ----------------------------- Hero / banners ----------------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  color: #fff;
  padding: 9rem 0 4rem;
}
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; margin: 0 0 1rem; line-height: 1.1; }
.page-hero p { font-size: 1.15rem; color: rgba(255, 255, 255, 0.8); max-width: 720px; margin: 0; }
.page-hero .hero-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.5rem; color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.page-hero .badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ----------------------------- Seções ----------------------------- */
.section { padding: 4rem 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin: 0 0 0.75rem; }
.section-subtitle { color: var(--muted-foreground); font-size: 1.1rem; }
.text-center { text-align: center; }

/* ----------------------------- Cards de post ----------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.4s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-glow); }
.post-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.post-card:hover .thumb img { transform: scale(1.08); }
.post-card .body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-card .cat {
  align-self: flex-start;
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}
.post-card h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.5rem; }
.post-card:hover h3 { color: var(--accent); }
.post-card .excerpt { color: var(--muted-foreground); font-size: 0.95rem; margin: 0 0 1rem; }
.post-card .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--muted-foreground); }
.post-card .read-more { color: var(--accent); font-weight: 600; }

/* ----------------------------- Post (single) ----------------------------- */
.post-content { max-width: 760px; margin: 0 auto; padding: 3rem 1rem; }
.post-content > * { margin-top: 0; }
.post-content p,
.post-content ul,
.post-content ol { color: #3a3a3a; font-size: 1.08rem; line-height: 1.8; margin: 0 0 1.25rem; }
.post-content h2 { font-size: 1.7rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.post-content h3 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--muted);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  color: #444;
}
.post-content pre {
  background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem;
  border-radius: var(--radius); overflow-x: auto;
}

/* ----------------------------- CTA band ----------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  max-width: 980px;
  margin: 0 auto;
  background: var(--gradient-primary);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-glow);
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
}
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; margin: 0 0 0.75rem; }
.cta-band p { color: rgba(255, 255, 255, 0.9); max-width: 620px; margin: 0 auto 1.5rem; font-size: 1.05rem; }
.cta-band .blob { position: absolute; width: 12rem; height: 12rem; background: rgba(255,255,255,0.1); border-radius: 9999px; }
.cta-band .blob.tr { top: -5rem; right: -5rem; }
.cta-band .blob.bl { bottom: -5rem; left: -5rem; }

/* ----------------------------- Paginação ----------------------------- */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 3rem; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: all 0.2s ease;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current { background: var(--gradient-primary); color: #fff; border-color: transparent; }

/* ----------------------------- Footer ----------------------------- */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 2rem;
  position: relative;
  overflow: hidden;
}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2rem; }
.site-footer .logo img { width: 150px; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.site-footer h4 { color: var(--accent); font-weight: 600; margin: 0 0 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.site-footer a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 0.75rem; }
.footer-socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1); transition: all 0.3s ease;
}
.footer-socials a:hover { background: var(--gradient-primary); transform: scale(1.1); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.6);
}
.footer-bottom .legal { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* ----------------------------- Responsivo ----------------------------- */
@media (max-width: 960px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
