/* Оптимизированная загрузка шрифтов */

/* Системные шрифты как fallback */
body {
    font-family: 
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
}

/* Preload локальных шрифтов */
@font-face {
    font-family: 'Novelist';
    src: url('../fonts/Novelist_free.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Miama Nueva';
    src: url('../fonts/miama-nueva.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Alegreya Sans Font Family */
@font-face {
    font-family: 'Alegreya Sans';
    src: url('../fonts/alegreya-sans-300.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('../fonts/alegreya-sans-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('../fonts/alegreya-sans-500.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('../fonts/alegreya-sans-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Font classes для оптимизации */
.font-novelist {
    font-family: 'Novelist', serif;
}

.font-miama {
    font-family: 'Miama Nueva', 'Roboto', sans-serif;
}


/* Избегаем FOUT - Flash of Unstyled Text */
.font-loading {
    visibility: hidden;
}

.font-loaded .font-loading {
    visibility: visible;
}

/* Оптимизированные размеры шрифтов */
h1, h2, h3 {
    font-family: 'Novelist', serif;
}

h2, h3 {
    font-family: 'Alegreya Sans', sans-serif;
}

.banner {
    font-family: 'Miama Nueva', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Responsive font sizes */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
}

/* Updated timestamp for cache busting */