@use 'sass:meta';
@use 'iro-sass/src/bem';
@use 'iro-sass/src/props';
@use '../props' as *;

@forward 'media.vars';
@use 'media.vars' as vars;

@mixin styles {
    @include materialize-at-root(meta.module-variables('vars'));

    @include bem.layout('media') {
        display:     flex;
        gap:         props.get(vars.$gap);
        align-items: center;
        line-height: 1.4;

        @each $mod, $size in vars.$sizes {
            @include bem.modifier($mod) {
                gap: props.get($size);
            }
        }

        @include bem.modifier('wrap') {
            flex-wrap: wrap;
        }

        @include bem.elem('block') {
            flex: 0 0 auto;

            @include bem.modifier('shrink', 'main') {
                flex-shrink:     1;
                min-inline-size: 0;
            }

            @include bem.modifier('main') {
                inline-size: 100%;
            }
        }
    }
}