/* ==========================================================================
   FONT CONFIGURATION
   ========================================================================== */

/**
 * Adobe Typekit Font Import
 * Contains filson-pro font family with all weights and styles
 * Kit ID: egu4fhs
 */
@import url('https://use.typekit.net/egu4fhs.css');

/**
 * Font Stack Configuration
 * Centralized font family definitions
 */
:root {
  /* Primary Font Family */
  --font-family-primary: 'filson-pro';

  /* Font Family Aliases */
  --font-family-base: var(--font-family-primary);
  --font-family-heading: var(--font-family-primary);
  --font-family-body: var(--font-family-primary);

  /* Monospace Font Family */
  --font-family-mono: 'filson-pro';
}

/**
 * Font Weight Configuration
 * Standardized font weights for filson-pro
 */
:root {
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Semantic Weight Aliases */
  --font-weight-normal: var(--font-weight-regular);
  --font-weight-strong: var(--font-weight-bold);
}

/**
 * Font Style Configuration
 */
:root {
  --font-style-normal: normal;
  --font-style-italic: italic;
}

/**
 * Base Typography Settings
 * Applied to html element as foundation
 */
html {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-regular);
  font-style: var(--font-style-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/**
 * Heading Font Configuration
 * Ensures all headings use the primary font
 */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family-heading);
}

/**
 * Body Text Font Configuration
 */
body, p, span, div, a, li, td, th,
input, textarea, select, button {
  font-family: var(--font-family-body);
}

/**
 * Monospace Elements
 */
code, kbd, pre, samp,
.code, .monospace {
  font-family: var(--font-family-mono) !important;
}

/**
 * Font Loading Optimization
 * Preload critical font weights for better performance
 */
@supports (font-display: swap) {
  /* This will be handled by the @import above, but we define the behavior */
  html {
    font-display: swap;
  }
}

/**
 * Font Fallback Behavior
 * Ensure graceful degradation if custom fonts fail to load
 */
@supports not (font-family: 'filson-pro') {
  :root {
    --font-family-primary: 'filson-pro';
  }
}

/**
 * Print Optimization
 * Use system fonts for better print performance
 */
@media print {
  * {
    font-family: 'filson-pro' !important;
  }

  code, pre {
    font-family: 'filson-pro' !important;
  }
}

/**
 * Development Helper
 * Uncomment to test font loading issues
 */
/*
.debug-fonts * {
  outline: 1px solid red;
}

.debug-fonts *:before {
  content: attr(data-font-family);
  font-size: 10px;
  color: red;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
}
*/
