@use "sass:map" as map;
@use "../variables" as vars;
@use "../values/" as vals;
@use "../functions/" as func;

@if map.get(vals.$fds-font-weights, 'thin') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("thin");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-Thin.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-Thin.woff") format("woff");
    font-display: swap;
  }

  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("thin");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-ThinItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-ThinItalic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'extralight') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("extralight");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-ExtraLight.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-ExtraLight.woff") format("woff");
    font-display: swap;
  }

  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("extralight");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-ExtraLightItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-ExtraLightItalic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'light') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("light");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-Light.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-Light.woff") format("woff");
    font-display: swap;
  }

  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("light");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-LightItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-LightItalic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'normal') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("normal");
    src: url(vars.$font-path + 'complete/eot/IBMPlexSans-Regular.eot'), // IE9 Compat Modes
    url(vars.$font-path + 'complete/woff/IBMPlexSans-Regular.woff') format('woff'), // Modern Browsers
    url(vars.$font-path + 'complete/woff2/IBMPlexSans-Regular.woff2') format('woff2'), // Modern Browsers
    url(vars.$font-path + 'complete/ttf/IBMPlexSans-Regular.ttf')  format('truet ype'); // Safari, Android, iOS
    font-display: swap;
  }
  
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("normal");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-Italic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-Italic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'medium') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("medium");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-Medium.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-Medium.woff") format("woff");
    font-display: swap;
  }
  
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("medium");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-MediumItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-MediumItalic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'semibold') != false {
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("semibold");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-SemiBold.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-SemiBold.woff") format("woff");
    font-display: swap;
  }
  
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("semibold");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-SemiBoldItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-SemiBoldItalic.woff") format("woff");
    font-display: swap;
  }
}

@if map.get(vals.$fds-font-weights, 'bold') != false { 
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: func.font-weight("bold");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-Bold.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-Bold.woff") format("woff");
    font-display: swap;
  }
  
  @font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: func.font-weight("bold");
    src: url(vars.$font-path + "complete/woff2/IBMPlexSans-BoldItalic.woff2") format("woff2"), url(vars.$font-path + "complete/woff/IBMPlexSans-BoldItalic.woff") format("woff");
    font-display: swap;
  }
}

@font-face {
  font-family: system;
  src:  local(".SFNSText-Light"),                   // Mac OS X - El Captain
        local(".HelveticaNeueDeskInterface-Light"), // Mac OS X - Yosemite
        local(".LucidaGrandeUI"),                   // Mac OS X - Mavericks
        local("Ubuntu Light"),                      // Ubuntu
        local("Segoe UI Light"),                    // Windows - Vista
        local("Roboto-Light"),                      // Android - Ice Cream Sandwich (4.0)+
        local("DroidSans"),                         // Android - Cupcake (1.5) to Honeycomb (3.2.6)
        local("Tahoma");                            // Windows - XP
  font-style: normal;
  font-weight: func.font-weight("normal");
  font-display: swap;
}