/* Rich HTML from CKEditor — scope with .tutorial-prose */
.tutorial-prose {
	color: #1a1d26;
	font-size: 1.05rem;
	line-height: 1.7;
}

.tutorial-prose h1, .tutorial-prose h2, .tutorial-prose h3, .tutorial-prose h4 {
	font-weight: 700;
	margin-top: 1.25rem;
	margin-bottom: 0.65rem;
	color: #0f172a;
}

.tutorial-prose h1 { font-size: 1.75rem; }
.tutorial-prose h2 { font-size: 1.45rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.35rem; }
.tutorial-prose h3 { font-size: 1.2rem; }

.tutorial-prose p { margin-bottom: 0.85rem; }

.tutorial-prose ul, .tutorial-prose ol {
	padding-left: 1.35rem;
	margin-bottom: 1rem;
}

.tutorial-prose li { margin-bottom: 0.35rem; }

.tutorial-prose table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 0.95rem;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
	border-radius: 8px;
	overflow: hidden;
}

.tutorial-prose th, .tutorial-prose td {
	border: 1px solid #e2e8f0;
	padding: 0.6rem 0.85rem;
	text-align: start;
}

/* Headings must stay readable: CMS/HTML often ships inline light-on-light or white text on thead. */
.tutorial-prose thead,
.tutorial-prose thead tr {
	color: #0f172a;
}

.tutorial-prose th {
	background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
	font-weight: 700;
	color: #0f172a !important;
	border-color: #94a3b8;
}

.tutorial-prose thead th {
	background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%) !important;
	color: #0f172a !important;
}

.tutorial-prose tr:nth-child(even) td {
	background: #fafbfc;
}

.tutorial-prose pre {
	background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
	color: #e2e8f0;
	padding: 1rem 1.15rem;
	border-radius: 10px;
	overflow-x: auto;
	font-size: 0.9rem;
	line-height: 1.55;
	margin: 1rem 0;
	border: 1px solid #334155;
}

.tutorial-prose code {
	font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
	font-size: 0.9em;
}

.tutorial-prose pre code {
	color: #a5f3fc;
	background: transparent;
	padding: 0;
	border-radius: 0;
}

.tutorial-prose :not(pre) > code {
	background: #f1f5f9;
	color: #0f766e;
	padding: 0.15rem 0.45rem;
	border-radius: 6px;
}

.tutorial-prose blockquote {
	border-left: 4px solid #6366f1;
	padding-left: 1rem;
	margin: 1rem 0;
	color: #475569;
	font-style: italic;
	background: #f8fafc;
	padding: 0.75rem 1rem;
	border-radius: 0 8px 8px 0;
}

/* -------------------------------------------------------------------------
   Premium chapter column (.ebook-prose) — Tailwind slate / indigo palette,
   comfortable measure, safe overflow for tables & pre (web + PDF companion).
   ------------------------------------------------------------------------- */
.ebook-chapter-shell {
	margin-top: 2rem;
	overflow: hidden;
	border-radius: 1.5rem;
	border: 1px solid rgba(226, 232, 240, 0.95);
	background: #fff;
	box-shadow:
		0 25px 50px -12px rgba(15, 23, 42, 0.1),
		0 0 0 1px rgba(15, 23, 42, 0.05);
}

.ebook-chapter-shell-head {
	border-bottom: 1px solid #f1f5f9;
	padding: 0.75rem 1.5rem;
	background: linear-gradient(135deg, #f8fafc 0%, #ffffff 45%, rgba(238, 242, 255, 0.85) 100%);
}

@media (min-width: 640px) {
	.ebook-chapter-shell-head {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

.ebook-chapter-shell-kicker {
	margin: 0;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #4f46e5;
}

.ebook-chapter-shell-body {
	overflow-x: auto;
	padding: 2rem 1.5rem;
}

@media (min-width: 640px) {
	.ebook-chapter-shell-body {
		padding: 2.5rem 2.5rem;
	}
}

.ebook-prose {
	--ebook-accent: #4f46e5;
	--ebook-accent-ring: rgba(79, 70, 229, 0.12);
	color: #1e293b;
	font-size: 1.0625rem;
	line-height: 1.78;
	max-width: 65ch;
	margin-inline: auto;
	font-feature-settings: "kern" 1, "liga" 1;
	text-rendering: optimizeLegibility;
}

.ebook-prose > :first-child {
	margin-top: 0;
}

.ebook-prose > :last-child {
	margin-bottom: 0;
}

.ebook-prose h1,
.ebook-prose h2,
.ebook-prose h3,
.ebook-prose h4,
.ebook-prose h5,
.ebook-prose h6 {
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #0f172a;
	margin-top: 1.75rem;
	margin-bottom: 0.75rem;
	line-height: 1.22;
}

.ebook-prose h1:first-child,
.ebook-prose h2:first-child,
.ebook-prose h3:first-child {
	margin-top: 0;
}

.ebook-prose h1 {
	font-size: 1.875rem;
}

.ebook-prose h2 {
	font-size: 1.5rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid #e2e8f0;
}

.ebook-prose h3 {
	font-size: 1.25rem;
	color: #334155;
}

.ebook-prose h4 {
	font-size: 1.1rem;
	color: #475569;
}

.ebook-prose p {
	margin-top: 0;
	margin-bottom: 1rem;
}

.ebook-prose a {
	color: #4338ca;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.ebook-prose a:hover {
	color: #4f46e5;
}

.ebook-prose ul,
.ebook-prose ol {
	padding-left: 1.5rem;
	margin: 0 0 1.1rem;
}

.ebook-prose li {
	margin-bottom: 0.4rem;
}

.ebook-prose li > ul,
.ebook-prose li > ol {
	margin-top: 0.35rem;
	margin-bottom: 0.35rem;
}

.ebook-prose table {
	width: 100%;
	max-width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 1.35rem 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	border-radius: 12px;
	overflow: hidden;
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.06),
		0 10px 40px -18px rgba(15, 23, 42, 0.18);
}

.ebook-prose th,
.ebook-prose td {
	border: 1px solid #e2e8f0;
	padding: 0.65rem 0.85rem;
	text-align: start;
	vertical-align: top;
}

.ebook-prose thead,
.ebook-prose thead tr {
	color: #0f172a;
}

.ebook-prose th {
	background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
	font-weight: 700;
	color: #0f172a !important;
	border-color: #cbd5e1;
}

.ebook-prose thead th {
	background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%) !important;
	color: #0f172a !important;
}

.ebook-prose tbody tr:nth-child(even) td {
	background: #f8fafc;
}

.ebook-prose tbody tr:hover td {
	background: #f1f5ff;
}

.ebook-prose pre {
	background: linear-gradient(155deg, #0f172a 0%, #1e293b 55%, #312e81 100%);
	color: #e2e8f0;
	padding: 1.1rem 1.2rem;
	border-radius: 14px;
	overflow-x: auto;
	font-size: 0.875rem;
	line-height: 1.62;
	margin: 1.35rem 0;
	border: 1px solid rgba(99, 102, 241, 0.35);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ebook-prose code {
	font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
	font-size: 0.9em;
}

.ebook-prose pre code {
	color: #c4b5fd;
	background: transparent;
	padding: 0;
	border-radius: 0;
	font-size: inherit;
}

.ebook-prose :not(pre) > code {
	background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
	color: #3730a3;
	padding: 0.12rem 0.42rem;
	border-radius: 6px;
	font-size: 0.88em;
	border: 1px solid rgba(99, 102, 241, 0.2);
}

.ebook-prose blockquote {
	margin: 1.35rem 0;
	padding: 1rem 1.15rem 1rem 1.25rem;
	border-left: 4px solid var(--ebook-accent);
	border-radius: 0 12px 12px 0;
	background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 55%, #ffffff 100%);
	color: #475569;
	font-style: italic;
	box-shadow: 0 1px 0 var(--ebook-accent-ring);
}

.ebook-prose hr {
	border: 0;
	height: 1px;
	margin: 2rem 0;
	background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.ebook-prose img,
.ebook-prose video {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	margin: 1rem 0;
	box-shadow: 0 12px 40px -20px rgba(15, 23, 42, 0.25);
}

.ebook-prose figure {
	margin: 1.35rem 0;
}

.ebook-prose figcaption {
	font-size: 0.875rem;
	color: #64748b;
	text-align: center;
	margin-top: 0.5rem;
	font-style: italic;
}
