/*
 * Chevrons (core/categories, core/latest-posts, core/navigation): a small chevron before every item and an underline
 * on hover. Latest posts get a cream row on hover and small author and date lines; a navigation keeps its submenus
 * open as indented lists (render.php drops core's hover handlers). Indents, gaps and type are the blocks' settings.
 * Loaded only on pages where a block uses the style (inc/rt-block-styles.php).
 */
.is-style-chevron-list {
	--chevron-list-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 8'%3E%3Cpath d='M.5.5 4 4 .5 7.5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E");
}

.is-style-chevron-list:where(ul),
.is-style-chevron-list ul {
	list-style: none;
	margin-block: 0;
	padding-inline-start: 0;
}

.is-style-chevron-list li,
.is-style-chevron-list .wp-block-navigation-item {
	position: relative;
	padding-inline-start: 1.3125rem;
}

.is-style-chevron-list li::before,
.is-style-chevron-list .wp-block-navigation-item::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.5rem;
	width: 0.3125rem;
	height: 0.5rem;
	background: currentColor;
	-webkit-mask: var(--chevron-list-mark) center / contain no-repeat;
	mask: var(--chevron-list-mark) center / contain no-repeat;
}

.is-style-chevron-list:dir(rtl) li::before,
.is-style-chevron-list:dir(rtl) .wp-block-navigation-item::before {
	transform: scaleX(-1);
}

.is-style-chevron-list a {
	text-decoration: none;
	text-underline-offset: 0.1875rem;
}

.is-style-chevron-list a:hover,
.is-style-chevron-list a:focus-visible,
.is-style-chevron-list a[aria-current],
.is-style-chevron-list .current-cat > a {
	text-decoration: underline;
}

/* Categories: room between the items */
.wp-block-categories.is-style-chevron-list li + li {
	margin-block-start: 0.875rem;
}

/* Latest posts: the title, then core's author and date lines in small type; a cream row on hover */
.wp-block-latest-posts.is-style-chevron-list li {
	display: flex;
	flex-wrap: wrap;
	column-gap: var(--wp--preset--spacing--20);
	padding: 0.9375rem 0.3125rem 0.9375rem 2.6875rem;
	transition: background-color 0.2s ease;
}

.wp-block-latest-posts.is-style-chevron-list li::before {
	inset-inline-start: 1.375rem;
	top: 1.4375rem;
}

.wp-block-latest-posts.is-style-chevron-list li:hover,
.wp-block-latest-posts.is-style-chevron-list li:focus-within {
	background-color: var(--wp--preset--color--cream);
}

.wp-block-latest-posts.is-style-chevron-list li > a {
	flex-basis: 100%;
}

/* Author and date: core's small type (0.8125em of the block's font size) in the block's text colour; the titles take
   its link colour */
.wp-block-latest-posts.is-style-chevron-list li > :not(a) {
	margin: 0.25rem 0 0;
}

/* Navigation (the editor renders it as divs, hence core's item classes): items one under the other (the gap is the
   block's Block spacing), submenus open in place */
.wp-block-navigation.is-style-chevron-list .wp-block-navigation-item {
	display: block;
}

.wp-block-navigation.is-style-chevron-list .has-child .wp-block-navigation__submenu-container {
	position: static;
	z-index: auto;
	width: auto;
	min-width: 0;
	height: auto;
	margin-block-start: 0.8125rem;
	padding: 0 0 0 0.125rem;
	overflow: visible;
	border: 0;
	background: transparent;
	color: inherit;
	opacity: 1;
	visibility: visible;
}

.wp-block-navigation.is-style-chevron-list .wp-block-navigation__submenu-container > .wp-block-navigation-item + .wp-block-navigation-item {
	margin-block-start: 0.625rem;
}

.wp-block-navigation.is-style-chevron-list .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0;
}

.wp-block-navigation.is-style-chevron-list .wp-block-navigation__submenu-icon {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-latest-posts.is-style-chevron-list li {
		transition: none;
	}
}
