/*
Theme Name: Stream Note
Theme URI:
Author:
Description: A clean, YouTube-adjacent reading theme for standard WordPress posts.
Version: 0.1.1
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: stream-note
*/

:root {
	--stream-note-paper: #f7f7f7;
	--stream-note-surface: #fff;
	--stream-note-ink: #0f0f0f;
	--stream-note-muted: #5f6368;
	--stream-note-line: #e5e5e5;
	--stream-note-accent: #ff0033;
	--stream-note-accent-dark: #b00020;
	--stream-note-header-height: 64px;
	--stream-note-rail-width: 220px;
	--stream-note-radius: 16px;
	--stream-note-shadow: 0 10px 30px rgba(15, 15, 15, .06);
	--stream-note-focus: 0 0 0 3px var(--stream-note-accent);
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", Meiryo, sans-serif;
	color: var(--stream-note-ink);
	background: var(--stream-note-paper);
}

html {
	box-sizing: border-box;
	background: var(--stream-note-paper);
	scroll-behavior: smooth;
}

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

body {
	margin: 0;
	background: var(--stream-note-paper);
	color: var(--stream-note-ink);
	font-size: 1rem;
	line-height: 1.8;
	overflow-x: hidden;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
	vertical-align: middle;
}

a {
	color: inherit;
	text-decoration-thickness: .08em;
	text-underline-offset: .16em;
}

a:hover {
	color: var(--stream-note-accent-dark);
}

button,
input,
textarea,
select {
	font: inherit;
}

button,
a,
input,
summary {
	-webkit-tap-highlight-color: transparent;
}

:focus-visible {
	outline: none;
	box-shadow: var(--stream-note-focus);
}

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

.stream-note-skip-link:focus {
	clip: auto !important;
	width: auto;
	height: auto;
	left: 1rem;
	top: 1rem;
	padding: .6rem .9rem;
	background: var(--stream-note-ink);
	color: #fff;
	z-index: 100;
}

.stream-note-header {
	position: sticky;
	top: 0;
	z-index: 20;
	min-height: var(--stream-note-header-height);
	background: rgba(247, 247, 247, .94);
	border-bottom: 1px solid var(--stream-note-line);
	backdrop-filter: blur(12px);
}

.admin-bar .stream-note-header {
	top: 32px;
}

.stream-note-header__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: 1440px;
	min-height: var(--stream-note-header-height);
	margin: 0 auto;
	padding: .65rem 1.5rem;
}

.stream-note-branding {
	flex: 0 0 auto;
}

.stream-note-brand {
	display: inline-flex;
	align-items: center;
	gap: .65rem;
	max-width: 260px;
	font-weight: 800;
	letter-spacing: -.02em;
	text-decoration: none;
}

.stream-note-brand__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-decoration: none;
}

.stream-note-brand__logo .custom-logo-link {
	display: block;
}

.stream-note-brand__logo .custom-logo {
	display: block;
	max-height: 34px;
	width: auto;
}

.stream-note-mark {
	display: inline-flex;
	align-items: flex-end;
	gap: 3px;
	width: 25px;
	height: 25px;
	padding: 4px;
	border-radius: 8px;
	background: var(--stream-note-accent);
}

.stream-note-mark span {
	display: block;
	width: 4px;
	border-radius: 4px;
	background: #fff;
}

.stream-note-mark span:nth-child(1) { height: 8px; }
.stream-note-mark span:nth-child(2) { height: 13px; }
.stream-note-mark span:nth-child(3) { height: 17px; background: var(--stream-note-ink); }

.stream-note-header__tools {
	display: flex;
	justify-content: flex-end;
	flex: 1 1 auto;
}

.stream-note-header__search {
	width: min(360px, 100%);
}

.stream-note-search-form {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 40px;
	padding: .2rem .25rem .2rem .8rem;
	border: 1px solid var(--stream-note-line);
	border-radius: 999px;
	background: var(--stream-note-surface);
}

.stream-note-search-form__label {
	flex: 1 1 auto;
}

.stream-note-search-form__input {
	width: 100%;
	padding: .35rem 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--stream-note-ink);
}

.stream-note-search-form__input::placeholder {
	color: var(--stream-note-muted);
}

.stream-note-search-form__submit {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: var(--stream-note-accent-dark);
	color: #fff;
	cursor: pointer;
}

.stream-note-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 4px;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	padding: .55rem;
	border: 1px solid var(--stream-note-line);
	border-radius: 10px;
	background: var(--stream-note-surface);
	cursor: pointer;
}

.stream-note-menu-toggle__line {
	display: block;
	width: 20px;
	height: 2px;
	flex: 0 0 2px;
	background: var(--stream-note-ink);
	transform-origin: center;
	transition: transform .18s ease, opacity .18s ease;
}

.stream-note-js .stream-note-menu-toggle[aria-expanded="true"] .stream-note-menu-toggle__line:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.stream-note-js .stream-note-menu-toggle[aria-expanded="true"] .stream-note-menu-toggle__line:nth-child(2) {
	opacity: 0;
}

.stream-note-js .stream-note-menu-toggle[aria-expanded="true"] .stream-note-menu-toggle__line:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.stream-note-shell {
	display: grid;
	grid-template-columns: var(--stream-note-rail-width) minmax(0, 1fr);
	align-items: start;
	max-width: 1440px;
	margin: 0 auto;
}

.stream-note-rail {
	position: sticky;
	top: calc(var(--stream-note-header-height) + 1px);
	max-height: calc(100vh - var(--stream-note-header-height) - 1px);
	overflow-y: auto;
	border-right: 1px solid var(--stream-note-line);
}

.admin-bar .stream-note-rail {
	top: calc(var(--stream-note-header-height) + 33px);
	max-height: calc(100vh - var(--stream-note-header-height) - 33px);
}

.stream-note-rail__inner {
	padding: 2rem 1.25rem;
}

.stream-note-menu__list,
.stream-note-kind-nav__list,
.stream-note-footer__list {
	padding: 0;
	margin: 0;
	list-style-type: none;
}

.stream-note-primary-nav ul {
	padding-inline-start: 0;
	list-style-type: none;
}

.stream-note-menu__list li,
.stream-note-kind-nav__list li {
	position: relative;
}

.stream-note-menu__list > li > a,
.stream-note-kind-nav__list a {
	display: block;
	padding: .55rem .65rem;
	border-radius: 9px;
	font-size: .92rem;
	text-decoration: none;
}

.stream-note-menu__list > li > a:hover,
.stream-note-kind-nav__list a:hover {
	background: rgba(255, 0, 51, .08);
	color: var(--stream-note-ink);
}

.stream-note-menu__list .sub-menu {
	padding: .2rem 0 .35rem .8rem;
	margin: 0;
	border-left: 1px solid var(--stream-note-line);
	list-style: none;
}

.stream-note-menu__list .sub-menu a {
	display: inline-block;
	padding: .35rem .5rem;
	font-size: .88rem;
	text-decoration: none;
}

.stream-note-submenu-toggle {
	display: none;
	position: absolute;
	right: .2rem;
	top: .25rem;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--stream-note-muted);
	cursor: pointer;
}

.stream-note-submenu-toggle:hover {
	background: rgba(255, 0, 51, .08);
	color: var(--stream-note-accent-dark);
}

.stream-note-js .stream-note-submenu-toggle {
	display: inline-flex;
}

.stream-note-kind-nav {
	padding-top: 1.5rem;
	margin-top: 1.5rem;
	border-top: 1px solid var(--stream-note-line);
}

.stream-note-rail__label,
.stream-note-eyebrow {
	margin: 0 0 .45rem;
	color: var(--stream-note-accent-dark);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.stream-note-main {
	min-width: 0;
	padding: 0 clamp(1rem, 3vw, 3rem) 4rem;
}

.stream-note-content {
	max-width: 1180px;
	margin: 0 auto;
	padding-top: clamp(2.25rem, 5vw, 4.5rem);
}

.stream-note-page-heading,
.stream-note-section-heading {
	max-width: 760px;
	margin: 0 0 2rem;
}

.stream-note-page-heading h1,
.stream-note-section-heading h2,
.stream-note-entry__title {
	margin: 0;
	font-weight: 800;
	letter-spacing: -.045em;
	line-height: 1.22;
	text-wrap: balance;
}

.stream-note-page-heading h1 {
	font-size: clamp(2rem, 4vw, 3.25rem);
}

.stream-note-section-heading h2 {
	font-size: clamp(1.5rem, 2.8vw, 2.2rem);
}

.stream-note-page-heading__description {
	margin-top: .8rem;
	color: var(--stream-note-muted);
}

.stream-note-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
	gap: 1.25rem;
}

.stream-note-card {
	min-width: 0;
	border: 1px solid var(--stream-note-line);
	border-radius: var(--stream-note-radius);
	background: var(--stream-note-surface);
	box-shadow: var(--stream-note-shadow);
	overflow: hidden;
}

.stream-note-card__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	background: #eeeeee;
	overflow: hidden;
	text-decoration: none;
}

.stream-note-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .25s ease;
}

.stream-note-card:hover .stream-note-card__media img {
	transform: scale(1.025);
}

.stream-note-card__media--fallback {
	display: grid;
	place-items: center;
	background: #eeeeee;
}

.stream-note-card__media--youtube {
	background: #0f0f0f;
}

.stream-note-card__youtube-fallback {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: auto;
}

.stream-note-card__media--youtube img {
	position: relative;
	z-index: 1;
}

.stream-note-card__play {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.stream-note-card__play::before,
.stream-note-card__play::after {
	position: absolute;
	content: "";
}

.stream-note-card__play::before {
	width: 3.2rem;
	height: 2.25rem;
	border-radius: .65rem;
	background: rgba(255, 0, 51, .94);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.stream-note-card__play::after {
	width: 0;
	height: 0;
	margin-left: .18rem;
	border-top: .42rem solid transparent;
	border-bottom: .42rem solid transparent;
	border-left: .68rem solid #fff;
}

.stream-note-card__no-photo {
	display: flex;
	align-items: flex-end;
	gap: .35rem;
	width: 56px;
	height: 46px;
	padding: .65rem;
	border: 1px solid rgba(15, 15, 15, .2);
	border-radius: 13px;
	background: rgba(255, 255, 255, .6);
}

.stream-note-card__no-photo span {
	display: block;
	width: 7px;
	border-radius: 4px;
	background: var(--stream-note-muted);
}

.stream-note-card__no-photo span:nth-child(1) { height: 13px; }
.stream-note-card__no-photo span:nth-child(2) { height: 22px; }
.stream-note-card__no-photo span:nth-child(3) { height: 30px; background: var(--stream-note-accent); }

.stream-note-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	padding: 1rem 1.1rem 1.15rem;
}

.stream-note-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem .55rem;
	width: 100%;
	margin-bottom: .55rem;
	color: var(--stream-note-muted);
	font-size: .73rem;
}

.stream-note-card__type,
.stream-note-card__type--link,
.stream-note-pill {
	display: inline-flex;
	align-items: center;
	padding: .18rem .55rem;
	border-radius: 999px;
	background: rgba(255, 0, 51, .1);
	color: var(--stream-note-accent-dark);
	font-size: .72rem;
	font-weight: 700;
	text-decoration: none;
}

.stream-note-card__channel,
.stream-note-card__date {
	white-space: nowrap;
}

.stream-note-card__title {
	width: 100%;
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.5;
}

.stream-note-card__title a {
	text-decoration: none;
	overflow-wrap: anywhere;
}

.stream-note-card__excerpt {
	margin: .6rem 0 0;
	color: var(--stream-note-muted);
	font-size: .86rem;
	line-height: 1.7;
}

.stream-note-card__protected {
	margin: .6rem 0 0;
	color: var(--stream-note-muted);
	font-size: .8rem;
}

.stream-note-next-actions {
	padding: 1.25rem;
	margin-top: 2rem;
	border: 1px solid var(--stream-note-line);
	border-left: 4px solid var(--stream-note-accent);
	border-radius: var(--stream-note-radius);
	background: var(--stream-note-surface);
	box-shadow: var(--stream-note-shadow);
}

.stream-note-next-actions > .stream-note-section-title {
	margin-bottom: 1rem;
}

.stream-note-next-actions__grid {
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
	gap: 1rem;
}

.stream-note-next-actions__latest,
.stream-note-next-actions__search {
	min-width: 0;
	padding: 1rem;
	border: 1px solid var(--stream-note-line);
	border-radius: 12px;
	background: var(--stream-note-paper);
}

.stream-note-next-actions__latest {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: .25rem;
	text-decoration: none;
}

.stream-note-next-actions__latest:hover {
	border-color: var(--stream-note-accent);
	color: var(--stream-note-ink);
}

.stream-note-next-actions__eyebrow {
	color: var(--stream-note-accent-dark);
	font-size: .75rem;
	font-weight: 800;
}

.stream-note-next-actions__label {
	font-size: 1.05rem;
	font-weight: 750;
}

.stream-note-next-actions__arrow {
	align-self: flex-end;
	color: var(--stream-note-accent-dark);
	font-size: 1.25rem;
	line-height: 1;
}

.stream-note-next-actions__search h3 {
	margin: 0 0 .5rem;
	font-size: .95rem;
}

.stream-note-pagination,
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: .45rem;
	justify-content: center;
	margin-top: 2.5rem;
}

.nav-links a,
.nav-links span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.35rem;
	min-height: 2.35rem;
	padding: .3rem .7rem;
	border: 1px solid var(--stream-note-line);
	border-radius: 999px;
	background: var(--stream-note-surface);
	font-size: .85rem;
	text-decoration: none;
}

.nav-links .current {
	border-color: var(--stream-note-accent-dark);
	background: var(--stream-note-accent-dark);
	color: #fff;
}

.stream-note-empty {
	max-width: 620px;
	padding: 2rem;
	border: 1px dashed #d1d5db;
	border-radius: var(--stream-note-radius);
	background: rgba(255, 255, 255, .55);
	text-align: center;
}

.stream-note-empty p {
	margin-top: 0;
}

.stream-note-empty .stream-note-search-form {
	max-width: 420px;
	margin: 1rem auto 0;
}

.stream-note-search-landing {
	max-width: 680px;
	padding: clamp(1.25rem, 4vw, 2rem);
	border: 1px solid var(--stream-note-line);
	border-radius: var(--stream-note-radius);
	background: var(--stream-note-surface);
	box-shadow: var(--stream-note-shadow);
}

.stream-note-search-landing .stream-note-search-form {
	min-height: 52px;
	padding-left: 1rem;
}

.stream-note-search-landing__latest {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	margin-top: 1rem;
	color: var(--stream-note-accent-dark);
	font-weight: 700;
}

.stream-note-search-landing__latest span {
	font-size: 1.2em;
}

.stream-note-reading-layout {
	max-width: 1100px;
	margin: 0 auto;
}

.stream-note-page-entry,
.stream-note-front-entry {
	display: grid;
	grid-template-columns: minmax(0, 740px) minmax(210px, 260px);
	grid-template-areas:
		"header toc"
		"content toc";
	column-gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.stream-note-page-entry > .stream-note-page-heading,
.stream-note-front-entry > .stream-note-page-heading { grid-area: header; }
.stream-note-page-entry > .stream-note-page-content,
.stream-note-front-entry > .stream-note-page-content { grid-area: content; }
.stream-note-page-entry > .stream-note-toc,
.stream-note-front-entry > .stream-note-toc { grid-area: toc; }

.stream-note-entry {
	display: grid;
	grid-template-columns: minmax(0, 740px) minmax(210px, 260px);
	grid-template-areas:
		"breadcrumbs breadcrumbs"
		"header toc"
		"thumbnail toc"
		"content toc"
		"footer toc";
	column-gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.stream-note-breadcrumbs {
	grid-area: breadcrumbs;
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	margin-bottom: 1.5rem;
	color: var(--stream-note-muted);
	font-size: .78rem;
}

.stream-note-entry__header { grid-area: header; }
.stream-note-entry__thumbnail { grid-area: thumbnail; }
.stream-note-entry__content { grid-area: content; }
.stream-note-entry__footer { grid-area: footer; }
.stream-note-toc { grid-area: toc; }

.stream-note-entry__kicker {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
	margin-bottom: .85rem;
}

.stream-note-entry__channel {
	color: var(--stream-note-muted);
	font-size: .85rem;
}

.stream-note-entry__title {
	font-size: clamp(2rem, 4vw, 3.5rem);
}

.stream-note-entry__meta {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem .65rem;
	margin-top: 1rem;
	color: var(--stream-note-muted);
	font-size: .8rem;
}

.stream-note-meta-label {
	color: var(--stream-note-ink);
	font-weight: 700;
}

.stream-note-entry__thumbnail {
	margin: 2rem 0 0;
}

.stream-note-entry__thumbnail img {
	display: block;
	width: 100%;
	border-radius: var(--stream-note-radius);
}

.stream-note-entry__thumbnail figcaption {
	margin-top: .55rem;
	color: var(--stream-note-muted);
	font-size: .78rem;
}

.stream-note-entry__content,
.stream-note-page-content {
	min-width: 0;
	margin-top: 2.25rem;
	font-size: 1.05rem;
}

.stream-note-entry__content > :first-child,
.stream-note-page-content > :first-child {
	margin-top: 0;
}

.stream-note-entry__content h2,
.stream-note-entry__content h3,
.stream-note-page-content h2,
.stream-note-page-content h3 {
	position: relative;
	margin: 2.75rem 0 1rem;
	scroll-margin-top: calc(var(--stream-note-header-height) + 1.25rem);
	font-weight: 800;
	line-height: 1.35;
}

.stream-note-entry__content h2,
.stream-note-page-content h2 { font-size: 1.65rem; }
.stream-note-entry__content h3,
.stream-note-page-content h3 { font-size: 1.25rem; }

.stream-note-heading-number {
	display: inline-block;
	margin-right: .5rem;
	color: var(--stream-note-accent-dark);
	font-size: .72em;
	letter-spacing: .03em;
	vertical-align: .12em;
}

.stream-note-entry__content p,
.stream-note-page-content p {
	margin: 1.1rem 0;
}

.stream-note-entry__content a,
.stream-note-page-content a {
	color: var(--stream-note-accent-dark);
}

.stream-note-entry__content blockquote,
.stream-note-page-content blockquote {
	margin: 1.6rem 0;
	padding: .85rem 1.2rem;
	border-left: 3px solid var(--stream-note-accent);
	background: rgba(255, 255, 255, .65);
	color: #3f3f46;
}

.stream-note-entry__content pre,
.stream-note-page-content pre {
	max-width: 100%;
	padding: 1rem;
	border-radius: 12px;
	background: #18181b;
	color: #f4f4f4;
	overflow-x: auto;
	font: .9em/1.7 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.stream-note-entry__content code,
.stream-note-page-content code {
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	font-size: .9em;
}

.stream-note-entry__content :not(pre) > code,
.stream-note-page-content :not(pre) > code {
	padding: .12em .3em;
	border-radius: 4px;
	background: #eeeeee;
}

.stream-note-entry__content .wp-block-table,
.stream-note-page-content .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
}

.stream-note-entry__content table,
.stream-note-page-content table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	font-size: .9em;
}

.stream-note-entry__content th,
.stream-note-entry__content td,
.stream-note-page-content th,
.stream-note-page-content td {
	padding: .6rem .7rem;
	border: 1px solid var(--stream-note-line);
	text-align: left;
	vertical-align: top;
}

.stream-note-entry__content figure,
.stream-note-page-content figure {
	margin: 1.8rem 0;
}

.stream-note-entry__content .wp-block-embed,
.stream-note-page-content .wp-block-embed {
	max-width: 100%;
}

.stream-note-entry__content .wp-block-embed__wrapper,
.stream-note-page-content .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.stream-note-entry__content .wp-block-embed__wrapper iframe,
.stream-note-page-content .wp-block-embed__wrapper iframe {
	position: absolute;
	width: 100%;
	height: 100%;
	border: 0;
}

.stream-note-page-links {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--stream-note-line);
	font-size: .9rem;
}

.stream-note-page-links a,
.stream-note-page-links span {
	display: inline-flex;
	padding: .3rem .65rem;
	border-radius: 999px;
	background: var(--stream-note-surface);
	text-decoration: none;
}

.stream-note-toc {
	position: sticky;
	top: calc(var(--stream-note-header-height) + 1.25rem);
	min-width: 0;
	margin-top: 2rem;
	padding: 1rem;
	border: 1px solid var(--stream-note-line);
	border-radius: 14px;
	background: rgba(255, 255, 255, .72);
}

.admin-bar .stream-note-toc {
	top: calc(var(--stream-note-header-height) + 3.25rem);
}

.stream-note-toc summary {
	padding: .25rem 0 .65rem;
	font-weight: 800;
	cursor: pointer;
}

.stream-note-toc__scroll-wrap {
	position: relative;
}

.stream-note-toc__list {
	max-height: min(56vh, 520px);
	padding: 0 0 .5rem 1.25rem;
	margin: 0;
	overflow-y: auto;
	font-size: .82rem;
	list-style: none;
}

.stream-note-toc__sublist {
	padding: .3rem .2rem .35rem .75rem;
	margin: .35rem 0 .45rem .55rem;
	border-left: 2px solid rgba(176, 0, 32, .3);
	border-radius: 0 8px 8px 0;
	background: rgba(15, 15, 15, .025);
	list-style: none;
}

.stream-note-toc__item {
	margin: .35rem 0;
	padding-left: .1rem;
}

.stream-note-toc__item a {
	display: grid;
	grid-template-columns: 2.4rem minmax(0, 1fr);
	column-gap: .35rem;
	align-items: start;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.stream-note-toc__number {
	color: var(--stream-note-accent-dark);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.stream-note-toc__label {
	min-width: 0;
}

.stream-note-toc__item--h3 {
	font-size: .96em;
}

.stream-note-toc__item--h3 .stream-note-toc__label {
	color: var(--stream-note-muted);
}

.stream-note-toc__scroll-hint {
	margin: .35rem 0 0;
	color: var(--stream-note-muted);
	font-size: .72rem;
}

.stream-note-entry__footer {
	margin-top: 2.2rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--stream-note-line);
}

.stream-note-entry__categories {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.stream-note-entry__categories a {
	display: inline-flex;
	padding: .25rem .65rem;
	border-radius: 999px;
	background: var(--stream-note-surface);
	font-size: .78rem;
	text-decoration: none;
}

.stream-note-related {
	margin-top: 4rem;
}

.stream-note-section-title {
	margin: 0 0 1.25rem;
	font-size: 1.4rem;
}

.stream-note-footer {
	border-top: 1px solid var(--stream-note-line);
	background: #f0f0f0;
}

.stream-note-footer__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	max-width: 1180px;
	margin: 0 auto;
	padding: 1.5rem clamp(1rem, 3vw, 3rem);
	color: var(--stream-note-muted);
	font-size: .8rem;
}

.stream-note-footer__list {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1rem;
}

.stream-note-footer__list a {
	text-decoration: none;
}

.stream-note-footer__copy {
	margin: 0;
}

.stream-note-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .65rem 1rem;
	border-radius: 999px;
	background: var(--stream-note-accent-dark);
	color: #fff;
	font-size: .9rem;
	text-decoration: none;
}

.stream-note-empty__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .75rem;
	align-items: center;
}

@media (max-width: 980px) {
	.stream-note-header__inner {
		padding-inline: 1rem;
	}

	.stream-note-shell {
		display: block;
	}

	.stream-note-rail {
		position: fixed;
		left: 0;
		top: var(--stream-note-header-height);
		bottom: 0;
		z-index: 18;
		width: min(86vw, 320px);
		max-height: none;
		border-right: 1px solid var(--stream-note-line);
		background: var(--stream-note-paper);
		box-shadow: 18px 0 40px rgba(15, 15, 15, .12);
		transform: translateX(-105%);
		visibility: hidden;
	}

	.admin-bar .stream-note-rail {
		top: 78px;
		max-height: none;
	}

	.stream-note-js .stream-note-rail.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	html:not(.stream-note-js) .stream-note-rail {
		position: static;
		width: auto;
		max-height: none;
		border-right: 0;
		box-shadow: none;
		transform: none;
		visibility: visible;
	}

	.stream-note-js .stream-note-menu-toggle {
		display: inline-flex;
	}

	.stream-note-js .stream-note-rail .sub-menu {
		display: none;
	}

	.stream-note-js .stream-note-rail li.is-open > .sub-menu {
		display: block;
	}

	.stream-note-main {
		padding-inline: clamp(1rem, 4vw, 2rem);
	}

	.stream-note-entry {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"breadcrumbs"
			"header"
			"thumbnail"
			"toc"
			"content"
			"footer";
	}

	.stream-note-page-entry,
	.stream-note-front-entry {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"header"
			"toc"
			"content";
	}

	.stream-note-toc {
		position: static;
		margin-top: 2rem;
	}

	.stream-note-next-actions__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 560px) {
	:root {
		--stream-note-header-height: 58px;
	}

	.admin-bar .stream-note-header {
		top: 46px;
	}

	.admin-bar .stream-note-rail {
		top: 104px;
	}

	.stream-note-header__inner {
		gap: .6rem;
		min-height: var(--stream-note-header-height);
	}

	.stream-note-brand {
		max-width: 135px;
	}

	.stream-note-header__search {
		width: min(42vw, 180px);
	}

	.stream-note-search-form {
		padding-left: .65rem;
	}

	.stream-note-card-grid {
		grid-template-columns: 1fr;
	}

	.stream-note-card__media {
		aspect-ratio: 16 / 9;
	}

	.stream-note-empty__actions {
		align-items: stretch;
		flex-direction: column;
	}

	.stream-note-empty__actions .stream-note-search-form {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
