/*
 * Resource Centre: the hub (posts page and page-hub), real-link type navigation, archives, search and the shared
 * article reading extras (type label, "In this guide", related resources). Loaded only on those views.
 * Direction: a dark editorial knowledge workbench. Near black canvas, raised charcoal, thin ruled dividers, square edges,
 * orange only for an action, the current location or an index. No glow, no gradient text, no decorative motion.
 * Tokens only (assets/css/tokens.css).
 */

/* ------------------------------------------------------------------ head */

.cc-hub__head .cc-kicker {
	display: inline-flex;
	align-items: center;
	gap: var(--cc-space-s);
}

.cc-hub__head .cc-kicker::after {
	content: "";
	width: 2.25rem;
	height: 2px;
	background: var(--cc-color-action);
}

.cc-hub__head h1 {
	max-width: 22ch;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1.05;
}

.cc-hub__head > p:not(.cc-kicker) {
	max-width: 40rem;
	color: var(--cc-color-secondary);
	font-size: var(--cc-font-size-l);
}

/* ------------------------------------------------------------------ search */

.cc-hub__search .wp-block-search__label {
	display: block;
	margin-bottom: var(--cc-space-xs);
	color: var(--cc-color-secondary);
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.cc-hub__search .wp-block-search__input:focus-visible,
.cc-hub__search .wp-block-search__button:focus-visible {
	outline: var(--cc-focus-width) solid var(--cc-color-focus);
	outline-offset: var(--cc-focus-offset);
}

.cc-hub__search .wp-block-search__button {
	min-height: 3.25rem;
	min-width: var(--cc-target-min);
}

.search .cc-hub__search {
	max-width: 44rem;
	margin-top: var(--cc-space-m);
}

/* ------------------------------------------------------------------ front doors */

.cc-hub-routes__ask {
	margin: var(--cc-space-xl) 0 var(--cc-space-m);
	padding-top: var(--cc-space-m);
	border-top: 1px solid var(--cc-color-line);
	font-size: var(--cc-font-size-s);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cc-color-secondary);
}

.cc-hub-routes__doors {
	display: grid;
	gap: var(--cc-space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 48em) {
	.cc-hub-routes__doors {
		grid-template-columns: 1.15fr 1fr;
	}
}

.cc-hub-routes__door {
	position: relative;
	display: grid;
	gap: var(--cc-space-xs);
	height: 100%;
	min-height: var(--cc-target-min);
	padding: var(--cc-space-l) var(--cc-space-xl) calc(var(--cc-space-l) + 1.5rem) var(--cc-space-l);
	box-sizing: border-box;
	background: var(--cc-color-raised);
	border: 1px solid var(--cc-color-line);
	border-left: 3px solid var(--cc-color-action);
	border-radius: var(--cc-radius-s);
	color: var(--cc-color-white);
	text-decoration: none;
}

.cc-hub-routes__door::after {
	content: "\2192" / "";
	position: absolute;
	left: var(--cc-space-l);
	bottom: var(--cc-space-m);
	color: var(--cc-color-action);
	font-size: var(--cc-font-size-l);
	line-height: 1;
	transition: transform var(--cc-transition-fast) ease;
}

.cc-hub-routes__door:hover {
	border-color: var(--cc-color-action);
}

.cc-hub-routes__door:hover::after {
	transform: translateX(4px);
}

.cc-hub-routes__door:focus-visible {
	outline: var(--cc-focus-width) solid var(--cc-color-focus);
	outline-offset: var(--cc-focus-offset);
}

.cc-hub-routes__kicker {
	color: var(--cc-color-action);
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cc-hub-routes__title {
	font-family: var(--cc-font-heading);
	font-size: var(--cc-font-size-xl);
	font-weight: 700;
	line-height: 1.12;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.cc-hub-routes__text {
	color: var(--cc-color-secondary);
}

.cc-hub-routes__shortcuts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cc-space-xs) var(--cc-space-m);
	margin-top: var(--cc-space-l);
}

.cc-hub-routes__shortcuts ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--cc-space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cc-hub-routes__label {
	color: var(--cc-color-secondary);
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cc-hub-routes__shortcuts a {
	display: inline-flex;
	align-items: center;
	min-height: var(--cc-target-min);
	color: var(--cc-color-white);
	text-decoration: underline;
	text-decoration-color: var(--cc-color-line-strong);
	text-underline-offset: 0.25em;
}

.cc-hub-routes__shortcuts a:hover {
	text-decoration-color: var(--cc-color-action);
}

/* ------------------------------------------------------------------ groups, resource lists and the All resources list */

.cc-hub-group + .cc-hub-group {
	margin-top: var(--cc-space-xl);
}

.cc-hub-group__title {
	margin: 0 0 var(--cc-space-m);
	padding-top: var(--cc-space-m);
	border-top: 1px solid var(--cc-color-line);
	font-size: var(--cc-font-size-xxl);
	scroll-margin-top: var(--cc-space-xl);
}

/* The existing grid minimum (19rem) cannot fit a 320 px screen with the container padding: cap it at the container. */
.cc-hub .cc-resources {
	grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
}

.cc-resources__more {
	margin: calc(-1 * var(--cc-space-m)) 0 var(--cc-space-xl);
}

.cc-resources__more a {
	display: inline-flex;
	align-items: center;
	min-height: var(--cc-target-min);
	color: var(--cc-color-white);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--cc-color-action);
	text-underline-offset: 0.25em;
}

.cc-hub__all {
	scroll-margin-top: var(--cc-space-xl);
}

.cc-hub__all > h2 {
	margin: 0 0 var(--cc-space-m);
	padding-top: var(--cc-space-m);
	border-top: 1px solid var(--cc-color-line);
}

/* A visible way to a person, beside the article list: one short line and the Support action. */
.cc-hub__supportrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cc-space-s) var(--cc-space-m);
	margin: 0 0 var(--cc-space-l);
}

.cc-hub__supportrow p {
	margin: 0;
	max-width: 40rem;
	color: var(--cc-color-secondary);
}

.cc-resource-grid {
	gap: var(--cc-space-m);
}

.cc-post-card .wp-block-post-title {
	overflow-wrap: anywhere;
	line-height: 1.2;
}

.cc-post-card .wp-block-post-title a {
	text-decoration-color: var(--cc-color-line-strong);
}

.cc-post-card:hover,
.cc-post-card:focus-within {
	border-color: var(--cc-color-action);
}

.cc-resource-type {
	margin: 0;
	color: var(--cc-color-action);
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cc-article-header__inner > .cc-resource-type {
	margin-bottom: var(--cc-space-xs);
}

/* ------------------------------------------------------------------ type links (real links, current one marked) */

.cc-hub-types {
	margin: 0 0 var(--cc-space-l);
}

.cc-hub-types__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--cc-space-l);
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--cc-color-line);
}

.cc-hub-types__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--cc-target-min);
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	color: var(--cc-color-secondary);
	font-weight: 600;
	text-decoration: none;
}

.cc-hub-types__link:hover {
	color: var(--cc-color-white);
	border-bottom-color: var(--cc-color-line-strong);
}

.cc-hub-types__link[aria-current="page"] {
	color: var(--cc-color-white);
	border-bottom-color: var(--cc-color-action);
	/* The current view is also underlined and bolder, so it is not shown by colour alone. */
	text-decoration: underline;
	text-underline-offset: 0.35em;
}

.cc-hub-types__link:focus-visible {
	outline: var(--cc-focus-width) solid var(--cc-color-focus);
	outline-offset: var(--cc-focus-offset);
}

/* ------------------------------------------------------------------ pagination */

.wp-block-query-pagination {
	align-items: center;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--cc-target-min);
	min-height: var(--cc-target-min);
	padding-inline: var(--cc-space-xs);
	box-sizing: border-box;
}

.wp-block-query-pagination .page-numbers.current {
	border-bottom: 2px solid var(--cc-color-action);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* ------------------------------------------------------------------ article extras */

.cc-guide-contents {
	margin: 0 0 var(--cc-space-xl);
	padding: var(--cc-space-m) var(--cc-space-l);
	border: 1px solid var(--cc-color-panel-line);
	border-left: 3px solid var(--cc-color-panel-ink);
	background: rgba(255, 255, 255, 0.5);
	font-size: var(--cc-font-size-s);
	line-height: 1.5;
}

.cc-guide-contents__title {
	margin: 0 0 var(--cc-space-xs);
	font-size: var(--cc-font-size-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cc-guide-contents__list {
	display: grid;
	gap: 0 var(--cc-space-xl);
	margin: 0;
	padding-left: var(--cc-space-l);
}

@media (min-width: 48em) {
	.cc-guide-contents__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.cc-guide-contents__list a {
	display: inline-block;
	padding-block: var(--cc-space-xxs);
	min-height: 1.5rem;
}

.cc-article-foot {
	border-top: 1px solid var(--cc-color-line);
	background: var(--cc-color-canvas);
}

.cc-article-foot__inner {
	padding-block: var(--cc-space-xl);
}

.cc-article-foot__title {
	margin: 0 0 var(--cc-space-m);
	font-size: var(--cc-font-size-s);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cc-color-secondary);
}

.cc-article-foot__list {
	display: grid;
	gap: var(--cc-space-m);
	margin: 0 0 var(--cc-space-l);
	padding: 0;
	list-style: none;
}

@media (min-width: 48em) {
	.cc-article-foot__list {
		grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	}
}

.cc-article-foot__list li {
	display: grid;
	gap: var(--cc-space-xs);
	align-content: start;
	padding: var(--cc-space-m);
	background: var(--cc-color-raised);
	border: 1px solid var(--cc-color-line);
	border-radius: var(--cc-radius-s);
}

.cc-article-foot__link {
	color: var(--cc-color-white);
	font-family: var(--cc-font-heading);
	font-size: var(--cc-font-size-l);
	font-weight: 700;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.cc-article-foot__back {
	margin: 0;
}

.cc-article-foot__back a {
	display: inline-flex;
	align-items: center;
	min-height: var(--cc-target-min);
	color: var(--cc-color-white);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.cc-hub-routes__door::after {
		transition: none;
	}

	.cc-hub-routes__door:hover::after {
		transform: none;
	}
}

@media print {
	.cc-hub-types,
	.cc-article-foot,
	.cc-hub-routes {
		display: none;
	}
}
