////
/// @group sheet
////

.sheet {
	background-color: $sheet-bg;
	border-color: $sheet-border-color;
	border-style: $sheet-border-style;
	border-width: $sheet-border-width;

	@include border-radius($sheet-border-radius);

	padding-bottom: $sheet-padding-bottom;
	padding-left:  $sheet-padding-left;
	padding-right:  $sheet-padding-right;
	padding-top: $sheet-padding-top;

	@include clay-scale-component {
		padding-bottom: $sheet-padding-bottom-mobile;
		padding-left:  $sheet-padding-left-mobile;
		padding-right:  $sheet-padding-right-mobile;
		padding-top: $sheet-padding-top-mobile;
	}

	.panel-group {
		&,
		.panel:last-child .panel-body {
			margin-bottom: $sheet-panel-group-margin-bottom;

			@include clay-scale-component {
				margin-bottom: $sheet-panel-group-margin-bottom-mobile;
			}
		}

		.panel-body {
			margin-bottom: $sheet-section-margin-bottom;

			@include clay-scale-component {
				margin-bottom: $sheet-section-margin-bottom-mobile;
			}
		}
	}
}

.sheet-header {
	margin-bottom: $sheet-header-margin-bottom;

	@include clay-scale-component {
		margin-bottom: $sheet-header-margin-bottom-mobile;
	}

	&::after {
		clear: both;
		content: '';
		display: block;
	}
}

.sheet-section {
	margin-bottom: $sheet-section-margin-bottom;

	@include clay-scale-component {
		margin-bottom: $sheet-section-margin-bottom-mobile;
	}

	> fieldset {
		margin-bottom: -$sheet-section-margin-bottom;

		@include clay-scale-component {
			margin-bottom: -$sheet-section-margin-bottom-mobile;
		}
	}

	> .card-page:last-child,
	.card-page-last {
		margin-bottom: -$card-margin-bottom;
	}

	&::after {
		clear: both;
		content: '';
		display: block;
	}
}

fieldset {
	+ .sheet-footer {
		margin-top: 0;
	}
}

.sheet-footer {
	display: flex;
	margin-bottom: $sheet-footer-margin-bottom;
	margin-left: $sheet-footer-margin-left;
	margin-right: $sheet-footer-margin-right;
	margin-top: $sheet-footer-margin-top;

	@include clay-scale-component {
		margin-bottom: $sheet-footer-margin-bottom-mobile;
		margin-left: $sheet-footer-margin-left-mobile;
		margin-right: $sheet-footer-margin-right-mobile;
		margin-top: $sheet-footer-margin-top-mobile;
	}

	&::after {
		clear: both;
		content: '';
		display: block;
	}
}

.sheet-footer-btn-block-sm-down {
	@include sheet-footer-btn-block($sheet-footer-btn-block-sm-down);
}

// Sheet Sizes

/// @deprecated as of v3.x use `.container .sheet` instead

.sheet-lg {
	margin-left: auto;
	margin-right: auto;
	max-width: $sheet-lg-max-width;
}

// Sheet Title

.sheet-title {
	color: $sheet-title-color;
	display: block;
	font-size: $sheet-title-font-size;
	font-weight: $sheet-title-font-weight;
	line-height: $sheet-title-line-height;
	margin-bottom: $sheet-title-margin-bottom;
	word-wrap: break-word;

	@include clay-scale-component {
		font-size: $sheet-title-font-size-mobile;
		margin-bottom: $sheet-title-margin-bottom-mobile;
	}
}

// Sheet Subtitle

.sheet-subtitle {
	border-color: $sheet-subtitle-border-color;
	border-style: $sheet-subtitle-border-style;
	border-width: $sheet-subtitle-border-width;
	color: $sheet-subtitle-color;
	display: block;
	font-size: $sheet-subtitle-font-size;
	font-weight: $sheet-subtitle-font-weight;
	line-height: $sheet-subtitle-line-height;
	margin-bottom: $sheet-subtitle-margin-bottom;
	padding-bottom: $sheet-subtitle-padding-y;
	padding-left: $sheet-subtitle-padding-x;
	padding-right: $sheet-subtitle-padding-x;
	padding-top: $sheet-subtitle-padding-y;
	position: relative;
	text-transform: $sheet-subtitle-text-transform;
	word-wrap: break-word;

	@include clay-scale-component {
		font-size: $sheet-subtitle-font-size-mobile;
		margin-bottom: $sheet-subtitle-margin-bottom-mobile;
	}

	&.autofit-row {
		padding-bottom: 0;

		.autofit-col {
			margin-bottom: $sheet-subtitle-padding-y;
		}
	}

	&.collapse-icon {
		padding-left: $sheet-subtitle-collapse-icon-padding-left;
		padding-right: $sheet-subtitle-collapse-icon-padding-right;
	}

	.collapse-icon-closed,
	.collapse-icon-open {
		bottom: $sheet-subtitle-collapse-icon-bottom;
		font-size: $sheet-subtitle-collapse-icon-font-size;
		left: $sheet-subtitle-collapse-icon-left;
		right: $sheet-subtitle-collapse-icon-right;
		top: $sheet-subtitle-collapse-icon-top;
	}

	.heading-text {
		margin-bottom: $sheet-subtitle-heading-text-margin-bottom;
		margin-top: $sheet-subtitle-heading-text-margin-top;
	}

	a,
	.btn {
		text-transform: none;
	}
}

a.sheet-subtitle {
	@include clay-link($sheet-subtitle-link);
}

// Sheet Tertiary Title

.sheet-tertiary-title {
	color: $sheet-tertiary-title-color;
	display: block;
	font-size: $sheet-tertiary-title-font-size;
	font-weight: $sheet-tertiary-title-font-weight;
	line-height: $sheet-tertiary-title-line-height;
	margin-bottom: $sheet-tertiary-title-margin-bottom;
	padding-bottom: $sheet-tertiary-title-padding-y;
	padding-left: $sheet-tertiary-title-padding-x;
	padding-right: $sheet-tertiary-title-padding-x;
	padding-top: $sheet-tertiary-title-padding-y;
	text-transform: $sheet-tertiary-title-text-transform;
	word-wrap: break-word;

	@include clay-scale-component {
		font-size: $sheet-tertiary-title-font-size-mobile;
		margin-bottom: $sheet-tertiary-title-margin-bottom-mobile;
	}
}

// Sheet Text

.sheet-text {
	color: $sheet-text-color;
	font-size: $sheet-text-font-size;
	font-weight: $sheet-text-font-weight;
	margin-bottom: $sheet-text-margin-bottom;
	word-wrap: break-word;

	@include clay-scale-component {
		font-size: $sheet-text-font-size-mobile;
		margin-bottom: $sheet-text-margin-bottom-mobile;
	}
}