/*
 * Hadof Interface Continuity V27.
 *
 * Keeps the global decision navigation contained on desktop and editorial
 * route lists readable on narrow screens.
 */

/*
 * The journey rail is a direct child of the mega-menu grid. Earlier negative
 * margins treated it like a child of the padded columns and expanded every
 * menu beyond its panel, producing nested horizontal and vertical scrollbars.
 */
@media (min-width: 981px) {
	.hadof-v2-mega {
		grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
		max-height: calc(100dvh - var(--h2-header) - 16px);
		overscroll-behavior: contain;
		overflow-x: hidden;
		overflow-y: auto;
		width: min(1320px, calc(100vw - 48px));
	}

	body.admin-bar .hadof-v2-mega {
		max-height: calc(100dvh - var(--h2-header) - 48px);
	}

	.hadof-v2-mega__intro,
	.hadof-v2-mega__columns,
	.hadof-v2-mega__column {
		min-width: 0;
	}

	.hadof-v2-mega__intro {
		padding: 1.65rem;
	}

	.hadof-v2-mega__columns {
		padding: 1.15rem;
	}

	.hadof-v2-mega__column {
		padding: .35rem .95rem .75rem;
	}

	.hadof-v2-mega__column a {
		padding: .58rem 0;
	}

	.hadof-v2-mega__column a :is(b, small) {
		overflow-wrap: anywhere;
	}

	.hadof-v2-mega__journey {
		box-sizing: border-box;
		display: grid;
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		grid-template-columns: max-content;
		margin: 0;
		min-width: 0;
		overflow: hidden;
		padding: 0;
		width: 100%;
	}

	.hadof-v2-mega__journey > span {
		align-items: center;
		display: flex;
		min-width: 0;
		padding: .65rem 1rem;
	}

	.hadof-v2-mega__journey a {
		line-height: 1.25;
		min-width: 0;
		padding: .6rem .72rem;
		white-space: normal;
	}
}

@media (max-width: 640px) {
	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a {
		align-items: start !important;
		display: grid !important;
		gap: 1rem !important;
		grid-template-columns: 92px minmax(0, 1fr) !important;
		min-height: 0 !important;
		overflow: hidden;
		padding: 1.35rem 0 !important;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > figure {
		align-self: start !important;
		aspect-ratio: 1 / 1 !important;
		grid-column: 1 !important;
		grid-row: 1 !important;
		height: 92px !important;
		margin: 0 !important;
		max-width: 92px !important;
		min-height: 92px !important;
		min-width: 0 !important;
		overflow: hidden !important;
		width: 92px !important;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > figure img {
		display: block !important;
		height: 100% !important;
		inset: auto !important;
		margin: 0 !important;
		max-height: none !important;
		max-width: 100% !important;
		min-height: 0 !important;
		min-width: 0 !important;
		object-fit: cover !important;
		position: static !important;
		transform: none !important;
		width: 100% !important;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > figure figcaption {
		display: none !important;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div {
		align-content: start !important;
		background: transparent !important;
		display: grid !important;
		gap: .35rem !important;
		grid-column: 2 !important;
		grid-row: 1 !important;
		grid-template-columns: minmax(0, 1fr) !important;
		min-width: 0 !important;
		padding: 0 !important;
		position: relative;
		z-index: 1;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div :is(span, h3, p, b) {
		grid-column: auto !important;
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div span {
		font-size: .68rem;
		line-height: 1.35;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div h3 {
		font-size: 1.12rem;
		line-height: 1.16;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div p {
		font-size: .83rem;
		line-height: 1.5;
	}

	body.hadof-v2-content .hx-industries-hub .hx-industry-grid > a > div b {
		font-size: .76rem;
		line-height: 1.4;
		margin-top: .15rem;
	}
}
