.hupe-materials-module {
	--hupe-blue: #0074a2;
	--hupe-blue-dark: #005f86;
	--hupe-blue-soft: #e6f4f8;
	--hupe-border: #d7e6ec;
	--hupe-text: #18202a;
	--hupe-muted: #676f75;
	--hupe-card: #fff;
	--hupe-shadow: 0 14px 35px rgba(0, 116, 162, 0.10);
	--hupe-accent: #ff735e;
	--hupe-radius: 18px;
	color: var(--hupe-text);
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hupe-materials-tools {
	display: grid;
	grid-template-columns: minmax(260px, 420px) 1fr;
	gap: 22px;
	align-items: center;
	margin-bottom: 24px;
	width: 100%;
}

.hupe-materials-search {
	position: relative;
}

.hupe-materials-search svg {
	position: absolute;
	left: 18px;
	top: calc(50% - 2px);
	z-index: 1;
	color: #8ca0b4;
	transform: translateY(-50%);
	pointer-events: none;
}

.hupe-materials-search-input {
	width: 100%;
	height: 56px;
	max-width: none !important;
	box-sizing: border-box;
	padding: 0 18px 0 50px !important;
	color: var(--hupe-text);
	background: #fff;
	border: 1px solid var(--hupe-border);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(11, 74, 115, 0.06);
	font: 600 15px/1 Inter, system-ui, sans-serif;
	outline: none;
}

.hupe-materials-search-input:focus {
	border-color: rgba(0, 116, 162, 0.45);
	box-shadow: 0 0 0 5px rgba(0, 116, 162, 0.12);
}

.hupe-materials-grade-filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.hupe-grade-filter-button {
	min-width: 46px;
	height: 46px;
	padding: 0 14px;
	color: var(--hupe-blue-dark);
	background: #fff;
	border: 1px solid rgba(0, 116, 162, 0.28);
	border-radius: 999px;
	font-weight: 800;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hupe-grade-filter-button:hover,
.hupe-grade-filter-button:focus {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(0, 116, 162, 0.12);
}

.hupe-grade-filter-button.is-active {
	min-width: 58px;
	color: #fff;
	background: var(--hupe-blue);
	border-color: var(--hupe-blue);
	box-shadow: 0 10px 20px rgba(0, 116, 162, 0.22);
}

.hupe-materials-module-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.hupe-materials-module-row {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 170px 230px;
	column-gap: 28px;
	row-gap: 0;
	align-items: center;
	padding: 24px 24px 24px 28px;
	background: var(--hupe-card);
	border: 1px solid var(--hupe-border);
	border-radius: var(--hupe-radius);
	box-shadow: 0 2px 0 rgba(0, 116, 162, 0.02);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hupe-materials-module-row:hover {
	transform: translateY(-2px);
	box-shadow: var(--hupe-shadow);
	border-color: rgba(0, 116, 162, 0.28);
}

.hupe-materials-module-main {
	min-width: 0;
	align-self: center;
	padding-top: 40px;
}

.hupe-materials-module-grades {
	position: absolute;
	left: 0;
	top: 18px;
	margin: 0;
}

.hupe-materials-module-grade-pill,
.hupe-materials-module-grade {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 40px;
	min-width: 118px;
	max-width: calc(100vw - 48px);
	padding: 0 22px 0 26px;
	color: #fff;
	background: var(--hupe-blue);
	border-radius: 0 999px 999px 0;
	box-shadow: 0 8px 16px rgba(0, 116, 162, 0.18);
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	box-sizing: border-box;
}

.hupe-materials-module-grade-values {
	font-weight: 800;
}

.hupe-materials-module-title {
	margin: 0 0 8px;
	color: var(--hupe-text);
	text-align: left;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0;
}

.hupe-materials-module-author {
	margin-top: 6px;
	color: var(--hupe-muted);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
}

.hupe-materials-module-published {
	align-self: center;
	padding-left: 24px;
	color: var(--hupe-muted);
	border-left: 1px solid var(--hupe-border);
}

.hupe-materials-module-published span,
.hupe-materials-module-published strong {
	display: block;
}

.hupe-materials-module-published span {
	margin-bottom: 3px;
	font-size: 14px;
	font-weight: 600;
}

.hupe-materials-module-published strong {
	color: #2d3b43;
	font-size: 15px;
	font-weight: 800;
}

.hupe-materials-module-files {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	align-self: center;
	gap: 9px;
}

.hupe-materials-download-button,
.hupe-materials-link-button {
	width: 100%;
	max-width: 220px;
	min-height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 13px 16px;
	color: var(--hupe-blue-dark);
	text-decoration: none;
	background: linear-gradient(180deg, #fff, var(--hupe-blue-soft));
	border: 1px solid rgba(0, 116, 162, 0.28);
	border-radius: 14px;
	font-weight: 800;
	transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.hupe-materials-download-button:hover,
.hupe-materials-download-button:focus,
.hupe-materials-link-button:hover,
.hupe-materials-link-button:focus {
	color: #fff;
	background: var(--hupe-accent);
	border-color: var(--hupe-accent);
	transform: translateY(-1px);
}

.hupe-materials-download-button svg,
.hupe-materials-link-button svg {
	flex: 0 0 auto;
}

.hupe-download-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.18;
}

.hupe-download-text small {
	margin-top: 4px;
	color: currentColor;
	opacity: 0.75;
	font-size: 12px;
	font-weight: 700;
}

.hupe-file-types {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 7px;
}

.hupe-file-types em {
	padding: 5px 7px;
	color: var(--hupe-blue-dark);
	background: #fff;
	border: 1px solid rgba(0, 116, 162, 0.20);
	border-radius: 999px;
	font-size: 10px;
	font-style: normal;
	font-weight: 800;
	line-height: 1;
}

.hupe-materials-download-button:hover .hupe-file-types em,
.hupe-materials-download-button:focus .hupe-file-types em {
	color: #fff;
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.35);
}

.hupe-materials-module-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 28px;
}

.hupe-page-button {
	width: 42px;
	height: 42px;
	padding: 0;
	color: var(--hupe-blue-dark);
	background: #fff;
	border: 1px solid rgba(0, 116, 162, 0.28);
	border-radius: 999px;
	font-weight: 800;
}

.hupe-page-button.is-active {
	width: 58px;
	color: #fff;
	background: var(--hupe-blue);
	border-color: var(--hupe-blue);
}

.hupe-materials-empty {
	margin: 0;
	color: var(--hupe-muted);
}

@media (max-width: 980px) {
	.hupe-materials-tools {
		grid-template-columns: 1fr;
	}

	.hupe-materials-grade-filter {
		justify-content: flex-start;
	}

	.hupe-materials-module-row {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.hupe-materials-module-published {
		padding: 18px 0 0;
		border-left: 0;
		border-top: 1px solid var(--hupe-border);
	}

	.hupe-materials-module-files {
		align-items: flex-start;
	}

	.hupe-materials-download-button,
	.hupe-materials-link-button {
		max-width: 100%;
	}
}

@media (max-width: 640px) {
	.hupe-materials-module-row {
		padding: 24px 22px 20px;
	}

	.hupe-materials-module-title {
		font-size: 19px;
	}

	.hupe-materials-module-grade-pill,
	.hupe-materials-module-grade {
		max-width: calc(100vw - 28px);
	}
}
