/**
 * MH Commute (Figma "V5 Commute map and matrix"): map at the left, heading and minutes
 * table at the right. Tablet and phone: heading, map, then the table.
 */

.mh-commute__inner {
	display: grid;
	grid-template-columns: minmax(0, 510fr) minmax(0, 626fr);
	grid-template-rows: auto 1fr;
	column-gap: 64px;
	align-items: start;
}

.mh-commute__head {
	grid-column: 2;
	grid-row: 1;
}

.mh-commute__map {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.mh-commute__data {
	grid-column: 2;
	grid-row: 2;
	margin-top: 28px;
}

.mh-commute__text {
	margin-top: 16px;
	color: var(--mh-text);
}

.mh-commute__text:first-child {
	margin-top: 0;
}

/* The bundled map is an SVG with its own rounded corners. */
.mh-commute__map img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* Minutes table ------------------------------------------------------ */

.mh-commute__table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: fixed;
	color: var(--mh-text);
}

.mh-commute__th {
	height: 36px;
	padding: 0 8px 0 0;
	color: var(--mh-heading);
	text-align: left;
	vertical-align: middle;
	white-space: nowrap;
}

.mh-commute__th--mode {
	width: 104px;
}

.mh-commute__mode {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mh-commute__mode-icon {
	flex: none;
	width: 24px;
	height: 24px;
}

.mh-commute__table tbody th,
.mh-commute__table tbody td {
	padding: 12px 8px 12px 0;
	border-top: 1px solid var(--mh-line);
	text-align: left;
	vertical-align: middle;
}

.mh-commute__table tbody tr:last-child th,
.mh-commute__table tbody tr:last-child td {
	border-bottom: 1px solid var(--mh-line);
}

.mh-commute__place {
	font-weight: 400;
}

.mh-commute__place-inner {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mh-commute__pin {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--mh-heading);
	color: var(--mh-bg);
	font-size: 12px;
	line-height: 16px;
	font-weight: 600;
}

.mh-commute__name {
	min-width: 0;
	color: var(--mh-text);
	font-size: 16px;
	line-height: 24px;
}

.mh-commute__minutes {
	color: var(--mh-heading);
	font-family: var(--mh-serif);
	font-size: 28px;
	line-height: 36px;
	font-variant-numeric: lining-nums;
	white-space: nowrap;
}

.mh-commute__source {
	margin-top: 28px;
	color: var(--mh-muted);
}

.mh-commute__source:first-child {
	margin-top: 0;
}

/* Tablet: heading, map full width, then the table. */
@media (max-width: 1024px) {
	.mh-commute__inner {
		display: block;
	}

	.mh-commute__map {
		margin-top: 40px;
	}

	.mh-commute__data {
		margin-top: 40px;
	}

	.mh-commute__map:first-child {
		margin-top: 0;
	}

	.mh-commute__th--mode {
		width: 96px;
	}
}

/* Phone: narrow minute columns, icon above the column label, names may wrap. */
@media (max-width: 767px) {
	.mh-commute__text {
		font-size: 16px;
		line-height: 24px;
	}

	.mh-commute__map,
	.mh-commute__data {
		margin-top: 32px;
	}

	.mh-commute__th {
		height: auto;
		padding-top: 4px;
		padding-bottom: 8px;
		vertical-align: bottom;
	}

	.mh-commute__th--place {
		white-space: normal;
	}

	.mh-commute__th--mode {
		width: 56px;
		padding-right: 4px;
	}

	.mh-commute__mode {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.mh-commute__mode-icon {
		width: 20px;
		height: 20px;
	}

	.mh-commute__table tbody th,
	.mh-commute__table tbody td {
		padding-right: 4px;
	}

	.mh-commute__place-inner {
		gap: 10px;
		padding-right: 8px;
	}

	.mh-commute__name {
		font-size: 14px;
		line-height: 20px;
	}

	.mh-commute__minutes {
		font-size: 26px;
		line-height: 32px;
	}
}
