* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	background: #fdfdfd;
	color: #333;
	font-family: "Playfair Display", serif;
}

@font-face {
	font-family: "Playfair Display";
	src: url("/assets/fonts/PlayfairDisplay-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Visually hidden (SEO + accessibility) */
.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;
}

main {
	max-width: 760px;
	margin: 0 auto;
	padding: 120px 20px 140px;
}

.chapter-title {
	font-family: "Playfair Display", serif;
	font-size: 1.8rem;
	color: #c1272d;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin-bottom: 30px;
}

.chapter-text {
	font-size: 1.05rem;
	line-height: 1.7;
}

h3 {
	font-size: 1.3em;
	font-weight: 600;
	margin-top: 40px;
}

p { margin: 18px 0; }

ul, ol { margin: 15px 0 25px 30px; }
li { margin: 7px 0; }

.section-divider {
	border: none;
	border-top: 1px solid #ccc;
	margin: 60px 0;
}

.floating-box {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 80px;
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #fff;
	border-bottom: 1px solid #ccc;
	z-index: 100;
}

.floating-box a {
	display: flex;
	align-items: center;
	height: 100%;
}

.floating-box img {
	height: 100%;
	width: auto;
	display: block;
}

/* Simple internal nav (helps SEO + usability) */
.toc {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}
.toc a {
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid rgba(0,0,0,0.2);
}
.toc a:hover {
	border-bottom-color: rgba(0,0,0,0.6);
}

section {
	scroll-margin-top: 140px; /* height of header + breathing room */
}

footer {
	text-align: center;
	padding: 40px 20px 60px;
	font-size: 0.9rem;
	color: #888;
	border-top: 1px solid #ccc;
}

footer p {
	margin: 0;
}

/* Chapter listing (landing page) */
.chapter-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.chapter-list li {
	margin: 0;
	border-bottom: 1px solid #eee;
}

.chapter-list li:last-child {
	border-bottom: none;
}

.chapter-list a {
	display: flex;
	align-items: baseline;
	gap: 20px;
	padding: 18px 0;
	color: #333;
	text-decoration: none;
}

.chapter-list a:hover {
	color: #c1272d;
}

.chapter-number {
	font-size: 1.1rem;
	min-width: 36px;
	color: #c1272d;
}

.chapter-name {
	font-size: 1.05rem;
}

.chapter-status {
	font-size: 0.85rem;
	color: #999;
	font-style: italic;
	margin-left: auto;
}

/* Chapter navigation */
.chapter-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 80px;
	padding-top: 40px;
	border-top: 1px solid #ccc;
	font-size: 0.95rem;
}

.chapter-nav a {
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid rgba(0,0,0,0.2);
}

.chapter-nav a:hover {
	border-bottom-color: rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
	.floating-box a:first-child img { height: 38px; }
	main { padding-top: 100px; }
	.toc {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px 20px;
	}
	.toc li:nth-child(n+5) {
		grid-column: 1 / -1;
	}
}
