/* ============================================================
   mind.allen87.com — Global Styles
   Tipografia: DM Serif Display (H1/H2) + Inter (H3+ e corpo)
   Referência: blogs/mind/docs/layout.md
   ============================================================ */

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* ── Headings H1/H2 — DM Serif Display ─────────────────────────────────────── */
/* DM Serif Display tem apenas peso 400. Peso visual vem do tamanho e contraste  */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl)); }

/* ── Headings H3–H5 — Inter (hierarquia dentro do conteúdo) ────────────────── */
h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl);   font-weight: 600; letter-spacing: 0; }
h5 { font-size: var(--text-lg);   font-weight: 500; letter-spacing: 0; }

/* ── Tipografia — Corpo ─────────────────────────────────────────────────────── */
p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
}

/* Lead — intro de artigo ou seção */
.lead {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--text-muted);
  font-weight: 300;
}

/* Eyebrow — rótulo acima de título */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Links ──────────────────────────────────────────────────────────────────── */
.prose a,
a.link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.prose a:hover,
a.link:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* ── Código ─────────────────────────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  overflow-x: auto;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ── Blockquote ─────────────────────────────────────────────────────────────── */
blockquote {
  border-left: 2px solid var(--accent);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-8) 0;
  background: var(--accent-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote p {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Highlight Box ──────────────────────────────────────────────────────────── */
.highlight-box {
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-8);
  margin: var(--sp-8) 0;
}

.highlight-box p {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Containers ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container--prose {
  width: 100%;
  max-width: var(--max-width-prose);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

/* ── Prosa (corpo do artigo) ────────────────────────────────────────────────── */
.prose { color: var(--text); }

.prose h2 { margin-top: var(--sp-12); margin-bottom: var(--sp-5); }
.prose h3 { margin-top: var(--sp-8);  margin-bottom: var(--sp-3); }
.prose p  { margin-bottom: var(--sp-6); }

.prose ul,
.prose ol {
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.prose li           { margin-bottom: var(--sp-2); line-height: 1.7; }
.prose ul li        { list-style: disc; }
.prose ol li        { list-style: decimal; }
.prose strong       { font-weight: 600; color: var(--text); }
.prose em           { font-style: italic; color: var(--text-muted); }

/* ── Referências ────────────────────────────────────────────────────────────── */
.references {
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}

.references__title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-5);
}

.references ol {
  padding-left: var(--sp-5);
  margin: 0;
  list-style: decimal;
}

.references li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: var(--sp-3);
}

.references a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color var(--transition-fast);
}

.references a:hover { color: var(--accent-hover); }

/* ── Progress Bar de Leitura ────────────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--progress-bar);
  z-index: var(--z-toast);
  transition: width 80ms linear;
  opacity: 0.7;
}

/* ── Scroll Top ─────────────────────────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-raised);
}

.scroll-top.visible  { opacity: 1; pointer-events: auto; }
.scroll-top:hover    { transform: translateY(-2px); color: var(--accent); border-color: var(--border-accent); }

/* ── Utilidades ─────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent); }

.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }

.font-display { font-family: var(--font-display); }
.font-sans    { font-family: var(--font-sans); }
.font-mono    { font-family: var(--font-mono); }
