@use 'sass:list';

/// Computes the top shadow for a Material Design depth effect. Used by the
/// `depth-level()` mixin.
///
/// @param {Number} $depth - The shadow effect's depth level.
/// @param {Color} $color [#000] - The color of the shadow effect.
/// @param {Number} $intensity [1] - An optional value that is multiplied with
/// the default color opacity to increase or decrease the intensity of the
/// effect.
///
/// @return {List} Computed values for the top-shadow.
///
/// @access public
/// @group Utilities
/// @see {mixin} depth-level
@function top-shadow($depth, $color, $intensity) {
  $primary-offset: list.nth(1.5 3 10 14 19, $depth) * 1px;
  $blur: list.nth(1.5 3 10 14 19, $depth) * 4px;
  $color: rgba($color, $intensity * list.nth(0.12 0.16 0.19 0.25 0.3, $depth));

  @return 0 $primary-offset $blur $color;
}
