/* ============================================================
   BASE — Reset, tipografia e elementos globais
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Acessibilidade — skip link */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 9999;
  padding: .5rem 1rem; background: var(--color-primary);
  color: #fff; border-radius: 0 0 var(--radius) var(--radius);
  transition: top var(--transition-fast);
  &:focus { top: 0; }
}

/* Foco visível */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h3 { font-size: clamp(var(--text-lg),  2vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--fw-semibold); }

p { line-height: var(--lh-relaxed); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  &:hover { color: var(--color-primary-dark); }
}

strong, b { font-weight: var(--fw-semibold); }
em, i     { font-style: italic; }

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button { cursor: pointer; border: none; background: none; }

input, textarea, select {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;

  &:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(123,78,158,.15); }
  &::placeholder { color: var(--color-text-muted); }
}

textarea { resize: vertical; min-height: 80px; }

details summary { cursor: pointer; user-select: none; }
details summary::-webkit-details-marker { display: none; }

/* Prosa (conteúdo HTML gerado) */
.prose {
  line-height: var(--lh-relaxed);
  color: var(--color-text);

  h1, h2, h3, h4 { margin-top: 1.5em; margin-bottom: .5em; }
  p  { margin-bottom: 1em; }
  ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
  ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
  li { margin-bottom: .4em; line-height: var(--lh-relaxed); }
  a  { text-decoration: underline; }
  strong { font-weight: var(--fw-semibold); }
  blockquote { border-left: 3px solid var(--color-primary); padding-left: 1rem; color: var(--color-text-secondary); margin: 1em 0; }
}

/* Main com offset do header fixo */
#main-content { padding-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }
