/*
 * Custom Fonts for HUMO SAGRADO Theme
 * Font loading with fallbacks
 */

/* Inter Font Family */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-regular.woff2') format('woff2');
}

/* Usando solo Inter Regular disponible para todos los pesos */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-regular.woff2') format('woff2');
}

/* Playfair Display Font Family */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/playfair-display-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/playfair-display-bold.woff2') format('woff2');
}

/* Usando Playfair Display Bold para peso 900 */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../fonts/playfair-display-bold.woff2') format('woff2');
}

/* Font Variables */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Base font application */
body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.heading,
.site-title,
.entry-title,
.widget-title {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* Special heading weights */
h1, .h1 {
    font-weight: 900;
}

h2, .h2 {
    font-weight: 700;
}

h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-weight: 600;
}

/* Code and monospace */
code, pre, kbd, samp,
.code {
    font-family: var(--font-mono);
}

/* Font loading optimization */
.fonts-loading body {
    visibility: hidden;
}

.fonts-loaded body {
    visibility: visible;
}

/* Fallback for when fonts fail to load */
.fonts-failed body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fonts-failed h1, 
.fonts-failed h2, 
.fonts-failed h3, 
.fonts-failed h4, 
.fonts-failed h5, 
.fonts-failed h6,
.fonts-failed .heading,
.fonts-failed .site-title,
.fonts-failed .entry-title,
.fonts-failed .widget-title {
    font-family: Georgia, 'Times New Roman', serif;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        font-feature-settings: 'kern' 1;
    }
}

/* Print styles */
@media print {
    body {
        font-family: 'Times New Roman', serif;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Times New Roman', serif;
    }
}