/* ================================================================
   PHILOMANUS — Global Styles
   Tipografía, layout base y accesibilidad.
   Directiva: Quiet Confidence | Mobile-first
   ================================================================ */

/* ── Base ── */

html {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-light);
  background-color: var(--surface-page);
}

/* ── Contenedor ── */

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

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

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

/* ── Tipografía ── */

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  color: var(--color-light);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-5xl);
    font-weight: var(--weight-black);
  }
}

h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

@media (min-width: 768px) {
  h2 {
    font-size: var(--text-2xl);
  }
}

h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

@media (min-width: 768px) {
  h3 {
    font-size: var(--text-xl);
  }
}

p {
  max-width: var(--content-max-width);
}

/* Cuerpo destacado en desktop — Quiet Confidence: 18px base */
@media (min-width: 1024px) {
  .body-text {
    font-size: var(--text-md);
  }
}

/* ── Enlaces ── */

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

/* ── Secciones ── */

section {
  padding-block: var(--section-padding-y);
}

@media (min-width: 1024px) {
  section {
    padding-block: var(--section-padding-y-lg);
  }
}

/* ── Utilidades ── */

/* ── Skip Link (accesibilidad teclado) ── */

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

.skip-link:focus-visible {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: var(--space-4) var(--space-8);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 100000;
  background: var(--color-dark);
  color: var(--color-light);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

/* ── Cursor pointer global para interactivos ── */

a,
button,
[role="button"] {
  cursor: pointer;
}

.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;
}

.text-muted {
  color: var(--color-light-muted);
}

.text-center {
  text-align: center;
}

/* ── Accesibilidad de movimiento (WCAG 2.1 AA) ── */

@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;
  }
}
