/* ==========================================================================
   FONT OVERRIDE - TARGETED APPROACH
   Forces custom fonts ONLY on card titles, NOT on body content
   Applies to BOTH Profile and Explore page cards
   ========================================================================== */

/* CRITICAL: Force Vazirmatn on ALL card titles (Profile & Explore) */
.cards-grid .card-title,
.cards-grid h6.card-title,
.cards-grid h5.card-title,
.cards-grid h4.card-title,
.cards-grid .cards-grid__post-card__title,
.cards-grid .study-title-overlay,
.cards-grid .review-title-text,
.cards-grid .review-header .review-title-text,
.cards-grid .new-review-card .review-title-text,
.cards-grid .review-card .review-title-text,
/* EXPLORE PAGE CARDS */
.explore-card .card-title,
.explore-card h6.card-title,
.explore-card h5.card-title,
.explore-card h4.card-title,
.explore-card .study-title-overlay,
.explore-card .review-title-text,
.explore-card .review-header .review-title-text,
.explore-card-wrapper .card-title,
.explore-card-wrapper .study-title-overlay,
.explore-card-wrapper .review-title-text {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* Force Inter for explicitly English-marked titles */
.cards-grid .card-title[lang="en"],
.cards-grid .review-title-text[lang="en"],
.cards-grid .review-title-text.direction-ltr,
.explore-card .card-title[lang="en"],
.explore-card .review-title-text[lang="en"],
.explore-card .review-title-text.direction-ltr {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Arial', sans-serif !important;
}

/* Card subtitles - use custom fonts (Profile & Explore) */
.cards-grid .card-subtitle,
.cards-grid .cards-grid__post-card__subtitle,
.explore-card .card-subtitle,
.explore-card-wrapper .card-subtitle {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* Card text/body - use custom fonts (Profile & Explore) */
.cards-grid .card-text,
.cards-grid .cards-grid__post-card__text,
.cards-grid .card-body,
.cards-grid .unified-card .card-body,
.cards-grid .study-card .card-body,
.cards-grid .publication-card .card-body,
.cards-grid .cards-grid__post-card__body,
.explore-card .card-text,
.explore-card-wrapper .card-text,
.explore-card .card-body,
.explore-card-wrapper .card-body {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* IMPORTANT: DO NOT apply custom fonts to review card body content */
/* Let review content use default system fonts for better performance */
.cards-grid .review-content-area,
.cards-grid .new-review-card .review-content-area,
.cards-grid .review-card .review-content-area,
.explore-card .review-content-area,
.explore-card .new-review-card .review-content-area,
.explore-card-wrapper .review-content-area {
    font-family: inherit !important; /* Use default system font */
}

/* CRITICAL: Explore review body text - LIGHT MODE ONLY (dark mode handled in dark-mode-cards.css) */
@media (prefers-color-scheme: light), (prefers-color-scheme: no-preference) {
    #exploreFeed .review-text-content,
    #exploreFeed .review-content-area .review-text-content {
        color: #333333 !important;
    }
}

/* Apply font rendering features for better appearance (Profile & Explore) */
.cards-grid .card-title,
.cards-grid .review-title-text,
.cards-grid .card-subtitle,
.cards-grid .card-text,
.explore-card .card-title,
.explore-card .review-title-text,
.explore-card .card-subtitle,
.explore-card .card-text,
/* CRITICAL: Explore review body - same legibility as profile review body */
#exploreFeed .review-text-content,
#exploreFeed .review-content-area .review-text-content {
    font-feature-settings: "liga" 1, "kern" 1, "calt" 1 !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* ==========================================================================
   DETAIL PAGE ELEMENTS (Study, Publication, Post Details)
   Applied to full detail views
   ========================================================================== */

/* Detail page titles (h4.card-title) */
.container .card .card-body h4.card-title,
.container .card-body h4.card-title,
.card h4.card-title,
h4.card-title {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* Detail page text-muted paragraphs */
.container .card .card-body p.text-muted,
.container .card-body p.text-muted,
.card-body p.text-muted,
p.text-muted {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* Detail page strong elements (authors, publishers, etc.) */
.container .card .card-body strong,
.container .card-body strong,
.card-body strong,
.row strong,
strong {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   REVIEW DETAIL PAGE ELEMENTS
   ========================================================================== */

/* Review detail page title (h2.review-title-inline) */
.review-header-card h2.review-title-inline,
h2.review-title-inline,
.review-title-inline {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 700 !important;
}

/* Review author link (inside .review-by) */
.review-by a,
.review-by strong a,
.review-header-inline .review-by a,
a.text-decoration-none.text-dark {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* Review info section text (external work details) */
.review-info-section p.text-muted,
.external-work-details-section p.text-muted,
.external-work-card p.text-muted,
p.text-muted.small {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* ==========================================================================
   PUBLICATION DETAIL PAGE ELEMENTS
   ========================================================================== */

/* Publication detail page title (h1.publication-title) */
.publication-header h1.publication-title,
h1.publication-title,
.publication-title {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 700 !important;
}

/* Publication author name */
.publication-author a strong,
.publication-author strong,
p.publication-author a strong,
p.publication-author strong {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* Publication info content (language, genre, etc.) */
.complete-book-info-section .info-card .info-content span,
.book-info-grid .info-card .info-content span,
.info-card .info-content span,
.info-content span {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* Publication description content */
.publication-description .description-content,
.publication-main-content .description-content,
.description-content {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    /* Text justification - language-aware */
    text-align: justify !important;
    text-align-last: right !important; /* Default for Persian RTL */
    direction: rtl !important; /* Default for Persian */
}

/* English paragraphs in description content */
.description-content[lang="en"],
.description-content[dir="ltr"],
.description-content p[lang="en"],
.description-content p[dir="ltr"] {
    text-align: justify !important;
    text-align-last: left !important; /* For English LTR */
    direction: ltr !important;
}

/* Persian paragraphs in description content */
.description-content[lang="fa"],
.description-content[dir="rtl"],
.description-content p[lang="fa"],
.description-content p[dir="rtl"] {
    text-align: justify !important;
    text-align-last: right !important; /* For Persian RTL */
    direction: rtl !important;
}

/* ==========================================================================
   PUBLICATION DETAIL PAGE - REVIEW CARDS SECTION
   ========================================================================== */

/* Review cards in publication detail page */
.reviews-of-my-books-section .simple-review-card .simple-review-title,
.reviews-of-my-books-section h6.simple-review-title,
.recent-reviews-list .simple-review-title,
.simple-review-title {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 600 !important;
}

/* Reviewer username in review cards */
.reviews-of-my-books-section .simple-review-username-link,
.reviews-of-my-books-section .simple-review-username-text,
.recent-reviews-list .simple-review-username-link,
.recent-reviews-list .simple-review-username-text,
.simple-review-username-link,
.simple-review-username-text {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* Review labels */
.reviews-of-my-books-section .simple-review-label,
.recent-reviews-list .simple-review-label,
.simple-review-label {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* ==========================================================================
   POST DETAIL PAGE ELEMENTS
   ========================================================================== */

/* Post detail page title (h1.h3 in card-header) */
article.card .card-header h1.h3,
article.card .card-header h1,
.card-header h1.h3,
h1.h3 {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 700 !important;
}

/* Post detail page content (article card-body) */
article.card .card-body,
article .card-body {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
}
