/* fonts.css - Font Override File */

/* === NUCLEAR IMPORT (Overrides everything) === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Poppins:wght@400;500;600&family=Yaldevi:wght@400;500;600;700&family=Abhaya+Libre:wght@400;500;600;700&display=swap');

/* === ATOMIC OVERRIDES === */
/* !important forces override of inline styles too */

/* 1. CRUSH ALL BODY/MAIN TEXT */
body,
p, span, div, li, td, th,
.about-text, .about-list li,
.footer-content, .footer-link, .footer-copyright,
.subject-card p,
.page-subtitle,
.resource-item,
.year-card,
.file-size {
    font-family: 'Poppins', 'Inter', sans-serif !important;
    font-weight: 400 !important;
}

/* 2. DESTROY ALL ENGLISH HEADINGS */
h1, h2, h3,
.header-title, .about-title, .choose-medium-title,
.page-title, .section-title, .category-title,
.main-title, .subheading,
.year-card h3, .subject-card h3:not(.sinhala-font),
.text-container h1, .text-container h2 {
    font-family: 'Montserrat', sans-serif !important;
}

/* Montserrat weights (override individually) */
h1, .page-title, .choose-medium-title, .header-title {
    font-weight: 800 !important; /* Extra-bold */
}

h2, .about-title, .section-title, .category-title {
    font-weight: 700 !important; /* Bold */
}

h3, .subheading, .card-title, .year-card h3 {
    font-weight: 600 !important; /* Semi-bold */
}

/* 3. ANNIHILATE ALL BUTTONS */
button, .medium-button, .download-btn, .tab-button,
.back-button, .menu-item:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
}

/* 4. NUKE SINHALA HEADINGS/TOPICS */
.sinhala-font.sinhala-topic,
.subject-card h3.sinhala-font,
.menu-item.sinhala-font,
.medium-button.sinhala-font,
.page-title.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}

/* 5. OBLITERATE SINHALA BODY TEXT */
.sinhala-font:not(.sinhala-topic),
[lang="si"]:not(h1):not(h2):not(h3):not(.sinhala-topic),
.subject-card p.sinhala-font,
.menu-sub-text.sinhala-font {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 400 !important;
}

/* 6. HEADER-SPECIFIC OVERRIDES */
.header-glass *:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
}

.header-glass .sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

/* 7. MENU OVERRIDES */
.menu-panel *:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
}

.menu-panel .sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

/* 8. SUBJECT CARD OVERRIDES */
.subject-card h3:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
}

.subject-card p:not(.sinhala-font) {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400 !important;
}

/* 9. FOOTER OVERRIDES */
.footer * {
    font-family: 'Poppins', sans-serif !important;
}

/* === UTILITY NUKES === */
/* Quick fixes for stubborn elements */
.font-override-english {
    font-family: 'Montserrat', sans-serif !important;
}

.font-override-sinhala-heading {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}

.font-override-sinhala-body {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 400 !important;
}
/* ===== FORCE WHITE TEXT IN CHEMISTRY SINHALA PAGE ===== */

/* Override all resource item titles */
.resource-item h3,
.resource-item .font-bold.text-xl {
    color: white !important;
}

/* Override all resource item descriptions */
.resource-item p,
.resource-item .text-gray-600 {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Override past paper item titles */
.past-paper-item h3,
.grade-title,
.term-title {
    color: white !important;
}

/* Override grade and term titles */
.grade-section .grade-title,
.term-section .term-title {
    color: white !important;
}

/* Override tab headings */
.tab-content h2 {
    color: white !important;
}
/* ===== ETERNAL FIXES - ADD TO EXISTING fonts.css ===== */

/* === PROBLEM 1: INDEX PAGE BUTTONS === */
/* Sinhala Medium button - Force Yaldevi */
.medium-button-sinhala.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

/* English Medium button - Make it bolder */
.medium-button-english {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important; /* Increased from 600 to 700 */
    letter-spacing: 0.5px !important;
}

/* === PROBLEM 2 & 3: HAMBURGER MENU - ETERNAL FIX === */
/* This will work on ALL pages (English and Sinhala) */

/* 1. Menu Title "NCSS කුප්පිය" - ALWAYS Yaldevi */
.menu-main-title {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.8rem !important;
}

/* 2. "සිංහල මාධ්‍ය" Category Title - ALWAYS Yaldevi */
.menu-category .category-title.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
    color: #c0c0c0 !important;
}

/* 3. "English Medium" Category Title - Montserrat */
.menu-category .category-title:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    color: #c0c0c0 !important;
}

/* 4. Sinhala Menu Items (like ජීවවිද්‍යාව) - Yaldevi */
.menu-item.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 500 !important;
}

/* 5. English Menu Items (like Biology) - Montserrat */
.menu-item:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important;
}

/* === LANGUAGE-BASED OVERRIDES FOR CONSISTENCY === */
/* These ensure fonts work based on html lang attribute */

/* English pages body text */
html[lang="en"] body {
    font-family: 'Poppins', 'Inter', sans-serif !important;
}

/* Sinhala pages body text */
html[lang="si"] body {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
}

/* English page headings */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] .page-title,
html[lang="en"] .section-title {
    font-family: 'Montserrat', sans-serif !important;
}

/* Sinhala page headings */
html[lang="si"] h1,
html[lang="si"] h2,
html[lang="si"] h3,
html[lang="si"] .page-title,
html[lang="si"] .section-title {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

/* === NUCLEAR OPTION: FORCE SINHALA FONT DETECTION === */
/* This catches any Sinhala text that might have been missed */
* {
    font-family: inherit !important;
}

/* Detect Sinhala Unicode range and apply Yaldevi */
*:not(script):not(style):not(link) {
    unicode-range: U+0D80-0DFF;
}
/* ===== ULTIMATE HAMBURGER MENU FIX ===== */
/* Add this LAST in your fonts.css file */

/* 1. NUCLEAR FIX for menu title - Must be last to override everything */
.menu-main-title,
.menu-panel .menu-main-title,
.side-menu .menu-main-title,
#sideMenu .menu-main-title,
html .menu-main-title,
body .menu-main-title,
* .menu-main-title {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.8rem !important;
}

/* 2. Ensure no other rules can override this */
.menu-title-area .menu-main-title,
.menu-panel .menu-title-area .menu-main-title {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important !important;
}

/* 3. Double-check for any inline style overrides */
.menu-main-title[style*="font-family"],
.menu-main-title[style*="font-family"] {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

/* 4. Also fix the Sinhala category title */
.menu-category .category-title.sinhala-font,
.menu-panel .category-title.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}
/* ===== FIX SINHALA PAGES FOOTER & ENGLISH TEXT ===== */

/* 1. Force ALL English text in Sinhala pages to use English fonts */
/* This targets Sinhala pages (html[lang="si"]) but applies English fonts to specific elements */
html[lang="si"] .footer,
html[lang="si"] .footer-content,
html[lang="si"] .footer-link,
html[lang="si"] .footer-copyright,
html[lang="si"] .social-icons,
html[lang="si"] .social-icon {
    font-family: 'Poppins', 'Montserrat', 'Inter', sans-serif !important;
    font-weight: 400 !important;
}

/* 2. Specifically target footer links and text */
html[lang="si"] .footer *:not(.sinhala-font) {
    font-family: 'Poppins', 'Montserrat', 'Inter', sans-serif !important;
}

/* 3. Fix any English text in resource items/cards in Sinhala pages */
html[lang="si"] .resource-item :not(.sinhala-font):not(span):not(.item-icon),
html[lang="si"] .year-card :not(.sinhala-font),
html[lang="si"] .past-paper-item :not(.sinhala-font) {
    font-family: 'Poppins', 'Montserrat', 'Inter', sans-serif !important;
}

/* 4. Nuclear option: Force English fonts on any element that doesn't have sinhala-font class */
html[lang="si"] *:not(.sinhala-font):not(script):not(style):not(link) {
    font-family: 'Poppins', 'Montserrat', 'Inter', sans-serif !important;
}

/* 5. But preserve Sinhala fonts where they should be */
html[lang="si"] .sinhala-font,
html[lang="si"] [class*="sinhala"],
html[lang="si"] .menu-main-title,
html[lang="si"] .category-title.sinhala-font,
html[lang="si"] .menu-item.sinhala-font {
    font-family: 'Yaldevi', 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
}

/* 6. Fix specific English elements that might appear in Sinhala pages */
html[lang="si"] .download-btn:not(.sinhala-font),
html[lang="si"] .tab-button:not(.sinhala-font),
html[lang="si"] .back-button:not(.sinhala-font),
html[lang="si"] .contact-link,
html[lang="si"] .page-subtitle:not(.sinhala-font) {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
}
/* ===== FIX SINHALA MEDIUM SUBJECT SELECTION PAGE ===== */

/* Sinhala Medium Page - Subject Cards */
/* Titles should be Yaldevi (headings) */
html[lang="si"] .subject-card h3,
html[lang="si"] .subject-card h3.sinhala-font,
.subject-card h3.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}

/* Descriptions should be Abhaya Libre (body) */
html[lang="si"] .subject-card p,
html[lang="si"] .subject-card p.sinhala-font,
.subject-card p.sinhala-font {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 400 !important;
}
/* Fix Sinhala Medium Subject Selection Page */
html[lang="si"] .subject-card h3,
.Subject-card h3.sinhala-font {
  font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
  font-weight: 600 !important;
}

html[lang="si"] .subject-card p,
.Subject-card p.sinhala-font {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
  font-weight: 400 !important;
}

/* Fix All Sinhala Subject Pages */
html[lang="si"] .resource-item h3,
.resource-item h3.sinhala-font {
  font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
  font-weight: 600 !important;
}

html[lang="si"] .resource-item p,
html[lang="si"] .resource-item .text-gray-600,
.resource-item p.sinhala-font,
.resource-item .text-gray-600.sinhala-font {
  font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
  font-weight: 400 !important;
}
/* ===== FINAL FIX - DON'T TOUCH ANYTHING ELSE ===== */

/* Sinhala Medium Subject Cards */
html[lang="si"] .subject-card h3.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

html[lang="si"] .subject-card p.sinhala-font {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
}

/* Sinhala Subject Pages */
html[lang="si"] .page-title.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

html[lang="si"] .page-subtitle.sinhala-font {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
}

html[lang="si"] .resource-item h3.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}

html[lang="si"] .resource-item p.sinhala-font {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
}

html[lang="si"] .grade-title.sinhala-font,
html[lang="si"] .term-title.sinhala-font {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
}
/* ===== SAFE FIX FOR SINHALA MED.HTML ONLY ===== */
/* Only affects the subject selection page, not subject pages */

/* Target ONLY the Sinhala Medium page with its specific structure */
html[lang="si"] .main-content .subjects-grid .subject-card h3 {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}

html[lang="si"] .main-content .subjects-grid .subject-card p {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 400 !important;
}

/* Page title fix for Sinhala Medium page only */
html[lang="si"] .main-content .page-title {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 800 !important;
}

/* Back button fix for Sinhala Medium page only */
html[lang="si"] .main-content .back-button {
    font-family: 'Yaldevi', 'Noto Sans Sinhala', sans-serif !important;
    font-weight: 600 !important;
}