/**
 * Resource Library theme
 */

:root {
	--rl-color-bg: #f3f1ec;
	--rl-color-surface: #fffcf7;
	--rl-color-text: #161412;
	--rl-color-text-muted: #6e6962;
	--rl-color-border: rgba(22, 20, 18, 0.1);
	--rl-color-accent: #161412;
	--rl-color-well: #e8e4dc;
	--rl-color-focus: #2c6bed;

	--rl-font-sans: "Instrument Sans", "Segoe UI", sans-serif;
	--rl-font-serif: "Instrument Serif", Georgia, serif;

	--rl-text-xs: 0.75rem;
	--rl-text-sm: 0.875rem;
	--rl-text-md: 1rem;
	--rl-text-lg: 1.25rem;
	--rl-text-xl: 1.75rem;
	--rl-text-2xl: 2.75rem;
	--rl-text-3xl: clamp(2.5rem, 5vw, 4rem);

	--rl-leading-tight: 1.15;
	--rl-leading-body: 1.55;

	--rl-space-1: 0.25rem;
	--rl-space-2: 0.5rem;
	--rl-space-3: 0.75rem;
	--rl-space-4: 1rem;
	--rl-space-5: 1.5rem;
	--rl-space-6: 2rem;
	--rl-space-7: 3rem;
	--rl-space-8: 4.5rem;
	--rl-space-9: 7rem;

	--rl-container: 76rem;
	--rl-radius: 2px;
	--rl-radius-pill: 999px;
	--rl-border: 1px solid var(--rl-color-border);
	--rl-shadow: none;
	--rl-ease: 180ms ease;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--rl-color-bg);
	color: var(--rl-color-text);
	font-family: var(--rl-font-sans);
	font-size: var(--rl-text-md);
	line-height: var(--rl-leading-body);
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
	font-weight: 500;
	line-height: var(--rl-leading-tight);
	letter-spacing: -0.02em;
	margin: 0;
}

button,
input,
textarea {
	font: inherit;
}

:focus-visible {
	outline: 2px solid var(--rl-color-focus);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rl-skip {
	position: absolute;
	left: var(--rl-space-4);
	top: -100px;
	z-index: 100;
	padding: var(--rl-space-2) var(--rl-space-4);
	background: var(--rl-color-text);
	color: var(--rl-color-bg);
}

.rl-skip:focus {
	top: var(--rl-space-4);
}

.rl-header,
.rl-main,
.rl-footer {
	width: min(100% - 2.5rem, var(--rl-container));
	margin-inline: auto;
}

.rl-header {
	padding-block: var(--rl-space-5);
}

.rl-header__inner {
	display: flex;
	align-items: center;
	gap: var(--rl-space-5);
}

.rl-brand__name {
	font-family: var(--rl-font-serif);
	font-size: 1.35rem;
	text-decoration: none;
}

.custom-logo {
	max-height: 1.75rem;
	width: auto;
}

.rl-header__nav {
	margin-left: auto;
}

.rl-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rl-space-4);
	list-style: none;
	margin: 0;
	padding: 0;
}

.rl-nav a {
	font-size: var(--rl-text-sm);
	text-decoration: none;
}

.rl-header__browse {
	font-size: var(--rl-text-sm);
	padding: 0.45rem 0.85rem;
	border: var(--rl-border);
	border-radius: var(--rl-radius-pill);
	text-decoration: none;
	white-space: nowrap;
}

.rl-header__browse:hover {
	background: var(--rl-color-text);
	color: var(--rl-color-bg);
	text-decoration: none;
}

.rl-main {
	padding-bottom: var(--rl-space-9);
}

.rl-hero {
	padding: var(--rl-space-8) 0 var(--rl-space-7);
}

.rl-hero__inner {
	max-width: 40rem;
}

.rl-hero__eyebrow,
.rl-eyebrow {
	font-size: var(--rl-text-xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rl-color-text-muted);
	margin: 0 0 var(--rl-space-4);
}

.rl-hero__title {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-3xl);
	font-weight: 400;
	margin-bottom: var(--rl-space-4);
}

.rl-hero__lede {
	color: var(--rl-color-text-muted);
	font-size: 1.05rem;
	margin: 0 0 var(--rl-space-6);
	max-width: 32rem;
}

.rl-search {
	display: flex;
	gap: 0;
	border-bottom: 1px solid var(--rl-color-text);
	max-width: 28rem;
}

.rl-search input {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 0.7rem 0;
	color: inherit;
}

.rl-search input:focus {
	outline: none;
}

.rl-search input:focus-visible {
	outline: none;
}

.rl-search button {
	border: 0;
	background: transparent;
	padding: 0.7rem 0 0.7rem 1rem;
	cursor: pointer;
}

.rl-section {
	padding-top: var(--rl-space-7);
}

.rl-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--rl-space-4);
	margin-bottom: var(--rl-space-5);
}

.rl-section__head h2 {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-xl);
	font-weight: 400;
}

.rl-types {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--rl-space-2);
	overflow-x: auto;
	padding-bottom: var(--rl-space-2);
	-webkit-overflow-scrolling: touch;
}

.rl-types__item {
	flex: 0 0 auto;
	padding: 0.4rem 0.8rem;
	border: var(--rl-border);
	border-radius: var(--rl-radius-pill);
	font-size: var(--rl-text-sm);
	text-decoration: none;
}

.rl-types__item:hover,
.rl-types__item.is-active {
	background: var(--rl-color-text);
	color: var(--rl-color-bg);
	border-color: var(--rl-color-text);
	text-decoration: none;
}

.rl-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--rl-space-6) var(--rl-space-5);
}

.rl-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rl-card__media {
	aspect-ratio: 4 / 3;
	background: var(--rl-color-well);
	border-radius: var(--rl-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.rl-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform var(--rl-ease);
}

.rl-card:hover .rl-card__media img {
	transform: scale(1.03);
}

.rl-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 10px,
		rgba(22, 20, 18, 0.03) 10px,
		rgba(22, 20, 18, 0.03) 11px
	);
}

.rl-card__body {
	padding-top: var(--rl-space-3);
}

.rl-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--rl-space-2);
	margin-bottom: var(--rl-space-2);
}

.rl-card__type {
	font-size: var(--rl-text-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rl-color-text-muted);
	text-decoration: none;
}

.rl-card__title {
	font-size: 1.05rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.rl-card__title a {
	text-decoration: none;
}

.rl-card__title a:hover {
	text-decoration: underline;
}

.rl-card__meta {
	margin: var(--rl-space-2) 0 0;
	font-size: var(--rl-text-sm);
	color: var(--rl-color-text-muted);
}

.rl-favorite {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	border: 0;
	background: transparent;
	padding: 0.2rem;
	color: inherit;
	cursor: pointer;
	text-decoration: none;
	min-height: 44px;
	min-width: 44px;
	justify-content: center;
}

.rl-favorite:hover {
	text-decoration: none;
}

.rl-favorite__label {
	font-size: var(--rl-text-xs);
}

.rl-page-head {
	padding: var(--rl-space-7) 0 var(--rl-space-5);
}

.rl-page-head h1 {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-2xl);
	font-weight: 400;
}

.rl-page-head__row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--rl-space-5);
	margin-bottom: var(--rl-space-5);
}

.rl-count {
	margin: var(--rl-space-2) 0 0;
	color: var(--rl-color-text-muted);
	font-size: var(--rl-text-sm);
}

.rl-directory {
	display: grid;
	grid-template-columns: 15.5rem minmax(0, 1fr);
	gap: var(--rl-space-6);
	align-items: start;
}

.rl-filters__toggle {
	display: none;
}

.rl-filters__backdrop {
	display: none;
}

.rl-filters__panel-head {
	display: none;
}

.rl-filters__panel h2 {
	font-size: var(--rl-text-lg);
}

.rl-filters__form fieldset {
	border: 0;
	margin: 0 0 var(--rl-space-5);
	padding: 0;
}

.rl-filters__form legend {
	font-size: var(--rl-text-xs);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rl-color-text-muted);
	margin-bottom: var(--rl-space-3);
}

.rl-filter-option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.4rem;
	font-size: var(--rl-text-sm);
	cursor: pointer;
}

.rl-filters__hint {
	font-size: var(--rl-text-sm);
	color: var(--rl-color-text-muted);
}

.rl-filters__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--rl-space-3);
	padding-top: var(--rl-space-3);
}

.rl-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.1rem;
	border: var(--rl-border);
	border-radius: var(--rl-radius-pill);
	background: transparent;
	cursor: pointer;
	text-decoration: none;
	font-size: var(--rl-text-sm);
}

.rl-button:hover {
	text-decoration: none;
	background: var(--rl-color-text);
	color: var(--rl-color-bg);
	border-color: var(--rl-color-text);
}

.rl-button--primary {
	background: var(--rl-color-text);
	color: var(--rl-color-bg);
	border-color: var(--rl-color-text);
	padding: 0.9rem 1.35rem;
}

.rl-button--primary:hover {
	opacity: 0.85;
}

.rl-text-link {
	font-size: var(--rl-text-sm);
}

.rl-empty {
	padding: var(--rl-space-8) 0;
	max-width: 28rem;
}

.rl-empty--page {
	padding-top: var(--rl-space-9);
}

.rl-empty__title {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-xl);
	margin: 0 0 var(--rl-space-3);
}

.rl-empty__text {
	color: var(--rl-color-text-muted);
	margin: 0 0 var(--rl-space-4);
}

.rl-pagination {
	margin-top: var(--rl-space-7);
}

.rl-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rl-space-3);
	font-size: var(--rl-text-sm);
}

.rl-single {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
	gap: var(--rl-space-7);
	padding-top: var(--rl-space-6);
	align-items: start;
}

.rl-single__figure {
	margin: 0;
	background: var(--rl-color-well);
	border-radius: var(--rl-radius);
	min-height: 22rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rl-single__figure img {
	width: 100%;
	height: auto;
	max-height: 70vh;
	object-fit: contain;
}

.rl-single__thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
	gap: var(--rl-space-2);
	margin-top: var(--rl-space-3);
}

.rl-single__thumbs img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--rl-color-well);
}

.rl-single__title {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-2xl);
	font-weight: 400;
	margin: 0 0 var(--rl-space-4);
}

.rl-single__excerpt {
	color: var(--rl-color-text-muted);
	margin-bottom: var(--rl-space-5);
}

.rl-single__save {
	margin-bottom: var(--rl-space-4);
}

.rl-meta {
	margin: 0 0 var(--rl-space-5);
}

.rl-meta > div {
	display: grid;
	grid-template-columns: 7rem 1fr;
	gap: var(--rl-space-3);
	padding: 0.65rem 0;
	border-top: var(--rl-border);
	font-size: var(--rl-text-sm);
}

.rl-meta dt {
	color: var(--rl-color-text-muted);
	font-weight: 400;
}

.rl-meta dd {
	margin: 0;
}

.rl-license-notes,
.rl-license-disclaimer {
	font-size: var(--rl-text-sm);
	color: var(--rl-color-text-muted);
}

.rl-single__cta {
	margin-top: var(--rl-space-6);
}

.rl-footer {
	padding: var(--rl-space-7) 0;
	border-top: var(--rl-border);
	margin-top: auto;
}

.rl-footer__inner {
	display: flex;
	justify-content: space-between;
	gap: var(--rl-space-5);
	align-items: flex-start;
}

.rl-footer__name {
	font-family: var(--rl-font-serif);
	font-size: var(--rl-text-lg);
	margin: 0 0 var(--rl-space-2);
}

.rl-footer__tag {
	margin: 0;
	color: var(--rl-color-text-muted);
	font-size: var(--rl-text-sm);
}

.rl-prose-list {
	display: grid;
	gap: var(--rl-space-5);
}

.admin-bar .rl-filters__panel {
	top: 32px;
}

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

	.rl-directory {
		grid-template-columns: 1fr;
	}

	.rl-page-head__row {
		flex-direction: column;
		align-items: stretch;
	}

	.rl-header__browse {
		display: none;
	}

	.rl-filters__toggle {
		display: inline-flex;
		align-items: center;
		gap: 0.4rem;
		margin: var(--rl-space-4) 0;
		padding: 0.55rem 0.9rem;
		border: var(--rl-border);
		border-radius: var(--rl-radius-pill);
		background: var(--rl-color-surface);
		cursor: pointer;
	}

	.rl-filters__count {
		display: inline-flex;
		min-width: 1.2rem;
		height: 1.2rem;
		align-items: center;
		justify-content: center;
		border-radius: var(--rl-radius-pill);
		background: var(--rl-color-text);
		color: var(--rl-color-bg);
		font-size: 0.7rem;
	}

	.rl-filters__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(22, 20, 18, 0.35);
		z-index: 40;
	}

	.rl-filters__backdrop[hidden] {
		display: none;
	}

	.rl-filters__panel {
		position: fixed;
		inset: 0 0 0 auto;
		width: min(22rem, 100%);
		background: var(--rl-color-bg);
		z-index: 50;
		padding: var(--rl-space-5);
		overflow: auto;
		transform: translateX(100%);
		transition: transform var(--rl-ease);
		visibility: hidden;
	}

	body.rl-filters-open .rl-filters__panel {
		transform: translateX(0);
		visibility: visible;
	}

	.rl-filters__panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: var(--rl-space-5);
	}

	.rl-icon-button {
		border: 0;
		background: transparent;
		font-size: 1.6rem;
		line-height: 1;
		cursor: pointer;
		min-width: 44px;
		min-height: 44px;
	}

	.rl-single {
		grid-template-columns: 1fr;
	}

	body.rl-filters-open {
		overflow: hidden;
	}
}

@media (max-width: 639px) {
	.rl-header,
	.rl-main,
	.rl-footer {
		width: min(100% - 1.5rem, var(--rl-container));
	}

	.rl-grid {
		grid-template-columns: 1fr;
		gap: var(--rl-space-6);
	}

	.rl-hero {
		padding-top: var(--rl-space-6);
	}

	.rl-favorite__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
}
