/* ==========================================================================
   NEOTEC — CORE
   Design tokens, fontes, reset, tipografia, layout base, botões, formulários.
   Toda cor/fonte/espaçamento do tema deve sair daqui (variáveis abaixo).
   ========================================================================== */

/* ---------- Fontes (auto-hospedadas, OFL) ---------- */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/geist-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-latin-ext-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20C0, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Superfícies */
  --c-ink: #0d0e11;          /* fundo escuro principal (hero, header, footer, CTA) */
  --c-ink-2: #15171b;        /* superfície escura elevada */
  --c-ink-3: #1e2127;        /* bordas/itens sobre escuro */
  --c-paper: #f6f5f1;        /* fundo claro principal */
  --c-sand: #ecebe5;         /* fundo claro secundário (code, chips) */
  --c-surface: #ffffff;      /* cards */

  /* Texto */
  --c-text: #17191d;
  --c-text-muted: #5b5f68;
  --c-text-subtle: #8a8d95;
  --c-on-dark: #f2f1ec;
  --c-on-dark-muted: rgba(242, 241, 236, .64);
  --c-on-dark-subtle: rgba(242, 241, 236, .42);

  /* Linhas */
  --c-line: rgba(13, 14, 17, .10);
  --c-line-strong: rgba(13, 14, 17, .20);
  --c-line-dark: rgba(242, 241, 236, .12);

  /* Destaque (alterável no Personalizar → Identidade visual) */
  --c-accent: #d4813a;
  --c-accent-strong: #a95e1f;   /* texto de destaque sobre fundo claro (AA) */
  --c-accent-soft: rgba(212, 129, 58, .12);
  --c-on-accent: #0d0e11;

  /* Estados */
  --c-success: #2f8a57;
  --c-danger: #b42318;
  --c-focus: var(--c-accent);

  /* Tipografia */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: .6875rem;  /* 11 */
  --fs-xs: .75rem;     /* 12 */
  --fs-sm: .875rem;    /* 14 */
  --fs-base: 1rem;     /* 16 */
  --fs-md: 1.0625rem;  /* 17 — corpo de leitura */
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.375rem, 1.1rem + .9vw, 1.625rem);
  --fs-2xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem);
  --fs-3xl: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  --fs-display: clamp(2.75rem, 1.6rem + 5vw, 5.25rem);

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.7;
  --tracking-tight: -0.03em;
  --tracking-label: .14em;

  /* Espaçamento */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --section-y: clamp(4rem, 3rem + 4vw, 7.5rem);

  /* Layout */
  --container: 1240px;
  --container-wide: 1440px;
  --container-narrow: 760px;
  --gutter: clamp(1.25rem, .8rem + 2vw, 2.5rem);
  --header-h: 76px;

  /* Forma */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(13, 14, 17, .05);
  --shadow: 0 12px 32px -14px rgba(13, 14, 17, .22);
  --shadow-lg: 0 30px 70px -30px rgba(13, 14, 17, .45);

  /* Movimento */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: .18s;
  --t: .32s;

  /* Textura de grade usada nas faixas escuras (home e páginas internas) */
  --grid-texture:
    linear-gradient(rgba(242, 241, 236, .045) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(242, 241, 236, .045) 1px, transparent 1px) 0 0 / 64px 64px;

  /* ---- Aliases legados (mantêm conteúdo antigo/inline coerente) ---- */
  --ink: var(--c-ink);
  --ink-60: var(--c-text-muted);
  --ink-20: var(--c-line-strong);
  --ink-08: var(--c-line);
  --paper: var(--c-paper);
  --off: var(--c-sand);
  --void: var(--c-ink);
  --void2: var(--c-ink-2);
  --accent: var(--c-accent);
  --accent2: var(--c-accent-strong);
  --rule: var(--c-line);
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --primary-color: var(--c-ink);
  --secondary-color: var(--c-ink-2);
  --accent-color: var(--c-accent);
  --text-color: var(--c-text);
  --light-bg: var(--c-paper);
  --white: #fff;
  --container-width: var(--container);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}
img, svg, video, canvas, picture { display: block; max-width: 100%; height: auto; }
iframe { max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease); }
ul[class], ol[class] { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-6) 0; }
::selection { background: var(--c-accent); color: var(--c-on-accent); }

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

/* ---------- Tipografia base ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  color: inherit;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--fs-2xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-base); }
h6 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; }
p { text-wrap: pretty; }
small { font-size: var(--fs-sm); }
code, kbd, pre, samp { font-family: var(--font-mono); }

/* Ênfase editorial: uma palavra em serifada itálica, cor de destaque */
.highlight,
.neo-section-title em,
.neo-cta-title span,
.text-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Rótulo/eyebrow — assinatura do sistema (home + internas) */
.eyebrow,
.neo-section-eyebrow,
.neo-cta-eyebrow,
.slide-subtitle {
  display: inline-flex;
  align-items: center;
  gap: .75em;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-accent-strong);
}
.eyebrow::before,
.neo-section-eyebrow::before,
.neo-cta-eyebrow::before,
.slide-subtitle::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  flex: none;
}

/* ---------- Layout ---------- */
.container,
.container-wide,
.container-full {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container { max-width: calc(var(--container) + var(--gutter) * 2); }
.container.container-wide,
.container-wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }
.container-full { max-width: none; }

.row { display: block; }
.col-lg-12 { width: 100%; }
.site-main { display: block; min-height: 40vh; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
  position: fixed !important; top: 12px; left: 12px; z-index: 100000;
  padding: 12px 18px; background: var(--c-surface); color: var(--c-text);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
}
.skip-link:not(:focus) { position: absolute; left: -9999px; }

.text-center { text-align: center; }

/* ---------- Botões ---------- */
.btn,
.button,
.wp-block-button__link,
.neo-btn-light,
.header-cta-button,
input[type="submit"],
button[type="submit"]:not(.search-submit):not(.search-icon),
.comment-form .submit {
  --btn-bg: var(--c-ink);
  --btn-fg: var(--c-on-dark);
  --btn-bd: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: .8em 1.5em;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 550;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease),
              border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:hover,
.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button[type="submit"]:not(.search-submit):not(.search-icon):hover,
.comment-form .submit:hover { transform: translateY(-1px); }
.btn i, .btn svg { font-size: .9em; transition: transform var(--t) var(--ease); }
.btn:hover .fa-arrow-right { transform: translateX(3px); }

/* Primário = destaque */
.btn-primary,
.header-cta-button,
.slide-btn,
.wp-block-button:not(.is-style-outline) .wp-block-button__link,
input[type="submit"],
.comment-form .submit { --btn-bg: var(--c-accent); --btn-fg: var(--c-on-accent); }
.btn-primary:hover,
.header-cta-button:hover,
.slide-btn:hover,
input[type="submit"]:hover,
.comment-form .submit:hover { --btn-bg: color-mix(in srgb, var(--c-accent) 86%, #fff); }

/* Secundário = tinta */
.btn-secondary,
.section-btn { --btn-bg: var(--c-ink); --btn-fg: var(--c-on-dark); }
.btn-secondary:hover,
.section-btn:hover { --btn-bg: var(--c-ink-3); }

/* Contorno */
.btn-outline,
.btn-load-more,
.load-more-button,
.is-style-outline .wp-block-button__link {
  --btn-bg: transparent; --btn-fg: var(--c-text); --btn-bd: var(--c-line-strong);
}
.btn-outline:hover,
.btn-load-more:hover,
.load-more-button:hover,
.is-style-outline .wp-block-button__link:hover { --btn-bg: var(--c-ink); --btn-fg: var(--c-on-dark); --btn-bd: var(--c-ink); }

/* Claro (sobre fundo escuro) */
.neo-btn-light,
.btn-cta { --btn-bg: var(--c-on-dark); --btn-fg: var(--c-ink); }
.neo-btn-light:hover,
.btn-cta:hover { --btn-bg: var(--c-accent); --btn-fg: var(--c-on-accent); --btn-bd: var(--c-accent); }

.btn-block { display: flex; width: 100%; }
.btn.loading, .btn-load-more.loading { opacity: .6; pointer-events: none; }
.btn[disabled], button[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* Link com seta (padrão para "Leia mais", "Ver todos") */
.link-arrow,
.blog-card-link,
.card-read-more,
.read-more,
.neo-section-link,
.portfolio-card-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-line-strong);
  padding-bottom: 2px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), gap var(--t) var(--ease);
}
.link-arrow:hover,
.blog-card-link:hover,
.card-read-more:hover,
.neo-section-link:hover,
.portfolio-card-link:hover { color: var(--c-accent-strong); border-color: currentColor; gap: .75em; }

/* ---------- Formulários ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], input[type="date"],
textarea, select {
  width: 100%;
  min-height: 48px;
  padding: .75em 1em;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  appearance: none;
}
textarea { min-height: 160px; resize: vertical; }
select {
  padding-right: 2.5em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b5f68' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
::placeholder { color: var(--c-text-subtle); opacity: 1; }
label { font-size: var(--fs-sm); font-weight: 500; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-accent); width: 1.05em; height: 1.05em; }

/* Busca padrão (get_search_form e variações do tema) */
.search-form,
.news-search-form .search-input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}
.search-form label { flex: 1; display: block; }
.search-form .search-field,
.search-input-group input[type="search"],
.search-input-group input[type="text"] { padding-right: 3.25em; border-radius: var(--r-pill); padding-left: 1.25em; }
.search-form .search-submit,
.search-input-group .search-submit {
  position: absolute;
  right: 5px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-ink);
  color: var(--c-on-dark);
  font-size: var(--fs-sm);
  transition: background var(--t-fast) var(--ease);
}
.search-form .search-submit:hover,
.search-input-group .search-submit:hover { background: var(--c-accent); color: var(--c-on-accent); }
.search-form input[type="submit"].search-submit { width: auto; padding: 0 1em; border-radius: var(--r-pill); font-size: var(--fs-xs); min-height: 38px; }

/* ---------- Chips / tags (estilo único em todo o tema) ---------- */
.chip,
.tag-link,
.tag-cloud-link,
.category-tag,
.category-badge,
.badge,
.tech-badge,
.tech-item,
.post-categories a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .35em .85em;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs) !important;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
a.chip:hover,
.tag-link:hover,
.tag-cloud-link:hover,
a.category-tag:hover,
a.category-badge:hover,
.post-categories a:hover { color: var(--c-accent-strong); border-color: var(--c-accent); background: var(--c-accent-soft); }
.category-badge,
.category-tag { color: var(--c-accent-strong); border-color: color-mix(in srgb, var(--c-accent) 45%, transparent); }

/* ---------- Ícones FA alinhados ao texto ---------- */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands { line-height: 1; }

/* ---------- Spinner ---------- */
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-7) 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--c-line-strong);
  border-top-color: var(--c-accent);
  animation: spin .8s linear infinite;
}

/* ---------- Animações ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Conteúdo nunca depende de JS para aparecer */
.animate-on-scroll { animation: rise .7s var(--ease) both; }
.animate-none, .animate-on-scroll.animate-none { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
