@use "../kit-deps" as *;
@use "typography" as *;

.description-list {
	display: grid;
	width: 100%;
	max-width: 760px;
	margin: 0;
	border: $border-width-base solid $border-color-muted;
	border-left-width: $border-width-accent;
	background: $surface-panel-muted;

	.description-list-row {
		display: grid;
		grid-template-columns: minmax(140px, 0.36fr) minmax(0, 1fr);
		gap: $space-4;
		padding: $space-3 $space-4;
		border-bottom: $border-width-base solid rgba($color-text-light, 0.08);
		transition-duration: $motion-base;
		transition-timing-function: $motion-ease;
		transition-property: background;

		&:last-child {
			border-bottom: 0;
		}

		@include hover_touch {
			background: $surface-panel-strong;

			.description-list-term {
				color: $color-secondary;
			}

			.description-list-value {
				transform: translateX($space-1);
			}
		}
	}

	.description-list-term {
		margin: 0;
		color: $color-text-dark;
		font-size: $font-size-sm;
		font-weight: $font-weight-semibold;
		line-height: $line-height-normal;
		text-transform: uppercase;
		transition-duration: $motion-base;
		transition-timing-function: $motion-ease;
		transition-property: color;
	}

	.description-list-value {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: $space-2;
		min-width: 0;
		margin: 0;
		color: $color-text-light;
		font-size: $font-size-base;
		line-height: $line-height-normal;
		transition-duration: $motion-base;
		transition-timing-function: $motion-ease;
		transition-property: transform;
	}

	.description-list-value-muted {
		color: $color-text-medium;
	}

	&.description-list-compact {
		max-width: 520px;

		.description-list-row {
			grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
			gap: $space-3;
			padding: $space-2 $space-3;
		}

		.description-list-term,
		.description-list-value {
			font-size: $font-size-sm;
		}
	}
}

@include media_down("sm") {
	.description-list {
		.description-list-row {
			grid-template-columns: 1fr;
			gap: $space-1;
		}
	}
}
