/* ======================================================= */
/* CSS for control sap.ui.integration.cards/ObjectContent  */
/* Base theme                                              */
/* ======================================================= */

.sapFCardObjectContent {
	&:not(.sapUiIntCardContentWithBlockingMessage) {
		padding: 1rem;
	}

	&.sapUiIntCardContentWithBlockingMessage {
		/* when we have blocking message we don't need the 1 rem padding, but need bigger min-height than the default (inline) one of 3rem */
		min-height: 5rem !important;
	}

	&.sapFCardObjectContentWithOverlay {

		.sapMFlexBox.sapUiIntImgWithOverlayLayout,
		.sapMFlexBox.sapFCardObjectGroup:has( > .sapUiIntImageWithOverlay:only-child ),
		 > .sapMFlexBox,
		.sapUiIntImageWithOverlay:only-child {
			height: 100%;
		}
	}
}

.sapUiIntCardWithFooter:not(.sapUiIntCardFooterInvisible) .sapFCardObjectContent {
	padding-bottom: 0;
}

.sapFCardObjectGroup {

	.sapFCardObjectItemTitle {
		margin-bottom: 0.5rem;
	}

	> .sapFCardObjectItemLabel {
		margin-top: 1rem;
	}

	.sapUiAFLayoutItem > .sapFCardObjectItemPairContainer > .sapFCardObjectItemLabel,
	.sapUiAFLayoutItem > .sapMHBox  {
		margin-top: 1rem;
	}

	.sapUiAFLayoutItem > .sapFCardObjectItemPairContainer {
		margin-right: 0.5rem;
	}

	// we don't know which item will be last on the row, so we remove the margin from the container
	> .sapUiAFLayout {
		margin-right: -0.5rem;
	}

	&:not(.sapFCardObjectGroupLastInColumn) {
		padding-bottom: 1.75rem;
	}

	&:not(.sapFCardObjectGroupWithTitle) {

		/* Don't apply margin to the first label when there is no title */
		> .sapFCardObjectItemLabel {
			margin-top: 0;
		}

		/* Apply margin to the rest of the labels */
		> .sapFCardObjectItemLabel ~ .sapFCardObjectItemLabel {
			margin-top: 1rem;
		}
	}

	/* Don't add margin top to the value if it's the first element in the group (not labeled) */
	.sapFCardObjectItemValue:not(:first-child) {
		margin-top: 0.375rem;
	}

	.sapUiSizeCompact & .sapFCardObjectItemValue:not(:first-child) {
		margin-top: 0.25rem;
	}

	.sapFCardObjectItemPairContainer {
		min-width: 0; /* prevent overflow of the flex container */
	}

	.sapFCardObjectItemValueEntries {
		gap: 0.25rem;
	}

	.sapFCardObjectItemAvatar {
		margin-right: 0.5rem;
		flex-shrink: 0;
	}

	/* Rating Indicator */
	.sapMRI {
		margin-bottom: 0;
	}

	/* Image */
	> .sapFCardObjectImage:not(:first-child) {
		margin-top: 1rem;
	}

	.sapUiIntImageWithOverlay.sapFCardObjectImageFullWidth:first-child,
	.sapMImg.sapFCardObjectImageFullWidth:first-child {
		top: -16px;
		margin-top: 0;
		height: ~"calc(100% + 16px)";
	}

	.sapUiIntImageWithOverlay.sapFCardObjectImageFullWidth:last-child,
	.sapMImg.sapFCardObjectImageFullWidth:last-child {
		margin-bottom: -16px;
	}

	.sapUiIntImageWithOverlay.sapFCardObjectImageFullWidth:only-child,
	.sapMImg.sapFCardObjectImageFullWidth:only-child {
		margin-bottom: -32px;
	}

	.sapUiIntImageWithOverlay.sapFCardObjectImageFullWidth,
	.sapMImg.sapFCardObjectImageFullWidth {
		width: ~"calc(100% + 32px)";
		left: -16px;
	}

	.sapFCardObjectImage {
		position: relative;
	}
}

.sapFCardObjectSpaceBetweenGroup {
	margin-right: 2rem;
}

.sapFCard .sapFCardContent {

	.sapFCardObjectContent .sapUiAFLayout .sapUiAFLayoutItem.sapFCardInvisibleContent {
		display: none;
	}
}

/* Removing top space of NumericIndicators */
.sapUiIntOCNumericIndicators {

	/* size L */
	&:not(.sapMTileSmallPhone) {

		/* number */
		.sapMNCValue >:first-child {
			padding-top: 0;
			height: 2.5rem;
			line-height: 2rem;
		}

		/* trend and unit */
		.sapMNCValue :nth-child(2) {
			padding-top: 0;
			height: 2rem;
		}
	}

	/* size S */
	&.sapMTileSmallPhone {

		.sapMNC {
			width: auto;
		}

		/* number */
		.sapMNCValue :first-child {
			padding-top: 0.25rem;
		}

		/* trend and unit */
		.sapMNCValue .sapMNCIndScale {
			padding-top: 0px;

			.sapMNCScale,
			.sapMNCIndIcon {
				padding-top: 0;
			}
		}
	}
}

.sapUiIntOCNumericIndicators .sapUiIntOCNumericIndicatorsDetails {
	color: var(--sapTile_TextColor);
	height: 1rem;
}

.sapFCardObjectContent {

	.sapFAvatarGroupInactive {
		pointer-events: none;

		&.sapFAvatarGroupIndividual .sapFAvatarGroupItem {
			pointer-events: none;
		}
	}

	.sapFAvatarGroupMoreButton.sapMBtnDisabled {
		cursor: default;
		opacity: 1;
	}

	.sapUiIntCardObjectButtonGroup {
		padding-left: 0;

		.sapMBarChild:first-child {
			margin-left: 0;
		}
	}
}