/**
 * at-amber Theme - Book Pages Module
 * Version: 1.0.0
 * Date: 2025-12-11
 *
 * Styling for research book pages at /research/books/[book-name]/
 * Part of The Genesis Dome (Research room)
 *
 * Features:
 * - Breadcrumb navigation (/ Research / Book Title /)
 * - Book header (icon + title + description)
 * - Stacked book pages with borders (page-like appearance)
 * - Auto page numbering via CSS counter (bottom right)
 * - Content layout helpers (headings, images, lists)
 * - Responsive design
 */

/* ===================================================================
   BREADCRUMB NAVIGATION
   =================================================================== */

.book-breadcrumb {
	margin-bottom: 2rem;
	padding: 0.75rem 0;
	font-size: 0.95rem;
	color: var(--text-secondary);
	border-bottom: 1px solid var(--border-color);
}

.book-breadcrumb a {
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.2s ease;
}

.book-breadcrumb a:hover {
	color: var(--accent);
}

.book-breadcrumb .separator {
	margin: 0 0.5rem;
	color: var(--text-muted);
}

.book-breadcrumb .current {
	color: var(--accent);
	font-weight: 600;
}

/* ===================================================================
   BOOK HEADER
   =================================================================== */

.book-header {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 2px solid var(--accent);
}

.book-header-title {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
}

.book-header-title i {
	font-size: 2.5rem;
	color: var(--accent);
}

.book-header-title h1 {
	margin: 0;
	font-size: 2.5rem;
	color: var(--text-primary);
	font-weight: 700;
}

.book-header-description {
	font-size: 1.1rem;
	color: var(--text-secondary);
	line-height: 1.6;
	max-width: 800px;
}

.book-header-meta {
	margin-top: 1rem;
	display: flex;
	gap: 2rem;
	flex-wrap: wrap;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.book-header-meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.book-header-meta-item i {
	color: var(--accent);
}

/* ===================================================================
   BOOK PAGES CONTAINER
   =================================================================== */

.book-pages-container {
	/* Initialize CSS counter for page numbering */
	counter-reset: book-page;
}

/* ===================================================================
   INDIVIDUAL BOOK PAGE
   =================================================================== */

.book-page {
	position: relative;
	background: var(--bg-secondary);
	border: 2px solid var(--accent);
	border-radius: 8px;
	padding: 3rem;
	margin-bottom: 2rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

	/* Increment counter for each page */
	counter-increment: book-page;
}

/* Page number (bottom right corner) */
.book-page::after {
	content: "Page " counter(book-page);
	position: absolute;
	bottom: 1rem;
	right: 1.5rem;
	font-size: 0.85rem;
	color: var(--text-muted);
	font-family: 'Orbitron', sans-serif;
	font-weight: 600;
}


/* ===================================================================
   BOOK CONTENT ELEMENTS
   =================================================================== */

/* Chapter/Section Headings */
.book-heading-chapter {
	font-size: 2rem;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--accent);
	font-family: 'Orbitron', sans-serif;
}

.book-heading-section {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-top: 2rem;
	margin-bottom: 1rem;
}

.book-heading-subsection {
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
}

/* Paragraphs */
.book-page p {
	line-height: 1.8;
	margin-bottom: 1.25rem;
	color: var(--text-primary);
}

/* Lists */
.book-page ul,
.book-page ol {
	margin-bottom: 1.25rem;
	padding-left: 2rem;
	line-height: 1.8;
}

.book-page li {
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.book-page ul li::marker {
	color: var(--accent);
}

.book-page ol li::marker {
	color: var(--accent);
	font-weight: 600;
}

/* ===================================================================
   IMAGES
   =================================================================== */

/* Centered image */
.book-image-center {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 2rem auto;
	border-radius: 4px;
	border: 1px solid var(--border-color);
}

/* Left-aligned image (text wraps right) */
.book-image-left {
	float: left;
	max-width: 45%;
	height: auto;
	margin: 0.5rem 1.5rem 1rem 0;
	border-radius: 4px;
	border: 1px solid var(--border-color);
}

/* Right-aligned image (text wraps left) */
.book-image-right {
	float: right;
	max-width: 45%;
	height: auto;
	margin: 0.5rem 0 1rem 1.5rem;
	border-radius: 4px;
	border: 1px solid var(--border-color);
}

/* Image caption */
.book-image-caption {
	display: block;
	text-align: center;
	font-size: 0.9rem;
	color: var(--text-muted);
	font-style: italic;
	margin-top: 0.5rem;
}

/* ===================================================================
   SPECIAL CONTENT BLOCKS
   =================================================================== */

/* Quote/Callout block */
.book-quote {
	background: var(--bg-tertiary);
	border-left: 4px solid var(--accent);
	padding: 1.5rem;
	margin: 2rem 0;
	border-radius: 4px;
	font-style: italic;
	color: var(--text-secondary);
}

.book-quote cite {
	display: block;
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--text-muted);
	font-style: normal;
}

/* Info box (highlighted information) */
.book-info-box {
	background: rgba(212, 165, 116, 0.1);
	border: 1px solid var(--accent);
	border-radius: 4px;
	padding: 1.5rem;
	margin: 2rem 0;
}

.book-info-box-title {
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.book-info-box-title i {
	font-size: 1.2rem;
}

/* Code block styling */
.book-code {
	background: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	padding: 1rem 1.5rem;
	margin: 1.5rem 0;
	font-family: 'Courier New', monospace;
	font-size: 0.9rem;
	color: var(--text-primary);
	overflow-x: auto;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

/* Clear floats after images */
.book-clearfix::after {
	content: "";
	display: table;
	clear: both;
}

/* Text emphasis */
.book-text-accent {
	color: var(--accent);
	font-weight: 600;
}

.book-text-highlight {
	background: rgba(212, 165, 116, 0.2);
	padding: 0.2rem 0.4rem;
	border-radius: 3px;
}

/* Horizontal divider */
.book-divider {
	border: 0;
	height: 2px;
	background: linear-gradient(to right, transparent, var(--accent), transparent);
	margin: 3rem 0;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 768px) {
	/* Smaller book header */
	.book-header-title h1 {
		font-size: 1.8rem;
	}

	.book-header-title i {
		font-size: 2rem;
	}

	.book-header-description {
		font-size: 1rem;
	}

	/* Reduce page padding on mobile */
	.book-page {
		padding: 2rem 1.5rem;
		padding-bottom: 3rem; /* Extra space for page number */
	}

	/* Smaller headings */
	.book-heading-chapter {
		font-size: 1.5rem;
	}

	.book-heading-section {
		font-size: 1.25rem;
	}

	/* Stack images on mobile instead of float */
	.book-image-left,
	.book-image-right {
		float: none;
		max-width: 100%;
		margin: 1.5rem 0;
	}

	/* Adjust breadcrumb */
	.book-breadcrumb {
		font-size: 0.85rem;
	}

	.book-breadcrumb .separator {
		margin: 0 0.25rem;
	}
}

@media (max-width: 480px) {
	/* Even smaller on very small screens */
	.book-page {
		padding: 1.5rem 1rem;
		padding-bottom: 2.5rem;
	}

	.book-page::after {
		font-size: 0.75rem;
		right: 1rem;
		bottom: 0.75rem;
	}
}
