/* FONT OVERRIDE - Chỉ override những phần cần thiết để prevent font loading từ /css/common/font/ */
/* Load file này cuối cùng để override các font declarations */

/* ============================================
   1. Override Bootstrap CSS Variables
   ============================================ */
:root {
    --bs-font-sans-serif: "Arial", "Helvetica Neue", Helvetica, sans-serif !important;
}

/* ============================================
   2. Override @font-face để prevent browser load fonts từ /css/common/font/
   Browser sẽ dùng local fonts thay vì download
   ============================================ */

/* Prevent Roboto font loading - redirect to local Arial/Helvetica */
@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 100;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 500;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 600;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 800;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Roboto';
    src: local('Arial'), local('Helvetica');
    font-weight: 900;
    font-style: normal;
    font-display: block;
}

/* Prevent Source Sans Pro font loading - redirect to local Arial/Helvetica */
@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 100;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 500;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 600;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 800;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: local('Arial'), local('Helvetica');
    font-weight: 900;
    font-style: normal;
    font-display: block;
}

/* ============================================
   3. Override inline styles nếu có element dùng Roboto/Source Sans Pro
   Chỉ override khi detect trong inline style
   ============================================ */
[style*="font-family"][style*="Roboto"]:not(.fa):not(.glyphicon):not([class*="icon"]):not([class*="Icon"]) {
    font-family: "Times New Roman", Times, "Arial", "Helvetica Neue", Helvetica, sans-serif !important;
}

[style*="font-family"][style*="Source Sans Pro"]:not(.fa):not(.glyphicon):not([class*="icon"]):not([class*="Icon"]) {
    font-family: "Times New Roman", Times, "Arial", "Helvetica Neue", Helvetica, sans-serif !important;
}

/* ============================================
   4. Preserve Icon Fonts - KHÔNG override FontAwesome, Glyphicons
   ============================================ */
.fa, .fa:before, .fa:after, [class^="fa-"], [class*=" fa-"] {
    font-family: 'FontAwesome' !important;
}

.glyphicon, .glyphicon:before, .glyphicon:after, [class^="glyphicon-"], [class*=" glyphicon-"] {
    font-family: 'Glyphicons Halflings' !important;
}
