@import 'lib/neat/neat-helpers';

$max-width: em(960) !default;
$max-vw-margins: 960 * 0.1; // 10vw
$max-width-huge-px: 960 - $max-vw-margins;
$max-width-huge: em($max-width-huge-px);

// Breakpoints
$tiny: em(480);
$small: em(600);
$medium: em(768);
$large: em(900);
$huge: em(960);
$huge-plus: $huge + em($max-vw-margins);
$jumbo: em(1500);
$massive: em(1800);

$tiny-down: new-breakpoint(max-width $tiny);
$tiny-up: new-breakpoint(min-width $tiny);
$small-up: new-breakpoint(min-width $small); // commonly-used
$medium-down: new-breakpoint(max-width $medium);
$medium-up: new-breakpoint(min-width $medium); // commonly-used
$large-up: new-breakpoint(min-width $large); // commonly-used
$huge-up: new-breakpoint(min-width $huge);
$jumbo-up: new-breakpoint(min-width $jumbo);
$massive-up: new-breakpoint(min-width $massive);

@mixin respond-to($media) {
  @if $media == tiny-down {
    @media only screen and (max-width: $tiny) { @content; }
  } @else if $media == tiny-up {
    @media only screen and (min-width: $tiny) { @content; }
  } @else if $media == tiny-to-small {
    @media only screen and (min-width: $tiny) and (max-width: $small) { @content; }
  } @else if $media == tiny-to-medium {
    @media only screen and (min-width: $tiny) and (max-width: $medium) { @content; }
  } @else if $media == small-down {
    @media only screen and (max-width: $small) { @content; }
  } @else if $media == small-up {
    @media only screen and (min-width: $small) { @content; }
  } @else if $media == small-to-medium {
    @media only screen and (min-width: $small) and (max-width: $medium) { @content; }
  } @else if $media == small-to-large {
    @media only screen and (min-width: $small) and (max-width: $large) { @content; }
  } @else if $media == small-to-huge {
    @media only screen and (min-width: $small) and (max-width: $huge) { @content; }
  } @else if $media == medium-down {
    @media only screen and (max-width: $medium) { @content; }
  } @else if $media == medium-up {
    @media only screen and (min-width: $medium) { @content; }
  } @else if $media == medium-to-large {
    @media only screen and (min-width: $medium) and (max-width: $large) { @content; }
  } @else if $media == medium-to-huge-plus {
    @media only screen and (min-width: $medium) and (max-width: $huge) { @content; }
  } @else if $media == medium-to-huge {
    @media only screen and (min-width: $medium) and (max-width: $huge-plus) { @content; }
  } @else if $media == large-up {
    @media only screen and (min-width: $large) { @content; }
  } @else if $media == huge-down {
    @media only screen and (max-width: $huge) { @content; }
  } @else if $media == huge-up {
    @media only screen and (min-width: $huge) { @content; }
  } @else if $media == huge-plus {
    @media only screen and (min-width: $huge) and (max-width: $huge-plus) { @content; }
  } @else if $media == huge-plus-up {
    @media only screen and (min-width: $huge-plus) { @content; }
  } @else if $media == jumbo-up {
    @media only screen and (min-width: $jumbo) { @content; }
  } @else if $media == massive-up {
    @media only screen and (min-width: $massive) { @content; }
  }
}

// Omega reset
// http://www.joshfry.me/blog/2013/05/13/omega-reset-for-bourbon-neat
@mixin omega-reset($nth) {
  &:nth-child(#{$nth}) { margin-right: flex-gutter(); }
  &:nth-child(#{$nth}+1) { clear: none }
}
