/*
Theme Name: Top Tecnologia
Theme URI: https://toptecnologia.blog/
Author: Design Master Solutions
Description: Tema para blog de listas e comparativos de produtos. Linguagem de ficha tecnica: dados tabulares, grid de precisao e leitura confortavel em artigo longo.
Version: 2.1.0
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: toptec
*/

/* Direcao: datasheet — a ficha tecnica de componente, documento nativo do
 * assunto e exatamente o que um comparativo de produto e.
 * display: Space Grotesk · body: IBM Plex Sans · dados: JetBrains Mono
 * signature: spec strip + barra que desenha a nota em vez de so escrever
 * escuro por padrao, claro automatico quando o sistema pede.
 */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  color-scheme: dark light;

  --bg:     #0b0a12;
  --bg-2:   #14131f;
  --bg-3:   #1c1a2a;
  --line:   #262436;
  --line-2: #35324a;

  --fg:   #e8e6f0;
  --fg-2: #a9a5bd;
  --fg-3: #6f6b86;

  /* sinal — violeta da marca */
  --accent:     #8b5cf6;
  --accent-hi:  #a78bfa;
  --accent-dim: #2a1f52;
  --accent-ink: #0b0a12;

  /* dado medido — ciano, so em numero e barra */
  --data:     #22d3ee;
  --data-dim: #0e3b47;

  --amz:     #ff9900;
  --amz-ink: #1a1206;
  --ml:      #ffe600;
  --ml-ink:  #1f2033;

  --f-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-body:    "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --t-xs:   0.75rem;
  --t-sm:   0.8125rem;
  --t-base: 1.0625rem;
  --t-md:   1.1875rem;
  --t-lg:   1.4375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-hero: clamp(2.5rem, 6vw, 4.5rem);

  --s-2xs: 0.25rem;
  --s-xs:  0.5rem;
  --s-sm:  0.75rem;
  --s-md:  1rem;
  --s-lg:  1.5rem;
  --s-xl:  2.25rem;
  --s-2xl: 3.5rem;
  --s-3xl: 5.5rem;

  --measure: 68ch;
  --wide:    1200px;
  --gut:     1.5rem;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 130ms;
  --base: 240ms;
}

/* Claro — quando o sistema pede. Mesmos papeis, superficie invertida. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfaff; --bg-2: #f3f2f9; --bg-3: #eae8f3;
    --line: #e0dded; --line-2: #cbc7dd;
    --fg: #16141f; --fg-2: #4d4960; --fg-3: #7b7691;
    --accent: #6d28d9; --accent-hi: #5b21b6; --accent-dim: #f1ebff; --accent-ink: #ffffff;
    --data: #0e7490; --data-dim: #d8f2f8;
  }
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-hi); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
@media (prefers-color-scheme: light) {
  a { color: var(--accent); }
  a:hover { color: var(--accent-hi); }
}

:focus-visible { outline: 2px solid var(--data); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--f-display); font-weight: 700; font-style: normal;
  line-height: 1.12; letter-spacing: -0.025em; margin: 0;
  text-wrap: balance; overflow-wrap: anywhere;
}
p, ul, ol { margin: 0 0 var(--s-md); }

.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; }

.skip-link {
  position: absolute; left: var(--s-md); top: -100px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s-sm) var(--s-md); border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: var(--t-sm); text-decoration: none;
}
.skip-link:focus { top: var(--s-md); }

/* rotulo de instrumento */
.tag {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-hi);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap  { width: min(100% - (var(--gut) * 2), var(--wide));    margin-inline: auto; }
.prose { width: min(100% - (var(--gut) * 2), var(--measure)); margin-inline: auto; }

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) { .masthead { background: var(--bg); } }

.masthead__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-md); padding-block: var(--s-sm);
}

.masthead__brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--fg); }
.masthead__brand:hover { color: var(--fg); }
.masthead__mark {
  font-family: var(--f-display); font-weight: 700; font-size: var(--t-md);
  letter-spacing: -0.04em; line-height: 1;
}
/* o ponto da marca vira um LED de status */
.masthead__mark em {
  font-style: normal; color: var(--accent-hi);
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.masthead__tag {
  font-family: var(--f-mono); font-size: var(--t-xs);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3);
}

.masthead__list {
  display: flex; flex-wrap: wrap; gap: var(--s-xs) var(--s-md);
  align-items: center; list-style: none; padding: 0; margin: 0;
}
.masthead__list li { margin: 0; }
.masthead__nav a {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-2); text-decoration: none; white-space: nowrap;
  padding: 0.3rem 0.1rem; border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.masthead__nav a:hover { color: var(--accent-hi); border-bottom-color: var(--accent); }
.masthead__nav .current-menu-item > a { color: var(--fg); border-bottom-color: var(--data); }

/* ============================================================
   SPEC STRIP — assinatura do tema
   ============================================================ */
/* O gap de 1px mostrando o fundo faz as divisorias — funciona com qualquer
   numero de colunas que o auto-fit resolver, inclusive quebrando em duas
   linhas no celular. Borda por celula erraria nas quebras. */
.spec {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.spec__cell { padding: var(--s-sm) var(--s-md); background: var(--bg-2); min-width: 0; }
.spec__k {
  display: block; font-family: var(--f-mono); font-size: var(--t-xs);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3);
  margin-bottom: 0.15rem;
}
.spec__v {
  display: block; font-family: var(--f-mono); font-size: var(--t-md); font-weight: 500;
  color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.2;
  overflow-wrap: anywhere;
}
.spec__v--data { color: var(--data); }

/* ============================================================
   HOME
   ============================================================ */
.lede { padding: var(--s-3xl) 0 var(--s-2xl); position: relative; isolation: isolate; }

/* grade de precisao — so no topo, com mascara, para nao virar papel de parede */
.lede::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 18% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 70% at 18% 0%, #000 0%, transparent 72%);
  opacity: 0.55;
}

.lede__title { font-size: var(--t-hero); max-width: 14ch; margin-block: var(--s-sm) var(--s-md); }
.lede__sub { font-size: var(--t-md); color: var(--fg-2); max-width: 54ch; margin-bottom: var(--s-xl); }

.section { padding-block: var(--s-2xl); border-top: 1px solid var(--line); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-md); margin-bottom: var(--s-xl); flex-wrap: wrap;
}
.section__title { font-size: var(--t-xl); }
.section__note {
  font-family: var(--f-mono); font-size: var(--t-xs); color: var(--fg-3);
  letter-spacing: 0.1em; text-transform: uppercase;
}

.featured { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-xl); align-items: start; }
.featured__media {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-2); aspect-ratio: 16 / 9; display: block;
}
.featured__media img { width: 100%; height: 100%; object-fit: cover; }
.featured__title { font-size: var(--t-2xl); margin-block: var(--s-sm); }
.featured__title a { color: inherit; text-decoration: none; }
.featured__title a:hover { color: var(--accent-hi); }
.featured__excerpt { color: var(--fg-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); gap: var(--s-xl) var(--s-lg); }
.card { display: flex; flex-direction: column; gap: var(--s-sm); min-width: 0; }
.card__media {
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-2); aspect-ratio: 3 / 2; display: block;
  transition: border-color var(--base) var(--ease);
}
.card:hover .card__media { border-color: var(--line-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--base) var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__title { font-size: var(--t-md); line-height: 1.28; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--accent-hi); }
.card__meta { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--fg-3); letter-spacing: 0.06em; }
.card__excerpt { font-size: var(--t-sm); color: var(--fg-2); margin: 0; }

.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: var(--s-lg); }
.track { border-top: 1px solid var(--line-2); padding-top: var(--s-sm); min-width: 0; }
.track__name { font-family: var(--f-display); font-size: var(--t-md); margin-bottom: 0.15rem; }
.track__name a { color: inherit; text-decoration: none; }
.track__name a:hover { color: var(--accent-hi); }
.track__count { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--fg-3); letter-spacing: 0.08em; }
.track ul { list-style: none; padding: 0; margin: var(--s-sm) 0 0; }
.track li { margin-bottom: var(--s-xs); font-size: var(--t-sm); line-height: 1.45; }
.track li a { color: var(--fg-2); text-decoration: none; }
.track li a:hover { color: var(--accent-hi); }

/* ============================================================
   ARTIGO
   ============================================================ */
.article__header { padding: var(--s-2xl) 0 var(--s-lg); }
.article__title { font-size: clamp(2rem, 4.5vw, 3.25rem); max-width: 19ch; margin-block: var(--s-sm) var(--s-md); }
.article__standfirst { font-size: var(--t-md); color: var(--fg-2); max-width: 58ch; margin-bottom: var(--s-lg); }
.article__hero { margin: var(--s-lg) auto var(--s-2xl); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }

.entry-content { font-size: var(--t-base); }
.entry-content > * { width: min(100% - (var(--gut) * 2), var(--measure)); margin-inline: auto; }
.entry-content h2 {
  font-size: var(--t-xl); margin: var(--s-2xl) auto var(--s-md);
  padding-top: var(--s-md); border-top: 1px solid var(--line);
}
.entry-content h3 { font-size: var(--t-lg); margin: var(--s-xl) auto var(--s-sm); }
.entry-content p { margin-bottom: var(--s-md); }
.entry-content ul, .entry-content ol { padding-left: 1.35em; margin-bottom: var(--s-md); }
.entry-content li { margin-bottom: var(--s-xs); }
.entry-content li::marker { color: var(--accent); }
.entry-content strong { color: var(--fg); font-weight: 600; }
.entry-content blockquote { border-left: 2px solid var(--accent); padding-left: var(--s-md); color: var(--fg-2); font-style: normal; }
.entry-content figure { margin: var(--s-xl) auto; }
.entry-content figcaption { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--fg-3); margin-top: var(--s-xs); }
.entry-content img { border-radius: var(--r-md); }
.entry-content code {
  font-family: var(--f-mono); font-size: 0.9em;
  background: var(--bg-3); color: var(--data);
  padding: 0.12em 0.35em; border-radius: var(--r-sm);
}
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-2xl) auto; }

/* ============================================================
   LISTA DE PRODUTO
   ============================================================ */
.tt-aviso {
  width: min(100% - (var(--gut) * 2), var(--measure)); margin: 0 auto var(--s-xl);
  padding: var(--s-md) var(--s-lg);
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--t-sm); color: var(--fg-2); line-height: 1.65;
}
.tt-aviso strong { color: var(--fg); }

.tt-produto {
  width: min(100% - (var(--gut) * 2), var(--measure)); margin: var(--s-xl) auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-2); overflow: hidden;
  transition: border-color var(--base) var(--ease);
}
.tt-produto:hover { border-color: var(--line-2); }
.tt-produto__topo { display: flex; gap: var(--s-lg); align-items: flex-start; padding: var(--s-lg); }

.tt-produto__foto {
  flex: 0 0 150px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; padding: var(--s-xs);
  display: flex; align-items: center; justify-content: center;
}
.tt-produto__foto img { width: 100%; border-radius: 0; }

.tt-produto__dados { flex: 1; min-width: 0; }
.tt-produto__dados > p:last-of-type { margin-bottom: 0; }

.tt-selo {
  display: inline-block; font-family: var(--f-mono); font-size: var(--t-xs);
  font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-hi); background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 0.25rem 0.55rem; border-radius: var(--r-sm); margin-bottom: var(--s-sm);
}

/* nota como leitura de instrumento: a barra desenha o valor */
.tt-nota {
  display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap;
  font-family: var(--f-mono); font-size: var(--t-sm); color: var(--fg-3);
  margin-bottom: var(--s-sm);
}
.tt-nota strong { color: var(--data); font-weight: 500; font-variant-numeric: tabular-nums; }
.tt-barra {
  --v: 94%;
  flex: 0 0 84px; height: 5px; border-radius: 99px;
  background: var(--data-dim); position: relative; overflow: hidden;
}
.tt-barra::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v);
  background: var(--data); border-radius: inherit;
}

.tt-botoes { display: flex; flex-wrap: wrap; gap: var(--s-xs); margin-top: var(--s-md); }
.tt-btn {
  display: inline-block; padding: 0.65rem 1.1rem; border-radius: var(--r-sm);
  font-family: var(--f-mono); font-weight: 500; font-size: var(--t-sm);
  letter-spacing: 0.04em; text-decoration: none; line-height: 1.25;
  border: 1px solid transparent;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.tt-btn:hover { transform: translateY(-1px); }
.tt-btn:active { transform: translateY(0); }
.tt-btn--amz { background: var(--amz); color: var(--amz-ink) !important; }
.tt-btn--amz:hover { box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--amz) 55%, transparent); }
.tt-btn--ml { background: var(--ml); color: var(--ml-ink) !important; }
.tt-btn--ml:hover { box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--ml) 55%, transparent); }

.tt-vozes {
  width: min(100% - (var(--gut) * 2), var(--measure)); margin: var(--s-lg) auto;
  padding: var(--s-md) var(--s-lg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.tt-vozes h4 {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3);
  margin-bottom: var(--s-md);
}
.tt-voz { margin: 0 0 var(--s-md); padding-left: var(--s-md); border-left: 1px solid var(--line-2); font-size: var(--t-sm); color: var(--fg-2); }
.tt-voz:last-child { margin-bottom: 0; }
.tt-voz__meta { display: block; font-family: var(--f-mono); font-size: var(--t-xs); color: var(--fg-3); margin-top: var(--s-2xs); letter-spacing: 0.05em; }

.tt-tabela-wrap {
  width: min(100% - (var(--gut) * 2), 960px); margin: var(--s-xl) auto;
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md);
}
.tt-tabela { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 640px; }
.tt-tabela th, .tt-tabela td { padding: var(--s-sm) var(--s-md); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tt-tabela thead th {
  background: var(--bg-3); color: var(--fg-2);
  font-family: var(--f-mono); font-weight: 500; font-size: var(--t-xs);
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
.tt-tabela tbody tr:last-child td { border-bottom: 0; }
.tt-tabela tbody tr:hover { background: var(--bg-3); }
.tt-tabela td { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.tt-tabela td:first-child { color: var(--fg); font-weight: 600; }

/* ============================================================
   ARQUIVO
   ============================================================ */
.archive-head { padding: var(--s-2xl) 0 var(--s-lg); border-bottom: 1px solid var(--line); }
.archive-head h1 { font-size: var(--t-2xl); margin-top: var(--s-sm); }
.archive-head p { color: var(--fg-2); margin-top: var(--s-sm); max-width: 56ch; }

.pagination { display: flex; flex-wrap: wrap; gap: var(--s-xs); justify-content: center; padding-block: var(--s-2xl); }
.pagination .page-numbers {
  display: inline-block; min-width: 2.5rem; text-align: center;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: var(--t-sm); text-decoration: none; color: var(--fg-2);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent-hi); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   RODAPE
   ============================================================ */
.colophon { border-top: 1px solid var(--line); margin-top: var(--s-3xl); padding-block: var(--s-2xl) var(--s-xl); background: var(--bg-2); }
.colophon__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: var(--s-xl); }
.colophon__about { font-size: var(--t-sm); color: var(--fg-2); margin-top: var(--s-sm); max-width: 40ch; }
.colophon h3 { font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: var(--s-sm); }
.colophon ul { list-style: none; padding: 0; margin: 0; }
.colophon li { margin-bottom: var(--s-xs); font-size: var(--t-sm); }
.colophon li a { color: var(--fg-2); text-decoration: none; }
.colophon li a:hover { color: var(--accent-hi); }
.colophon__legal {
  margin-top: var(--s-xl); padding-top: var(--s-md); border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--fg-3); line-height: 1.7;
}
.colophon__legal code { font-family: var(--f-mono); color: var(--fg-2); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
  .featured { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --gut: 1.15rem; --t-hero: clamp(2.1rem, 9vw, 2.75rem); }
  .masthead { position: static; }
  .masthead__top { flex-direction: column; align-items: flex-start; gap: var(--s-xs); }
  .tt-produto__topo { flex-direction: column; padding: var(--s-md); }
  .tt-produto__foto { flex: none; width: min(180px, 55%); margin-inline: auto; }
  .tt-btn { flex: 1 1 100%; text-align: center; }
  .section { padding-block: var(--s-xl); }
  .lede { padding-top: var(--s-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .card:hover .card__media img { transform: none; }
  .tt-btn:hover { transform: none; }
}

/* link de "ver tudo" no fim de uma secao */
.ver-tudo { margin: var(--s-xl) 0 0; }
.ver-tudo a {
  font-family: var(--f-mono); font-size: var(--t-sm); letter-spacing: 0.06em;
  text-decoration: none; color: var(--accent-hi);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 2px;
  transition: border-color var(--fast) var(--ease);
}
.ver-tudo a:hover { border-bottom-color: var(--accent); }
