/* Our resources. Measured on the live site and read from its Elementor settings. */

.resources-intro .button {
	align-self: flex-start;
}

/* The category filter beside the list. */
.resources {
	display: flex;
	gap: var(--space-48);
	max-width: var(--content-width);
	margin: 0 auto;
	padding-bottom: var(--resources-end-space);
}

.resource-filter {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-20);
	width: 25%;
}

.resource-filter__item {
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-primary);
	font-family: inherit;
	font-size: var(--text-14);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-normal);
	letter-spacing: var(--tracking-filter);
	text-align: left;
	text-transform: uppercase;
	cursor: pointer;
}

.resource-filter__item:hover {
	color: var(--color-primary-hover);
}

.resource-filter__item[aria-pressed="true"] {
	color: var(--color-accent);
}

/* The dropdown that stands in for the buttons on tablet and phone. */
.resource-filter-menu {
	display: none;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-8);
}

.resource-filter-menu__label {
	color: var(--color-primary);
	font-size: var(--text-14);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-filter);
	text-transform: uppercase;
}

.resource-filter-menu__field {
	position: relative;
	align-self: stretch;
	color: var(--color-primary);
}

/* The arrow, drawn in the text colour, in place of the browser's own. */
.resource-filter-menu__field::after {
	content: '';
	position: absolute;
	top: 50%;
	right: var(--space-24);
	width: var(--space-8);
	height: var(--space-8);
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-75%) rotate(45deg);
	pointer-events: none;
}

/* 16 px text keeps phones from zooming in when the dropdown is tapped. */
.resource-filter-menu__select {
	width: 100%;
	padding: var(--space-12) var(--space-48) var(--space-12) var(--space-16);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-small);
	background: var(--color-white);
	color: inherit;
	font-family: inherit;
	font-size: var(--text-16);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-normal);
	appearance: none;
	cursor: pointer;
}

.resource-filter-menu__show[hidden] {
	display: none;
}

.resources__list-block {
	flex: 1;
	min-width: 0;
}

.resource-list {
	display: grid;
	gap: var(--space-30);
}

.resources__more {
	margin-top: var(--space-30);
	text-align: center;
}

/* A card waiting behind "Load More", or left out by the filter. */
.resource-card[hidden] {
	display: none;
}

.resource-card--list {
	gap: var(--space-24);
	padding: var(--space-24) var(--space-24) var(--space-32);
}

.resource-card--list .resource-card__image {
	height: var(--cover-resource-list);
	object-fit: cover;
	object-position: top center;
}

.resource-card--list .resource-card__body {
	padding: 0;
}

.resource-card__description {
	margin: 0;
	font-size: var(--text-14);
	line-height: var(--leading-snug);
}

/* Fixed in the bottom corner on every width, as live. */
.back-to-top {
	position: fixed;
	right: var(--space-8);
	bottom: var(--space-8);
	z-index: 98;
	display: flex;
	padding: var(--space-24);
	border-radius: var(--radius-pill);
	background: var(--color-pink-shadow);
	color: var(--color-primary);
}

.back-to-top svg {
	display: block;
	fill: currentColor;
}

@media (max-width: 1024px) {
	.resources-intro {
		margin-bottom: 0;
		text-align: left;
	}

	.resources {
		flex-direction: column;
		gap: var(--space-24);
		padding: 0 var(--space-20) var(--space-70);
	}

	/* A dropdown of the same categories takes the place of the buttons, so every category is one
	   tap away and the chosen one is always on screen. */
	.resource-filter {
		display: none;
	}

	.resource-filter-menu {
		display: flex;
	}

	.resource-card__description {
		display: none;
	}
}

@media (max-width: 767px) {
	.resources-intro {
		align-items: center;
		text-align: center;
	}

	.resources-intro .button {
		align-self: center;
	}

	.resource-card--list .resource-card__image {
		height: var(--cover-resource-list-phone);
	}
}
