@use 'sass:map';
@use '~@angular/material' as mat;

@mixin color($theme) {
  $config: mat.get-color-config($theme);
  $foreground: map.get($config, foreground);
  $is-dark-theme: mat.get-color-from-palette($theme, is-dark);
  $text-color: mat.get-color-from-palette($foreground, text);

  mtna-page-not-found {
    h2 {
      color: mat.get-color-from-palette($foreground, text);
    }
    .mat-icon {
      color: mat.get-color-from-palette($foreground, secondary-text);
    }
    svg {
      @if $is-dark-theme {
        .text,
        .logo-left-arrow,
        .logo-right-arrow {
          fill: $text-color;
        }
      } @else {
        .text {
          fill: #353b47;
        }
        .logo-left-arrow {
          fill: #00609c;
        }
        .logo-right-arrow {
          fill: #80bc00;
        }
      }
    }
  }
}

@mixin typography($theme) {
  h2 {
    $typography-config: mat.get-typography-config($theme);
    @if $typography-config != null {
      font-family: mat.font-family($typography-config);
    } @else {
      font-family: 'Comfortaa', 'Roboto', sans-serif;
    }
  }
}

@mixin theme($theme) {
  $config: mat.get-color-config($theme);
  @if $config != null {
    @include color($theme);
  }
  @include typography($theme);
}
