/* ═══════════════════════════════════════════════════════════════════
   PAGES.CSS — Techduto 2026 Internal Pages
   Extends main.css (design system). No duplicated resets/variables.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Additional Variables (pages-only, extends main.css) ──
   main.css defines: --red, --dark-red, --very-dark-red, --salmon,
   --gray4, --gray6, --gray9, --gray11, --dark-bg, --light-bg, --white, --font
   We add NEW variables here, never redefine main.css ones. ── */
:root {
  --red-dark: #CC2A1E;
  --pg-bg: #f6f7f8;
  --pg-border: #eaebed;
  --pg-divider: #d1d3d6;
  --pg-muted: #5f6368;
  --pg-body: #555;
  --pg-heading: #2a2a2a;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s cubic-bezier(.4,0,.2,1), background-color 0.3s cubic-bezier(.4,0,.2,1), color 0.3s cubic-bezier(.4,0,.2,1), border-color 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════ HERO (Internal Pages — padronizado) ═══════════════════ */
.hero {
  /* 09/08/2026: fallback escuro quando a página não tem hero image (ex: solução
     recém-criada sem foto ainda) — sem isso o H1 branco ficava branco sobre fundo
     branco, ilegível (achado do André). .hero-bg cobre isso por cima quando existe
     foto real, então não muda nada nas páginas que já têm imagem. */
  background: var(--pg-heading, #1a1a1a);
  position: relative;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
@media (max-width: 768px) { .hero { height: 195px; } }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(0,0,0,.50) 24%, rgba(0,0,0,.50) 76%, transparent 100%),
    linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,.62) 100%);
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2;
  color: var(--white);
  max-width: 800px;
  padding: 0 24px;
}
.hero-content h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
  letter-spacing: -.01em;
}
.hero-content p {
  font-size: 16px;
  line-height: 1.5;
  opacity: .92;
  font-weight: 400;
  max-width: 640px;
  margin: 0 auto;
  letter-spacing: .005em;
}
@media (max-width: 768px) {
  .hero-content { margin-top: 10px; }
  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 14px; line-height: 1.45; max-width: 92%; }
}
.hero-tag {
  display: inline-block;
  background: rgba(238,49,36,.9);
  color: var(--white);
  padding: 4px 16px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
/* .product-hero: removido — agora todos internal pages usam .hero base (210px / 195px mobile) */

/* ═══════════════════ PROSE (generic content) ═══════════════════ */
.prose { max-width: 800px; }
.prose h2 { font-size: 24px; font-weight: 700; color: var(--pg-heading); margin: 32px 0 12px; }
.prose h3 { font-size: 20px; font-weight: 700; color: var(--pg-heading); margin: 24px 0 8px; }
.prose p { font-size: 15px; line-height: 1.8; color: var(--pg-body); margin-bottom: 16px; }
.prose ul, .prose ol { margin: 12px 0 16px 24px; }
.prose li { font-size: 15px; line-height: 1.7; color: var(--pg-body); margin-bottom: 6px; list-style: disc; }
.prose ol li { list-style: decimal; }
.prose img { border-radius: var(--radius); margin: 24px 0; }
.prose a { color: var(--red); font-weight: 600; }
.prose a:hover { color: var(--red-dark); }

/* ═══════════════════ BTN-PRIMARY ═══════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: var(--white);
  padding: 14px 32px; border-radius: 8px;
  font-size: 15px; font-weight: 700;
  border: none; cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.btn-primary svg { fill: currentColor; }

/* ═══════════════════ FILTER BAR ═══════════════════ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 24px 0 32px; justify-content: center;
}
.filter-pill {
  padding: 10px 24px; border-radius: 100px;
  border: 2px solid var(--pg-divider);
  font-size: 14px; font-weight: 600; color: var(--pg-body);
  cursor: pointer; transition: var(--transition);
  background: var(--white);
}
.filter-pill:hover { border-color: var(--red); color: var(--red); }
.filter-pill.active { background: var(--red); border-color: var(--red); color: var(--white); }

/* ═══════════════════ CTA FINAL ═══════════════════ */
.cta-final {
  background: var(--red); padding: 48px 24px; text-align: center;
}
.cta-final h2 { color: var(--white); font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.cta-final p { color: rgba(255,255,255,0.85); font-size: 15px; margin-bottom: 24px; }

/* Compat note inside specs section.
   11/08/2026: removido o tratamento "caixa cinza + risco colorido lateral"
   (padrão reconhecido de callout gerado por IA) — André apontou que o
   problema era o componente em si, não a posição da borda. Nota vira
   parágrafo integrado, só com um divisor fino no topo. */
.compat-note {
  font-size: 14px; color: var(--gray9); line-height: 1.8;
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--pg-border);
}
/* 07/08/2026: primeiro uso de <a> dentro de .compat-note (link pra artigo
   relacionado, eletroduto) — sem esta regra o link herdava a cor cinza do
   texto e ficava invisível como link (achado do André). */
.compat-note a { color: var(--red); font-weight: 600; text-decoration: underline; }
.compat-note a:hover { color: var(--red-dark); }

/* Pagination */
.pagination { padding: 40px 0; text-align: center; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--pg-body); background: var(--white);
  border: 1px solid var(--pg-divider); transition: var(--transition);
}
.pagination .page-numbers:hover { border-color: var(--red); color: var(--red); }
.pagination .page-numbers.current {
  background: var(--red); color: var(--white); border-color: var(--red);
}

/* ═══════════════════ SECTION BLOCK (generic) ═══════════════════ */
.section-block { padding: 48px 0; }
.section-block:nth-child(even) { background: var(--pg-bg); }

/* ═══════════════════ VISUAL DETAILS ═══════════════════ */

/* Technical grid overlay on hero */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background-image:
    linear-gradient(rgba(238,49,36,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,49,36,.05) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Slow zoom animation on hero bg */
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.06); } }
.hero-bg { animation: heroZoom 20s ease-in-out infinite alternate; }

/* Red corner accent on intro images */
.segment-intro-image { position: relative; }
.segment-intro-image::before {
  content: ''; position: absolute; top: -3px; left: -3px;
  width: 50px; height: 50px;
  border-top: 4px solid var(--red); border-left: 4px solid var(--red);
  border-radius: 12px 0 0 0; z-index: 2;
}

/* Stats banner (dark section) — reutilizado no hub de produtos e em páginas
   de segmento; a versão "fonte" completa vive em page-segment.css, mas essa
   página carrega só components.css, então a regra base fica duplicada aqui
   de propósito (valores idênticos — não diverge o design ao mudar um lado). */
.segment-numbers {
  padding: 56px 0; background: var(--dark-bg, #2b2b2b);
  position: relative; overflow: hidden;
}
.segment-numbers::before {
  content: ''; position: absolute;
  top: 0; right: -50px; width: 200px; height: 100%;
  background: linear-gradient(135deg, transparent 40%, var(--red, #EE3124) 40%, var(--red, #EE3124) 42%, transparent 42%);
  opacity: .12;
}
.numbers-grid { display: grid; gap: 32px; text-align: center; }

/* Vertical dividers between number items */
.number-item { position: relative; }
.number-item + .number-item::before {
  content: ''; position: absolute; left: -16px; top: 10%;
  width: 1px; height: 80%;
  background: rgba(255,255,255,.1);
}
.number-item .number-value {
  font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 700;
  color: var(--red, #EE3124); line-height: 1; margin-bottom: 8px;
}
.number-item .number-label { font-size: 13px; color: rgba(255,255,255,.55); }
@media (max-width: 768px) {
  .number-item + .number-item::before { display: none; }
}

/* Corner number in problem cards */
.problem-card { position: relative; overflow: hidden; }
.problem-card[data-num]::after {
  content: attr(data-num);
  position: absolute; top: 12px; right: 16px;
  font-size: 48px; font-weight: 700;
  color: var(--pg-border); line-height: 1;
}

/* Diagonal grid on CTA */
.cta-final { position: relative; overflow: hidden; }
.cta-final::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.04) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255,255,255,.04) 25%, transparent 25%);
  background-size: 40px 40px;
}
.cta-final > * { position: relative; }

/* Scroll-triggered fade-up animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { opacity: 0; animation: fadeUp .5s cubic-bezier(.4,0,.2,1) forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* Drop cap on first paragraph in intro */
.segment-intro-text p:first-child::first-letter {
  font-size: 3em; font-weight: 800; color: var(--red);
  float: left; line-height: .8; margin-right: 6px; margin-top: 4px;
}

/* Page width constraint.
   overflow-x: clip (não hidden) impede scroll horizontal SEM criar um scroll
   container — assim não quebra `position: sticky` (ex.: sidebar TOC das páginas
   de documento). `hidden` fica como fallback para browsers antigos. */
main, .site-content { max-width: 100%; overflow-x: hidden; overflow-x: clip; }

/* Call-out reutilizável em artigos (ex.: chamada para o diagnóstico/ferramenta) */
.article-callout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  background: var(--pg-bg, #f6f7f8); border: 1px solid var(--pg-border, #eaebed);
  border-left: 4px solid var(--red); border-radius: 12px;
  padding: 18px 22px; margin: 28px 0;
}
.article-callout p { margin: 0 !important; flex: 1 1 240px; font-weight: 600; color: var(--pg-heading, #2a2a2a); line-height: 1.5; }
.article-callout a.article-callout-btn {
  flex: 0 0 auto; background: var(--red) !important; color: #fff !important;
  padding: 12px 24px; border-radius: 50px; font-weight: 700; font-size: 14px;
  text-decoration: none !important; border: none !important; white-space: nowrap;
  transition: background .15s, transform .12s;
}
.article-callout a.article-callout-btn:hover { background: var(--red-dark, #CC2A1E) !important; transform: translateY(-1px); }

/* ═══════════════════ EMPTY CTA CARD (compact, horizontal) ═══════════════════ */
.empty-cta-card {
  display: flex; align-items: center; gap: 24px;
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform .15s, box-shadow .15s;
  max-width: 720px;
  margin: 0 auto;
}
.empty-cta-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.empty-cta-card > div { flex: 1; min-width: 0; }
.empty-cta-eyebrow {
  display: inline-block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); font-weight: 700; margin: 0 0 2px;
}
.empty-cta-title {
  font-size: 17px; font-weight: 700; line-height: 1.2;
  color: #001f3d; margin: 0 0 2px;
}
.empty-cta-text {
  font-size: 13px; color: #666; line-height: 1.4;
  margin: 0;
}
.empty-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); color: #fff;
  padding: 8px 14px; border-radius: 4px;
  font-weight: 700; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0; white-space: nowrap;
}
.empty-cta-card:hover .empty-cta-btn { background: #aa2c1c; }
@media (max-width: 600px) {
  .empty-cta-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px; }
  .empty-cta-btn { align-self: stretch; justify-content: center; }
}

@media (max-width: 600px) {
  .cta-final .container { display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .cta-final .btn-pill { width: 100%; justify-content: center; margin-left: 0 !important; }
}

/* A11y (WCAG 2.4.7): indicador de foco visível consistente por teclado.
   Baseline global — componentes com :focus-visible próprio têm precedência por especificidade. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.segment-card:focus-visible,
.product-tag:focus-visible,
.solution-card a:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid #EE3124;
  outline-offset: 2px;
  border-radius: 2px;
}
