/*
 * CourseForge AI: learner-facing design for AI-built courses.
 * Everything is scoped to .cf-content (the generated lesson body) or body.cf-ld-fix,
 * so it never changes the rest of your theme or your other courses.
 * Selectors are doubled (.cf-content.cf-content) to win over theme heading styles.
 */

.cf-content {
	--cf-ink: #0f172a;
	--cf-text: #334155;
	--cf-muted: #64748b;
	--cf-line: #e2e8f0;
	--cf-soft: #f8fafc;
	--cf-accent: #6366f1;
	max-width: 760px;
	color: var(--cf-text);
	font-size: 17px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Reading time ---------- */
.cf-content .cf-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.cf-content .cf-meta__item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--cf-soft); color: var(--cf-muted); font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: inset 0 0 0 1px var(--cf-line); }
.cf-content .cf-meta__time::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Typography ---------- */
.cf-content.cf-content p { margin: 0 0 1.15em; color: var(--cf-text); font-size: 1em; line-height: 1.75; }
.cf-content.cf-content .cf-lead { margin-bottom: 1.6em; color: var(--cf-ink); font-size: 1.16em; line-height: 1.65; }
.cf-content.cf-content h2 {
	position: relative;
	margin: 2.1em 0 .7em;
	padding: 0 0 0 16px;
	color: var(--cf-ink);
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
	font-weight: 750;
	line-height: 1.3;
	letter-spacing: -.015em;
	text-transform: none;
}
.cf-content.cf-content h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px; border-radius: 3px; background: linear-gradient(180deg, var(--cf-accent), #a855f7); }
.cf-content.cf-content h3 { margin: 1.6em 0 .5em; color: var(--cf-ink); font-size: 1.18rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; text-transform: none; }
.cf-content.cf-content h4 { margin: 1.4em 0 .4em; color: var(--cf-ink); font-size: 1.02rem; font-weight: 700; text-transform: none; }
.cf-content.cf-content strong { color: var(--cf-ink); font-weight: 700; }
.cf-content.cf-content ul, .cf-content.cf-content ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.cf-content.cf-content li { margin: .4em 0; padding-left: .2em; line-height: 1.7; }
.cf-content.cf-content ul > li::marker { color: var(--cf-accent); }
.cf-content.cf-content code { padding: .12em .4em; border-radius: 5px; background: #f1f5f9; color: #be185d; font-size: .9em; }
.cf-content.cf-content pre { margin: 0 0 1.4em; padding: 16px 18px; overflow-x: auto; border-radius: 12px; background: #0f172a; color: #e2e8f0; font-size: .9em; line-height: 1.6; }
.cf-content.cf-content pre code { padding: 0; background: none; color: inherit; }
.cf-content.cf-content blockquote { margin: 1.4em 0; padding: 14px 20px; border: 0; border-left: 4px solid var(--cf-accent); border-radius: 0 12px 12px 0; background: var(--cf-soft); color: var(--cf-ink); font-style: normal; }
.cf-content.cf-content blockquote p:last-child { margin-bottom: 0; }

/* Numbered steps: clear circles instead of plain numbers (not inside boxes or the lesson contents list). */
.cf-content.cf-content > ol:not(.cf-toc), .cf-content.cf-content > div:not(.cf-box) ol { counter-reset: cf-step; list-style: none; padding-left: 0; }
.cf-content.cf-content > ol:not(.cf-toc) > li, .cf-content.cf-content > div:not(.cf-box) ol > li { position: relative; margin: .75em 0; padding-left: 44px; counter-increment: cf-step; }
.cf-content.cf-content > ol:not(.cf-toc) > li::before, .cf-content.cf-content > div:not(.cf-box) ol > li::before {
	content: counter(cf-step);
	position: absolute; left: 0; top: .1em;
	display: grid; place-items: center;
	width: 30px; height: 30px;
	border-radius: 50%;
	background: #eef2ff; color: #4338ca;
	font-size: .85em; font-weight: 800; line-height: 1;
	box-shadow: inset 0 0 0 1.5px #c7d2fe;
}

/* Tables */
.cf-content.cf-content table { width: 100%; margin: 1.4em 0 1.8em; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--cf-line); border-radius: 12px; font-size: .94em; line-height: 1.55; }
.cf-content.cf-content th { padding: 12px 14px; background: #eef2ff; color: #312e81; font-weight: 700; text-align: left; border: 0; border-bottom: 1px solid #c7d2fe; }
.cf-content.cf-content td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--cf-line); vertical-align: top; }
.cf-content.cf-content tr:last-child td { border-bottom: 0; }
.cf-content.cf-content tbody tr:nth-child(even) td { background: #fafbfd; }

/* Images */
.cf-content.cf-content .cf-figure { margin: 2em 0 2.2em; }
.cf-content.cf-content .cf-figure img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 14px 36px rgba(15, 23, 42, .12); }
.cf-content.cf-content .cf-figure figcaption { margin-top: .7em; color: var(--cf-muted); font-size: .86em; font-style: normal; text-align: center; }

/* ---------- Boxes ---------- */
.cf-content.cf-content .cf-box {
	position: relative;
	margin: 2em 0;
	padding: 20px 22px 18px;
	border: 1px solid var(--cf-box-line);
	border-left: 0;
	border-radius: 16px;
	background: var(--cf-box-bg);
	box-shadow: inset 4px 0 0 var(--cf-box-color);
}
.cf-content.cf-content .cf-box > :last-child { margin-bottom: 0; }
.cf-content.cf-content .cf-box p, .cf-content.cf-content .cf-box li { font-size: .97em; }
.cf-content.cf-content .cf-box ul, .cf-content.cf-content .cf-box ol { margin-bottom: 0; }
.cf-content.cf-content .cf-box__label {
	display: flex; align-items: center; gap: 9px;
	margin: 0 0 .7em !important;
	color: var(--cf-box-color);
	font-size: .78rem !important;
	font-weight: 800;
	letter-spacing: .09em;
	line-height: 1.3 !important;
	text-transform: uppercase;
}
.cf-content.cf-content .cf-box__label::before {
	content: ""; flex: 0 0 auto;
	width: 26px; height: 26px;
	border-radius: 8px;
	background: var(--cf-box-color) var(--cf-icon) center / 16px no-repeat;
}

.cf-content .cf-objectives { --cf-box-color: #4f46e5; --cf-box-bg: #f5f6ff; --cf-box-line: #e0e3ff; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3C/svg%3E"); }
.cf-content .cf-why { --cf-box-color: #0284c7; --cf-box-bg: #f2f9fe; --cf-box-line: #d6ecfa; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.cf-content .cf-example { --cf-box-color: #7c3aed; --cf-box-bg: #f8f5ff; --cf-box-line: #ebe3fd; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4zM13.5 6.5l4 4'/%3E%3C/svg%3E"); }
.cf-content .cf-scenario { --cf-box-color: #0d9488; --cf-box-bg: #f2fbfa; --cf-box-line: #d3f1ed; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }
.cf-content .cf-mistakes { --cf-box-color: #e11d48; --cf-box-bg: #fff5f7; --cf-box-line: #fde0e6; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4zM12 10v4M12 17.2v.1'/%3E%3C/svg%3E"); }
.cf-content .cf-takeaways { --cf-box-color: #d97706; --cf-box-bg: #fffaf0; --cf-box-line: #fcecc8; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='m12 3 2.6 5.4 5.9.8-4.3 4.1 1 5.8L12 16.4l-5.2 2.7 1-5.8-4.3-4.1 5.9-.8z'/%3E%3C/svg%3E"); }
.cf-content .cf-check { --cf-box-color: #16a34a; --cf-box-bg: #f3fcf6; --cf-box-line: #d5f3df; --cf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.2 9.3a3 3 0 0 1 5.6 1.2c0 2-2.8 2.3-2.8 4M12 17.3v.1'/%3E%3C/svg%3E"); }

/* Takeaways and objectives as checklists; mistakes with crosses. */
.cf-content.cf-content .cf-takeaways ul, .cf-content.cf-content .cf-mistakes ul, .cf-content.cf-content .cf-objectives ul { list-style: none; padding-left: 0; }
.cf-content.cf-content .cf-takeaways li, .cf-content.cf-content .cf-mistakes li, .cf-content.cf-content .cf-objectives li { position: relative; padding-left: 30px; margin: .55em 0; }
.cf-content.cf-content .cf-takeaways li::before, .cf-content.cf-content .cf-mistakes li::before, .cf-content.cf-content .cf-objectives li::before {
	content: ""; position: absolute; left: 0; top: .32em;
	width: 19px; height: 19px; border-radius: 50%;
	background: var(--cf-box-color) center / 11px no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.cf-content.cf-content .cf-mistakes li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E"); }
.cf-content.cf-content .cf-objectives li::before { background-color: transparent; box-shadow: inset 0 0 0 2px var(--cf-box-color); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='%234f46e5'/%3E%3C/svg%3E"); }

/* Self-check: a proper reveal button */
.cf-content.cf-content .cf-check > p:not(.cf-box__label) { color: var(--cf-ink); font-weight: 600; }
.cf-content.cf-content .cf-check details { margin-top: .9em; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--cf-box-line); }
.cf-content.cf-content .cf-check summary { display: flex; align-items: center; gap: 8px; padding: 11px 16px; color: #15803d; font-weight: 700; font-size: .95em; cursor: pointer; list-style: none; user-select: none; }
.cf-content.cf-content .cf-check summary::-webkit-details-marker { display: none; }
.cf-content.cf-content .cf-check summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 16px; line-height: 1; transition: transform .2s; }
.cf-content.cf-content .cf-check details[open] summary::before { content: "–"; }
.cf-content.cf-content .cf-check details[open] summary { border-bottom: 1px solid var(--cf-box-line); }
.cf-content.cf-content .cf-check details > :not(summary) { padding: 0 16px; }
.cf-content.cf-content .cf-check details > p:first-of-type { padding-top: 12px; }
.cf-content.cf-content .cf-check details > :last-child { padding-bottom: 14px; margin-bottom: 0; }

/* Lesson overview and course facts */
.cf-content.cf-content .cf-toc { counter-reset: cf-toc; list-style: none; padding: 0; margin: 0 0 1.6em; border: 1px solid var(--cf-line); border-radius: 14px; overflow: hidden; }
.cf-content.cf-content .cf-toc li { position: relative; margin: 0; padding: 14px 16px 14px 56px; border-bottom: 1px solid var(--cf-line); counter-increment: cf-toc; font-weight: 600; color: var(--cf-ink); }
.cf-content.cf-content .cf-toc li:last-child { border-bottom: 0; }
.cf-content.cf-content .cf-toc li::before { content: counter(cf-toc); position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eef2ff; color: #4338ca; font-size: .85em; font-weight: 800; box-shadow: none; }
.cf-content.cf-content .cf-course-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 1.6em 0; }
.cf-content.cf-content .cf-course-facts > div { padding: 16px 18px; border-radius: 14px; background: var(--cf-soft); box-shadow: inset 0 0 0 1px var(--cf-line); }
.cf-content.cf-content .cf-course-facts span { display: block; color: var(--cf-muted); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cf-content.cf-content .cf-course-facts strong { display: block; margin-top: 4px; font-size: 1rem; line-height: 1.4; }

@media (max-width: 640px) {
	.cf-content { font-size: 16px; }
	.cf-content.cf-content .cf-box { padding: 16px 16px 14px; border-radius: 14px; }
	.cf-content.cf-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- LearnDash course-content list: keep each lesson's topics stacked under it ---------- */
body.cf-ld-fix .learndash-wrapper .ld-item-list .ld-item-list-item { display: block !important; flex-direction: column !important; min-height: 0 !important; height: auto !important; }
body.cf-ld-fix .learndash-wrapper .ld-item-list .ld-item-list-item > .ld-item-list-item-preview { width: auto !important; max-width: none !important; min-height: 0 !important; align-items: center !important; }
body.cf-ld-fix .learndash-wrapper .ld-item-list .ld-item-list-item > .ld-item-list-item-expanded { position: static !important; float: none !important; width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; transform: none !important; }
body.cf-ld-fix .learndash-wrapper .ld-item-list .ld-item-list-item-expanded .ld-table-list { width: 100% !important; max-width: none !important; margin: 0 !important; }
body.cf-ld-fix .learndash-wrapper .ld-item-list .ld-item-list-item-expanded .ld-table-list-item { width: auto !important; }
