/* ==========================================================================
   LOCAL FONT FALLBACKS - REPLACES GOOGLE FONTS
   Fast loading local fonts to prevent timeout issues
   ========================================================================== */

/* System Font Stacks - No external dependencies */
.font-literary-latin {
    font-family: 'Georgia', 'Times New Roman', 'Times', serif;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-literary-arabic {
    font-family: 'Tahoma', 'Arial Unicode MS', 'Arial', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-literary-chinese {
    font-family: 'SimSun', '宋体', 'MS Mincho', serif;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-literary-japanese {
    font-family: 'MS Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-literary-korean {
    font-family: 'Batang', '바탕', 'MS Mincho', serif;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-ui-latin {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.font-ui-arabic {
    font-family: 'Tahoma', 'Segoe UI', 'Arial Unicode MS', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Review & Post Typography with Local Fonts */
.review-content,
.post-content-full {
    font-family: 'Georgia', 'Times New Roman', 'Times', 'Tahoma', 'Arial Unicode MS', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #2c3e50;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-spacing: 0.05em;
    margin-bottom: 1.5em;
}

.review-title,
.post-title-main {
    font-family: 'Georgia', 'Times New Roman', 'Times', 'Tahoma', serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #1a202c;
    margin-bottom: 1rem;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.post-content {
    font-family: 'Georgia', 'Times New Roman', 'Times', 'Tahoma', serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #4a5568;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.review-summary,
.post-meta {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #718096;
    font-feature-settings: "liga" 1, "kern" 1;
}

.publication-card .card-title,
.review-card .card-title,
.study-card .card-title {
    font-family: 'Georgia', 'Times New Roman', 'Times', 'Tahoma', serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #2d3748;
    font-feature-settings: "liga" 1, "kern" 1;
}

/* Responsive Typography */
@media (min-width: 1200px) {
    .review-content,
    .post-content-full {
        font-size: 19px;
        line-height: 1.8;
        max-width: 65ch;
        margin: 0 auto 1.5em auto;
    }
    
    .review-title,
    .post-title-main {
        font-size: 32px;
        line-height: 1.25;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .review-content,
    .post-content-full {
        font-size: 17px;
        line-height: 1.7;
        max-width: 70ch;
    }
    
    .review-title,
    .post-title-main {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .review-content,
    .post-content-full {
        font-size: 16px;
        line-height: 1.65;
        text-align: left;
        max-width: none;
    }
    
    .review-title,
    .post-title-main {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .post-content {
        font-size: 15px;
        line-height: 1.55;
    }
}

/* Language-specific enhancements */
.review-content[lang="ar"],
.review-content[lang="fa"],
.review-content[lang="ur"],
.review-content.arabic-text,
.post-content-full[lang="ar"],
.post-content-full[lang="fa"],
.post-content-full[lang="ur"],
.post-content-full.arabic-text {
    font-family: 'Tahoma', 'Arial Unicode MS', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    font-size: 19px;
    line-height: 1.9;
    letter-spacing: 0.03em;
    word-spacing: 0.1em;
    font-feature-settings: "liga" 1, "kern" 1;
}

.review-title[lang="ar"],
.review-title[lang="fa"],
.review-title[lang="ur"],
.review-title.arabic-text,
.post-title-main[lang="ar"],
.post-title-main[lang="fa"],
.post-title-main[lang="ur"],
.post-title-main.arabic-text {
    font-family: 'Tahoma', 'Arial Unicode MS', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    font-size: 24px;
    line-height: 1.4;
    font-weight: 600;
}

/* Universal literary text class */
.universal-literary-text {
    font-family: 'Georgia', 'Times New Roman', 'Times', 'Tahoma', 'Arial Unicode MS', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

/* Font loading error fallbacks */
.font-loading-error {
    font-family: 'Georgia', 'Times New Roman', 'Times', serif !important;
}

.font-loading-error-ui {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

.fonts-failed .review-content,
.fonts-failed .post-content-full {
    font-family: 'Georgia', 'Times New Roman', 'Times', serif !important;
}

.fonts-failed .review-summary,
.fonts-failed .post-meta {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
} 