/* Header, footer and page chrome. */

.sr-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--sr-line);
}

.sr-header__inner {
	display: flex;
	align-items: center;
	gap: var(--sr-5);
	min-height: 68px;
}

.sr-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--sr-2);
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--sr-ink);
	text-decoration: none;
	flex: none;
}

.sr-brand:hover { color: var(--sr-ink); }

.sr-mark {
	width: 26px;
	height: 26px;
	flex: none;
	border-radius: 7px;
	background: var(--sr-ink);
	position: relative;
	overflow: hidden;
}

/* Three ascending signal bars and a beacon dot. Not a magnifying glass, not a robot. */
.sr-mark::before {
	content: "";
	position: absolute;
	left: 6px;
	bottom: 6px;
	width: 3px;
	height: 6px;
	background: #fff;
	box-shadow: 5px 0 0 #fff, 10px 0 0 #fff;
	border-radius: 1px;
}

.sr-mark::after {
	content: "";
	position: absolute;
	left: 11px;
	bottom: 12px;
	width: 3px;
	height: 4px;
	background: #fff;
	box-shadow: 5px 3px 0 var(--sr-beacon);
	border-radius: 1px;
}

.sr-nav {
	display: flex;
	align-items: center;
	gap: var(--sr-1);
	margin-left: auto;
}

.sr-nav__link,
.sr-nav__toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--sr-1);
	padding: var(--sr-2) var(--sr-3);
	border-radius: var(--sr-radius);
	font-size: var(--sr-step--1);
	font-weight: 500;
	color: var(--sr-graphite);
	text-decoration: none;
	background: none;
	border: 0;
	font-family: inherit;
	cursor: pointer;
	transition: background var(--sr-motion), color var(--sr-motion);
}

.sr-nav__link:hover,
.sr-nav__toggle:hover,
.sr-nav__link[aria-current="page"] {
	background: var(--sr-surface-sunk);
	color: var(--sr-ink);
}

.sr-nav__item { position: relative; }

.sr-nav__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 320px;
	background: var(--sr-surface);
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius-lg);
	box-shadow: var(--sr-shadow-lg);
	padding: var(--sr-3);
	display: grid;
	gap: 2px;
}

.sr-nav__panel[hidden] { display: none; }

.sr-nav__panel a {
	display: block;
	padding: var(--sr-2) var(--sr-3);
	border-radius: var(--sr-radius);
	text-decoration: none;
	color: var(--sr-ink);
}

.sr-nav__panel a:hover { background: var(--sr-beacon-soft); }

.sr-nav__panel strong {
	display: block;
	font-size: var(--sr-step--1);
	font-weight: 600;
}

.sr-nav__panel span {
	display: block;
	font-size: var(--sr-step--1);
	color: var(--sr-mute);
	line-height: 1.45;
}

.sr-header__actions {
	display: flex;
	align-items: center;
	gap: var(--sr-2);
	flex: none;
}

.sr-menu-button {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius);
	background: var(--sr-surface);
	cursor: pointer;
}

.sr-menu-button span,
.sr-menu-button span::before,
.sr-menu-button span::after {
	display: block;
	width: 16px;
	height: 1.5px;
	background: var(--sr-ink);
	position: relative;
}

.sr-menu-button span::before,
.sr-menu-button span::after {
	content: "";
	position: absolute;
	left: 0;
}

.sr-menu-button span::before { top: -5px; }
.sr-menu-button span::after { top: 5px; }

/* The WordPress admin bar occupies the top of the viewport for signed-in editors, so the
   sticky header starts below it rather than under it. */
body.admin-bar .sr-header { top: 32px; }

@media screen and (max-width: 782px) {
	body.admin-bar .sr-header { top: 46px; }
}

/* Buttons */
.sr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sr-2);
	padding: 0.6rem 1.05rem;
	border-radius: var(--sr-radius);
	border: 1px solid transparent;
	font: inherit;
	font-size: var(--sr-step--1);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background var(--sr-motion), border-color var(--sr-motion), color var(--sr-motion);
}

.sr-btn--primary {
	background: var(--sr-ink);
	color: #fff;
}

.sr-btn--primary:hover { background: var(--sr-beacon-deep); color: #fff; }

.sr-btn--accent {
	background: var(--sr-beacon);
	color: #fff;
}

.sr-btn--accent:hover { background: var(--sr-beacon-deep); color: #fff; }

.sr-btn--ghost {
	border-color: var(--sr-line-strong);
	background: var(--sr-surface);
	color: var(--sr-ink);
}

.sr-btn--ghost:hover { border-color: var(--sr-ink); color: var(--sr-ink); }

.sr-btn--lg { padding: 0.8rem 1.4rem; font-size: var(--sr-step-0); }

/* Footer */
.sr-footer {
	margin-top: var(--sr-10);
	background: var(--sr-ink);
	color: #c9d1d9;
	padding-block: var(--sr-8) var(--sr-5);
}

.sr-footer a { color: #c9d1d9; text-decoration: none; }
.sr-footer a:hover { color: #fff; text-decoration: underline; }

.sr-footer__grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(4, 1fr);
	gap: var(--sr-6);
}

.sr-footer__brand p {
	color: #8b949e;
	font-size: var(--sr-step--1);
	max-width: 34ch;
}

.sr-footer__brand .sr-brand { color: #fff; }
.sr-footer__brand .sr-mark { background: #fff; }
.sr-footer__brand .sr-mark::before { background: var(--sr-ink); box-shadow: 5px 0 0 var(--sr-ink), 10px 0 0 var(--sr-ink); }
.sr-footer__brand .sr-mark::after { background: var(--sr-ink); box-shadow: 5px 3px 0 var(--sr-beacon); }

.sr-footer h2 {
	font-size: var(--sr-step--1);
	font-weight: 600;
	color: #fff;
	margin-bottom: var(--sr-3);
}

.sr-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: var(--sr-2);
	font-size: var(--sr-step--1);
}

.sr-footer__base {
	margin-top: var(--sr-7);
	padding-top: var(--sr-4);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	flex-wrap: wrap;
	gap: var(--sr-4);
	justify-content: space-between;
	font-size: var(--sr-step--1);
	color: #8b949e;
}

@media (max-width: 960px) {
	.sr-footer__grid { grid-template-columns: repeat(2, 1fr); }
	.sr-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.sr-menu-button { display: inline-flex; }

	/*
	 * Collapsed by default on small screens, but only once JavaScript has confirmed the
	 * toggle will work. Without the `has-js` gate a visitor with scripts disabled would get a
	 * navigation menu that can never be opened.
	 */
	.has-js .sr-nav { display: none; }
	.has-js .sr-nav.is-open { display: flex; }

	.sr-nav {
		position: fixed;
		inset: 68px 0 auto;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--sr-surface);
		border-bottom: 1px solid var(--sr-line);
		padding: var(--sr-4);
		max-height: calc(100dvh - 68px);
		overflow-y: auto;
		box-shadow: var(--sr-shadow-lg);
	}

	.sr-nav__link,
	.sr-nav__toggle {
		width: 100%;
		justify-content: space-between;
		padding: var(--sr-3);
		font-size: var(--sr-step-0);
	}

	.sr-nav__panel {
		position: static;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--sr-line);
		border-radius: 0;
		min-width: 0;
		margin-left: var(--sr-3);
		padding-block: 0;
	}

	.sr-header__actions .sr-btn--ghost { display: none; }
}

@media (max-width: 480px) {
	.sr-footer__grid { grid-template-columns: 1fr; }
}

/* Directory footer: the site index, not four token columns. */
.sr-directory {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--sr-7) var(--sr-6);
	padding-bottom: var(--sr-8);
	margin-bottom: var(--sr-7);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sr-directory__head { margin-bottom: var(--sr-3); }

.sr-directory__head h3 {
	display: flex;
	align-items: baseline;
	gap: var(--sr-2);
	font-size: var(--sr-step-0);
	font-weight: 600;
	color: #fff;
	margin: 0 0 var(--sr-1);
}

.sr-directory__head h3 a { color: #fff; text-decoration: none; }
.sr-directory__head h3 a:hover { text-decoration: underline; }

.sr-directory__head .sr-count {
	color: #8b949e;
	border-color: rgba(255, 255, 255, 0.18);
}

.sr-directory__head p {
	margin: 0;
	font-size: var(--sr-step--1);
	color: #8b949e;
	line-height: 1.5;
	max-width: 42ch;
}

.sr-directory__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0;
	font-size: var(--sr-step--1);
}

.sr-directory__list li {
	display: grid;
	grid-template-columns: 1.9rem 1fr;
	gap: var(--sr-1);
	align-items: baseline;
	padding-block: 0.35rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sr-directory__list li:last-child { border-bottom: 0; }

.sr-directory__index {
	font-family: var(--sr-font-mono);
	font-size: 0.72rem;
	color: #57606a;
}

.sr-directory__list a { line-height: 1.45; }
