/* ==========================================================================
   DevSEOMaker — base.css
   --------------------------------------------------------------------------
   Reset moderno + estilos por defecto de los elementos HTML.
   Aquí NO van clases de componentes (eso está en components.css).
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Al saltar a un #ancla, deja hueco para la cabecera fija */
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/* Desplazamiento suave solo si el usuario no ha pedido reducir movimiento */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* En móvil se reserva espacio para la barra fija inferior (WhatsApp/Auditoría) */
@media (max-width: 1023px) {
  body {
    padding-bottom: var(--mobile-bar-height);
  }
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ---- Tipografía ------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  text-wrap: balance; /* Reparte las palabras entre líneas de forma equilibrada */
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-2xl); }
h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}
h4 { font-size: var(--text-lg); font-weight: var(--weight-bold); }

p {
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

li + li {
  margin-top: var(--space-2);
}

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

a {
  color: var(--color-blue);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* El atributo HTML "hidden" debe ocultar SIEMPRE, aunque una clase
   (p. ej. .btn con display:inline-flex) intente mostrar el elemento.
   El JS usa hidden para menús, desplegables y botones del formulario. */
[hidden] {
  display: none !important;
}

/* ---- Accesibilidad --------------------------------------------------------- */

/* Anillo de foco visible solo al navegar con teclado (no al hacer clic) */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* Oculta visualmente pero lo mantiene para lectores de pantalla */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Enlace "Saltar al contenido": invisible hasta que se navega con Tab */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
}

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

/* Si el usuario pide reducir movimiento, se anulan animaciones y transiciones */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
