.site-main {
	max-width: var(--rds-wrap);
	margin: 0 auto;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	border-radius: 8px;
	padding: 12px 18px;
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 20px;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
}

.button--outline {
	border: 1px solid var(--rds-black);
	color: var(--rds-black);
	background: transparent;
}

.button--filled {
	border: 1px solid var(--rds-black);
	background: var(--rds-black);
	color: var(--rds-white);
}

/* hover: filled -> #777777 grey (header CTAs), outline -> the save-button
   box hover colour */
.button {
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.button--filled:hover,
.button--filled:focus-visible {
	border-color: #777777;
	background: #777777;
}

.button--outline:hover,
.button--outline:focus-visible {
	background: #e8e3df; /* same as the save-button box hover (.hero__bookmark) */
}

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

/* -- breadcrumb (template-parts/breadcrumb.php, single/breadcrumb.php) -- */

.breadcrumb {
	margin-top: 12px;
	padding: 24px 48px;
}

.breadcrumb__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 20px;
	color: #666666;
}

.breadcrumb__list li {
	display: flex;
	gap: 8px;
}

.breadcrumb__list li + li::before {
	content: "/";
}

.breadcrumb__list a {
	color: var(--rds-black);
}

.breadcrumb__list a:hover {
	text-decoration: underline;
}

/* -- generic page (page.php) — interim layout until the page's own design -- */

.page-default__inner {
	max-width: 640px;
	margin: 0 auto;
	padding: 72px 24px 96px;
}

.page-default__title {
	margin: 0 0 36px;
	font-family: var(--font-display);
	font-size: 48px;
	font-weight: 500;
	line-height: 50px;
}

.page-default__content {
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.page-default__content a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.page-default__content img {
	height: auto;
}

/* Theme My Login forms (/login/, /lostpassword/, …) */
.page-default__content .tml-field-wrap {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	margin-bottom: 18px;
}

.page-default__content .tml-field:not([type="checkbox"]) {
	height: 50px;
	padding: 0 18px;
	border: 1px solid var(--rds-dark-grey);
	border-radius: 8px;
	font-family: var(--font-body);
	font-size: 14px;
}

.page-default__content .tml-rememberme-wrap {
	flex-direction: row;
	align-items: center;
}

.page-default__content .tml-button {
	height: 50px;
	padding: 0 24px;
	border: 0;
	border-radius: 8px;
	background: var(--rds-black);
	color: var(--rds-white);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 900;
	text-transform: uppercase;
	cursor: pointer;
}

.page-default__content .tml-links {
	display: flex;
	gap: 18px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

/* -- dialogs (premium notice, collection picker, …) -- */

.rds-modal {
	position: fixed; /* keep the UA's modal positioning: "relative" put the dialog in the page flow, and focusing it scrolled the page */
	width: min(520px, calc(100vw - 32px));
	padding: 36px;
	border: 0;
	border-radius: 8px;
	font-family: var(--font-body);
	color: var(--rds-black);
}

.rds-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.rds-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.rds-modal__title {
	margin: 0 0 18px;
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: 500;
	line-height: 32px;
}

.rds-modal__text {
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 20px;
}

.rds-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.rds-modal__message {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 20px;
}

.rds-modal__message:empty {
	display: none;
}

.rds-modal__message.is-error {
	color: #c0392b;
}

@media (max-width: 560px) {
	.rds-modal {
		padding: 28px 20px;
	}
}

/* -- collection picker (template-parts/collection-modal.php) -- */

.collection-list {
	display: flex;
	flex-direction: column;
	max-height: 280px;
	margin: 0 0 24px;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.collection-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--rds-mid-grey);
	font-size: 14px;
	line-height: 20px;
}

.collection-list__toggle {
	flex-shrink: 0;
	min-width: 88px;
	padding: 6px 12px;
	border: 1px solid var(--rds-black);
	border-radius: 8px;
	background: var(--rds-black);
	color: var(--rds-white);
	font-family: var(--font-body);
	font-size: 13px;
	cursor: pointer;
}

.collection-list__toggle.is-saved {
	background: transparent;
	color: var(--rds-black);
}

.collection-list__empty {
	padding: 12px 0;
	font-size: 14px;
	color: #777777;
}

.collection-new {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.collection-new__input {
	flex: 1 1 200px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--rds-mid-grey);
	border-radius: 8px;
	font-family: var(--font-body);
	font-size: 14px;
}

/* -- "Saved" notice after bookmarking (assets/js/favourites.js) -- */

.rds-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 18px;
	width: max-content; /* shrink-to-fit from left: 50% would only get half the screen */
	max-width: calc(100vw - 32px);
	padding: 14px 18px;
	border-radius: 8px;
	background: var(--rds-black);
	color: var(--rds-white);
	font-size: 14px;
	line-height: 20px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.rds-toast.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.rds-toast__action {
	flex-shrink: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rds-white);
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 20px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.rds-toast__action:hover {
	color: var(--rds-mid-grey);
}

@media (max-width: 600px) {
	.rds-toast {
		left: 24px;
		right: 24px;
		width: auto;
		max-width: none;
		justify-content: space-between;
		transform: translateY(12px);
	}

	.rds-toast.is-visible {
		transform: none;
	}
}

/* -- page scroll lock while a modal dialog is open (assets/js/modals.js) -- */

html.rds-scroll-lock,
html.rds-scroll-lock body {
	overflow: hidden;
}

dialog {
	overscroll-behavior: contain;
}

/* -- subscription flow steps (template-parts/subscribe-steps.php) -- */

.subscribe-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	counter-reset: step;
	font-size: 14px;
	line-height: 20px;
	color: #999999;
}

.subscribe-steps__step {
	display: flex;
	align-items: center;
	gap: 8px;
	counter-increment: step;
}

.subscribe-steps__step::before {
	content: counter(step);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 12px;
}

.subscribe-steps__step.is-done {
	color: var(--rds-dark-grey);
}

.subscribe-steps__step.is-done::before {
	content: "✓";
	border-color: var(--rds-beige);
	background: var(--rds-beige);
	color: var(--rds-white);
}

.subscribe-steps__step.is-current {
	color: var(--rds-black);
	font-weight: 600;
}

.subscribe-steps__step.is-current::before {
	border-color: var(--rds-black);
	background: var(--rds-black);
	color: var(--rds-white);
}

/* -- phone: generic page title and dialogs on the _M grid (24px gutter) -- */

@media (max-width: 600px) {
	.page-default__inner {
		padding: 36px 24px 72px;
	}

	.page-default__title {
		margin-bottom: 24px;
		font-size: 42px;
		line-height: 48px;
	}

	.rds-modal {
		width: calc(100vw - 48px);
		max-width: none;
		padding: 24px;
	}
}

/* breadcrumb on every page (was only fixed on the project page in
   single.css): Figma 3.0_M breadcrumb = 18/24 padding */
@media (max-width: 900px) {
	.breadcrumb {
		margin-top: 0;
		padding: 18px 24px;
	}
}

/* -- back to top (footer.php) + reading progress (single.php) -- */

.back-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 900; /* under the fixed header (1000) and dialogs */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--rds-black);
	border-radius: 50%;
	background: var(--rds-white);
	color: var(--rds-black);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

.back-to-top[hidden] {
	display: none;
}

.back-to-top:hover,
.back-to-top:focus-visible {
	background: var(--rds-black);
	color: var(--rds-white);
}

.reading-progress {
	position: fixed;
	top: var(--rds-admin-bar, 0px);
	left: 0;
	right: 0;
	z-index: 1001; /* over the fixed header */
	height: 3px;
	pointer-events: none;
}

.reading-progress__bar {
	height: 100%;
	background: var(--rds-beige);
	transform: scaleX(0);
	transform-origin: left center;
}

@media (max-width: 600px) {
	.back-to-top {
		right: 16px;
		bottom: 16px;
	}
}
