/* Optimized font loading */
/* File created: 2025-10-22 */

/* =============================================================================
   FONT-FACE DECLARATIONS
   ============================================================================= */


@font-face {
    font-family: "Captcha";
    src: url("../font/open_sans_semibold_italic.ttf") format('truetype');
    font-weight: 600;
    font-style: italic;
    font-display: swap; /* OPTIMASI: Prevent FOIT (Flash of Invisible Text) */
}


/* Instead of 9 separate font-family names, gunakan 1 family dengan weight */

/* Montserrat Regular (400) - MOST USED */
@font-face {
    font-family: "Montserrat";
    src: url("../font/Montserrat-Regular.otf") format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Montserrat Light (300) - USED */
@font-face {
    font-family: "Montserrat";
    src: url("../font/Montserrat-Light.otf") format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Montserrat SemiBold (600) - USED */
@font-face {
    font-family: "Montserrat";
    src: url("../font/Montserrat-SemiBold.otf") format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Montserrat Bold (700) - USED */
@font-face {
    font-family: "Montserrat";
    src: url("../font/Montserrat-Bold.otf") format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Montserrat Medium (500) - DEFINED but RARELY USED */
@font-face {
    font-family: "Montserrat";
    src: url("../font/Montserrat-Medium.otf") format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/*
   ont-face untuk ExtraLight, Thin, ExtraBold, Black dihapus
   karena TIDAK DIGUNAKAN di CSS.

   Jika dibutuhkan nanti, bisa di-uncomment:

   @font-face {
       font-family: "Montserrat";
       src: url("../font/Montserrat-ExtraLight.otf") format('opentype');
       font-weight: 200;
       font-style: normal;
       font-display: swap;
   }

   @font-face {
       font-family: "Montserrat";
       src: url("../font/Montserrat-Thin.otf") format('opentype');
       font-weight: 100;
       font-style: normal;
       font-display: swap;
   }

   @font-face {
       font-family: "Montserrat";
       src: url("../font/Montserrat-ExtraBold.otf") format('opentype');
       font-weight: 800;
       font-style: normal;
       font-display: swap;
   }

   @font-face {
       font-family: "Montserrat";
       src: url("../font/Montserrat-Black.otf") format('opentype');
       font-weight: 900;
       font-style: normal;
       font-display: swap;
   }
*/

/* =============================================================================
   BACKWARD COMPATIBILITY - OPTIMASI
   ============================================================================= */

/* OPTIMASI: Alias untuk backward compatibility dengan existing CSS */
/* Ini membuat existing CSS tetap work tanpa perlu update semua references */

@font-face {
    font-family: "Montserrat Regular";
    src: url("../font/Montserrat-Regular.otf") format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat Light";
    src: url("../font/Montserrat-Light.otf") format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat Semi Bold";
    src: url("../font/Montserrat-SemiBold.otf") format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat Bold";
    src: url("../font/Montserrat-Bold.otf") format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat Medium";
    src: url("../font/Montserrat-Medium.otf") format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* =============================================================================
   PERFORMANCE NOTES
   ============================================================================= */

/*
   BEFORE OPTIMIZATION:
   - 9 Montserrat variants loaded = ~3.5MB
   - No font-display = FOIT (Flash of Invisible Text)
   - Separate font-family names = hard to maintain

   AFTER OPTIMIZATION:
   - 5 Montserrat variants loaded = ~2MB (-43% size)
   - font-display: swap = No FOIT, text visible immediately
   - Unified font-family "Montserrat" dengan weight = easier to use
   - Backward compatibility aliases = no breaking changes

   FUTURE OPTIMIZATION:
   - Convert OTF/TTF to WOFF2 format = -60% size reduction
   - Subset fonts (only latin characters) = -40% size reduction
   - Self-host Font Awesome = no extra HTTP request
   - Remove unused Font Awesome icons = -80% size reduction
*/

