@import url('@ufpe/tokens/css');

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  color: var(--color-text-default);
  background: var(--color-surface-default);
  line-height: 1.55;
}

a { color: var(--color-text-brand); text-decoration: none; border-bottom: 1px solid currentColor; }
a:hover { background: var(--color-surface-muted); }

h1, h2, h3, h4 {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-brand);
  letter-spacing: -0.01em;
  margin-top: 0;
}
h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); margin-top: var(--space-6); }
h3 { font-size: var(--font-size-lg); margin-top: var(--space-4); }

.versalete {
  font-variant-caps: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--font-size-sm);
}
code { background: var(--color-surface-muted); padding: 1px 6px; border-radius: 3px; }
pre  { background: var(--color-surface-muted); padding: var(--space-2); border-radius: 6px; overflow-x: auto; }

table { border-collapse: collapse; width: 100%; margin: var(--space-2) 0; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--color-border-default); text-align: left; vertical-align: top; }
th { font-weight: var(--font-weight-bold); color: var(--color-text-brand); }

/* Layout shell */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--color-brand-primary);
  color: var(--color-brand-contrast);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: var(--space-3);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-4);
}
.sidebar .brand img { width: 40px; }
.sidebar .brand strong { display: block; font-size: var(--font-size-md); }
.sidebar .brand small { opacity: .85; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav .group {
  margin-top: var(--space-3); margin-bottom: 4px;
  font-size: var(--font-size-xs); opacity: .7;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 0 10px;
}
.sidebar nav button {
  background: transparent; border: 0; color: inherit;
  font: inherit; font-size: var(--font-size-sm);
  text-align: left; padding: 8px 10px; border-radius: 4px;
  cursor: pointer;
}
.sidebar nav button:hover { background: rgba(255,255,255,.12); }
.sidebar nav button[aria-current="true"] { background: rgba(0,0,0,.3); font-weight: var(--font-weight-bold); }

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-2) 10px 0;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--font-size-xs);
  opacity: .7;
}
.sidebar-footer a {
  display: flex; align-items: baseline; justify-content: space-between;
  color: inherit; text-decoration: none; border: 0;
  padding: 8px 4px;
  font-family: ui-monospace, Menlo, monospace;
}
.sidebar-footer a:hover { opacity: 1; background: none; }
.sidebar-footer .ver { font-weight: var(--font-weight-bold); }
.sidebar-footer .sha { opacity: .7; }

.sidebar { display: flex; flex-direction: column; }
.sidebar nav { flex: 1; }

.main { padding: var(--space-6); max-width: 920px; }
.main > * + * { margin-top: var(--space-2); }

.lede { font-size: var(--font-size-md); color: var(--color-text-muted); }

.tag {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--font-size-xs); font-weight: var(--font-weight-bold);
  background: var(--color-surface-muted); color: var(--color-text-default);
}
.tag.stable    { background: #d4edda; color: #155724; }
.tag.beta      { background: #fff3cd; color: #856404; }
.tag.deprecated { background: #f8d7da; color: #721c24; }

.callout {
  border-left: 4px solid var(--color-brand-primary);
  background: var(--color-surface-muted);
  padding: var(--space-2);
  margin: var(--space-3) 0;
}

/* Component-specific */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: var(--space-2); }
.swatch { border: 1px solid var(--color-border-default); border-radius: 6px; overflow: hidden; }
.swatch .chip { height: 100px; cursor: pointer; }
.swatch .meta { padding: var(--space-1) var(--space-2); font-size: var(--font-size-xs); }
.swatch .meta strong { display: block; color: var(--color-text-brand); margin-bottom: 4px; font-size: var(--font-size-base); }

.codeblock-wrap { position: relative; }
.codeblock-wrap button.copy {
  position: absolute; top: 8px; right: 8px;
  background: var(--color-surface-default); border: 1px solid var(--color-border-default);
  font: inherit; font-size: var(--font-size-xs); cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
}
.codeblock-wrap pre { margin: 0; }

.token-table code { white-space: nowrap; }

.preview-box {
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  padding: var(--space-4);
  display: flex; align-items: center; justify-content: center; min-height: 220px;
  background: var(--color-surface-default);
}

.dont-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: var(--space-2); }
.dont-card { border: 1px solid var(--color-border-default); padding: var(--space-2); border-radius: 6px; }
.dont-card .label { font-size: var(--font-size-xs); color: var(--color-text-brand); margin-top: 8px; }
