/* Base y componentes compartidos. Requiere tokens.css. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo/archivo-latin-standard-normal.de2f1fe81758.woff2") format("woff2");
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-18);
  line-height: var(--lh-text);
  color: var(--color-text);
  background: var(--color-bg);
  font-kerning: normal;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: var(--lh-heading);
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--color-accent);
}

:focus-visible,
/* El botón del calendario de un campo de fecha u hora está dentro del campo: el campo solo coincide con
   :focus-within, y sin esto el foco del teclado no se vería. */
input:is([type="date"], [type="time"]):focus-within {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.on-dark {
  background: var(--color-bg);
  color: var(--color-text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 100;
  left: var(--s-4);
  top: calc(-1 * var(--s-8));
  padding: var(--s-2) var(--s-4);
  background: var(--c-indigo);
  color: var(--c-cal);
  border-radius: var(--r-1);
}

.skip-link:focus {
  top: var(--s-4);
}

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Iconos de trazo (templates/components/icons.html) */
.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Logotipo */
.wordmark {
  height: auto;
  overflow: visible;
}

.wordmark__bar {
  fill: var(--color-accent);
}

/* Botones */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 3rem;
  padding: var(--s-3) var(--s-5);
  border: 2px solid transparent;
  border-radius: var(--r-1);
  font: inherit;
  font-size: var(--fs-16);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--c-rosa);
  color: var(--c-white);
}

.button--primary:hover {
  background: var(--c-rosa-press);
}

.button--secondary {
  border-color: currentColor;
  color: var(--color-text);
  background: transparent;
}

.button--secondary:hover {
  border-color: var(--color-accent);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.button[aria-busy="true"]::after {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Avisos de estado (formularios y mensajes) */
.notice {
  padding: var(--s-3) var(--s-4);
  border-left: 4px solid currentColor;
  border-radius: var(--r-1);
  font-size: var(--fs-16);
}

.notice--success { color: var(--c-success); background: var(--c-success-bg); }
.notice--error { color: var(--c-error); background: var(--c-error-bg); }
.notice--warning { color: var(--c-warning); background: var(--c-warning-bg); }
.notice--info { color: var(--c-info); background: var(--c-info-bg); }

/* Etiquetas de estado */
.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  border: 1px solid currentColor;
  border-radius: var(--r-1);
  font-size: var(--fs-14);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.tag--accent {
  border-color: var(--c-rosa);
  background: var(--c-rosa);
  color: var(--c-white);
}

.tag--muted {
  color: var(--color-muted);
}

/* Cambio de idioma */
.language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  font-size: var(--fs-14);
}

.language-switch button {
  font: inherit;
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--color-line);
  border-radius: var(--r-1);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.language-switch button[aria-current="true"] {
  border-color: currentColor;
  font-weight: 650;
}

/* Variante discreta de la cabecera: «ES | EN», el idioma activo subrayado en rosa. */
.language-switch--compact {
  flex-wrap: nowrap;
  gap: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.language-switch--compact button {
  padding: var(--s-1) var(--s-2);
  border: 0;
  border-radius: 0;
  color: var(--color-muted);
  font-weight: 600;
}

.language-switch--compact button + button {
  border-left: 1px solid var(--color-line);
}

.language-switch--compact button:hover {
  color: var(--color-text);
}

.language-switch--compact button[aria-current="true"] {
  color: var(--color-text);
  text-decoration: underline 2px var(--c-rosa);
  text-underline-offset: 0.35em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
