/* ============================================================
   PULSE-ART Observatory — Resources, "Explore" variant
   ------------------------------------------------------------
   Load AFTER resources-observatory.css.
   Body: class="res-page res-x"
   Needs resources-observatory-explore.js for the dropdowns.
   ============================================================ */

.res-x {
	--x-navy: #1b1b4b;
	--x-navy-2: #262657;
	--x-yellow: #f6d20a;
	--x-orange: #e85c1a;
	--x-magenta: #e2007a;
	--x-blue: #3a5fe0;
	--x-grey: #8b8f9e;
	--x-ink: #14143a;
}

/* Two tones per type: the bright one paints bars and dots, the "ink" one is
   used wherever the colour carries text. The bright oranges and ochres only
   reach ~3:1 on white, which fails WCAG AA for body-size text. */
.res-x .res-type-policy    { --res-accent: var(--x-blue);    --res-accent-ink: #2438b8; }
.res-x .res-type-academic  { --res-accent: var(--x-magenta); --res-accent-ink: #b00062; }
.res-x .res-type-projects  { --res-accent: var(--x-orange);  --res-accent-ink: #a83d0c; }
.res-x .res-type-framework { --res-accent: #b58b00;          --res-accent-ink: #7d6000; }
.res-x .res-type-toolkit   { --res-accent: #562db6;          --res-accent-ink: #554477; }
.res-x .res-type-other     { --res-accent: #3c4e62;          --res-accent-ink: #4b4f63; }

/* ============================================================
   1. DARK HERO
   ============================================================ */
.x-hero {
	position: relative;
	background: var(--x-navy);
	color: #fff;
	overflow: hidden;
}

.x-hero-inner {
	position: relative;
	max-width: 1240px;
	margin: 0 auto;
	padding: 44px 40px 34px;
	z-index: 2;
}

@media (max-width: 767px) {
	.x-hero-inner {
		padding: 30px 20px 24px;
	}
}

.x-hero-top {
	display: flex;
	align-items: flex-start;
	gap: 30px;
	margin-bottom: 26px;
}

.x-eyebrow {
	margin: 0 0 8px;
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #ff7ab8;
}

.x-hero h1 {
	margin: 0;
	padding-bottom: 14px;
	border-bottom: 2px solid rgba(255, 255, 255, .25);
	font-size: 2.35rem;
	font-weight: 800;
	letter-spacing: -.025em;
	line-height: 1.1;
	color: #fff;
}

@media (max-width: 767px) {
	.x-hero h1 { font-size: 1.7rem; }
}

/* ---------- stats ---------- */
.x-stats {
	display: flex;
	gap: 30px;
	margin-left: auto;
	padding-top: 24px;
}

.x-stat strong {
	display: block;
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
	color: #fff;
}

.x-stat span {
	display: block;
	margin-top: 5px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .78);
}

@media (max-width: 900px) {
	.x-hero-top { flex-wrap: wrap; }
	.x-stats { margin-left: 0; padding-top: 4px; gap: 22px; }
}

/* ---------- decorative shapes ---------- */
.x-shapes {
	position: absolute;
	top: 26px;
	right: 0;
	width: 216px;
	height: 118px;
	pointer-events: none;
	z-index: 1;
}

@media (min-width: 1181px) {
	.x-stats { margin-right: 236px; }
}

@media (max-width: 1180px) {
	.x-shapes { display: none; }
}

/* ---------- search bar on dark ---------- */
.res-x .x-hero .res-keyword {
	border: 0;
	border-radius: 0;
	background: #fff;
	padding: 6px 6px 6px 20px;
	box-shadow: none;
}

.res-x .x-hero .res-keyword:focus-within {
	box-shadow: 0 0 0 3px rgba(226, 0, 122, .55);
}

.res-x .x-hero .res-keyword input {
	font-size: 1.02rem;
	padding: 12px 0;
}

.res-x .x-hero .res-keyword-icon { color: var(--x-magenta); }

.res-x .x-hero .res-keyword-submit {
	border-radius: 0;
	background: var(--x-magenta);
	padding: 12px 26px;
	font-size: .88rem;
}

.res-x .x-hero .res-keyword-submit:hover { background: #c30069; }

.res-x .x-hero .res-keyword-hint { display: none; }

/* ============================================================
   2. FILTER DROPDOWNS
   ============================================================ */
.x-filters {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin-top: 10px;
}

@media (max-width: 900px) {
	.x-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
	.x-filters { grid-template-columns: 1fr; }
}

.x-fbtn {
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
	border: 1px solid rgba(255, 255, 255, .18);
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-family: inherit;
	font-size: .94rem;
	font-weight: 700;
	text-align: left;
	padding: 15px 16px;
	cursor: pointer;
	transition: background .16s ease, border-color .16s ease;
}

.x-fbtn:hover {
	background: rgba(255, 255, 255, .12);
	border-color: rgba(255, 255, 255, .34);
}

.x-fbtn[aria-expanded="true"] {
	background: #fff;
	border-color: #fff;
	color: var(--x-navy);
}

.x-fbtn .x-caret {
	margin-left: auto;
	transition: transform .2s ease;
	opacity: .7;
}

.x-fbtn[aria-expanded="true"] .x-caret { transform: rotate(180deg); }

.x-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--x-magenta);
	color: #fff;
	font-size: .76rem;
	font-weight: 800;
}

.x-count[hidden] { display: none; }

.x-fbtn[aria-expanded="true"] .x-count { background: var(--x-magenta); }

/* ---------- panels ---------- */
.x-panel {
	background: #fff;
	color: var(--res-ink);
	padding: 20px 22px;
	margin-top: -1px;
	border: 1px solid #fff;
}

.x-panel[hidden] { display: none; }

.x-panel-lead {
	margin: 0 0 12px;
	font-size: .88rem;
	color: var(--res-muted);
}

.res-x .x-panel .res-chip {
	border-radius: 0;
}

.res-x .x-panel .res-chip[aria-pressed="true"] {
	background: var(--x-magenta);
	border-color: var(--x-magenta);
	color: #fff;
}

.res-x .x-panel .res-chip[aria-pressed="true"] .res-chip-count {
	background: rgba(255, 255, 255, .25);
	color: #fff;
}

/* the advanced fields live in the "More filters" panel */
.res-x .res-advanced {
	margin: 0;
	border: 0;
	padding: 0;
}

.res-x .res-advanced-toggle { display: none; }

.res-x .res-advanced-body {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
}

.res-x .res-field select,
.res-x .res-field input[type="text"],
.res-x .res-multi-btn,
.res-x .res-btn {
	border-radius: 0;
}

/* ---------- colour bar ---------- */
.x-colorbar {
	display: flex;
	height: 5px;
}

.x-colorbar span { flex: 1; }
.x-colorbar span:nth-child(1) { background: var(--x-yellow); }
.x-colorbar span:nth-child(2) { background: var(--x-orange); }
.x-colorbar span:nth-child(3) { background: var(--x-magenta); }
.x-colorbar span:nth-child(4) { background: var(--x-blue); }

/* ============================================================
   3. RESULTS AREA
   ============================================================ */
.res-x .res-results-head {
	background: #fff;
	border-radius: 0;
	border-color: rgba(20, 20, 58, .1);
	padding: 13px 18px;
	margin: 10px 0 20px;
}

.res-x .res-active { margin-bottom: 12px; }

.res-x .res-view,
.res-x .res-sort select,
.res-x .res-report-btn,
.res-x .res-manual-btn { background-color: #fff; }

.res-x .res-pill,
.res-x .res-chip,
.res-x .res-btn,
.res-x .res-sort select,
.res-x .res-view {
	border-radius: 0;
}

.res-x .res-count strong {
	font-size: 1.25rem;
}

.res-x .res-toolbar {
	border-bottom: 0;
	padding-bottom: 0;
}

/* a real heading, so the document does not jump from h1 to h3 */
.x-section-title {
	margin: 26px 0 2px;
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #b00062;
	border: 0;
	padding: 0;
}

.x-section-title::before,
.x-section-title::after { content: none; }

.res-x .res-toolbar { position: relative; margin: 0; }

/* ---------- report button ---------- */
.res-report-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--res-line);
	background: #fff;
	color: var(--res-ink);
	font-family: inherit;
	font-size: .84rem;
	font-weight: 700;
	padding: 7px 14px;
	cursor: pointer;
	border-radius: 0;
	transition: background .16s ease, border-color .16s ease;
}

.res-report-btn:hover {
	background: var(--x-navy);
	border-color: var(--x-navy);
	color: #fff;
}

/* ============================================================
   4. MINIMAL CARDS, FOUR ACROSS
   ============================================================ */
.res-x .res-results {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	counter-reset: x-card;
	/* a tinted field so the white cards read as objects sitting on it */
	background: #eef0f5;
	padding: 16px;
}

.res-x .res-more {
	background: #eef0f5;
	margin: 0;
	padding: 4px 16px 22px;
}

@media (max-width: 1100px) {
	.res-x .res-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
	.res-x .res-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
	.res-x .res-results { grid-template-columns: 1fr; }
}

.res-x .res-results.is-list {
	grid-template-columns: 1fr;
}

.res-x .res-item {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 0;
	border-top: 3px solid var(--res-accent, var(--res-line));
	border-radius: 0;
	box-shadow: 0 1px 2px rgba(20, 20, 58, .06);
	padding: 18px 18px 14px;
	overflow: hidden;
}

.res-x .res-item:hover {
	transform: none;
	box-shadow: 0 4px 16px rgba(20, 20, 58, .14);
	border-top-color: var(--res-accent);
}

/* running number — sized for three digits and kept clear of the text */
.res-x .res-item::before {
	content: counter(x-card, decimal-leading-zero);
	counter-increment: x-card;
	position: absolute;
	inset: 13px 16px auto auto;
	min-width: 2.6em;
	text-align: right;
	font-size: .84rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
	color: var(--res-accent-ink, var(--res-accent));
	opacity: .5;
	width: auto;
	height: auto;
	background: none;
	pointer-events: none;
}

.res-x .res-item-top {
	padding-right: 3.4em;
}

.res-x .res-item-media { display: none; }

/* flatten the two wrappers so the card's parts can be ordered freely */
.res-x .res-item-main,
.res-x .res-item-side {
	display: contents;
}

.res-x .res-item-top   { order: 1; }
.res-x .res-item h3    { order: 2; }
.res-x .res-item p     { order: 3; }
.res-x .res-meta       { order: 4; }
.res-x .res-tags       { order: 5; }
.res-x .res-item-foot  { order: 6; }

/* eyebrow: coloured dot + type, then the PULSE-ART code */
.res-x .res-item-top {
	align-items: center;
	gap: 0;
	margin-bottom: 10px;
}

.res-x .res-badge {
	order: 1;
	background: none;
	border-radius: 0;
	padding: 0;
	color: var(--res-accent-ink, var(--res-accent));
	font-size: .785rem;
	letter-spacing: .1em;
}

.res-x .res-badge .res-i { display: none; }

.res-x .res-badge::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--res-accent);
	margin-right: 7px;
	vertical-align: .04em;
}

.res-x .res-badge-pa {
	order: 2;
	color: #5c6070;
	opacity: 1;
}

.res-x .res-badge-pa::before {
	content: "•";
	width: auto;
	height: auto;
	border-radius: 0;
	background: none;
	margin: 0 7px;
	color: #b9bcc9;
	vertical-align: 0;
}

/* the document type is redundant here — the panel is compact */
.res-x .res-badge-doc { display: none; }

.res-x .res-item h3 {
	font-size: 1.06rem;
	line-height: 1.34;
	margin-bottom: 9px;
}

.res-x .res-item p {
	-webkit-line-clamp: 3;
	line-clamp: 3;
	font-size: .885rem;
	margin-bottom: 11px;
}

.res-x .res-tags {
	margin-bottom: 0;
	margin-top: auto;
	padding-top: 4px;
}

.res-x .res-tag {
	border-radius: 0;
	background: #f2f3f6;
	color: #4b4f63;
	font-weight: 600;
}

.res-x .res-tag-cluster,
.res-x .res-tag-cluster-edu {
	display: none;
}

.res-x .res-meta {
	margin: 0 0 10px;
	font-size: .79rem;
}

.res-x .res-meta > .res-meta-row:nth-child(n+3) { display: none; }

.res-x .res-item-foot {
	border-top: 1px solid var(--res-line);
	padding-top: 11px;
	margin-top: 12px;
}

.res-x .res-item-foot .res-format {
	display: none;
}

.res-x .res-item-foot {
	justify-content: flex-end;
}

.res-x .res-open {
	color: var(--res-accent-ink, var(--res-accent));
	font-size: .865rem;
}

/* keep the side rail inline in list view */
@media (min-width: 768px) {
	.res-x .res-results.is-list .res-item {
		display: grid;
		grid-template-columns: 3.6em minmax(0, 1fr) 270px;
		grid-template-areas: "num main side";
		column-gap: 24px;
		padding-left: 20px;
	}

	/* in a row the number gets its own column instead of floating over the text */
	.res-x .res-results.is-list .res-item::before {
		position: static;
		grid-area: num;
		inset: auto;
		min-width: 0;
		text-align: left;
		font-size: 1.15rem;
		opacity: .45;
		padding-top: 2px;
	}

	.res-x .res-results.is-list .res-item-top {
		padding-right: 0;
	}

	.res-x .res-results.is-list .res-item-main {
		display: flex;
		flex-direction: column;
		grid-area: main;
	}

	.res-x .res-results.is-list .res-item-side {
		display: flex;
		flex-direction: column;
		grid-area: side;
	}

	.res-x .res-results.is-list .res-item p {
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}

	.res-x .res-results.is-list .res-item-side {
		border-left: 1px solid var(--res-line);
		padding-left: 22px;
	}

	/* the right rail was the smallest text on the page — give it room,
	   show the field labels and keep the icons as anchors */
	.res-x .res-results.is-list .res-meta {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 7px;
		font-size: .855rem;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row {
		display: flex;
		align-items: baseline;
		gap: 7px;
		width: 100%;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row::before {
		content: none;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row .res-i {
		width: 15px;
		height: 15px;
		align-self: flex-start;
		margin-top: 2px;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row > .res-meta-label {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
		overflow: visible;
		font-weight: 700;
		color: #5c6070;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row > .res-meta-value {
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	/* the format is on the record page; the list does not repeat it */
	.res-x .res-results.is-list .res-item-foot .res-format {
		display: none;
	}

	.res-x .res-results.is-list .res-meta > .res-meta-row:nth-child(n+3) {
		display: inline-flex;
	}
}

/* ---------- help panel on the dark hero ---------- */
.res-x .res-help-on-dark .res-help-btn {
	border-radius: 0;
	border-color: rgba(255, 255, 255, .22);
	background: transparent;
	color: rgba(255, 255, 255, .92);
}

.res-x .res-help-on-dark .res-help-btn:hover {
	border-color: rgba(255, 255, 255, .55);
	background: rgba(255, 255, 255, .08);
	color: #fff;
}

.res-x .res-help-on-dark .res-help-btn[aria-expanded="true"] {
	background: #fff;
	border-color: #fff;
	color: var(--x-navy);
}

.res-x .res-help-panel {
	border-radius: 0;
	background: #fff;
	border-color: #fff;
}

.res-x .res-help-step .res-help-n {
	border-radius: 0;
	background: var(--x-magenta);
	color: #fff;
}

.res-x .res-help-close {
	border-radius: 0;
}

/* ---------- manual, squared to match the explore variant ---------- */
.res-x .res-manual-btn,
.res-x .man-print,
.res-x .man-close { border-radius: 0; }

.res-x .man-dialog { border-radius: 0; }

.res-x .man-toc a { border-radius: 0; }

.res-x .man-section h3 span { border-radius: 0; background: var(--x-magenta); }
