/* =====================================================
   imagens.ia.br — estilos globais
   Corpo: Figtree (geométrica, legível, não é Inter)
   Títulos de artigo: Playfair Display (editorial, serif)
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Playfair+Display:wght@700&display=swap');

/* ── Variáveis ─────────────────────────────────────── */

:root {
  --accent:        #0055E5;
  --accent-light:  #EBF1FF;
  --text:          #111111;
  --text-muted:    #5F6B7A;
  --text-faint:    #9CA3AF;
  --surface:       #FFFFFF;
  --surface-alt:   #F7F7F8;
  --border:        #E5E7EB;
  --border-strong: #CDD1D8;
  --radius:        4px;
  --font-body:     'Figtree', sans-serif;
  --font-display:  'Playfair Display', Georgia, serif;
  --max-article:   720px;
  --max-site:      1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent:        #4D8EFF;
    --accent-light:  #0C1A3A;
    --text:          #EDEDED;
    --text-muted:    #9CA3AF;
    --text-faint:    #6B7280;
    --surface:       #0B0B0B;
    --surface-alt:   #131313;
    --border:        #1E1E1E;
    --border-strong: #2A2A2A;
  }
}

/* ── Reset ─────────────────────────────────────────── */

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ── Header e navegação ───────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
}

.logo {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: url('/favicon.svg') center / contain no-repeat;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.125rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.12s ease, background 0.12s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-alt);
  text-decoration: none;
}

/* ── Layout do artigo ─────────────────────────────── */

.article-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── Breadcrumb ───────────────────────────────────── */

.breadcrumb {
  margin-bottom: 2.75rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: '/';
  margin: 0 0.5rem;
  opacity: 0.4;
}

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

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

.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}

/* ── Cabeçalho do artigo ──────────────────────────── */

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  line-height: 1;
}

.badge-level {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-category {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid transparent;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 5vw, 2.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

.article-excerpt {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.article-dates {
  font-size: 0.8125rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.updated-date {
  color: var(--text-faint);
}

/* ── Corpo do artigo (prose) ──────────────────────── */

.prose {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text);
  margin-top: 3rem;
  margin-bottom: 0;
}

.prose h2 + * {
  margin-top: 1rem;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-top: 2.25rem;
  margin-bottom: 0;
}

.prose h3 + * {
  margin-top: 0.75rem;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0;
}

.prose h4 + * {
  margin-top: 0.5rem;
}

.prose p {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose strong {
  font-weight: 700;
  color: var(--text);
}

.prose em {
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.375rem;
}

.prose li {
  margin-bottom: 0.375rem;
  line-height: 1.7;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.375rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.875rem 1.25rem;
  background: var(--surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose blockquote p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.prose code {
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.875em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--text);
}

.prose pre {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}

.prose th {
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.625rem 0.875rem;
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}

.prose td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Rodapé do artigo ─────────────────────────────── */

.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.update-notice {
  font-size: 0.8125rem;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ── Rodapé do site ───────────────────────────────── */

.site-footer {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-site);
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-brand .logo {
  font-size: 0.9375rem;
  color: var(--text);
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-note {
  font-size: 0.75rem !important;
  color: var(--text-faint) !important;
  letter-spacing: 0.03em;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s ease;
}

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

.footer-legal {
  max-width: var(--max-site);
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ── Página 404 ───────────────────────────────────── */

.not-found-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.not-found-inner {
  max-width: 480px;
  text-align: center;
}

.not-found-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--border-strong);
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.not-found-inner h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.not-found-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.not-found-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.not-found-secondary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.not-found-secondary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Páginas de índice (ferramentas, guias, etc.) ──── */

.index-main {
  flex: 1;
  padding: 2.5rem 1.5rem 5rem;
}

.index-inner {
  max-width: var(--max-site);
  margin: 0 auto;
}

.index-header {
  max-width: var(--max-article);
  margin-bottom: 3rem;
}

.index-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin: 1rem 0 0.75rem;
}

.index-header p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.index-empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: 3rem 0;
}

/* nav link ativo */
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-alt);
}

/* ── Homepage ─────────────────────────────────────── */

.hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 1.5rem 4.5rem;
}

.hero-inner {
  max-width: var(--max-article);
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.125rem;
}

.hero p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 52ch;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity 0.12s ease;
}

.hero-cta:hover {
  opacity: 0.88;
  text-decoration: none;
}

.home-section {
  padding: 4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.home-section--alt {
  background: var(--surface-alt);
}

.home-inner {
  max-width: var(--max-site);
  margin: 0 auto;
}

.home-inner--narrow {
  max-width: var(--max-article);
}

.section-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.75rem;
}

/* Cards grid */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  text-decoration: none;
  color: inherit;
}

.card-meta {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

/* Lista de artigos */

.list-articles {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: color 0.12s ease;
}

.list-item:hover {
  text-decoration: none;
  color: inherit;
}

.list-item:hover .list-item-text h3 {
  color: var(--accent);
}

.list-item-text {
  flex: 1;
  min-width: 0;
}

.list-item-text h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  transition: color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-date {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-footer {
  margin-top: 1.5rem;
}

.link-all {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.link-all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bloco sobre */

.about-block {
  padding: 2.5rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
}

.about-block h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-block p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.875rem;
}

.about-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.25rem;
}

.about-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Responsivo ───────────────────────────────────── */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  /* Header em duas linhas no mobile */
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0;
    gap: 0;
  }

  .logo {
    height: 52px;
    padding: 0 1rem;
    width: 100%;
  }

  /* Links em linha scrollável abaixo do logo */
  .nav-links {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.625rem 0.5rem;
    gap: 0;
    border-top: 1px solid var(--border);
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links li {
    flex-shrink: 0;
  }

  .nav-links a {
    white-space: nowrap;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }

  .article-main {
    padding: 1.75rem 1rem 3.5rem;
  }

  .breadcrumb {
    margin-bottom: 2rem;
  }

  .breadcrumb [aria-current="page"] {
    max-width: 20ch;
  }

  .prose h2 {
    margin-top: 2.5rem;
  }

  .footer-inner {
    gap: 2rem;
  }

  .index-main {
    padding: 1.75rem 1rem 3.5rem;
  }

  .index-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 1rem 2.75rem;
  }

  .home-section {
    padding: 3rem 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .list-item {
    flex-direction: column;
    gap: 0.375rem;
    align-items: flex-start;
  }

  .list-item-text h3,
  .list-item-text p {
    white-space: normal;
  }

  .about-block {
    padding: 1.5rem;
  }
}
