* {
	box-sizing: border-box;
}

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

@font-face {
	font-family: "Libre Baskerville";
	src: url("/assets/fonts/LibreBaskerville-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-size: 1.8rem;
	color: #8b6a3e;
	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-top: 1px solid #ccc;
	margin: 60px 0;
}

/* Fixed header */
.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 a:first-child img {
	height: calc(100% + 15px);
}

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

/* Internal navigation */
.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: 120px;
}

.logo {
	max-height: 200px;
	width: auto;
	display: block;
	margin: 0 auto;
}

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

footer p {
	margin: 0;
}

/* Gallery */
.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
}

.gallery-item {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	cursor: pointer;
}

.gallery-item img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: transform 0.3s ease;
	padding-top: 20px;
}

.gallery-item:hover img {
	transform: scale(1.05);
}

/* Lightbox */
.lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.lightbox.active {
	display: flex;
}

.lightbox img {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
}

.lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	font-size: 40px;
	color: #fff;
	background: none;
	border: none;
	cursor: pointer;
	z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 30px;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	padding: 20px 15px;
	cursor: pointer;
	z-index: 1001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
	background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
	left: 10px;
}

.lightbox-next {
	right: 10px;
}

@media (max-width: 768px) {
	.floating-box a:first-child img {
		height: calc(100% + 10px);
	}

	main {
		padding-top: 100px;
	}

	.logo {
		max-height: 200px;
	}

	.gallery {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.gallery-item img {
		height: 150px;
	}

	.lightbox-prev,
	.lightbox-next {
		padding: 15px 10px;
		font-size: 24px;
	}

	.lightbox-close {
		top: 10px;
		right: 15px;
		font-size: 35px;
	}
}
