/*
 * Pippin Report Finder: report cards in the state cards' look, with the search field, report groups and topic chips
 * in a sticky column on the left (the Library's layout). Tablet and phone: the tools sit above the cards as chips.
 * Colours and type follow the Kit globals. The section around it gives the colour (Section- Tint) and the width.
 */
.pt-reports {
	--pt-r-text: var(--e-global-color-text, #22294e);
	--pt-r-muted: var(--e-global-color-e4427e8, #757575);
	--pt-r-border: var(--e-global-color-b0de001, #d9d9d9);
	--pt-r-dark: var(--e-global-color-3fbeb61, #0f1328);
	--pt-r-surface: var(--e-global-color-5f0ace0, #fff);
	--pt-r-blue: var(--e-global-color-b65e592, #76d0f4);
	--pt-r-focus: var(--e-global-color-primary, #37aada);
	--pt-r-tint: var(--e-global-color-c2eafc, #c2eafc);
	display: flex;
	flex-direction: column;
	gap: 32px;
	color: var(--pt-r-text);
}

/* Intro */
.pt-reports__intro {
	display: flex;
	flex-direction: column;
	gap: var(--pt-section-xs, 16px);
}
.pt-reports .pt-reports__eyebrow {
	margin: 0;
	color: var(--e-global-color-5ab0001, #d83040);
	font-family: var(--e-global-typography-5ab0d00-font-family), sans-serif;
	font-size: var(--e-global-typography-5ab0d00-font-size, 0.875rem);
	font-weight: var(--e-global-typography-5ab0d00-font-weight, 700);
	letter-spacing: var(--e-global-typography-5ab0d00-letter-spacing, 0.16em);
	line-height: var(--e-global-typography-5ab0d00-line-height, 1.4);
	text-transform: uppercase;
}
/* The heading keeps a readable measure; the lead runs the full boxed width. */
.pt-reports .pt-reports__title {
	max-width: 760px;
	margin: 0;
	color: var(--pt-r-text);
}
.pt-reports .pt-reports__lead {
	margin: 0;
	color: var(--pt-r-muted);
	font-size: var(--e-global-typography-3bc6d1e-font-size, 1.5rem);
	line-height: var(--e-global-typography-3bc6d1e-line-height, 1.4);
	letter-spacing: var(--e-global-typography-3bc6d1e-letter-spacing, -0.019em);
}

/* Layout: tools on the left, results on the right. */
.pt-reports__layout {
	display: grid;
	grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
	gap: var(--pt-columns, 40px);
	align-items: start;
}
.pt-reports__results {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

/* Tools */
.pt-reports__tools {
	position: sticky;
	top: var(--pt-lib-sticky, 120px);
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-height: calc(100vh - var(--pt-lib-sticky, 120px) - 24px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.pt-reports__block {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pt-reports .pt-reports__block-title {
	margin: 0;
	padding: 0 14px;
	color: var(--pt-r-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}
.pt-reports__search {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
	height: 52px;
	margin: 2px;
	padding: 0 18px;
	border: 1.5px solid var(--pt-r-border);
	border-radius: 999px;
	background: var(--pt-r-surface);
	color: var(--pt-r-muted);
	cursor: text;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pt-reports__search:focus-within {
	border-color: var(--pt-r-focus);
	box-shadow: 0 0 0 4px rgba(55, 170, 218, 0.15);
}
.pt-reports__search svg {
	flex: none;
	width: 20px;
	height: 20px;
}
.pt-reports .pt-reports__input,
.pt-reports .pt-reports__input:focus {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--pt-r-text);
	font: inherit;
	font-size: 1rem;
}
.pt-reports__input::placeholder {
	color: var(--pt-r-muted);
	opacity: 1;
}
.pt-reports__groups,
.pt-reports__topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.pt-reports__topics {
	padding: 0 2px;
}
.pt-reports .pt-reports__chip,
.pt-reports .pt-reports__chip:hover,
.pt-reports .pt-reports__chip:focus {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 8px 16px;
	border: 1.5px solid var(--pt-r-border);
	border-radius: 999px;
	background: var(--pt-r-surface);
	box-shadow: none;
	color: var(--pt-r-text);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pt-reports .pt-reports__topic,
.pt-reports .pt-reports__topic:hover,
.pt-reports .pt-reports__topic:focus {
	padding: 6px 12px;
	font-size: 0.8125rem;
	font-weight: 500;
}
.pt-reports .pt-reports__chip:hover {
	border-color: var(--pt-r-blue);
}
.pt-reports .pt-reports__group[aria-pressed="true"] {
	border-color: var(--pt-r-dark);
	background: var(--pt-r-dark);
	color: #fff;
}
.pt-reports .pt-reports__topic[aria-pressed="true"] {
	border-color: var(--pt-r-focus);
	background: var(--e-global-color-2c7a47e, #e4f6fe);
	color: var(--pt-r-text);
}
.pt-reports .pt-reports__chip:focus-visible {
	outline: 2px solid var(--pt-r-focus);
	outline-offset: 2px;
}
.pt-reports__n {
	color: inherit;
	font-size: 0.75rem;
	font-weight: 500;
	opacity: 0.6;
}
.pt-reports__bar {
	display: flex;
	align-items: center;
	gap: 16px;
}
.pt-reports .pt-reports__count {
	margin: 0;
	color: var(--pt-r-muted);
	font-size: 0.875rem;
}
.pt-reports .pt-reports__clear,
.pt-reports .pt-reports__clear:hover,
.pt-reports .pt-reports__clear:focus {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--e-global-color-accent, #d83040);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: underline;
	text-transform: none;
	cursor: pointer;
}
.pt-reports__clear[hidden] {
	display: none;
}

/* Desktop: the groups are a list, like the Library's Type list. */
@media (min-width: 1025px) {
	.pt-reports__groups {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 2px;
	}
	.pt-reports .pt-reports__group,
	.pt-reports .pt-reports__group:hover,
	.pt-reports .pt-reports__group:focus {
		justify-content: space-between;
		width: 100%;
		padding: 10px 14px;
		border: 0;
		border-radius: 10px;
		background: transparent;
		color: var(--pt-r-text);
		font-size: 0.9375rem;
		font-weight: 500;
		text-align: left;
	}
	.pt-reports .pt-reports__group:hover {
		background: var(--e-global-color-5f0ace1, #f5f7fa);
	}
	.pt-reports .pt-reports__group[aria-pressed="true"] {
		background: var(--e-global-color-2c7a47e, #e4f6fe);
		color: var(--pt-r-text);
		font-weight: 600;
	}
	.pt-reports .pt-reports__group .pt-reports__n {
		font-size: 0.8125rem;
	}
}

/* Cards (the state cards' look) */
.pt-reports__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(236px, 100%), 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pt-reports__item {
	margin: 0;
}
.pt-reports__item[hidden] {
	display: none;
}
.pt-reports .pt-reports__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid rgba(15, 19, 40, 0.08);
	border-radius: 16px;
	background: var(--pt-r-surface);
	color: var(--pt-r-text);
	text-decoration: none;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.pt-reports .pt-reports__link:hover,
.pt-reports .pt-reports__link:focus-visible {
	border-color: var(--pt-r-blue);
	box-shadow: 0 16px 36px rgba(15, 19, 40, 0.12);
	color: var(--pt-r-text);
	transform: translateY(-2px);
}
.pt-reports .pt-reports__link:focus-visible {
	outline: 2px solid var(--pt-r-focus);
	outline-offset: 2px;
}
.pt-reports__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--pt-r-tint);
}
.pt-reports__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.pt-reports .pt-reports__link:hover .pt-reports__media img {
	transform: scale(1.04);
}
.pt-reports__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	max-width: calc(100% - 20px);
	padding: 3px 8px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--pt-r-dark);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pt-reports__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 18px;
}
.pt-reports .pt-reports__name {
	margin: 0;
	color: var(--pt-r-text);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
}
.pt-reports__summary {
	display: -webkit-box;
	overflow: hidden;
	color: var(--pt-r-muted);
	font-size: 0.875rem;
	line-height: 1.45;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}
.pt-reports .pt-reports__none {
	margin: 0;
	color: var(--pt-r-muted);
}

/* Tablet: the tools above the cards, as chips. */
@media (max-width: 1024px) {
	.pt-reports__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
	.pt-reports__tools {
		position: static;
		max-height: none;
		overflow: visible;
		gap: 16px;
	}
	.pt-reports__search {
		max-width: 560px;
	}
	.pt-reports .pt-reports__block-title {
		padding: 0;
	}
}

/* Phone: two cards a row, chips scroll sideways. */
@media (max-width: 767px) {
	.pt-reports {
		gap: 24px;
	}
	.pt-reports .pt-reports__lead {
		font-size: 1.125rem;
	}
	.pt-reports__groups,
	.pt-reports__topics {
		flex-wrap: nowrap;
		max-width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.pt-reports .pt-reports__chip {
		flex: none;
	}
	.pt-reports__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
	.pt-reports__body {
		padding: 10px 12px 14px;
	}
	.pt-reports .pt-reports__name {
		font-size: 0.9375rem;
	}
	.pt-reports__summary {
		font-size: 0.8125rem;
		-webkit-line-clamp: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pt-reports * {
		transition: none !important;
	}
}
