/*
 * Walking the World - Font Loading
 * 
 * Paper-printed aesthetic fonts for authentic feel.
 */

/* ===================================================================
   GOOGLE FONTS IMPORT - Paper-printed Aesthetic  
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Londrina+Solid:wght@400&family=Space+Mono:wght@400;700&display=swap');

/* ===================================================================
   FONT VARIABLES - Paper-printed Theme
   =================================================================== */

:root {
  --font-display: 'Londrina Solid', sans-serif;
  --font-body: 'Space Mono', 'Courier New', monospace;
  --font-interface: 'Space Mono', monospace;
  --font-mono: 'Space Mono', "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

/* ===================================================================
   LAMA TREE DS FONTS (TO BE INTEGRATED)
   =================================================================== */

/*
 * PLACEHOLDER: When Lama Tree DS fonts are available, add them here:
 * 
 * @font-face {
 *   font-family: 'LamaTreeDisplay';
 *   src: url('../fonts/lama-tree-display.woff2') format('woff2');
 *   font-weight: 400 700;
 *   font-display: swap;
 * }
 * 
 * @font-face {
 *   font-family: 'LamaTreeBody';
 *   src: url('../fonts/lama-tree-body.woff2') format('woff2');
 *   font-weight: 300 600;
 *   font-display: swap;
 * }
 * 
 * Then update the CSS variables:
 * --font-display: 'LamaTreeDisplay', Georgia, serif;
 * --font-body: 'LamaTreeBody', -apple-system, sans-serif;
 */

/* ===================================================================
   FALLBACK FONT LOADING
   =================================================================== */

/* Ensure smooth font loading with font-display: swap */
@supports (font-display: swap) {
  /* Future font-face declarations will use font-display: swap */
}

/* ===================================================================
   FONT PERFORMANCE OPTIMIZATIONS
   =================================================================== */

/* Reduce font rendering impact */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Optimize heading font rendering */
h1, h2, h3, h4, h5, h6 {
  font-synthesis: none;
  -webkit-font-feature-settings: "kern" 1, "liga" 1;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Optimize body text rendering */
p, li, td, th {
  -webkit-font-feature-settings: "kern" 1, "liga" 1;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Code font optimization */
code, pre {
  -webkit-font-feature-settings: "calt" 1;
  font-feature-settings: "calt" 1;
}

/* ===================================================================
   RESPONSIVE FONT LOADING
   =================================================================== */

/* Reduce font requests on slower connections */
@media (prefers-reduced-data: reduce) {
  /* Use system fonts only on data-sensitive connections */
  :root {
    --font-display: Georgia, serif;
    --font-body: -apple-system, sans-serif;
    --font-interface: -apple-system, sans-serif;
  }
}

/* ===================================================================
   FONT LOADING ERROR HANDLING
   =================================================================== */

/* Ensure readable fonts even if custom fonts fail to load */
.fonts-loading {
  /* Hide text briefly while fonts load */
  visibility: hidden;
}

.fonts-loaded,
.fonts-failed {
  /* Show text with loaded or fallback fonts */
  visibility: visible;
}