/* Font Preloading to Prevent FOUT */

/* Font face declarations with preloading strategy */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap; /* Use swap for faster text visibility */
  src: url('../fonts/cormorant-garamond-v16-latin-300.woff2') format('woff2'),
       url('../fonts/cormorant-garamond-v16-latin-300.woff') format('woff');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v16-latin-regular.woff2') format('woff2'),
       url('../fonts/cormorant-garamond-v16-latin-regular.woff') format('woff');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v16-latin-500.woff2') format('woff2'),
       url('../fonts/cormorant-garamond-v16-latin-500.woff') format('woff');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v16-latin-600.woff2') format('woff2'),
       url('../fonts/cormorant-garamond-v16-latin-600.woff') format('woff');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v16-latin-italic.woff2') format('woff2'),
       url('../fonts/cormorant-garamond-v16-latin-italic.woff') format('woff');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/montserrat-v25-latin-300.woff2') format('woff2'),
       url('../fonts/montserrat-v25-latin-300.woff') format('woff');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-v25-latin-regular.woff2') format('woff2'),
       url('../fonts/montserrat-v25-latin-regular.woff') format('woff');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat-v25-latin-500.woff2') format('woff2'),
       url('../fonts/montserrat-v25-latin-500.woff') format('woff');
}

/* Font class definitions for consistent usage */
.font-primary {
  font-family: 'Cormorant Garamond', serif;
}

.font-secondary {
  font-family: 'Montserrat', sans-serif;
}

/* Apply font-display: optional to specific elements that can wait for font loading */
.non-critical-text {
  font-display: optional;
}

/* Font smoothing for better rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
