:root {
	--bg: #efece6;
	--paper: #f7f6f2;
	--ink: #1b1e1c;
	--muted: #3e4641;
	--line: #d4cfc4;
	--accent: #1d4e89;
	--accent-dark: #163a66;
	--mark: #8a3412;
	--focus: #8a3412;
	--font: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "Hiragino Sans", "Yu Gothic", "Meiryo", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK JP", "Noto Sans CJK KR", "Noto Sans Thai", "Leelawadee UI", "Thonburi", sans-serif;
	--measure: 42rem;
	--page: 72rem;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
}

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

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: -4rem;
	background: var(--ink);
	color: #fff;
	padding: 0.6rem 0.9rem;
	z-index: 20;
}

.skip-link:focus {
	top: 0.75rem;
}

a {
	color: var(--accent);
}

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

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

.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	max-width: var(--page);
	margin: 0 auto;
	padding: 0.85rem 1.25rem 1rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.wordmark {
	color: var(--ink);
	text-decoration: none;
	font-weight: 680;
	letter-spacing: 0.01em;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

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

.channel-link {
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	border-bottom: 2px solid var(--mark);
}

.nav-toggle {
	margin-left: auto;
	min-height: 44px;
	min-width: 44px;
	padding: 0.4rem 0.85rem;
	border: 1px solid var(--ink);
	background: transparent;
	color: var(--ink);
	font: inherit;
	cursor: pointer;
}

.lang-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	width: 100%;
}

.lang-nav a {
	color: var(--ink);
	text-decoration: none;
	border: 1px solid var(--line);
	background: var(--bg);
	min-height: 44px;
	padding: 0.35rem 0.7rem;
	display: inline-flex;
	align-items: center;
}

.lang-nav a[aria-current="true"] {
	border-color: var(--ink);
	background: var(--ink);
	color: #fff;
}

html.js .lang-nav[data-open="false"] {
	display: none;
}

main {
	max-width: var(--page);
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
}

.landing h1,
.index h1,
.article h1,
.not-found h1 {
	font-size: clamp(1.85rem, 4vw, 2.6rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 0.6rem;
	overflow-wrap: break-word;
}

.lede {
	margin: 0 0 1.25rem;
	font-size: 1.15rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.lang-cards {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.75rem;
}

.lang-cards a {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 7.5rem;
	padding: 1rem 1.05rem;
	background: var(--paper);
	border: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.lang-cards a:hover {
	border-color: var(--ink);
}

.lang-cards .endonym {
	font-size: 1.2rem;
	font-weight: 650;
}

.lang-cards .count {
	color: var(--muted);
	font-size: 0.95rem;
}

.breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	padding: 0;
	margin: 0 0 1.25rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.breadcrumbs li {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 100%;
}

.breadcrumbs li + li::before {
	content: "/";
	color: var(--line);
}

.breadcrumbs a {
	color: var(--accent);
}

.article,
.index-list,
.index-header {
	max-width: var(--measure);
}

.article-date,
.index-list time {
	display: block;
	margin: 0.25rem 0 0.15rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.excerpt {
	font-size: 1.15rem;
	line-height: 1.55;
}

.sections section {
	margin: 1.75rem 0;
	padding-top: 0.25rem;
	border-top: 1px solid var(--line);
}

.sections h2 {
	font-size: 1.35rem;
	line-height: 1.3;
	margin: 1rem 0 0.6rem;
	overflow-wrap: break-word;
}

.sections p,
.excerpt,
.index-list p {
	overflow-wrap: break-word;
}

.child-links {
	display: grid;
	gap: 0.55rem;
	margin-top: 2rem;
}

.child-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 44px;
	padding: 0.75rem 0.9rem;
	background: var(--paper);
	border: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.child-card:hover {
	border-color: var(--ink);
}

.external-mark {
	color: var(--mark);
	flex: 0 0 auto;
}

.index-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 1.25rem;
}

.index-list li {
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--line);
}

.index-list a {
	font-weight: 650;
	font-size: 1.12rem;
	text-underline-offset: 0.15em;
}

.index-list p {
	margin: 0.35rem 0 0;
}

.not-found p {
	max-width: var(--measure);
}

.site-footer {
	border-top: 1px solid var(--line);
	background: var(--paper);
}

.site-footer p {
	max-width: var(--page);
	margin: 0 auto;
	padding: 1.25rem;
	color: var(--muted);
	font-size: 0.95rem;
}

@media (min-width: 800px) {
	.nav-toggle {
		display: none;
	}

	.lang-nav {
		width: auto;
		margin-left: auto;
		justify-content: flex-end;
		max-width: 46rem;
	}

	html.js .lang-nav[data-open="false"] {
		display: flex;
	}
}

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