@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";
@import "@wordpress/base-styles/variables";

.consolidated-stats-group {
	display: flex;
	gap: 24px;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: flex-start;

	@include break-mobile {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	@include break-wide {
		flex-wrap: nowrap;
	}

	.card {
		flex: 1;
		max-width: 100%;
		width: 100%;

		@include break-mobile {
			flex: 0 1 calc(50% - 16px);
			max-width: 45%;
		}

		border-radius: 6px; /* stylelint-disable-line scales/radii */
		padding: 1rem;
	}
}

.consolidated-stats-card__value {
	color: var(--color-accent-100);
	@include heading-x-large;
	margin-block-end: 8px;
}

.consolidated-stats-card__label-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;

	&.mobile {
		display: flex;
		flex-direction: column;
		height: 75%;
		align-items: flex-start;

		.consolidated-stats-card__info-mobile {
			@include body-small;

			margin: 0;
			padding: 0;
			color: var(--color-neutral-50);
			text-decoration: underline;
			display: flex;
			margin-block-start: auto;

			&.components-button:focus:not(:disabled) {
				outline: none;
				box-shadow: none;
			}

			&.components-button:hover {
				background: none;
			}

			.gridicon {
				fill: var(--color-neutral-50);
				margin-inline-end: 4px;
			}
		}
	}
}

.consolidated-stats-card__label {
	color: var(--color-accent);
	@include body-medium;
	text-wrap: balance;
}

.consolidated-stats-card__info-icon {
	cursor: pointer;
	position: relative;
	inset-block-start: 4px;
	inset-inline-start: 4px;
}

.consolidated-stats-card__popover-content {
	min-width: 200px;
	@include body-medium;

	@include break-mobile {
		min-width: 300px;
	}

	a,
	a:visited {
		color: var(--color-neutral-100);
		text-decoration: underline;
	}
	a:focus {
		outline: none;
	}
}
