////
/// Layout
/// @group foundation/layout
////

$layout-width-data: (
  primary: (
    min: rem(480px),
    max: rem(672px)
  ),
  secondary: (
    min: rem(240px),
    max: rem(344px)
  ),
  nav: (
    base: rem(240px)
  ),
  page-with-nav: (
    base: rem(700px)
  ),
  page-content: (
    not-condensed: rem(680px),
    partially-condensed: rem(450px)
  ),
  inner-spacing: (
    base: spacing(loose)
  ),
  outer-spacing: (
    min: spacing(loose),
    max: spacing(extra-loose)
  )
);

/// Returns the widths of the specified column.
/// @param {String} $name - The column name.
/// @return {Number} The width for the column.

@function layout-width($name, $value: base) {
  $fetched-value: map-get(map-get($layout-width-data, $name), $value);

  @if type-of($fetched-value) != null {
    @return $fetched-value;
  } @else {
    @error 'Column `#{$name} - #{$value}` not found. Available columns: #{available-names($layout-width-data)}';
  }
}
