/* =========================================================
   BASE — GLOBAL ELEMENT STYLES
   =========================================================

   Define os estilos fundamentais dos elementos HTML
   utilizados em todo o projecto.

   Depende de:
   - fonts.css
   - tokens.css

   Este ficheiro contém:
   - Reset complementar
   - HTML e Body
   - Tipografia global
   - Headings
   - Paragraphs
   - Links
   - Blockquotes
   - Code
   - Media
   - Lists
   - Form normalization
   - Estados globais básicos

   Não colocar aqui:
   - Containers
   - Layout estrutural
   - Componentes
   - Utilities
   - Estilos específicos de páginas
   - Overrides directos de temas ou plugins

   Regra:
   Manter este ficheiro simples, previsível e seguro,
   evitando resets agressivos que possam interferir
   com o tema pai ou page builders.
   ========================================================= */

/*
========================================================
01. RESET
========================================================
*/

html {
  box-sizing: border-box;

  font-size: 100%;

  scroll-behavior: smooth;

  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/*
========================================================
02. HTML & BODY
========================================================
*/

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  color: var(--text-primary);
  background-color: var(--surface-default);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/*
========================================================
03. ACCESSIBILITY
========================================================
*/

:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);

  outline-offset: var(--focus-offset);
}

/*
========================================================
04. TEXT SELECTION
========================================================
*/

::selection {
  background-color: rgba(var(--color-primary-rgb), 0.15);

  color: var(--text-primary);
}

/*
========================================================
05. HEADINGS
========================================================
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: var(--space-sm);

  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-heading);

  color: var(--text-heading);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: var(--font-size-h4);
}

h5 {
  font-size: var(--font-size-h5);
}

h6 {
  font-size: var(--font-size-h6);
}

/*
========================================================
06. PARAGRAPHS
========================================================
*/

p {
  margin-top: 0;
  margin-bottom: var(--space-md);

  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-body);

  color: var(--text-primary);
}

p:last-child {
  margin-bottom: 0;
}

/*
========================================================
07. TEXT ELEMENTS
========================================================
*/

small {
  font-size: var(--font-size-small);
}

strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

mark {
  background-color: var(--color-accent-light);

  color: var(--text-primary);
}

abbr[title] {
  text-decoration: underline dotted;

  cursor: help;
}

/*
========================================================
08. LINKS
========================================================
*/

a {
  color: var(--link-color);

  text-decoration: none;

  transition:
    color var(--transition-base),
    opacity var(--transition-base);
}

a:hover {
  color: var(--link-color-hover);
}

/*
========================================================
09. BLOCKQUOTE
========================================================
*/

/*
========================================================
10. CODE
========================================================
*/

/*
========================================================
11. MEDIA
========================================================
*/

/*
========================================================
12. FIGURES
========================================================
*/

/*
========================================================
13. LISTS
========================================================
*/

/*
========================================================
14. HORIZONTAL RULE
========================================================
*/

/*
========================================================
15. TABLES
========================================================
*/

/*
========================================================
16. FORM NORMALIZATION
========================================================

Apenas normalização global dos elementos de formulário.

Estilos visuais completos pertencem a components.css.
========================================================
*/

button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
}

button,
select {
  text-transform: none;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
  cursor: pointer;
}

textarea {
  overflow: auto;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/*
========================================================
17. PLACEHOLDERS
========================================================
*/

/*
========================================================
18. INTERACTIVE ELEMENTS
========================================================
*/

/*
========================================================
19. HIDDEN ELEMENTS
========================================================
*/
