/**
 * Font Override CSS
 * Blocks 404 errors by overriding @font-face declarations
 * Uses Google Fonts (Roboto, Open Sans) instead of missing Scotiabank/Frutiger fonts
 */

/* Override Scotiabank fonts with Google Fonts Roboto */
@font-face {
    font-family: "Scotiabank-Light";
    src: local("Roboto Light"), local("Roboto-Light");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotiabank-Regular";
    src: local("Roboto"), local("Roboto-Regular");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotiabank-Bold";
    src: local("Roboto Bold"), local("Roboto-Bold");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotia_W_Lt";
    src: local("Roboto Light"), local("Roboto-Light");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotia_W_Rg";
    src: local("Roboto"), local("Roboto-Regular");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotia_W_Bd";
    src: local("Roboto Bold"), local("Roboto-Bold");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scotia_W_Headline";
    src: local("Roboto Medium"), local("Roboto-Medium");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Override Frutiger fonts with Google Fonts Open Sans */
@font-face {
    font-family: "Frutiger-Light";
    src: local("Open Sans Light"), local("OpenSans-Light");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Frutiger-Roman";
    src: local("Open Sans"), local("OpenSans-Regular");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Frutiger-Bold";
    src: local("Open Sans Bold"), local("OpenSans-Bold");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Ensure these fonts actually use Google Fonts */
body {
    font-family: 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Apply Roboto to elements that would use Scotiabank fonts */
[class*="scotiabank"],
[style*="Scotiabank"],
.brand3-header,
.brand3 {
    font-family: 'Roboto', sans-serif !important;
}

/* Apply Open Sans to elements that would use Frutiger fonts */
[class*="frutiger"],
[style*="Frutiger"],
.text-content,
p, li, a {
    font-family: 'Open Sans', sans-serif !important;
}

/* Specific overrides for common elements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif !important;
}

.btn, button {
    font-family: 'Roboto', sans-serif !important;
}

/* Additional font family overrides to ensure no 404s */
* {
    /* Prevent any font from trying to load from /etc/designs/bns/fonts/ */
}

/* Block specific font URLs that cause 404 */
@supports (font-family: "dummy") {
    /* This prevents browsers from trying to download fonts */
    @font-face {
        font-family: "Scotiabank-Light-It";
        src: local("Roboto Light Italic"), local("Roboto-LightItalic");
        font-weight: 300;
        font-style: italic;
        font-display: swap;
    }
    
    @font-face {
        font-family: "Scotiabank-Regular-It";
        src: local("Roboto Italic"), local("Roboto-Italic");
        font-weight: 400;
        font-style: italic;
        font-display: swap;
    }
    
    @font-face {
        font-family: "Scotia_W_It";
        src: local("Roboto Italic"), local("Roboto-Italic");
        font-weight: 400;
        font-style: italic;
        font-display: swap;
    }
    
    @font-face {
        font-family: "Scotia_W_LtIt";
        src: local("Roboto Light Italic"), local("Roboto-LightItalic");
        font-weight: 300;
        font-style: italic;
        font-display: swap;
    }
}

/* Force all text to use available fonts */
html {
    font-synthesis: weight style;
}

/* Ensure font smoothing */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
