/* Docs hub, doc article, docs navigation, pager. Presets only. */

/* ---- Hub search */
.gm-doc-search {
	max-width: 760px;
}

.gm-doc-search .wp-block-search__inside-wrapper {
	gap: 8px;
}

.gm-doc-search .wp-block-search__input {
	min-height: 56px;
	padding: 0 20px;
	border: 1px solid var(--wp--preset--color--field);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--soil);
	font-size: var(--wp--preset--font-size--large);
}

.gm-doc-search .wp-block-search__input:focus {
	border-color: var(--wp--preset--color--moss);
	box-shadow: 0 0 0 1px var(--wp--preset--color--moss);
}

.gm-doc-search .wp-block-search__button {
	min-height: 56px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--on-moss);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
}

.gm-doc-search .wp-block-search__button:hover {
	background: var(--wp--preset--color--moss-deep);
}

.gm-suggestions {
	gap: 8px 12px;
}

.gm-suggestions p {
	margin: 0;
}

/* ---- Hub product cards */
.gm-docs-card .gm-doc-count,
.gm-docs-card .gm-doc-version {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.gm-docs-card .gm-doc-count {
	color: var(--wp--preset--color--soil);
	font-weight: 600;
}

.gm-docs-card .gm-doc-version::before {
	content: "·";
	margin-inline-end: 8px;
}

.gm-docs-card .wp-block-button__link::before {
	content: "";
	position: absolute;
	inset: 0;
}

.gm-docs-card .wp-block-button__link {
	position: static;
}

.gm-docs-card .wp-block-buttons {
	margin: 0;
}

/* ---- Hub: getting started (numbered) and popular */
.gm-start-list .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
	list-style: none;
	counter-reset: gm-start;
}

.gm-start-list .wp-block-post-template > li {
	counter-increment: gm-start;
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-start-item {
	position: relative;
	gap: 16px;
	padding: 12px 0;
}

.gm-start-item::before {
	content: counter(gm-start);
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--wp--preset--color--moss-tint);
	color: var(--wp--preset--color--moss);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.gm-start-item .wp-block-post-title,
.gm-popular-item .wp-block-post-title {
	margin: 0;
	flex: 1;
	font-weight: 500;
}

.gm-start-item .wp-block-post-title a,
.gm-popular-item .wp-block-post-title a {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--soil);
	text-decoration: none;
}

.gm-start-item .wp-block-post-title a::after,
.gm-popular-item .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.gm-start-item a:hover,
.gm-popular-item a:hover {
	color: var(--wp--preset--color--moss);
}

.gm-start-time {
	margin: 0;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}

.gm-popular-list .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
	list-style: none;
}

.gm-popular-list .wp-block-post-template > li {
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-popular-item {
	position: relative;
	gap: 16px;
	padding: 12px 0;
}

.gm-popular-item .wp-block-post-terms {
	margin: 0;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}

.gm-popular-item .wp-block-post-terms a {
	position: relative;
	z-index: 1;
	color: inherit;
	text-decoration: none;
}

/* ---- Doc layout: three columns from 1240px, two from 900px, one below. */
.gm-doc-crumbs {
	padding-bottom: var(--wp--preset--spacing--30);
}

.gm-doc-layout {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

.gm-doc-layout > .gm-toc {
	display: none;
}

.gm-doc-article {
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
	max-width: 720px;
	width: 100%;
	margin-inline: 0;
}

@media (min-width: 900px) {

	.gm-doc-layout {
		grid-template-columns: 240px minmax(0, 1fr);
		gap: 40px;
	}

	.gm-doc-layout > .gm-docs-nav {
		position: sticky;
		top: var(--wp--preset--spacing--30);
	}
}

@media (min-width: 1240px) {

	.gm-doc-layout {
		grid-template-columns: 260px minmax(0, 720px) 200px;
		gap: 48px;
		justify-content: center;
	}

	.gm-doc-layout > .gm-toc {
		position: sticky;
		top: var(--wp--preset--spacing--30);
		display: flex;
	}
}

/* ---- Docs navigation block */
.gm-docs-nav {
	min-width: 0;
}

.gm-docs-mobile {
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--surface);
}

.gm-docs-mobile > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	padding: 0 16px;
	cursor: pointer;
	font-weight: 600;
}

.gm-docs-mobile > summary::after,
.gm-docs-section > summary::after {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	background: var(--wp--preset--color--muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.gm-docs-mobile[open] > summary::after,
.gm-docs-section[open] > summary::after {
	transform: rotate(180deg);
}

.gm-docs-mobile .gm-docs-section {
	padding-inline: 16px;
}

.gm-docs-wide {
	display: none;
}

@media (min-width: 900px) {

	.gm-docs-mobile {
		display: none;
	}

	.gm-docs-wide {
		display: block;
	}
}

.gm-docs-nav__product {
	margin: 0 0 8px;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.gm-docs-section {
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-docs-section > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	cursor: pointer;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.gm-docs-section ul {
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.gm-docs-section a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--soil);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.gm-docs-section a:hover {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--moss);
}

.gm-docs-section a[aria-current="page"] {
	background: var(--wp--preset--color--moss-tint);
	color: var(--wp--preset--color--moss);
	font-weight: 500;
}

/* Index variant: the product docs page lists every section. */
.gm-docs-index {
	display: grid;
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 782px) {

	.gm-docs-index {
		grid-template-columns: minmax(0, 1fr);
	}
}

.gm-docs-index__title {
	margin: 0 0 8px;
	font-size: var(--wp--preset--font-size--h-4);
}

.gm-docs-index ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gm-docs-index li {
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-docs-index a {
	display: flex;
	align-items: center;
	min-height: 48px;
	color: var(--wp--preset--color--soil);
	text-decoration: none;
}

.gm-docs-index a:hover {
	color: var(--wp--preset--color--moss);
}

/* ---- Doc article header and meta */
.gm-doc-head {
	gap: var(--wp--preset--spacing--20);
}

.gm-doc-head .wp-block-post-title {
	margin: 0;
}

.gm-doc-meta {
	gap: 8px 16px;
}

.gm-doc-meta p {
	margin: 0;
}

.gm-version-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 24px;
	padding: 0 10px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--moss-tint);
	color: var(--wp--preset--color--moss);
	font-weight: 500;
}

.gm-version-badge::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentcolor;
}

.gm-version-badge:empty {
	display: none;
}

.gm-doc-meta .gm-reading::before {
	content: "·";
	margin-inline-end: 12px;
}

/* ---- Numbered steps with screenshots */
.gm-doc-step {
	gap: 16px;
}

.gm-doc-content > .gm-doc-step + .gm-doc-step {
	margin-block-start: var(--wp--preset--spacing--40);
}

.gm-step-badge {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--on-moss);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.gm-doc-step__body {
	flex: 1;
	min-width: 0;
	gap: var(--wp--preset--spacing--10);
}

.gm-doc-step__body p {
	margin: 0;
}

.gm-doc-step__title {
	font-size: var(--wp--preset--font-size--h-5);
	font-weight: 600;
}

.gm-doc-step .gm-shot.gm-placeholder {
	min-height: 180px;
	margin-top: var(--wp--preset--spacing--10);
}

/* ---- Feedback, pager, still stuck */
.gm-feedback {
	gap: 12px 24px;
	padding-block: var(--wp--preset--spacing--30);
	border-block: 1px solid var(--wp--preset--color--stone);
}

.gm-feedback p {
	margin: 0;
}

.gm-doc-pager {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	justify-content: space-between;
}

.gm-doc-pager__link {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 2px;
	min-height: 44px;
	padding: 16px 20px;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--card);
	color: var(--wp--preset--color--soil);
	text-decoration: none;
}

.gm-doc-pager__link--next {
	align-items: flex-end;
	text-align: end;
}

.gm-doc-pager__link:hover {
	border-color: var(--wp--preset--color--moss);
}

.gm-doc-pager__spacer {
	flex: 1 1 0;
}

.gm-doc-pager__label {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.gm-doc-pager__title {
	font-weight: 500;
}

@media (max-width: 599px) {

	.gm-doc-pager {
		flex-direction: column;
	}

	.gm-doc-pager__link--next {
		align-items: flex-start;
		text-align: start;
	}
}

.gm-still-stuck.is-style-card {
	padding: 20px 24px;
	gap: 16px;
}

.gm-still-stuck p {
	margin: 0;
}

.gm-still-stuck__title {
	font-weight: 600;
}

.gm-search-results .wp-block-post-template {
	display: flex;
	flex-direction: column;
	padding: 0;
	margin: 0;
	list-style: none;
}

.gm-search-results .wp-block-post-template > li {
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-still-stuck .wp-block-group {
	gap: 4px;
}

/* ---- Changelog: timeline, tag pills, aside */
.gm-changelog__columns {
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.gm-changelog-list .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
	list-style: none;
}

.gm-release {
	display: grid;
	grid-template-columns: 132px 24px minmax(0, 1fr);
	column-gap: 16px;
	padding-bottom: var(--wp--preset--spacing--40);
}

.gm-release__meta {
	gap: 2px;
	padding-top: 24px;
}

.gm-release__meta p,
.gm-release__meta .wp-block-post-title,
.gm-release__meta .wp-block-post-date {
	margin: 0;
}

.gm-release__version a {
	color: var(--wp--preset--color--soil);
	font-weight: 500;
	text-decoration: none;
}

.gm-release__version a::before {
	content: "v";
}

.gm-release__product {
	color: var(--wp--preset--color--muted);
}

/*
 * The dot sits on a line that runs to the next release. The newest release's
 * dot is Moss.
 */
.gm-release__rail {
	position: relative;
	margin: 0;
}

.gm-release__rail::before {
	content: "";
	position: absolute;
	top: 30px;
	bottom: calc(-1 * var(--wp--preset--spacing--40));
	left: 50%;
	width: 2px;
	transform: translateX(-50%);
	background: var(--wp--preset--color--stone);
}

.gm-release__rail::after {
	content: "";
	position: absolute;
	top: 26px;
	left: 50%;
	width: 12px;
	height: 12px;
	transform: translateX(-50%);
	border: 2px solid var(--wp--preset--color--paper);
	border-radius: 50%;
	background: var(--wp--preset--color--stone);
}

.gm-changelog-list .wp-block-post-template > li:first-child .gm-release__rail::after {
	background: var(--wp--preset--color--moss);
}

.gm-changelog-list .wp-block-post-template > li:last-child .gm-release__rail::before {
	bottom: 0;
}

.gm-release__card.is-style-card {
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--40);
}

.gm-release__title {
	margin: 0;
}

.gm-release__title p {
	margin: 0;
}

.gm-release__notes > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/*
 * Tag pills: a Group using a Changelog style, with a pill label above its
 * list.
 */
[class*="is-style-changelog-"] {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10);
}

[class*="is-style-changelog-"] > p:first-child {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: 24px;
	margin: 0;
	padding: 0 10px;
	border-radius: var(--wp--custom--radius--pill);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
}

.is-style-changelog-new > p:first-child {
	background: var(--wp--preset--color--marigold);
	color: var(--wp--preset--color--on-marigold);
}

.is-style-changelog-improved > p:first-child {
	background: var(--wp--preset--color--moss-tint);
	color: var(--wp--preset--color--moss);
}

.is-style-changelog-fixed > p:first-child {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--soil);
}

[class*="is-style-changelog-"] .wp-block-list {
	margin: 0;
}

.gm-changelog-aside {
	position: sticky;
	top: var(--wp--preset--spacing--30);
	gap: var(--wp--preset--spacing--30);
}

.gm-tag-key.is-style-card {
	gap: var(--wp--preset--spacing--10);
	padding: 20px 24px;
}

.gm-tag-key p {
	margin: 0;
}

.gm-aside-title {
	font-weight: 600;
}

.gm-tag-key__row {
	gap: 12px;
	padding-block: 6px;
}

.gm-tag-key__row > .wp-block-group {
	flex: none;
	min-width: 84px;
}

.gm-rss .wp-block-button__link {
	min-height: 44px;
}

.gm-count.gm-version {
	background: transparent;
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-weight: 400;
}

@media (max-width: 599px) {

	.gm-release {
		grid-template-columns: 20px minmax(0, 1fr);
	}

	.gm-release__meta {
		grid-column: 2;
		padding-top: 0;
		padding-bottom: 8px;
	}

	.gm-release__rail {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.gm-release__rail::before {
		top: 6px;
	}

	.gm-release__rail::after {
		top: 2px;
	}

	.gm-release__card {
		grid-column: 2;
	}
}

/* ---- 404 and search results */
.gm-not-found .wp-block-group {
	gap: var(--wp--preset--spacing--30);
}

.gm-not-found p,
.gm-not-found .wp-block-heading {
	margin: 0;
}

.gm-search-scope {
	gap: 4px 12px;
}

.gm-search-scope p {
	margin: 0;
}

.gm-result {
	gap: var(--wp--preset--spacing--10);
	padding-block: var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.gm-result p,
.gm-result .wp-block-post-title {
	margin: 0;
}

.gm-result__head {
	gap: 8px;
}

.gm-result__type {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	margin: 0;
	padding: 0 8px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--soil);
	font-weight: 500;
}

.gm-result .wp-block-post-title a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--soil);
	text-decoration: none;
}

.gm-result .wp-block-post-title a:hover {
	color: var(--wp--preset--color--moss);
}

.gm-release__title,
.gm-release__title p {
	line-height: 1.25;
}

.gm-release__version a {
	display: inline-flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
}

.gm-release__meta {
	gap: 0;
	padding-top: 12px;
}

.gm-result .wp-block-post-title a {
	min-width: 44px;
}

.gm-release-single::before {
	content: "v";
}

.gm-post-head .wp-block-post-date {
	margin: 0;
}
