/* =========================================================
 * AIDE Canada — Learn Resources
 * Designed to match aidecanada.ca/resources/learn,
 * styled with the Aide Canada brand tokens.
 * ========================================================= */

.alr-root,
.alr-single-page,
.alr-topic-page {
	/* Aide Canada brand tokens (source: skills/aide-canada-brand) */
	--aide-purple: #5236b8;
	--aide-dark-purple: #6856e8;
	--aide-medium-purple: #aeb0ff;
	--aide-lilac: #d7d8ff;
	--aide-light-purple: #e6e8ff;
	--aide-yellow: #f0bf4a;
	--aide-bright-yellow: #ffd550;
	--aide-slate: #2e2e2e;
	--aide-green: #189451;
	--aide-red: #f75c45;
	--aide-white: #ffffff;
	--aide-grey: #4c4c4d;
	--aide-ash: #a5a098;
	--aide-light-grey: #e5e3df;

	/* Local semantic aliases */
	--alr-purple: var(--aide-purple);
	--alr-purple-hover: var(--aide-dark-purple);
	--alr-text: var(--aide-slate);
	--alr-muted: var(--aide-grey);
	--alr-border: var(--aide-light-grey);
	--alr-soft: var(--aide-light-purple);
	--alr-soft-2: #f6f5fb;
	--alr-radius: 10px;
	--alr-radius-sm: 6px;

	/* Neutralize Avada's global link underline (Theme Options sets
	 * --awb-link_decoration_line: underline on body links). Donor site
	 * links are not underlined, so scope it off for all plugin output. */
	--awb-link_decoration_line: none;
	--awb-link_decoration_line_hover: none;

	box-sizing: border-box;
	color: var(--alr-text);
	font-family: "TT Norms", "Helvetica", "Arial", sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

.alr-root *,
.alr-root *::before,
.alr-root *::after,
.alr-single-page *,
.alr-single-page *::before,
.alr-single-page *::after,
.alr-topic-page *,
.alr-topic-page *::before,
.alr-topic-page *::after {
	box-sizing: inherit;
}

.alr-root h1,
.alr-root h2,
.alr-root h3,
.alr-root h4,
.alr-single-page h1,
.alr-single-page h2,
.alr-single-page h3,
.alr-single-page h4 {
	color: var(--aide-slate);
	font-family: "TT Norms", "Helvetica", "Arial", sans-serif;
	font-weight: 700;
	letter-spacing: -0.005em;
	line-height: 1.3;
}

/* Neutralize Avada's responsive typography on our headings.
 * The theme injects inline style="--fontSize: 36; line-height: 1.1;"
 * which blows up titles. Force our intended sizes regardless. */
.alr-root .fusion-responsive-typography-calculated,
.alr-single-page .fusion-responsive-typography-calculated {
	--fontSize: inherit;
}

.alr-root a {
	color: var(--alr-purple);
	text-decoration: none;
}

.alr-root a:hover,
.alr-root a:focus {
	color: var(--alr-purple-hover);
}

/* =========================================================
 * Layout: filter sidebar (left) + results (right)
 * Mirrors donor: col-3 / col-9
 * ========================================================= */

.alr-layout {
	align-items: start;
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
	margin: 1.5rem 0 2.5rem;
}

.alr-layout-topic {
	grid-template-columns: minmax(0, 1fr);
}

.alr-sidebar {
	align-self: start;
	background: transparent;
	border: none;
	padding: 0;
	position: sticky;
	top: 1rem;
}

.alr-filter-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.alr-field {
	display: block;
}

.alr-field label {
	color: var(--aide-slate);
	display: block;
	font-size: 0.92rem;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.alr-keyword-field label {
	position: absolute;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	white-space: nowrap;
}

.alr-field input,
.alr-field select,
.alr-sort-form select {
	background: var(--aide-white);
	border: 1px solid var(--alr-border);
	border-radius: var(--alr-radius-sm);
	color: var(--alr-purple);
	font: inherit;
	font-weight: 500;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	width: 100%;
}

.alr-field input::placeholder {
	color: var(--alr-purple);
	opacity: 0.75;
}

.alr-field input:focus,
.alr-field select:focus,
.alr-sort-form select:focus {
	border-color: var(--alr-purple);
	outline: 2px solid var(--alr-purple);
	outline-offset: 2px;
}

.alr-actions {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: 1fr 1fr;
	margin-top: 0.25rem;
}

.alr-actions .alr-button {
	width: 100%;
}

/* =========================================================
 * Buttons
 * ========================================================= */

.alr-button {
	align-items: center;
	background: var(--aide-white);
	border: 1.5px solid var(--alr-purple);
	border-radius: 999px;
	color: var(--alr-purple);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 600;
	gap: 0.4rem;
	justify-content: center;
	line-height: 1.2;
	min-height: 44px;
	padding: 0.6rem 1.25rem;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.alr-button:hover,
.alr-button:focus {
	background: var(--alr-soft);
	border-color: var(--alr-purple-hover);
	color: var(--alr-purple-hover);
	text-decoration: none;
}

.alr-button-primary {
	background: var(--alr-purple);
	border-color: var(--alr-purple);
	color: var(--aide-white);
}

.alr-button-primary:hover,
.alr-button-primary:focus {
	background: var(--alr-purple-hover);
	border-color: var(--alr-purple-hover);
	color: var(--aide-white);
}

/* =========================================================
 * Results header
 * ========================================================= */

.alr-results-header {
	align-items: center;
	background: var(--aide-light-grey);
	border-radius: var(--alr-radius-sm);
	display: grid;
	gap: 0.75rem;
	grid-template-columns: 1fr;
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
}

@media (min-width: 720px) {
	.alr-results-header {
		grid-template-columns: 1fr auto;
	}
}

.alr-root .alr-results-header h2 {
	color: var(--aide-slate);
	font-size: 1rem !important;
	font-weight: 700;
	line-height: 1.3 !important;
	margin: 0;
}

.alr-sort-form {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-self: end;
}

.alr-sort-form label {
	color: var(--alr-purple);
	font-weight: 600;
	white-space: nowrap;
}

.alr-sort-form select {
	border-color: var(--alr-purple);
	min-width: 220px;
	width: auto;
}

/* =========================================================
 * Resource card grid (3 per row, image on top, full link)
 * ========================================================= */

.alr-card-list {
	display: grid;
	gap: 1.5rem 1.25rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.alr-card-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.alr-card-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.alr-card {
	background: var(--aide-white);
	border: none;
	border-radius: 0;
	display: block;
	padding: 0;
}

.alr-card-link {
	color: inherit;
	display: block;
	text-decoration: none;
}

.alr-card-link:hover,
.alr-card-link:focus {
	color: inherit;
	text-decoration: none;
}

.alr-card-link:hover .alr-card-title,
.alr-card-link:focus .alr-card-title {
	color: var(--alr-purple);
}

.alr-card-link:focus-visible {
	outline: 2px solid var(--alr-purple);
	outline-offset: 4px;
}

.alr-card-image-wrap {
	background: var(--alr-soft);
	display: block;
	overflow: hidden;
}

.alr-card-image {
	display: block;
	height: 100%;
	min-height: 180px;
	object-fit: cover;
	transition: transform 0.25s ease;
	width: 100%;
}

.alr-card-link:hover .alr-card-image,
.alr-card-link:focus .alr-card-image {
	transform: scale(1.03);
}

.alr-card-content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.85rem 0 0;
}

.alr-card-type {
	color: var(--alr-purple);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.alr-root .alr-card-title {
	color: var(--aide-slate);
	font-size: 1.05rem !important;
	font-weight: 700;
	line-height: 1.35 !important;
	margin: 0;
	transition: color 0.15s ease;
}

.alr-card-cta {
	align-self: flex-start;
	background: var(--alr-purple);
	border: 1.5px solid var(--alr-purple);
	border-radius: var(--alr-radius-sm);
	color: var(--aide-white);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.2;
	margin-top: 0.25rem;
	padding: 0.4rem 0.85rem;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.alr-card-link:hover .alr-card-cta,
.alr-card-link:focus .alr-card-cta {
	background: var(--alr-purple-hover);
	border-color: var(--alr-purple-hover);
}

/* Journey icon row */

.alr-journey-icons,
.alr-single-journeys {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.25rem;
}

.alr-journey-icon {
	align-items: center;
	color: var(--alr-muted);
	display: inline-flex;
	font-size: 0.85rem;
	min-height: 36px;
	min-width: 36px;
}

.alr-journey-icon img {
	display: block;
	height: 36px;
	width: 36px;
}

/* =========================================================
 * Pagination
 * ========================================================= */

.alr-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin: 2rem 0 0;
}

.alr-pagination a,
.alr-page-current {
	align-items: center;
	border: 1px solid var(--alr-border);
	border-radius: var(--alr-radius-sm);
	color: var(--alr-purple);
	display: inline-flex;
	font-weight: 600;
	justify-content: center;
	min-height: 40px;
	min-width: 40px;
	padding: 0.35rem 0.75rem;
	text-decoration: none;
}

.alr-pagination a:hover,
.alr-pagination a:focus {
	background: var(--alr-soft);
	border-color: var(--alr-purple);
}

.alr-page-current {
	background: var(--alr-purple);
	border-color: var(--alr-purple);
	color: var(--aide-white);
}

.alr-no-results {
	background: var(--alr-soft);
	border-radius: var(--alr-radius);
	color: var(--aide-slate);
	padding: 1.5rem;
	text-align: center;
}

/* =========================================================
 * Topic navigation (breadcrumb + topic list above results)
 * ========================================================= */

.alr-topic-navigation {
	background: var(--alr-soft);
	border: 1px solid var(--alr-border);
	border-radius: var(--alr-radius);
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
}

.alr-breadcrumb,
.alr-selected-topic {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.5rem;
}

.alr-breadcrumb a,
.alr-topic-tags a,
.alr-topic-list a {
	color: var(--alr-purple);
	font-weight: 600;
	text-decoration: none;
}

.alr-selected-topic strong {
	color: var(--aide-slate);
}

.alr-topic-toggle {
	background: transparent;
	border: 1.5px solid var(--alr-purple);
	border-radius: 999px;
	color: var(--alr-purple);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.45rem 1rem;
}

.alr-topic-toggle:hover,
.alr-topic-toggle:focus {
	background: var(--aide-white);
}

.alr-topic-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.alr-topic-list[hidden] {
	display: none;
}

.alr-topic-list a {
	background: var(--aide-white);
	border: 1px solid var(--alr-purple);
	border-radius: 999px;
	color: var(--alr-purple);
	padding: 0.4rem 0.85rem;
}

.alr-topic-list a.is-active {
	background: var(--alr-purple);
	border-color: var(--alr-purple);
	color: var(--aide-white);
}

/* =========================================================
 * Single article page
 * ========================================================= */

.alr-single-back {
	margin: 0 0 1rem;
}

.alr-single {
	background: var(--aide-white);
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1fr);
	margin: 1.5rem 0 2.5rem;
}

.alr-single-header {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.alr-single-heading h1 {
	font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
	margin: 0 0 0.4rem;
}

.alr-single-image {
	position: relative;
	width: 100%;
}

.alr-single-image img {
	display: block;
	height: auto;
	width: 100%;
}

.alr-single-image-hero {
	margin: 1.5rem auto 1.25rem;
	max-width: 75%;
}

.alr-single-image-hero img {
	border-radius: var(--alr-radius);
	height: auto;
	max-height: none;
	object-fit: contain;
	width: 100%;
}

.alr-single-format-badge {
	background: var(--alr-purple);
	border-radius: 999px;
	color: var(--aide-white);
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.35rem 0.85rem;
	position: absolute;
	right: 0.85rem;
	top: 0.85rem;
	z-index: 1;
}

.alr-single-lead {
	color: var(--aide-slate);
	font-size: 1.15rem;
	font-weight: 500;
	line-height: 1.55;
	margin: 1.25rem 0 1.5rem;
}

.alr-single-lead p:last-child {
	margin-bottom: 0;
}

.alr-single-content h1 {
	margin-top: 0.35rem;
}

.alr-author {
	color: var(--alr-muted);
	font-weight: 600;
}

.alr-topic-tags-label {
	color: var(--aide-slate);
	font-weight: 700;
	margin: 1rem 0 0.5rem;
}

.alr-topic-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
}

.alr-topic-tags a {
	background: var(--alr-soft);
	border-radius: 999px;
	color: var(--alr-purple);
	font-weight: 600;
	padding: 0.35rem 0.85rem;
}

.alr-topic-tags a:hover,
.alr-topic-tags a:focus {
	background: var(--aide-lilac);
}

.alr-article-body {
	font-size: 1.02rem;
	line-height: 1.7;
}

.alr-article-body a {
	color: var(--alr-purple);
}

.alr-single-journeys-wrap {
	background: var(--alr-soft-2);
	border-radius: var(--alr-radius);
	margin-top: 1.75rem;
	padding: 1rem 1.25rem;
}

.alr-single-journeys-label {
	color: var(--aide-slate);
	font-weight: 700;
	margin-bottom: 0.5rem;
}

/* Mirrors donor: section.metadata font-weight-bold text-uppercase
 * border-top border-bottom py-4 */
.alr-keywords {
	border-bottom: 1px solid var(--alr-border);
	border-top: 1px solid var(--alr-border);
	color: var(--aide-slate);
	display: flex;
	flex-wrap: wrap;
	font-weight: 700;
	gap: 0.4rem;
	margin: 2rem 0 0;
	padding: 1.5rem 0;
	text-transform: uppercase;
}

.alr-keywords strong {
	color: var(--aide-slate);
	margin-right: 0.25rem;
}

.alr-keywords a {
	color: var(--alr-purple);
	font-weight: 700;
	text-decoration: none;
}

.alr-keywords a:hover,
.alr-keywords a:focus {
	text-decoration: underline;
}

.alr-share {
	align-items: center;
	border-top: 1px solid var(--alr-border);
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	margin-top: 2rem;
	padding-top: 1.25rem;
}

.alr-share-label {
	color: var(--aide-slate);
	font-weight: 700;
}

.alr-share-list {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.alr-share-list li {
	margin: 0;
	padding: 0;
}

.alr-share-btn {
	align-items: center;
	background: var(--aide-white);
	border: 1px solid var(--alr-border);
	border-radius: 50%;
	color: var(--alr-purple);
	display: inline-flex;
	height: 40px;
	justify-content: center;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	width: 40px;
}

.alr-share-btn svg {
	height: 18px;
	width: 18px;
}

.alr-share-btn:hover,
.alr-share-btn:focus {
	background: var(--alr-purple);
	border-color: var(--alr-purple);
	color: var(--aide-white);
}

/* =========================================================
 * Responsive
 * ========================================================= */

@media (max-width: 900px) {
	.alr-layout {
		grid-template-columns: 1fr;
	}

	.alr-sidebar {
		position: static;
	}
}

@media (max-width: 720px) {
	.alr-sort-form {
		justify-self: stretch;
	}

	.alr-sort-form select {
		flex: 1;
		min-width: 0;
		width: 100%;
	}

	.alr-single-image-hero {
		max-width: 100%;
	}
}
