/* ============================================================
   theme.css — estilos complementares ao Tailwind (utilitários
   do tema que não fazem sentido como classes inline)
   ============================================================ */

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --color-primary: #22b483;
  --color-primary-dark: #15926a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
}

/* Esconde elementos até o Alpine inicializar, evitando "flash" de conteúdo */
[x-cloak] {
  display: none !important;
}

/* ---------- Scrollbar customizada ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(34, 180, 131, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(34, 180, 131, 0.6);
}

/* ---------- Seleção de texto ---------- */
::selection {
  background-color: rgba(34, 180, 131, 0.25);
}

/* ---------- Offset de âncoras (compensa navbar fixa) ---------- */
section[id] {
  scroll-margin-top: 5.5rem;
}

/* ---------- Scroll reveal (usado em conjunto com theme.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respeita usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Cursor de digitação do terminal no hero ---------- */
#typed-command {
  white-space: pre;
}

/* ---------- Cartões com leve brilho ao passar o mouse ---------- */
.glow-hover {
  position: relative;
  isolation: isolate;
}
.glow-hover::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-primary), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}
.glow-hover:hover::before {
  opacity: 1;
}

/* ---------- Blocos de código (Prism.js) ---------- */
/* Selectors compartilhados entre o conteúdo rico dos artigos (.entry-content) e os
   cards "Carbon" de snippets/dicas (.carbon-card) — mesmo visual nos dois lugares.
   Fundo um pouco mais escuro que o dark:bg-ink-900 (#1a1a1f) do card por fora,
   pra dar profundidade e não confundir "card" com "caixa de código" no dark mode. */
.entry-content pre[class*="language-"],
.carbon-card pre[class*="language-"] {
  background: #121216;
  color: #e2e2e5;
  margin-top: 0;
  margin-bottom: 0;
  padding: 1.1em 1.25em;
  border-radius: 0.75em;
  font-size: 0.85em;
  line-height: 1.6;
  overflow-x: auto;
}
.entry-content pre[class*="language-"].line-numbers,
.carbon-card pre[class*="language-"].line-numbers {
  padding-left: 3.4em;
}
.entry-content code[class*="language-"],
.carbon-card code[class*="language-"] {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- "Janela" estilo Carbon (bolinhas + linguagem), só em CSS ---------- */
.entry-content pre[class*="language-"],
.carbon-card pre[class*="language-"] {
  position: relative;
  padding-top: 2.5rem;
}
.entry-content pre[class*="language-"]::before,
.carbon-card pre[class*="language-"]::before {
  content: "";
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 1.35rem 0 0 #ffbd2e, 2.7rem 0 0 #27c93f;
  z-index: 2;
}
.entry-content pre[class*="language-"]::after,
.carbon-card pre[class*="language-"]::after {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5rem;
  line-height: 2.5rem;
  padding-right: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.75em 0.75em 0 0;
  color: #75757f;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  box-sizing: border-box;
}

/* Numeração de linhas */
.entry-content .line-numbers .line-numbers-rows,
.carbon-card .line-numbers .line-numbers-rows {
  border-right: 1px solid #37373f;
  padding: 1.1em 0.6em 1.1em 0;
}
.entry-content .line-numbers-rows > span:before,
.carbon-card .line-numbers-rows > span:before {
  color: #5a5a64;
}

/* Barra de ferramentas / botão de copiar */
.entry-content div.code-toolbar,
.carbon-card div.code-toolbar {
  position: relative;
}
.entry-content div.code-toolbar > .toolbar,
.carbon-card div.code-toolbar > .toolbar {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.entry-content div.code-toolbar:hover > .toolbar,
.carbon-card div.code-toolbar:hover > .toolbar {
  opacity: 1;
}
.entry-content div.code-toolbar > .toolbar .toolbar-item button,
.carbon-card div.code-toolbar > .toolbar .toolbar-item button {
  background: #26262c;
  color: #aef1d2;
  border: 1px solid #37373f;
  border-radius: 0.4em;
  padding: 0.3em 0.7em;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  cursor: pointer;
}
.entry-content div.code-toolbar > .toolbar .toolbar-item button:hover,
.carbon-card div.code-toolbar > .toolbar .toolbar-item button:hover {
  background: #15926a;
  color: #ffffff;
  border-color: #15926a;
}

/* Cores dos tokens, na paleta do site (quando houver linguagem detectada) */
.entry-content .token.comment, .carbon-card .token.comment,
.entry-content .token.prolog, .carbon-card .token.prolog,
.entry-content .token.doctype, .carbon-card .token.doctype,
.entry-content .token.cdata, .carbon-card .token.cdata {
  color: #75757f;
  font-style: italic;
}
.entry-content .token.punctuation,
.carbon-card .token.punctuation {
  color: #9d9da7;
}
.entry-content .token.property, .carbon-card .token.property,
.entry-content .token.tag, .carbon-card .token.tag,
.entry-content .token.boolean, .carbon-card .token.boolean,
.entry-content .token.number, .carbon-card .token.number,
.entry-content .token.constant, .carbon-card .token.constant,
.entry-content .token.symbol, .carbon-card .token.symbol {
  color: #78e4b8;
}
.entry-content .token.selector, .carbon-card .token.selector,
.entry-content .token.attr-name, .carbon-card .token.attr-name,
.entry-content .token.string, .carbon-card .token.string,
.entry-content .token.char, .carbon-card .token.char,
.entry-content .token.builtin, .carbon-card .token.builtin {
  color: #aef1d2;
}
.entry-content .token.operator, .carbon-card .token.operator,
.entry-content .token.entity, .carbon-card .token.entity,
.entry-content .token.url, .carbon-card .token.url,
.entry-content .token.variable, .carbon-card .token.variable {
  color: #e2e2e5;
}
.entry-content .token.keyword, .carbon-card .token.keyword,
.entry-content .token.atrule, .carbon-card .token.atrule,
.entry-content .token.attr-value, .carbon-card .token.attr-value {
  color: #43cf9b;
  font-weight: 600;
}
.entry-content .token.function, .carbon-card .token.function,
.entry-content .token.class-name, .carbon-card .token.class-name {
  color: #d5f9e7;
}