/* ==========================================================================
   base.css — Reset moderno + estilos base
   C&C Servicios Integrales S.R.L
   ========================================================================== */

/* --- Reset moderno --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Imágenes y medios --- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* --- Formularios y controles --- */
input,
button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Tipografía base --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: 0.02em;
}

p {
  max-width: 65ch;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* --- Accesibilidad: skip to content --- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-accent);
  color: #000;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-base);
  transition: top var(--transition-fast);
}

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

/* --- Focus visible (accesibilidad teclado) --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Selección de texto --- */
::selection {
  background-color: var(--color-accent);
  color: #000000;
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* --- Contenedor base --- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-12);
  }
}

/* --- Visualmente oculto pero accesible por screen readers --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* El atributo [hidden] no funciona si el elemento tiene display explícito en CSS.
   Este override garantiza que hidden siempre oculte el elemento. */
[hidden] {
  display: none !important;
}

/* --- Reducción de movimiento (OBLIGATORIO para todas las animaciones) --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
