html {
  color: #595959;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

* {
  margin: 0;
  padding: 0;
}

::selection {
  background-color: var(--primario);
  color: var(--secundario);
}

body {
  background-color: var(--terciario);
  font-family: var(--fuente);
}

/* Navegación principal */
nav ul {
  display: flex;
  flex-direction: row;
  gap: 0.5em;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
}

nav li {
  list-style-type: none;
}

/* Definiciones / descripciones */
dd {
  padding-left: calc(100vw / 24);
}

/* Espaciado de párrafos y small */
p,
small,
address {
  padding-bottom: 1em;
}

/* Si viene una lista inmediatamente después del párrafo, no duplicamos espacio */
p:has(+ ul) {
  padding-bottom: 0;
}

/* Footer base (escritorio) */
footer {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

footer > nav {
  flex: 1 1 auto;
}

footer nav ul {
  justify-content: space-evenly;
  width: 100%;
}

/* Tipografía específica del footer */
footer nav a {
  font-size: medium;
  font-variant-caps: normal;
  letter-spacing: inherit;
}

/* Address y small con formato de bloque */
address,
small {
  display: block;
  white-space: pre-line;
  font-variant-numeric: lining-nums;
  font-style: normal;
}

address {
  line-height: var(--interlinea);
}

/* Enlaces genéricos */
a {
  color: var(--primario);
  text-decoration: underline dotted 0.1em var(--primario);
  text-underline-offset: 0.15em;
  transition: all 0.3s ease;
}

a:visited {
  all: none;
}

a:hover {
  background-color: var(--primario);
  color: var(--secundario);
  text-decoration-color: var(--secundario);
}

a:focus {
  background-color: var(--secundario);
  color: var(--primario);
  font-weight: 600;

  font-variation-settings:
  "wght" 600,
  "opsz" 19;
}

/* Enlaces dentro de la navegación principal */
nav a {
  font-variant-caps: all-small-caps;
  letter-spacing: clamp(0.035em, 0.02em + 0.05vw, 0.08em);

  font-weight: 600;

  font-variation-settings:
    "wght" 600,
    "opsz" 19;
}

nav ul li a {
  background-color: #ffffff;
}

body nav ul li:last-child a {
    color: #595959;
    text-decoration-color: #595959;
}

body nav ul li:last-child a:hover {
    background-color: #595959;
    color: #ffffff;
    text-decoration: none;
}

body nav ul li:last-child a:focus {
  color: #595959;
  background-color: #ffffff;
}

/* Botones genéricos y enlaces con aspecto de botón, incluyendo submit del formulario */
.boton,
button,
form input.submit {
  background-color: var(--primario);
  color: var(--secundario);
  border: 2px solid transparent;
  border-radius: 2em; /* ajusta al gusto */
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5em;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;

  font-variation-settings:
    "wght" 600,
    "opsz" 19;
}

.boton:hover,
button:hover,
form input.submit:hover {
  background-color: var(--secundario);
  color: var(--primario);
  border: 2px solid var(--primario);
}

.boton:focus,
button:focus,
form input.submit:focus {
  border-color: transparent;
  background-color: #595959;
  color: var(--secundario);
}

form input.submit {
  border-radius: 0;
}

header > .boton {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}