/*
 * Resources: the list page and the single post.
 */

/* ---------- Hero ---------- */

.te-phero--resources {
	min-height: 440px;
}

.te-phero--resources::before {
	background: linear-gradient(90deg, rgb(33 33 33 / 0.94) 0%, rgb(33 33 33 / 0.82) 50%, rgb(33 33 33 / 0.5) 100%);
}

.te-phero--resources .te-phero__title {
	max-width: 900px;
	margin: 18px 0 0;
}

.te-phero--resources .te-phero__intro {
	max-width: 620px;
	margin: 24px 0 0;
}

/* ---------- Search and filter ---------- */

.rs .rs-h2 {
	margin-top: 18px;
}

.rs-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 32px;
	margin-top: 32px;
}

.rs-search {
	flex: 1 1 360px;
	max-width: 560px;
}

.rs-search label {
	display: block;
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 600;
}

.rs-qwrap {
	position: relative;
	display: flex;
	gap: 8px;
	color: var(--te-text-3);
}

.rs-qwrap svg {
	position: absolute;
	top: 50%;
	left: 16px;
	margin-top: -10px;
	pointer-events: none;
}

.rs-qwrap input[type="search"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	min-height: 48px;
	padding: 10px 16px 10px 46px;
	border: 1px solid var(--te-stone);
	border-radius: var(--r-s);
	background: var(--te-white);
	color: var(--te-meteorite);
	font: inherit;
	font-size: 16px;
	appearance: none;
}

.rs-qwrap input::placeholder {
	color: var(--te-text-3);
	opacity: 1;
}

.rs-qwrap input:focus {
	outline: 2px solid var(--te-orange);
	outline-offset: 1px;
}

/* With JavaScript the list updates as you type, so the button isn't needed. It stays for screen readers and Enter still works. */
.js .rs-go {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.rs-count {
	display: flex;
	align-items: center;
	min-height: 48px;
	margin: 0;
	color: var(--te-text-2);
	font-size: 15px;
}

.rs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.rs-chip {
	gap: 8px;
	background: var(--te-warm-white);
	text-decoration: none;
}

.rs-chip:hover {
	border-color: var(--te-meteorite);
}

.rs-n {
	color: var(--te-text-3);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.rs-chip[aria-current="true"] {
	border-color: var(--te-meteorite);
	background: var(--te-meteorite);
	color: var(--te-on-dark);
}

.rs-chip[aria-current="true"] .rs-n {
	color: var(--te-on-dark-3);
}

[data-resources-results] {
	transition: opacity 0.15s ease;
}

[data-resources-results][aria-busy="true"] {
	opacity: 0.55;
}

/* ---------- Cards ---------- */

.rs-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
}

.rs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 212px;
	padding: 22px 24px 20px;
	border-radius: var(--r-l);
	background: var(--te-white);
	box-shadow: inset 0 0 0 1px var(--te-rule);
	transition: box-shadow 0.2s ease;
}

.rs-card:hover,
.rs-card:focus-within {
	box-shadow: inset 0 0 0 2px var(--te-meteorite);
}

/* The Resources list is four across on larger screens. Related posts under an article stay three across. */
@media (min-width: 1280px) {
	.rs .rs-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Picture, or a grey tile with the source's name where there is none. */
.rs-img {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 10;
	margin: -12px -14px 20px;
	padding: 20px;
	overflow: hidden;
	border-radius: calc(var(--r-l) - 8px);
	background-color: var(--te-warm-grey);
	color: var(--te-text-2);
	font-family: var(--hf);
	font-size: 24px;
	font-weight: var(--hw);
	letter-spacing: var(--ht);
	line-height: 28px;
	text-align: center;
}

.rs-img--photo {
	padding: 0;
}

.rs-img--photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * No featured image: one of the six dial images, with the source's name in
 * white at the top left, where every one of the six is clear.
 */
.rs-img--dial {
	align-items: flex-start;
	justify-content: flex-start;
	padding: 18px 20px;
	background-color: var(--te-meteorite);
	background-position: center;
	background-size: cover;
	color: var(--te-on-dark);
	text-align: left;
}

.rs-img--dial span {
	max-width: 14em;
	text-wrap: balance;
}

/* Videos and podcasts get a play mark above the source name. */
.rs-card.is-media .rs-img:not(.rs-img--photo) {
	flex-direction: column;
}

.rs-card.is-media .rs-img:not(.rs-img--photo)::before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	margin: 0 0 12px;
	border-top: 13px solid transparent;
	border-bottom: 13px solid transparent;
	border-left: 22px solid var(--te-meteorite);
}

.rs-card.is-media .rs-img.rs-img--dial::before {
	border-left-color: var(--te-on-dark);
}

.rs-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	color: var(--te-text-3);
	font-size: 14px;
	font-weight: 500;
	line-height: 18px;
}

.rs-title {
	margin: 14px 0 0;
	font-size: 21px;
	line-height: 25px;
}

.rs-title a {
	color: var(--te-meteorite);
	text-decoration: none;
}

/* The whole card is the link. */
.rs-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--r-l);
}

.rs-title a:focus-visible {
	outline: none;
}

.rs-title a:focus-visible::after {
	outline: 3px solid var(--te-orange);
	outline-offset: 2px;
}

.rs-card:hover .rs-title a {
	text-decoration: underline;
}

.rs-ex {
	margin: 8px 0 0;
	color: var(--te-text-2);
	font-size: 15px;
	line-height: 22px;
}

.rs-src {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: auto 0 0;
	padding-top: 16px;
	color: var(--te-text-3);
	font-size: 14px;
	line-height: 20px;
}

/* Tech East's own resources. */
.rs-card.is-te {
	background: var(--te-peach);
	box-shadow: none;
}

.rs-card.is-te:hover,
.rs-card.is-te:focus-within {
	box-shadow: inset 0 0 0 2px var(--te-meteorite);
}

.rs-card.is-te .rs-img:not(.rs-img--dial) {
	background-color: var(--te-warm-white);
}

.rs-card.is-te .rs-meta,
.rs-card.is-te .rs-ex,
.rs-card.is-te .rs-src {
	color: var(--te-text-2);
}

.rs-more {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 32px 0 0;
	color: var(--te-text-2);
	font-size: 15px;
}

.rs-more:empty {
	display: none;
}

.rs-empty {
	margin-top: 32px;
	padding: 40px;
	border-radius: var(--r-l);
	background: var(--te-white);
	box-shadow: inset 0 0 0 1px var(--te-rule-soft);
}

.rs-empty h3 {
	margin: 0;
	font-size: 28px;
	line-height: 32px;
}

.rs-empty p {
	margin: 10px 0 0;
	color: var(--te-text-2);
}

.rs-empty .rs-empty__cta {
	margin-top: 20px;
}

/* ---------- Suggest a resource ---------- */

.rs-sg {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.rs-sg .te-small-heading,
.rs-sg .te-h2 {
	margin-bottom: 0;
}

.rs-sg__text {
	max-width: 520px;
	margin: 20px 0 0;
	color: var(--te-text-2);
	font-size: 18px;
	line-height: 28px;
}

.rs-sgform {
	padding: 32px;
	border-radius: var(--r-l);
	background: var(--te-white);
	box-shadow: inset 0 0 0 1px var(--te-rule-soft);
}

/* ---------- Single post ---------- */

/*
 * The details and the article sit as one block in the middle of the page,
 * and the title above lines up with its left edge.
 */
.ps-hero-band,
.ps-wrap {
	--ps-width: 1180px;
}

.ps-wrap {
	grid-template-columns: 260px minmax(0, 848px);
	justify-content: center;
}

.ps-hero-band {
	padding-top: 132px;
	padding-right: max(var(--te-gutter), calc((100% - var(--ps-width)) / 2));
	padding-left: max(var(--te-gutter), calc((100% - var(--ps-width)) / 2));
}

.admin-bar .ps-hero-band {
	padding-top: 164px;
}

.ps-title {
	max-width: 980px;
	margin: 22px 0 0;
	font-size: clamp(40px, 4.6vw, 68px);
	line-height: 1;
}

.ps-by {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	margin: 28px 0 0;
	color: var(--te-on-dark-2);
	font-size: 16px;
}

.ps-by .lozenge-new {
	padding: 3px 12px;
	border-radius: 50px;
	background: var(--te-peach);
	color: var(--te-meteorite);
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
}

.ps-by__source {
	font-weight: 600;
}

.ps-side {
	position: sticky;
	top: 104px;
}

.ps-side dl {
	display: grid;
	gap: 16px;
	margin: 0;
}

.ps-side dt,
.ps-side h2 {
	color: var(--te-text-3);
	font-family: var(--te-font);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 18px;
}

.ps-side dd {
	margin: 4px 0 0;
	font-size: 16px;
}

.ps-side dd a {
	color: var(--te-meteorite);
	text-decoration: underline;
}

.ps-side h2 {
	margin: 28px 0 12px;
	font-size: 20px;
	line-height: 26px;
}

.ps-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.ps-share .v-chip {
	gap: 5px;
	background: var(--te-warm-white);
	text-decoration: none;
}

.ps-share .v-chip:hover {
	border-color: var(--te-meteorite);
}

.ps-back {
	margin: 28px 0 0;
}

/* The article text. The first paragraph is the lead. */
.ps-body > .ps-hero {
	margin: 0 0 36px;
}

.ps-body > .ps-hero img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	object-position: 50% 35%;
	border-radius: var(--r-l);
}

.ps-body > p:first-of-type {
	margin-top: 0;
	font-size: 22px;
	line-height: 33px;
}

.ps-body > h2 {
	margin-top: 44px;
}

.ps-body li::marker {
	color: var(--te-orange-text-grey);
}

.ps-body .wp-block-image {
	margin-top: 28px;
}

.ps-body .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--r-l);
}

.ps-body figcaption {
	margin-top: 8px;
	color: var(--te-text-2);
	font-size: 15px;
	line-height: 22px;
}

/* Pull quote: any Quote block in a post. The quotation marks are added for you. */
.ps-body .wp-block-quote {
	margin: 44px 0 0;
	padding: 4px 0 4px 28px;
	border: 0;
	border-left: 4px solid var(--te-orange);
}

.ps-body .wp-block-quote p {
	margin: 0;
	font-family: var(--hf);
	font-size: 30px;
	font-weight: var(--hw);
	letter-spacing: var(--ht);
	line-height: 38px;
}

.ps-body .wp-block-quote p + p {
	margin-top: 16px;
}

.ps-body .wp-block-quote p:first-of-type::before {
	content: "\201C";
}

.ps-body .wp-block-quote p:last-of-type::after {
	content: "\201D";
}

.ps-body .wp-block-quote cite {
	display: block;
	margin-top: 16px;
	color: var(--te-text-2);
	font-size: 16px;
	font-style: normal;
	line-height: 24px;
}

/* "Find out more" box: a Group with the class ps-cta, holding a text Group and a Buttons block. */
.ps-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 32px;
	margin-top: 44px;
	padding: 28px 32px;
	border-radius: var(--r-l);
	background: var(--te-white);
	box-shadow: inset 0 0 0 1px var(--te-rule-soft);
}

.ps-body .ps-cta h2 {
	margin: 0;
	font-size: 24px;
	line-height: 28px;
}

.ps-body .ps-cta p {
	margin: 6px 0 0;
	color: var(--te-text-2);
	font-size: 16px;
	line-height: 24px;
}

.ps-body .ps-cta .wp-block-button__link {
	text-decoration: none;
}

.ps-body .ps-cta .is-style-te-dark .wp-block-button__link {
	color: var(--te-on-dark);
}

.ps-relhead {
	align-items: flex-end;
	gap: 16px 32px;
	margin-bottom: 0;
}

.ps-relhead .te-h2 {
	margin-top: 18px;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1000px) {
	.rs-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rs-sg {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	/* Article first, details after. */
	.ps-wrap {
		display: flex;
		flex-direction: column-reverse;
	}

	.ps-side {
		position: static;
	}

	.ps-side dl {
		grid-template-columns: 1fr 1fr;
	}

	.ps-body > p:first-of-type {
		font-size: 19px;
		line-height: 29px;
	}

	.ps-body .wp-block-quote {
		padding-left: 20px;
	}

	.ps-body .wp-block-quote p {
		font-size: 24px;
		line-height: 31px;
	}

	.ps-cta {
		padding: 20px;
	}
}

@media (max-width: 640px) {
	.rs-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.rs-card {
		min-height: 0;
	}

	.rs-sgform {
		padding: 20px;
	}

	.rs-empty {
		padding: 24px;
	}
}

@media (max-width: 600px) {
	.te-phero--resources {
		min-height: 0;
	}

	.ps-hero-band {
		padding-top: 120px;
	}

	.admin-bar .ps-hero-band {
		padding-top: 166px;
	}

	.ps-title {
		font-size: 36px;
	}

	/* The topics become one row you can swipe. */
	.rs-chips {
		flex-wrap: nowrap;
		margin-right: -20px;
		margin-left: -20px;
		padding: 0 20px 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.rs-chips > * {
		flex: 0 0 auto;
	}

	.rs-count {
		min-height: 0;
	}
}

/* A file to download inside a post: its name, then a Download button. */
.ps-body .wp-block-file {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin: 28px 0 0;
	padding: 20px 24px;
	border-radius: var(--r-l);
	background: var(--te-white);
	box-shadow: inset 0 0 0 1px var(--te-rule-soft);
	font-size: 17px;
}

.ps-body .wp-block-file > a:first-child {
	color: var(--te-meteorite);
	font-weight: 600;
	text-underline-offset: 0.2em;
}

.ps-body .wp-block-file .wp-block-file__button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
	padding: 8px 20px;
	border-radius: var(--btn-r);
	background: var(--te-meteorite);
	color: var(--te-on-dark);
	font-size: 15px;
	text-decoration: none;
}

.ps-body .wp-block-file .wp-block-file__button:hover {
	background: var(--te-text-2);
}
