/* ============================================================
   Repository Manager — Frontend (Phase 4B-1)
   Matches the UNICEF SBC Knowledge Repository screenshot.
   UNICEF palette: cyan #00AEEF / light border #1CABE2.
   ============================================================ */

:root {
	--repo-unicef-cyan:      #00AEEF;
	--repo-unicef-cyan-dark: #008dc4;
	--repo-border:           #1CABE2;
	--repo-border-soft:      rgba(28, 171, 226, 0.35);
	--repo-bg-filters:       #f7fafb;
	--repo-bg-card:          #ffffff;
	--repo-text:             #222222;
	--repo-text-muted:       #4a4a4a;
	--repo-radius-lg:        12px;
	--repo-radius-md:        8px;
	--repo-radius-sm:        4px;
	--repo-border-width:     2px;
	--repo-gap-cards:        20px;
}

/* ---------- Filter bar ---------- */
.repo-filters-form {
	width: 100%;
	box-sizing: border-box;
	border: var(--repo-border-width) solid var(--repo-border);
	border-radius: var(--repo-radius-lg);
	background-color: var(--repo-bg-filters);
	padding: 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
}

.repo-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 24px;
	align-items: flex-end;
	justify-content: center;
}

.repo-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 0 0 auto;
	width: 220px;
	max-width: 100%;
}

.repo-filter-label {
	font-weight: 600;
	color: var(--repo-text);
	font-size: 14px;
	text-align: center;
}

.repo-filter-select {
	width: 100%;
	box-sizing: border-box;
	min-height: 36px;
	padding: 6px 10px;
	font-size: 14px;
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: var(--repo-radius-sm);
	color: var(--repo-text);
	line-height: 1.4;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 32px;
}

.repo-filter-select:hover {
	border-color: var(--repo-border);
}

.repo-filter-select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background-color: #f3f3f3;
}

.repo-filter-submit-wrap {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
}

.repo-filter-btn {
	min-height: 36px;
	padding: 6px 20px;
	cursor: pointer;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--repo-radius-sm);
	border: var(--repo-border-width) solid var(--repo-unicef-cyan);
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.repo-filter-btn-search {
	background-color: var(--repo-unicef-cyan);
	color: #ffffff;
}

.repo-filter-btn-search:hover,
.repo-filter-btn-search:focus {
	background-color: var(--repo-unicef-cyan-dark);
	border-color: var(--repo-unicef-cyan-dark);
	color: #ffffff;
}

.repo-filter-btn-reset {
	background-color: #ffffff;
	color: var(--repo-unicef-cyan-dark);
}

.repo-filter-btn-reset:hover,
.repo-filter-btn-reset:focus {
	background-color: #eaf6fb;
	border-color: var(--repo-unicef-cyan-dark);
	color: var(--repo-unicef-cyan-dark);
}

/* ---------- Resource listing ---------- */
.repo-resource-listing {
	width: 100%;
	margin-top: 24px;
}

.repo-resource-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--repo-gap-cards);
}

.repo-resource-card {
	display: flex;
	flex-wrap: nowrap;
	gap: 16px 20px;
	width: 100%;
	box-sizing: border-box;
	padding: 16px 20px;
	border: var(--repo-border-width) solid var(--repo-border);
	border-radius: var(--repo-radius-lg);
	background-color: var(--repo-bg-card);
	align-items: flex-start;
}

.repo-card-thumb {
	flex: 0 0 auto;
	width: 110px;
	max-width: 110px;
	box-sizing: border-box;
	border: 1px solid var(--repo-border-soft);
	border-radius: var(--repo-radius-md);
	padding: 4px;
	background-color: #fff;
}

.repo-card-thumb-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: calc(var(--repo-radius-md) - 2px);
}

.repo-card-thumb-placeholder {
	width: 100%;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: calc(var(--repo-radius-md) - 2px);
	background-color: #f2f9fc;
	color: #789;
	font-size: 11px;
	text-align: center;
	padding: 6px;
	box-sizing: border-box;
}

.repo-card-body {
	flex: 1 1 auto;
	min-width: 0;
}

.repo-card-title {
	margin: 0 0 8px 0;
	font-size: 18px;
	line-height: 1.35;
	font-weight: 700;
	color: var(--repo-unicef-cyan-dark);
}

.repo-card-meta-line {
	margin: 0 0 6px 0;
	color: var(--repo-text-muted);
	font-size: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 2px 0;
}

.repo-card-meta {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.repo-card-meta-label {
	font-weight: 700;
	color: var(--repo-text);
}

.repo-card-meta-sep {
	margin: 0 6px;
	color: #999;
}

.repo-card-audiences {
	margin: 0 0 6px 0;
	color: var(--repo-text-muted);
	font-size: 14px;
}

.repo-card-audience {
	margin: 0;
}

.repo-card-audience strong {
	font-weight: 700;
	color: var(--repo-text);
}

.repo-card-description {
	margin: 0;
	color: var(--repo-text-muted);
	font-size: 14px;
	line-height: 1.55;
}

.repo-resource-empty {
	padding: 32px 20px;
	text-align: center;
	border: 1px dashed var(--repo-border-soft);
	border-radius: var(--repo-radius-lg);
	color: var(--repo-text-muted);
	background-color: var(--repo-bg-filters);
}

/* ---------- Pagination ---------- */
.repo-pagination {
	margin: 28px 0 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: center;
}

.repo-pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	min-width: 22px;
	text-align: center;
	border-radius: var(--repo-radius-sm);
	border: 1px solid #d7e4ec;
	background-color: #fff;
	color: var(--repo-unicef-cyan-dark);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.4;
}

.repo-pagination .page-numbers:hover,
.repo-pagination a.page-numbers:focus {
	background-color: #eaf6fb;
	border-color: var(--repo-border);
	color: var(--repo-unicef-cyan-dark);
}

.repo-pagination .page-numbers.current {
	background-color: var(--repo-unicef-cyan);
	border-color: var(--repo-unicef-cyan);
	color: #fff;
	font-weight: 600;
	cursor: default;
}

.repo-pagination .page-numbers.dots {
	border-color: transparent;
	background-color: transparent;
	padding: 6px 4px;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 782px) {
	.repo-filters-form {
		padding: 16px;
	}

	.repo-filter-row {
		gap: 12px;
	}

	.repo-filter-field {
		width: 100%;
	}

	.repo-filter-label {
		text-align: left;
	}

	.repo-filter-submit-wrap {
		width: 100%;
	}

	.repo-filter-btn {
		flex: 1 1 50%;
	}

	.repo-resource-card {
		flex-direction: column;
		flex-wrap: wrap;
		padding: 14px;
	}

	.repo-card-thumb {
		width: 96px;
		max-width: 96px;
	}

	.repo-card-title {
		font-size: 16px;
	}
}

/* ---------- Card links (card remains visually identical) ---------- */
.repo-card-title-link {
	color: inherit;
	text-decoration: none;
}

.repo-card-title-link:hover,
.repo-card-title-link:focus {
	color: var(--repo-unicef-cyan-dark);
	text-decoration: underline;
}

.repo-card-thumb-link {
	display: block;
	text-decoration: none;
	outline: none;
}

.repo-card-thumb-link:hover .repo-card-thumb-img {
	opacity: 0.9;
}

/* ---------- Single Resource Detail View ---------- */
.repo-single-resource {
	width: 100%;
	box-sizing: border-box;
}

.repo-breadcrumb {
	margin: 0 0 16px 0;
}

.repo-breadcrumb-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: center;
	color: var(--repo-text-muted);
	font-size: 14px;
}

.repo-breadcrumb-item a {
	color: var(--repo-unicef-cyan-dark);
	text-decoration: none;
}

.repo-breadcrumb-item a:hover,
.repo-breadcrumb-item a:focus {
	text-decoration: underline;
}

.repo-breadcrumb-current {
	color: var(--repo-text);
	font-weight: 600;
}

.repo-breadcrumb-sep {
	color: #bbb;
	user-select: none;
}

.repo-single-header {
	margin: 0 0 20px 0;
}

.repo-single-title {
	margin: 0;
	font-size: 28px;
	line-height: 1.25;
	color: var(--repo-unicef-cyan-dark);
	font-weight: 700;
}

.repo-single-thumbnail-wrap {
	width: 100%;
	margin: 0 0 24px 0;
	border: var(--repo-border-width) solid var(--repo-border);
	border-radius: var(--repo-radius-lg);
	padding: 12px;
	box-sizing: border-box;
	background-color: #fff;
}

.repo-single-thumbnail-img {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: var(--repo-radius-md);
}

.repo-single-thumbnail-placeholder {
	width: 100%;
	min-height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--repo-radius-md);
	background-color: var(--repo-bg-filters);
	color: #789;
	font-size: 14px;
}

.repo-single-meta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 28px 0;
	padding: 20px 24px;
	border: 1px solid var(--repo-border-soft);
	border-radius: var(--repo-radius-lg);
	background-color: #fbfdfe;
}

.repo-single-meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	align-items: flex-start;
	font-size: 15px;
	line-height: 1.5;
}

.repo-single-meta-label {
	flex: 0 0 auto;
	min-width: 180px;
	font-weight: 700;
	color: var(--repo-text);
}

.repo-single-meta-value {
	flex: 1 1 280px;
	min-width: 0;
	color: var(--repo-text-muted);
}

.repo-single-meta-value > p {
	margin: 0;
}

.repo-single-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 16px;
	align-items: center;
	margin: 0 0 20px 0;
}

.repo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 22px;
	font-size: 15px;
	font-weight: 600;
	border-radius: var(--repo-radius-sm);
	border: var(--repo-border-width) solid var(--repo-unicef-cyan);
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	box-sizing: border-box;
	white-space: nowrap;
	line-height: 1.2;
}

.repo-btn-download {
	background-color: var(--repo-unicef-cyan);
	color: #fff;
}

.repo-btn-download:hover,
.repo-btn-download:focus {
	background-color: var(--repo-unicef-cyan-dark);
	border-color: var(--repo-unicef-cyan-dark);
	color: #fff;
	text-decoration: none;
}

.repo-btn-back {
	background-color: #fff;
	color: var(--repo-unicef-cyan-dark);
}

.repo-btn-back:hover,
.repo-btn-back:focus {
	background-color: #eaf6fb;
	border-color: var(--repo-unicef-cyan-dark);
	color: var(--repo-unicef-cyan-dark);
	text-decoration: none;
}

.repo-single-resource-unavailable {
	margin: 0;
	padding: 10px 14px;
	background-color: #fff7ed;
	border: 1px solid #f5d8b3;
	border-radius: var(--repo-radius-sm);
	color: #7a4f00;
	font-size: 14px;
	font-weight: 600;
}

.repo-single-not-found {
	padding: 20px 0;
}

/* ---------- Responsive: single view ---------- */
@media (max-width: 782px) {
	.repo-single-title {
		font-size: 22px;
	}

	.repo-single-meta {
		padding: 14px 16px;
	}

	.repo-single-meta-label {
		min-width: 0;
		width: 100%;
	}

	.repo-single-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.repo-btn {
		width: 100%;
	}
}
