////
///
/// Text Indent Mixins
/// ===========================================================================
/// First-line, hanging and block indentation for running text.
///
/// @group Typography.Indent
/// @author Scape Press
/// @link https://scape.style
/// @since 0.1.0 initial release
/// @todo None
/// @access public
///
////

// ============================================================================
// Use
// ============================================================================

///
/// Mixin for applying a standard first-line text indent.
/// @param {Length} $amount [1.5em] - The amount of indentation.
///
@use "../../../01-core/external" as *;

@mixin text_indent($amount: baseline(4)) {
    text-indent: $amount;
}

///
/// Mixin for removing text indentation.
///
@mixin text_indent--none {
    text-indent: 0;
}

///
/// Mixin for extra small text indentation.
///
@mixin text_indent--xs {
    @include text_indent(baseline(2));
}

///
/// Mixin for small text indentation.
///
@mixin text_indent--sm {
    @include text_indent(baseline(3));
}

///
/// Mixin for medium text indentation.
///
@mixin text_indent--md {
    @include text_indent();
}

///
/// Mixin for large text indentation.
///
@mixin text_indent--lg {
    @include text_indent(baseline(6));
}

///
/// Mixin for extra large text indentation.
///
@mixin text_indent--xl {
    @include text_indent(baseline(8));
}

///
/// Hanging indent: the first line sits at the margin, the rest are indented
/// (bibliographies, references).
/// @param {Length} $amount [baseline(4)] - Depth of the hang.
///
@mixin text_indent--hanging($amount: baseline(4)) {
    padding-inline-start: $amount;
    text-indent: calc(-1 * #{$amount});
}

///
/// Block indent: the whole block is inset from both margins (quotations,
/// excerpts).
/// @param {Length} $amount [baseline(4)] - Inset on each side.
///
@mixin text_indent--block($amount: baseline(4)) {
    margin-inline: $amount;
}
