/* ==========================================================================
   SISTEMA TIPOGRÁFICO - EXPOSICIÓN FOTOGRÁFICA
   Fuente Principal: Sora (Google Fonts)
   Fuentes de Respaldo: Arial, Helvetica, sans-serif
   ========================================================================== */

/* ==========================================================================
   CONFIGURACIÓN DE FALLBACKS Y OPTIMIZACIÓN
   ========================================================================== */

/* Fallback local si Google Fonts no está disponible */
@font-face {
  font-family: "Sora-Fallback";
  src: local("Arial"), local("Helvetica"), local("sans-serif");
  font-display: swap;
}

/* ==========================================================================
   CLASES TIPOGRÁFICAS ESPECÍFICAS
   ========================================================================== */

/* Títulos y Encabezados */
.title-hero {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.title-section {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.title-card {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: 1.25rem;
  line-height: 1.3;
}

/* Texto de Contenido */
.text-lead {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-light);
  font-size: 1.125rem;
  line-height: 1.6;
}

.text-body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 1rem;
  line-height: 1.5;
}

.text-small {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 0.875rem;
  line-height: 1.4;
}

.text-caption {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-light);
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--brown-dark);
  opacity: 0.8;
}

/* Elementos de Interfaz */
.btn-text {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
  letter-spacing: 0.025em;
  text-transform: none;
}

.form-label-text {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: 0.9rem;
  color: var(--brown-dark);
}

.nav-text {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* Estados Especiales */
.text-highlight {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  color: var(--brown-primary);
}

.text-muted-custom {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-light);
  color: var(--brown-dark);
  opacity: 0.7;
}

.text-error {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 0.875rem;
  color: #dc3545;
}

.text-success {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 0.875rem;
  color: #198754;
}

/* ==========================================================================
   RESPONSIVE TYPOGRAPHY
   ========================================================================== */

/* Escalado fluido para diferentes pantallas */
@media (max-width: 768px) {
  .title-hero {
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 1.15;
  }

  .title-section {
    font-size: clamp(1.5rem, 6vw, 1.75rem);
  }

  .text-lead {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .title-hero {
    font-size: clamp(1.75rem, 9vw, 2rem);
  }

  .title-section {
    font-size: clamp(1.25rem, 7vw, 1.5rem);
  }

  .text-lead {
    font-size: 1rem;
  }

  .text-body {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   OVERRIDE BOOTSTRAP TYPOGRAPHY
   ========================================================================== */

/* Sobrescribir estilos de Bootstrap para usar Sora */
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary) !important;
}

.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-bold) !important;
}

.lead {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-light) !important;
}

.btn {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-medium) !important;
}

.form-label {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-medium) !important;
}

.form-control,
.form-select {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-regular) !important;
}

.nav-link {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-regular) !important;
}

.card-title {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-semibold) !important;
}

.card-text {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-weight-regular) !important;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATION
   ========================================================================== */

/* Optimización de renderizado de texto */
* {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Preload hint para la fuente principal */
link[href*="fonts.googleapis.com"] {
  font-display: swap;
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Mejoras para lectura y accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Contraste mejorado para texto pequeño */
.text-small,
.text-caption {
  font-weight: var(--font-weight-regular);
}

/* Espaciado mejorado para legibilidad */
p,
.text-body {
  /*max-width: 65ch;  Líneas óptimas de lectura */
  word-spacing: 0.05em;
}

/* ==========================================================================
   UTILIDADES ADICIONALES
   ========================================================================== */

/* Clases de utilidad para casos específicos */
.font-numeric {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.font-italic {
  font-style: italic;
}

.text-uppercase-spaced {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--font-weight-medium);
}

.text-balance {
  text-wrap: balance;
}

/* Estilos para texto en imágenes */
.text-on-image {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  color: var(--white);
}
