@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel>
@using Dynamicweb.Frontend

<section data-swift-gridrow="@Model.Definition.Id"
	style="@Model.BackgroundImage?.ToBackgroundStyle(new () { Width=1680 }, true)" 
	data-dw-colorscheme="@Model.ColorScheme?.Id" 
	data-dw-itemtype="@Model.Item?.SystemName?.ToLower()" 
	data-dw-row-space-top="@(Model.TopSpacing ?? 1)" 
	data-dw-row-space-bottom="@(Model.BottomSpacing ?? 1)" 
	data-dw-row-gap-column="@(Model.GapX ?? 4)"
	data-dw-row-gap-row="@(Model.GapX ?? 3)"
	data-dw-row-vertical-align="@(Model.VerticalAlignment)">

	<div data-swift-container class="d-flex" data-dw-container-width="@(Model.ContainerWidth ?? 3)">
		@foreach(var column in Model.Columns)
		{
			string? flexFill = column.FitToContent ? null : "flex-fill";

			<div data-swift-gridcolumn class="@flexFill" data-dw-itemtype="@column.Paragraph?.Item?.SystemName?.ToLower()" id="@column.Paragraph?.ID" data-dw-colorscheme="@column.Paragraph?.ColorScheme?.Id">
				@column.Output()
			</div>
		}
	</div>
</section>

