/* =============================================================================
   base.css — Tipografías, jerarquía de texto, helpers
   ============================================================================= */

/* ---------------------------------------------------------------------------
   JERARQUÍA TIPOGRÁFICA — Epilogue para títulos, Be Vietnam Pro para UI
   --------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display, .title {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: var(--text-4xl); font-weight: 900; }
h2, .h2 { font-size: var(--text-3xl); font-weight: 800; }
h3, .h3 { font-size: var(--text-2xl); font-weight: 700; }
h4, .h4 { font-size: var(--text-xl); font-weight: 700; }
h5, .h5 { font-size: var(--text-lg); font-weight: 600; }
h6, .h6 { font-size: var(--text-base); font-weight: 600; }

/* Display gigante para hero */
.display {
  font-size: var(--text-5xl);
  font-weight: 900;
  line-height: 1.05;
}

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--text-5xl); }
  .display { font-size: var(--text-6xl); }
}

/* ---------------------------------------------------------------------------
   PÁRRAFOS Y TEXTO BASE
   --------------------------------------------------------------------------- */
p {
  color: var(--on-bg);
  font-size: var(--text-base);
  line-height: 1.65;
  margin-bottom: var(--space-4);
}

p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--on-bg);
  font-weight: 400;
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--on-bg-muted);
  font-weight: 400;
  line-height: 1.5;
}

/* Texto secundario y de baja jerarquía */
.hint, .sub, .timestamp, .meta {
  color: var(--on-bg-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

small, .text-small {
  font-size: var(--text-sm);
  color: var(--on-bg-muted);
}

/* ---------------------------------------------------------------------------
   ENLACES
   --------------------------------------------------------------------------- */
a {
  color: var(--violet);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--pink-dark);
}

a:focus-visible {
  outline: 2px solid var(--violet-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------------
   IMÁGENES
   --------------------------------------------------------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------------------------
   LISTAS
   --------------------------------------------------------------------------- */
ul, ol {
  padding-left: 1.25rem;
  color: var(--on-bg);
}

ul li, ol li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

/* Lista con bullets verdes (servicios de DBC) */
.list-services {
  list-style: none;
  padding-left: 0;
}

.list-services li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-2);
  color: var(--on-bg);
}

.list-services li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
}

/* ---------------------------------------------------------------------------
   CONTENEDORES Y LAYOUT BÁSICO
   --------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-prose {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container,
  .container-narrow,
  .container-prose {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* ---------------------------------------------------------------------------
   SECCIONES
   --------------------------------------------------------------------------- */
.section {
  padding: var(--space-12) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-20) 0;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header .section-title {
  margin-bottom: var(--space-4);
}

.section-header .subtitle {
  max-width: 700px;
  margin: 0 auto;
}

/* Variantes de fondo de sección */
.section-light    { background: var(--surface); }
.section-card     { background: var(--surface-low); }
.section-tinted   { background: var(--surface-mid); }
.section-dark     { background: var(--on-surface); color: var(--surface); }
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: var(--surface-low); }
.section-dark p   { color: var(--surface-mid); }

/* ---------------------------------------------------------------------------
   GRID HELPERS
   --------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------------
   ACCESIBILIDAD
   --------------------------------------------------------------------------- */

/* Texto sólo para lectores de pantalla */
.screen-reader-text,
.sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus,
.sr-only:focus {
  background-color: var(--surface-low);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 2px 2px var(--violet-dim);
  clip: auto !important;
  clip-path: none;
  color: var(--violet);
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Skip link (accesibilidad) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--violet);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
  color: white;
}

/* Reducir movimiento si el usuario lo prefiere */
@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;
  }
}

/* ---------------------------------------------------------------------------
   HELPERS UTILITARIOS
   --------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden    { display: none; }
.block     { display: block; }
.inline    { display: inline; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2     { gap: var(--space-2); }
.gap-4     { gap: var(--space-4); }
.gap-6     { gap: var(--space-6); }

@media (min-width: 768px) {
  .md-hidden { display: none; }
  .md-block  { display: block; }
  .md-flex   { display: flex; }
}

@media (max-width: 767px) {
  .mobile-hidden { display: none; }
}
