/*
 * HDR-4: split menu. The logo stands in the middle, with the first half of the
 * menu on its left and the second half on its right.
 *
 * It is one menu, shown twice. The first Navigation block leaves out its
 * second half and the second block leaves out its first half. An item is in
 * the first half when it stands no further from the start than from the end,
 * so five items split three and two. Up to twelve items are split this way.
 * On a phone the second block is not shown and the first opens the whole menu.
 */

@media (min-width: 600px) {
	.wprk-hdr-4 > .wprk-header__bar {
		align-items: center;
		column-gap: var(--wp--preset--spacing--50);
		display: grid;
		grid-template-areas: "first brand second";
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	}

	.wprk-hdr-4 .wprk-header__brand {
		grid-area: brand;
	}

	.wprk-hdr-4 .wprk-hdr-4__first {
		grid-area: first;
		justify-self: end;
	}

	.wprk-hdr-4 .wprk-hdr-4__second {
		grid-area: second;
		justify-self: start;
	}

	.wprk-hdr-4__first :is(.wp-block-navigation__container, .wp-block-page-list) > .wp-block-navigation-item:not(:nth-child(1 of .wp-block-navigation-item):nth-last-child(n + 1 of .wp-block-navigation-item), :nth-child(2 of .wp-block-navigation-item):nth-last-child(n + 2 of .wp-block-navigation-item), :nth-child(3 of .wp-block-navigation-item):nth-last-child(n + 3 of .wp-block-navigation-item), :nth-child(4 of .wp-block-navigation-item):nth-last-child(n + 4 of .wp-block-navigation-item), :nth-child(5 of .wp-block-navigation-item):nth-last-child(n + 5 of .wp-block-navigation-item), :nth-child(6 of .wp-block-navigation-item):nth-last-child(n + 6 of .wp-block-navigation-item)),
	.wprk-hdr-4__second :is(.wp-block-navigation__container, .wp-block-page-list) > .wp-block-navigation-item:is(:nth-child(1 of .wp-block-navigation-item):nth-last-child(n + 1 of .wp-block-navigation-item), :nth-child(2 of .wp-block-navigation-item):nth-last-child(n + 2 of .wp-block-navigation-item), :nth-child(3 of .wp-block-navigation-item):nth-last-child(n + 3 of .wp-block-navigation-item), :nth-child(4 of .wp-block-navigation-item):nth-last-child(n + 4 of .wp-block-navigation-item), :nth-child(5 of .wp-block-navigation-item):nth-last-child(n + 5 of .wp-block-navigation-item), :nth-child(6 of .wp-block-navigation-item):nth-last-child(n + 6 of .wp-block-navigation-item)) {
		display: none;
	}
}

/* Between a phone and a wide screen: the logo above, the two halves side by side below it as one row. */
@media (min-width: 600px) and (max-width: 1023px) {
	.wprk-hdr-4 > .wprk-header__bar {
		column-gap: var(--wp--preset--spacing--40);
		grid-template-areas:
			"brand brand"
			"first second";
		grid-template-columns: auto auto;
		justify-content: center;
		row-gap: 0;
	}

	.wprk-hdr-4 .wprk-header__brand {
		justify-self: center;
	}
}

@media (max-width: 599px) {
	.wprk-hdr-4 .wprk-hdr-4__second {
		display: none;
	}
}
