/* ==========================================================================
   RedVivienda · base.css
   Normalización, elementos HTML por defecto, tipografía y utilidades.
   ========================================================================== */

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

/* `hidden` debe ganar a cualquier `display` de componente. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--c-ink-800);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--c-ink-900);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -.02em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-brand-700); }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }

table { border-collapse: collapse; width: 100%; }

hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-6) 0; }

:focus-visible {
  outline: 2px solid var(--c-brand-600);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--c-brand-100); color: var(--c-brand-900); }

/* --- Utilidades --------------------------------------------------------- */

.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.u-skip-link {
  position: absolute;
  left: var(--s-4);
  top: -60px;
  z-index: var(--z-toast);
  background: var(--c-ink-900);
  color: var(--c-white);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  transition: top var(--t-base);
}
.u-skip-link:focus { top: var(--s-4); color: var(--c-white); }

.u-muted   { color: var(--c-ink-500); }
.u-small   { font-size: var(--fs-sm); }
.u-xsmall  { font-size: var(--fs-xs); }
.u-strong  { font-weight: 650; }
.u-center  { text-align: center; }
.u-spacer  { flex: 1 1 auto; }
.u-nowrap  { white-space: nowrap; }
.u-mt-0    { margin-top: 0 !important; }
.u-hide    { display: none !important; }

.u-legal {
  font-size: var(--fs-2xs);
  color: var(--c-ink-400);
  line-height: 1.45;
}
