/*
Theme Name: Decode Layer
Theme URI: https://decodelayer.com
Author: Decode Layer
Description: Tema WordPress do Decode Layer — blog de análises de eletroeletrônicos, gadgets e smart home. Convertido a partir do projeto React/Vite original para funcionar em qualquer hospedagem WordPress (incluindo Hostinger), com conteúdo, categorias e formulário de newsletter já prontos.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: decode-layer
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --background: 220 14% 7%;
  --foreground: 210 16% 92%;
  --surface: 220 12% 11%;
  --card: 220 12% 11%;
  --popover: 220 14% 9%;
  --code: 145 82% 48%;
  --code-soft: 145 45% 24%;
  --primary: 145 82% 48%;
  --primary-foreground: 220 20% 6%;
  --secondary: 220 10% 16%;
  --muted: 220 10% 16%;
  --muted-foreground: 215 12% 62%;
  --destructive: 0 72% 51%;
  --border: 220 10% 18%;
  --input: 220 10% 18%;
  --radius: 0.35rem;
  --max: 90rem;
  --max-narrow: 56rem;
}

* { box-sizing: border-box; }

.dl-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }
.dl-icon.fill { fill: hsl(var(--code)); stroke: hsl(var(--code)); }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-x: clip;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

.mono { font-family: 'JetBrains Mono', monospace; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 1024px) {
  .wrap { padding: 0 2.5rem; }
  .wrap-narrow { padding: 0; }
}

.border-y { border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.surface { background: hsl(var(--surface)); }

.grid-bg {
  background-image:
    linear-gradient(hsl(var(--border) / 0.55) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.55) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.8);
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.logo { display: flex; align-items: center; gap: 0.65rem; }
.logo-mark {
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--code) / 0.4);
  background: hsl(var(--code) / 0.1);
  color: hsl(var(--code));
}
.logo-text { font-family: 'JetBrains Mono', monospace; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.logo-text span { color: hsl(var(--code)); }

.primary-nav { display: none; align-items: center; gap: 1.5rem; }
@media (min-width: 1024px) { .primary-nav { display: flex; } }
.primary-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  transition: color .15s;
}
.primary-nav a:hover, .primary-nav a.current { color: hsl(var(--code)); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-newsletter-link {
  display: none;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--code) / 0.5);
  padding: 0.5rem 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--code));
}
@media (min-width: 1024px) { .btn-newsletter-link { display: inline-block; } }
.btn-newsletter-link:hover { background: hsl(var(--code) / 0.1); }

.menu-toggle {
  display: grid;
  place-items: center;
  height: 2.75rem;
  width: 2.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
}
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.mobile-nav { display: none; border-top: 1px solid hsl(var(--border)); background: hsl(var(--surface)); padding: 0.75rem 1.25rem; }
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  padding: 0.75rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
}
@media (min-width: 1024px) { .mobile-nav { display: none !important; } }

/* ---------- Buttons ---------- */
.btn-affiliate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  background: hsl(var(--code));
  padding: 0.85rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: hsl(var(--primary-foreground));
  box-shadow: 0 0 0 1px hsl(var(--code) / 0.4);
  transition: transform .15s;
  border: none;
}
.btn-affiliate:hover { transform: translateY(-1px); }
.btn-affiliate.block { width: 100%; }

.btn-outline {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--surface));
  padding: 0 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-outline:hover { border-color: hsl(var(--code) / 0.6); }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; padding: 4rem 1.25rem; }
@media (min-width: 1024px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; padding: 6rem 2.5rem; min-height: 86dvh; }
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--code) / 0.4);
  background: hsl(var(--code) / 0.1);
  padding: 0.4rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--code));
}
.hero h1 {
  margin: 1.5rem 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-size: 1.9rem;
}
@media (min-width: 640px) { .hero h1 { font-size: 2.25rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.1rem; } }
.hero p.lead { margin-top: 1.25rem; max-width: 36rem; font-size: 1.05rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.hero-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.hero-stats {
  margin-top: 2.25rem;
  display: grid;
  max-width: 32rem;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid hsl(var(--border));
  padding-top: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.hero-stats div { padding: 0 1rem; border-left: 1px solid hsl(var(--border)); }
.hero-stats div:first-child { border-left: none; padding-left: 0; }
.hero-stats dd { margin: 0.35rem 0 0; font-size: 1.15rem; color: hsl(var(--foreground)); display: flex; align-items: center; gap: 0.3rem; }
.hero-stats dt { margin: 0; }
.hero-image-wrap { position: relative; }
.hero-image-frame { position: absolute; inset: -0.75rem; border-radius: var(--radius); border: 1px solid hsl(var(--code) / 0.2); }
.hero-image-wrap img { position: relative; height: 300px; width: 100%; border-radius: var(--radius); border: 1px solid hsl(var(--border)); object-fit: cover; }
@media (min-width: 1024px) { .hero-image-wrap img { height: 520px; } }

/* ---------- Marquee ---------- */
.marquee-wrap { overflow: hidden; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--surface)); padding: 0.75rem 0; }
.marquee-track { display: flex; width: max-content; gap: 2rem; animation: marquee 22s linear infinite; }
.marquee-track span { display: flex; align-items: center; gap: 2rem; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.25em; color: hsl(var(--muted-foreground)); }
.marquee-track span em { color: hsl(var(--code)); font-style: normal; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-25%); } }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid hsl(var(--border)); padding-bottom: 1rem; }
.section-head h2 { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.03em; }
.section-head .count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: hsl(var(--muted-foreground)); }

.post-grid { margin-top: 2rem; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--surface)); transition: border-color .15s; }
.post-card:hover { border-color: hsl(var(--code) / 0.5); }
.post-card .thumb { display: block; overflow: hidden; height: 12rem; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .thumb img { transform: scale(1.03); }
.post-card-body { display: flex; flex: 1; flex-direction: column; gap: 0.75rem; padding: 1.25rem; }
.post-meta-row { display: flex; align-items: center; gap: 0.75rem; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.post-meta-row .cat { color: hsl(var(--code)); }
.post-meta-row .rating { margin-left: auto; display: inline-flex; align-items: center; gap: 0.25rem; color: hsl(var(--foreground)); }
.post-card h3 { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.post-card h3 a:hover { color: hsl(var(--code)); }
.post-card p.excerpt { margin: 0; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.post-card .read-more { margin-top: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-family: 'JetBrains Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--code)); }

/* ---------- Newsletter ---------- */
.newsletter-section { border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--surface)); }
.newsletter-section .inner { max-width: 72rem; margin: 0 auto; padding: 3.5rem 1.25rem; display: grid; gap: 2rem; }
@media (min-width: 1024px) { .newsletter-section .inner { grid-template-columns: 1fr 1fr; align-items: center; padding: 3.5rem 2.5rem; } }
.newsletter-section h2 { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; line-height: 1.4; margin: 0; }
.newsletter-section h2 em { color: hsl(var(--code)); font-style: normal; }
.newsletter-section p { margin-top: 0.75rem; font-size: 14px; color: hsl(var(--muted-foreground)); }

.dl-newsletter-form .row { display: flex; flex-direction: column; gap: 0.5rem; }
@media (min-width: 640px) { .dl-newsletter-form .row { flex-direction: row; } }
.dl-newsletter-form input[type="email"] {
  flex: 1; min-height: 48px; border-radius: var(--radius); border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); padding: 0 1rem; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: hsl(var(--foreground));
}
.dl-newsletter-form input[type="email"]::placeholder { color: hsl(var(--muted-foreground) / 0.7); }
.dl-newsletter-form input[type="email"]:focus { outline: none; border-color: hsl(var(--code)); }
.dl-newsletter-form button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); background: hsl(var(--code)); border: none; padding: 0 1.25rem;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: hsl(var(--primary-foreground));
}
.dl-newsletter-form button:disabled { opacity: 0.7; }
.dl-newsletter-form .hint { margin-top: 0.5rem; font-size: 12px; color: hsl(var(--muted-foreground)); }
.dl-newsletter-form .err { margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: hsl(var(--destructive)); }
.dl-newsletter-done { display: flex; align-items: center; gap: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: hsl(var(--code)); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid hsl(var(--primary-foreground) / 0.4); border-top-color: hsl(var(--primary-foreground)); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Categorias (home) ---------- */
.category-list { margin-top: 2rem; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.category-list a { display: flex; flex-direction: column; gap: 0.25rem; padding: 1.5rem 0; border-bottom: 1px solid hsl(var(--border)); transition: background .15s; }
.category-list a:last-child { border-bottom: none; }
.category-list a:hover { background: hsl(var(--surface) / 0.6); }
@media (min-width: 640px) { .category-list a { flex-direction: row; align-items: center; justify-content: space-between; } }
.category-list h3 { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; }
.category-list a:hover h3 { color: hsl(var(--code)); }
.category-list p { margin: 0.25rem 0 0; font-size: 14px; color: hsl(var(--muted-foreground)); }
.category-list .count { font-family: 'JetBrains Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--code)); }

/* ---------- Page/Post headers ---------- */
.page-header { padding: 3.5rem 0; }
.page-header h1 { margin: 0.75rem 0 0; font-family: 'JetBrains Mono', monospace; font-size: 2rem; }
@media (min-width: 1024px) { .page-header h1 { font-size: 2.4rem; } }
.page-header p { margin-top: 0.75rem; max-width: 42rem; color: hsl(var(--muted-foreground)); }

.post-header { padding: 3.5rem 0; }
.post-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.post-meta-line .cat { color: hsl(var(--code)); }
.post-meta-line .muted { color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; gap: 0.35rem; }
.post-header h1 { margin: 1.25rem 0 0; font-family: 'JetBrains Mono', monospace; font-weight: 700; line-height: 1.15; font-size: 1.85rem; }
@media (min-width: 1024px) { .post-header h1 { font-size: 2.6rem; } }
.post-header .lead { margin-top: 1rem; font-size: 1.1rem; color: hsl(var(--muted-foreground)); }
.post-header .kw { margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: hsl(var(--muted-foreground) / 0.7); }

.post-hero-img { margin-top: 2.5rem; height: 240px; width: 100%; border-radius: var(--radius); border: 1px solid hsl(var(--border)); object-fit: cover; }
@media (min-width: 1024px) { .post-hero-img { height: 420px; } }

.box-code { margin-top: 2rem; border-radius: var(--radius); border: 1px solid hsl(var(--code) / 0.4); background: hsl(var(--code) / 0.05); padding: 1.25rem; }
.box-code .label { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--code)); }
.box-code p { margin-top: 0.5rem; font-size: 14px; color: hsl(var(--muted-foreground)); }
.box-code .cta { margin-top: 1rem; }

/* ---------- Prose (conteúdo do post) ---------- */
.prose-decode p { margin-bottom: 1.15rem; line-height: 1.8; color: hsl(var(--foreground) / 0.86); }
.prose-decode h2 { font-family: 'JetBrains Mono', monospace; font-size: 1.35rem; margin: 2.25rem 0 1rem; color: hsl(var(--foreground)); }
.prose-decode h3 { font-weight: 600; font-size: 1.1rem; margin: 1.75rem 0 0.75rem; }
.prose-decode ul { list-style: none; margin-bottom: 1.25rem; }
.prose-decode li { position: relative; padding-left: 1.35rem; margin-bottom: 0.5rem; color: hsl(var(--foreground) / 0.86); }
.prose-decode li::before { content: '>'; position: absolute; left: 0; font-family: 'JetBrains Mono', monospace; color: hsl(var(--code)); }
.prose-decode a { color: hsl(var(--code)); text-decoration: underline; }

/* ---------- Tabela comparativa ---------- */
.compare-wrap { margin: 2.5rem 0; overflow-x: auto; border-radius: var(--radius); border: 1px solid hsl(var(--border)); }
.compare-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.compare-wrap caption { border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--surface)); padding: 0.75rem 1rem; text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--code)); }
.compare-wrap thead tr { background: hsl(var(--surface)); font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-wrap th, .compare-wrap td { padding: 0.75rem 1rem; text-align: left; }
.compare-wrap th:first-child { color: hsl(var(--muted-foreground)); }
.compare-wrap tbody tr { border-top: 1px solid hsl(var(--border)); }
.compare-wrap tbody td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: hsl(var(--muted-foreground)); }
.compare-cta { border-top: 1px solid hsl(var(--border)); background: hsl(var(--surface)); padding: 1rem; }

/* ---------- Prós/Contras ---------- */
.pros-cons { margin: 2.5rem 0; display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .pros-cons { grid-template-columns: 1fr 1fr; } }
.pros-cons .box { border-radius: var(--radius); background: hsl(var(--surface)); padding: 1.25rem; border: 1px solid hsl(var(--border)); }
.pros-cons .box.pros { border-color: hsl(var(--code) / 0.35); }
.pros-cons h3 { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.pros-cons .box.pros h3 { color: hsl(var(--code)); }
.pros-cons .box.cons h3 { color: hsl(var(--muted-foreground)); }
.pros-cons ul { margin-top: 0.75rem; list-style: none; }
.pros-cons li { margin-bottom: 0.5rem; font-size: 14px; color: hsl(var(--muted-foreground)); }

/* ---------- Not found ---------- */
.not-found { max-width: 56rem; margin: 0 auto; padding: 7rem 1.25rem; text-align: center; }
.not-found h1 { font-family: 'JetBrains Mono', monospace; font-size: 1.75rem; margin: 0; }
.not-found p { margin-top: 0.75rem; color: hsl(var(--muted-foreground)); }
.not-found .back { margin-top: 1.5rem; display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: hsl(var(--code)); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 6rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--surface)); }
.site-footer .cols { max-width: var(--max); margin: 0 auto; display: grid; gap: 2.5rem; padding: 3.5rem 1.25rem; }
@media (min-width: 1024px) { .site-footer .cols { grid-template-columns: repeat(4, 1fr); padding: 3.5rem 2.5rem; } }
.site-footer .about p { margin-top: 1rem; max-width: 20rem; font-size: 14px; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.site-footer h4 { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--code)); }
.site-footer ul { margin-top: 1rem; }
.site-footer li { margin-bottom: 0.5rem; font-size: 14px; color: hsl(var(--muted-foreground)); }
.site-footer li a:hover { color: hsl(var(--foreground)); }
.footer-bottom { border-top: 1px solid hsl(var(--border)); padding: 1.5rem 1.25rem; }
@media (min-width: 1024px) { .footer-bottom { padding: 1.5rem 2.5rem; } }
.footer-bottom .in { max-width: var(--max); margin: 0 auto; }
.footer-bottom p { margin: 0.35rem 0; font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.footer-bottom p.copy { color: hsl(var(--muted-foreground) / 0.7); }

/* ---------- Related posts ---------- */
.related-head { border-bottom: 1px solid hsl(var(--border)); padding-bottom: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.03em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
