/*
 * Shared navigation and footer on the legacy (non-facelift) pages: the design tokens and font faces
 * of ds.css (none of its global rules), the buttons the footer uses and a base scoped to the two
 * blocks. chrome.css (the components) and js/facelift/chrome.js load after it. Generated from
 * css/facelift/ds.css: keep the tokens in step when they change there.
 */

/* =============================================================
   Webmania Design System — Tokens
   Colors, typography, spacing, elevation.
   Primary brand color: deep green (webmania green)
   ============================================================= */

/* ---------- FONT FACES ---------- */

@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-RegularItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-MediumItalic.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-SemiBoldItalic.otf') format('opentype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Borna';
  src: url('../../fonts/fiscal-facelift/Borna-BoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../../fonts/fiscal-facelift/Inter-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../../fonts/fiscal-facelift/Inter-Italic-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- DESIGN TOKENS ---------- */

:root {
  /* ============ BRAND CORE ============ */

  /* Webmania Green — primary signature.
     --wm-green-700 = #00695A — SAMPLED DIRECTLY from the wordmark
     (logo-webmania-escuro.png) and the W-symbol background. This is
     the load-bearing brand green; all other steps are derived from it
     in OKLCH to keep the ramp perceptually even. */
  --wm-green-900: #00251F;  /* deepest — press, headline on light */
  --wm-green-800: #003D33;  /* default text-on-white, strong brand ink */
  --wm-green-700: #00695A;  /* ★ WORDMARK — primary brand surfaces, logo bg */
  --wm-green-600: #008070;  /* primary interactive default (hover step up from 700) */
  --wm-green-500: #0E9984;  /* hover / bright accent */
  --wm-green-400: #2CB39C;  /* vibrant marketing accent — "2024 Redesign" slide green */
  --wm-green-300: #6FCEBD;  /* pale accents, decorative fills */
  --wm-green-200: #AEE3D6;  /* tints, chips, success bg */
  --wm-green-100: #D6F0E8;  /* faint bg wash */
  --wm-green-50:  #EBF7F3;  /* page-level green tint */

  /* Claro (light tagline green) — seen as L-H-3 light wordmark */
  --wm-green-mist: #DFF5EC; /* faint minty tint for dark-on-dark */

  /* Marketing accent — vibrant, energetic green for headline highlights
     and "redesign"/announcement contexts. Brighter & more saturated than
     the product ramp, not for body text. Use sparingly on hero headlines
     and callouts, never on compliance UI. */
  --wm-green-vivid: #19C592;

  /* ============ NEUTRALS ============ */
  /* Warm-green-leaning grays — every step carries the webmania-green
     undertone so the neutrals feel family-coherent with --wm-green-*.
     Hues are perceptually-even in OKLCH; undertone is detectable at all
     steps (a, b channels biased slightly green across the ramp). */
  --wm-white:   #FFFFFF;
  --wm-ink-50:  #F4F7F5;   /* page alt — subtle green wash */
  --wm-ink-100: #E8EDEA;   /* alt surface */
  --wm-ink-200: #D4DCD8;   /* borders on light */
  --wm-ink-300: #B3BDB8;   /* dividers, disabled strokes */
  --wm-ink-400: #8B9691;   /* tertiary / placeholder */
  --wm-ink-500: #687370;   /* secondary text */
  --wm-ink-600: #4D5854;   /* stronger secondary, icons */
  --wm-ink-700: #343D39;   /* near-ink, body on dense tables */
  --wm-ink-800: #1F2724;   /* pressed borders, hover-darken dividers */
  --wm-ink-900: #0A110E;   /* true near-black; body copy on white */

  /* ============ SEMANTIC ACCENTS ============ */
  /* Complementary palette — muted, trustworthy. */
  --wm-amber-600: #B86F1A;   /* warnings, pending fiscal status — normalized to 600 step */
  --wm-amber-500: #D98A2B;   /* legacy alias, retained for one release */
  --wm-amber-100: #FBEAD2;
  --wm-red-600:   #C2413A;   /* errors, rejected documents (NF rejeitada) */
  --wm-red-100:   #F8DDDB;
  --wm-purple-600: #7A4DB0;  /* denegada (SEFAZ status 110) — distinct from rejected */
  --wm-purple-100: #E8DEF5;
  --wm-teal-600:  #1E7A8A;   /* contingência (SVC/SCAN offline emission) */
  --wm-teal-100:  #D4EAEF;
  --wm-blue-600:  #2C6FB8;   /* info, links in docs */
  --wm-blue-100:  #DAE7F5;
  --wm-slate-600: #5C6B78;   /* cancelled docs — desaturated, finite, distinct from "rejected" */
  --wm-slate-100: #E3E7EB;
  --wm-success:   var(--wm-green-600);
  --wm-success-bg: var(--wm-green-100);

  /* ============ SEMANTIC SURFACES ============ */
  --wm-bg:            var(--wm-white);
  --wm-bg-alt:        var(--wm-ink-50);
  --wm-bg-sunken:     var(--wm-ink-100);
  --wm-bg-brand:      var(--wm-green-700);
  --wm-bg-brand-deep: var(--wm-green-900);
  --wm-bg-brand-tint: var(--wm-green-50);

  --wm-fg:            var(--wm-ink-900);
  --wm-fg-muted:      var(--wm-ink-500);
  --wm-fg-subtle:     var(--wm-ink-400);
  --wm-fg-brand:      var(--wm-green-700);
  --wm-fg-on-brand:   var(--wm-white);
  --wm-fg-on-brand-muted: rgba(255, 255, 255, 0.72);

  --wm-border:        var(--wm-ink-200);
  --wm-border-strong: var(--wm-ink-300);
  --wm-border-brand:  var(--wm-green-600);

  /* ============ TYPOGRAPHY ============ */

  --wm-font-display: 'Borna', 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --wm-font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --wm-font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale — marketing & product speak both Borna+Inter. Borna for
     big statements, Inter for everything functional. */
  --wm-text-xs:    11px;
  --wm-text-sm:    13px;
  --wm-text-base:  15px;
  --wm-text-md:    17px;
  --wm-text-lg:    20px;
  --wm-text-xl:    24px;
  --wm-text-2xl:   32px;
  --wm-text-3xl:   42px;
  --wm-text-4xl:   56px;
  --wm-text-5xl:   72px;
  --wm-text-6xl:   96px;
  --wm-text-display: 128px;

  --wm-leading-tight:   1.08;
  --wm-leading-snug:    1.22;
  --wm-leading-normal:  1.48;
  --wm-leading-relaxed: 1.62;

  --wm-tracking-tight:   -0.025em;
  --wm-tracking-snug:    -0.012em;
  --wm-tracking-normal:  0;
  --wm-tracking-wide:    0.06em;
  --wm-tracking-caps:    0.14em;

  /* Font weights — Borna & Inter share 400/500/600/700 */
  --wm-fw-regular:  400;
  --wm-fw-medium:   500;
  --wm-fw-semibold: 600;
  --wm-fw-bold:     700;

  /* ============ SPACING (4px base) ============ */
  --wm-space-0:   0;
  --wm-space-1:   4px;
  --wm-space-2:   8px;
  --wm-space-3:   12px;
  --wm-space-4:   16px;
  --wm-space-5:   20px;
  --wm-space-6:   24px;
  --wm-space-8:   32px;
  --wm-space-10:  40px;
  --wm-space-12:  48px;
  --wm-space-16:  64px;
  --wm-space-20:  80px;
  --wm-space-24:  96px;
  --wm-space-32:  128px;

  /* ============ RADII ============ */
  /* Brand favors SOFT corners — the "W" symbol is in a rounded square
     (~18% of the square). UI scales inherit the softness. */
  --wm-radius-xs:   4px;
  --wm-radius-sm:   6px;
  --wm-radius-md:   10px;
  --wm-radius-lg:   14px;
  --wm-radius-xl:   20px;
  --wm-radius-2xl:  28px;
  --wm-radius-pill: 999px;

  /* ============ ELEVATION ============ */
  /* Subtle, green-tinted shadows — never pure black, never heavy. */
  --wm-shadow-xs: 0 1px 2px rgba(10, 41, 33, 0.06);
  --wm-shadow-sm: 0 2px 6px rgba(10, 41, 33, 0.06), 0 1px 2px rgba(10, 41, 33, 0.04);
  --wm-shadow-md: 0 6px 18px rgba(10, 41, 33, 0.08), 0 2px 4px rgba(10, 41, 33, 0.04);
  --wm-shadow-lg: 0 18px 40px rgba(10, 41, 33, 0.12), 0 6px 12px rgba(10, 41, 33, 0.06);
  --wm-shadow-xl: 0 32px 80px rgba(10, 41, 33, 0.18), 0 12px 24px rgba(10, 41, 33, 0.08);
  --wm-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);

  /* Glass / transparency — a recurring brand motif. */
  --wm-glass-light: rgba(255, 255, 255, 0.72);
  --wm-glass-brand: rgba(14, 89, 73, 0.72);
  --wm-glass-ink:   rgba(10, 15, 13, 0.64);
  --wm-blur-glass:  blur(18px) saturate(160%);

  /* ============ MOTION ============ */
  --wm-ease-out:    cubic-bezier(0.22, 1, 0.36, 1);     /* springy, confident */
  --wm-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --wm-ease-linear: linear;
  --wm-dur-fast:    120ms;
  --wm-dur-med:     220ms;
  --wm-dur-slow:    420ms;

  /* ============ Z-INDEX ============ */
  --wm-z-base:    1;
  --wm-z-sticky:  50;
  --wm-z-overlay: 100;
  --wm-z-modal:   200;
  --wm-z-toast:   300;
}

/* =============================================================
   SEMANTIC TYPOGRAPHY UTILITIES
   Use these classes as shorthand; they match the brand hierarchy.
   ============================================================= */

.wm-display {
  font-family: var(--wm-font-display);
  font-size: var(--wm-text-display);
  font-weight: var(--wm-fw-medium);
  line-height: var(--wm-leading-tight);
  letter-spacing: var(--wm-tracking-tight);
  color: var(--wm-fg);
}

.wm-h1 {
  font-family: var(--wm-font-display);
  font-size: var(--wm-text-5xl);
  font-weight: var(--wm-fw-medium);
  line-height: var(--wm-leading-tight);
  letter-spacing: var(--wm-tracking-tight);
  color: var(--wm-fg);
}

.wm-h2 {
  font-family: var(--wm-font-display);
  font-size: var(--wm-text-4xl);
  font-weight: var(--wm-fw-medium);
  line-height: var(--wm-leading-snug);
  letter-spacing: var(--wm-tracking-snug);
  color: var(--wm-fg);
}

.wm-h3 {
  font-family: var(--wm-font-display);
  font-size: var(--wm-text-3xl);
  font-weight: var(--wm-fw-medium);
  line-height: var(--wm-leading-snug);
  letter-spacing: var(--wm-tracking-snug);
  color: var(--wm-fg);
}

.wm-h4 {
  font-family: var(--wm-font-display);
  font-size: var(--wm-text-2xl);
  font-weight: var(--wm-fw-semibold);
  line-height: var(--wm-leading-snug);
  color: var(--wm-fg);
}

.wm-h5 {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-xl);
  font-weight: var(--wm-fw-semibold);
  line-height: var(--wm-leading-snug);
  color: var(--wm-fg);
}

.wm-lede {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-lg);
  font-weight: var(--wm-fw-regular);
  line-height: var(--wm-leading-normal);
  color: var(--wm-fg-muted);
}

.wm-body {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-base);
  font-weight: var(--wm-fw-regular);
  line-height: var(--wm-leading-relaxed);
  color: var(--wm-fg);
}

.wm-small {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-sm);
  font-weight: var(--wm-fw-regular);
  line-height: var(--wm-leading-normal);
  color: var(--wm-fg-muted);
}

.wm-micro {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-xs);
  font-weight: var(--wm-fw-medium);
  line-height: var(--wm-leading-normal);
  color: var(--wm-fg-muted);
}

.wm-eyebrow {
  font-family: var(--wm-font-body);
  font-size: var(--wm-text-xs);
  font-weight: var(--wm-fw-semibold);
  line-height: var(--wm-leading-normal);
  letter-spacing: var(--wm-tracking-caps);
  text-transform: uppercase;
  color: var(--wm-fg-brand);
}

.wm-mono {
  font-family: var(--wm-font-mono);
  font-size: var(--wm-text-sm);
  font-weight: var(--wm-fw-regular);
  line-height: var(--wm-leading-normal);
}

/* Base reset-ish defaults — opt in by adding `wm` class to the root */
.wm {
  font-family: var(--wm-font-body);
  color: var(--wm-fg);
  background: var(--wm-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wm h1 { all: unset; display: block; }
.wm h1 { font-family: var(--wm-font-display); font-size: var(--wm-text-5xl); font-weight: var(--wm-fw-medium); line-height: var(--wm-leading-tight); letter-spacing: var(--wm-tracking-tight); }
.wm h2 { font-family: var(--wm-font-display); font-size: var(--wm-text-4xl); font-weight: var(--wm-fw-medium); line-height: var(--wm-leading-snug); letter-spacing: var(--wm-tracking-snug); display: block; }
.wm h3 { font-family: var(--wm-font-display); font-size: var(--wm-text-3xl); font-weight: var(--wm-fw-medium); line-height: var(--wm-leading-snug); display: block; }
.wm h4 { font-family: var(--wm-font-display); font-size: var(--wm-text-2xl); font-weight: var(--wm-fw-semibold); line-height: var(--wm-leading-snug); display: block; }
.wm p  { font-family: var(--wm-font-body); font-size: var(--wm-text-base); line-height: var(--wm-leading-relaxed); }
.wm code, .wm pre { font-family: var(--wm-font-mono); font-size: 0.92em; }

/* ---------- Buttons (ds.css) ---------- */
.wm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 10px; font-family: var(--wm-font-body); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all 160ms var(--wm-ease-out); text-decoration: none; letter-spacing: -0.005em; }
.wm-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.wm-btn-lg { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.wm-btn-primary { background: var(--wm-green-600); color: var(--wm-white); }
.wm-btn-primary:hover { background: var(--wm-green-700); }
.wm-btn-ghost { background: var(--wm-white); color: var(--wm-green-700); border-color: var(--wm-ink-200); }
.wm-btn-ghost:hover { background: var(--wm-green-50); }
.wm-btn-on-brand { background: var(--wm-white); color: var(--wm-green-900); }
.wm-btn-on-brand:hover { background: var(--wm-green-50); }
.wm-btn-ghost-on-brand { background: transparent; color: var(--wm-white); border-color: rgba(255,255,255,0.32); }
.wm-btn-ghost-on-brand:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* ---------- Base of the navigation and the footer on legacy pages ---------- */
.wmfl-nav, .wmf, .wmm-tip, .cookie-consent-banner { font-family: var(--wm-font-body); -webkit-font-smoothing: antialiased; }
.wmfl-nav, .wmfl-nav *, .wmfl-nav *::before, .wmfl-nav *::after, .wmf, .wmf *, .wmf *::before, .wmf *::after { box-sizing: border-box; }
:where(.wmfl-nav, .wmf) a { color: var(--wm-green-700); text-decoration: none; }
:where(.wmfl-nav, .wmf) ul { margin: 0; padding: 0; list-style: none; }
:where(.wmfl-nav, .wmf) img { max-width: none; }

/* Same geometry as the legacy navigation (css/new-site/header.css, theme.css, policies.css), which every
   legacy page was laid out around: from 541 px it was a fixed 80 px bar over the page, so the pages leave
   that room at their top, and the shared navigation, still sticky, then takes no room in the flow. It stays
   in the flow where the old bar did: up to 540 px, on the API documentation templates and on the pages
   that set it static. It stacks like the old bar (z-index 1000), its dim and tooltips with it. */
:root .wmfl-nav { z-index: 1000; }
:root .wmm-dim { z-index: 999; }
:root .wmm-tip { z-index: 1001; }
@media (min-width: 541px) {
  :root .wmfl-nav { margin-bottom: -80px; } /* the old bar height: the room the pages leave starts right under this bar */
  .page-template-page-api-nfe .wmfl-nav,
  .page-template-page-api-nfse .wmfl-nav,
  .page-template-page-api-cte .wmfl-nav,
  .page-template-page-api-dce .wmfl-nav,
  .page-template-page-api-ciot .wmfl-nav,
  .page-template-page-api-bypass .wmfl-nav,
  .page-template-page-api-gnre .wmfl-nav,
  .page-template-page-api-dare .wmfl-nav,
  .page-template-page-api-dua-es .wmfl-nav,
  .page-template-page-api-nfcom .wmfl-nav,
  .page-template-page-api-mdfe .wmfl-nav,
  .page-template-page-api-consulta .wmfl-nav,
  .page-template-page-api-cep .wmfl-nav,
  .page-template-page-api-revenda .wmfl-nav,
  .page-template-page-api-gestao-documentos-fiscais .wmfl-nav,
  .page-template-page-api-validacao .wmfl-nav,
  body.page-id-1869 .wmfl-nav,
  body.page-id-1397 .wmfl-nav,
  body.page-id-1713 .wmfl-nav,
  body.page-id-1844 .wmfl-nav,
  body.page-id-1138 .wmfl-nav { margin-bottom: 0; }
}

/* Legacy CSS (global.css, products-responsive-fixes.css) sets overflow-x: hidden on html and body up to
   1024 px, which makes body a scroll container and stops the sticky navigation on Safari (iPhone, iPad).
   overflow-x: clip still hides the sideways overflow without creating a scroll container. */
@media (max-width: 1024px) {
  :root, :root body { overflow-x: clip; }
}
