// Scale Settings
// --------------


// Browser Default Font Size
// -------------------------
/// The default font-size used by most browsers.
/// @access private
$_BROWSER-DEFAULT-FONT-SIZE: 16px;


// Default Ratios
// --------------
/// Common pre-defined ratios that you can access by name.
/// Numeric ratios (like the musical scale) are exponential -
/// while a 'linear' scale uses simple multipliers.
/// This variable should not be edited.
/// Use the `$ratios` variable to add your own ratios,
/// or aliases for built-in ratios.
///
/// @group config
/// @type Map
$_DEFAULT-RATIOS: (
  'octave': 2,
  'major-seventh': 15 / 8,
  'minor-seventh': 16 / 9,
  'major-sixth': 5 / 3,
  'minor-sixth': 8 / 5,
  'fifth': 3 / 2,
  'augmented-fourth': 45 / 32,
  'fourth': 4 / 3,
  'major-third': 5 / 4,
  'minor-third': 6 / 5,
  'major-second': 9 / 8,
  'minor-second': 16 / 15,
  'multiple': 'linear',
);


// Ratios
// ------
/// Defined your own ratios,
/// or aliases for built-in ratios.
///
/// @group config
/// @type Map
///
/// @example scss -
///   $ratios: (
///     'line-height': 1 / 3,
///     'headings': 'linear',
///     'golden': 1.61803399,
///   );
$ratios: () !default;


// Get Ratio
// ---------
/// Retrieve a ratio by name
/// from either the `$_DEFAULT-RATIOS`
/// or user `$ratios` configurations.
///
/// @access private
///
/// @param {String | Number} $ratio -
///   The key-name or value of a ratio
/// @return {Number} -
///   The numeric value of a ratio
@function _get-ratio(
  $ratio
) {
  $_ratio-options: map-merge($_DEFAULT-RATIOS, $ratios);
  $_new-ratio: map-get($_ratio-options, $ratio) or $ratio;

  @if ($ratio != $_new-ratio) and map-has-key($_ratio-options, $_new-ratio) {
    $_new-ratio: _get-ratio($_new-ratio);
  }

  @return $_new-ratio;
}


// Sizes
// -----
/// Defined a palette of common sizes to be used across your project,
/// in the format "name: size" or "name: basis (ratio: multiplier)".
/// If your map includes a value for `root`,
/// it will be used in relative-size unit conversions.
///
/// @group config
/// @type String
///
/// @property 'root' [16px] -
///   The root font size for your document,
///   used for calculating relative sizes.
$sizes: (
  'root': $_BROWSER-DEFAULT-FONT-SIZE,
  'text': 'root' ('convert-units': 'rem'),
  'rhythm': 'text' ('fifth': 1),

  'h1': 'text' ('linear': 4),
  'h2': 'text' ('linear': 3),
  'h3': 'text' ('linear': 2),
) !default;
