/* Compute Illustrated für Frappe Learning.
   Farben aus dem Figma „Brand Kit“ (Collections „Primitives“/„Brand“):
   Ink #0B0F19, Paper #F5F7FA, Blue #3B82F6, Violet #8B5CF6, Cyan #22D3EE,
   Blue Light #93C5FD, Slate #475569, Rahmen #E3E8F0.
   Überschrieben werden nur die Variablen von frappe-ui; die Graustufen werden
   zu kühlen Slate-Tönen, die nach Ink (dunkel) bzw. Paper (hell) laufen. */

:root {
	--ci-ink: #0b0f19;
	--ci-paper: #f5f7fa;
	--ci-blue: #3b82f6;
	--ci-violet: #8b5cf6;
	--ci-cyan: #22d3ee;
	--ci-blue-light: #93c5fd;
	--ci-slate: #475569;
	--ci-border: #e3e8f0;
}

/* Hell: Paper-Flächen, Ink-Schrift, Slate für Nebentext */
:root,
[data-theme='light'] {
	--surface-base: #ffffff;
	--surface-gray-1: var(--ci-paper);
	--surface-gray-2: #eef2f6;
	--surface-gray-3: var(--ci-border);
	--surface-gray-4: #cbd5e1;
	--surface-gray-5: #94a3b8;
	--surface-gray-6: #64748b;
	--surface-gray-7: var(--ci-slate);
	--surface-gray-8: #334155;
	--surface-gray-9: #1e293b;
	--surface-gray-10: var(--ci-ink);
	--surface-sidebar: var(--ci-paper);
	--surface-alpha-sidebar: var(--ci-paper);

	--ink-gray-1: var(--ci-border);
	--ink-gray-2: #cbd5e1;
	--ink-gray-3: #94a3b8;
	--ink-gray-4: #64748b;
	--ink-gray-5: #64748b;
	--ink-gray-6: var(--ci-slate);
	--ink-gray-7: #334155;
	--ink-gray-8: #1e293b;
	--ink-gray-9: var(--ci-ink);
	--ink-blue-link: #2563eb;

	--outline-gray-1: #eef2f6;
	--outline-gray-2: var(--ci-border);
	--outline-gray-3: #cbd5e1;
	--outline-gray-4: #94a3b8;
	--outline-gray-5: #64748b;
	--outline-gray-6: var(--ci-slate);
	--outline-gray-7: #334155;
	--outline-gray-8: #1e293b;
	--outline-gray-9: var(--ci-ink);
	--outline-elevation-1: var(--ci-border);
	--outline-elevation-2: var(--ci-border);

	--gray-50: var(--ci-paper);
	--gray-100: #eef2f6;
	--gray-200: var(--ci-border);
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-500: #64748b;
	--gray-600: var(--ci-slate);
	--gray-700: #334155;
	--gray-800: #1e293b;
	--gray-900: var(--ci-ink);
	--gray-950: var(--ci-ink);

	--ci-akzent: var(--ci-blue);
	--ci-akzent-hover: #2563eb;
	--ci-akzent-text: #ffffff;
	--ci-code-bg: var(--ci-paper);
}

/* Dunkel: Ink als Grund, Flächen in Navy-Abstufungen, Links in Cyan wie auf der Website */
[data-theme='dark'] {
	--surface-base: var(--ci-ink);
	--surface-gray-1: #121826;
	--surface-gray-2: #182033;
	--surface-gray-3: #1f2940;
	--surface-gray-4: #283349;
	--surface-gray-5: #3a4660;
	--surface-gray-6: #64748b;
	--surface-gray-7: #94a3b8;
	--surface-gray-8: #cbd5e1;
	--surface-gray-9: var(--ci-border);
	--surface-gray-10: var(--ci-paper);
	--surface-sidebar: #0e1320;
	--surface-alpha-sidebar: #0e1320;
	--surface-elevation-1: #121826;
	--surface-elevation-2: #182033;
	--surface-elevation-3: #1f2940;

	--ink-base: var(--ci-ink);
	--ink-gray-1: #182033;
	--ink-gray-2: #283349;
	--ink-gray-3: #3a4660;
	--ink-gray-4: #64748b;
	--ink-gray-5: #7c8ba1;
	--ink-gray-6: #94a3b8;
	--ink-gray-7: #cbd5e1;
	--ink-gray-8: var(--ci-border);
	--ink-gray-9: var(--ci-paper);
	--ink-blue-link: var(--ci-cyan);

	--outline-base: var(--ci-ink);
	--outline-gray-1: #182033;
	--outline-gray-2: #1f2940;
	--outline-gray-3: #283349;
	--outline-gray-4: #3a4660;
	--outline-gray-5: #64748b;
	--outline-gray-6: #94a3b8;
	--outline-elevation-1: #1f2940;
	--outline-elevation-2: #283349;

	--ci-akzent: var(--ci-blue);
	--ci-akzent-hover: #60a5fa;
	--ci-akzent-text: #ffffff;
	--ci-code-bg: #121826;
}

/* Schrift: Inter (bringt das LMS schon mit), Überschriften Semi Bold wie im Brand Guide */
body {
	font-family: InterVar, Inter, ui-sans-serif, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, .ce-header {
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* Hauptschaltflächen in Brand-Blau wie „Subscribe on YouTube“ auf der Website */
button.bg-surface-gray-10 {
	background-color: var(--ci-akzent);
	color: var(--ci-akzent-text);
}
button.bg-surface-gray-10:hover {
	background-color: var(--ci-akzent-hover);
}

/* Fokus und Auswahl in den Brand-Farben */
:focus-visible {
	outline-color: var(--ci-cyan);
}
::selection {
	background-color: var(--ci-blue);
	color: var(--ci-paper);
}

/* Fortschrittsbalken in Blau statt Schwarz bzw. Weiß */
.overflow-hidden > .h-full.bg-surface-gray-10 {
	background-color: var(--ci-akzent);
}

/* Gewählte Antwort im Quiz in Blau */
html [type='radio']:checked,
html [type='checkbox']:checked {
	background-color: var(--ci-akzent);
	border-color: var(--ci-akzent);
}

/* Codeblöcke (Editor.js codeBox): eine ruhige Karte statt Rahmen in Rahmen */
.codeBoxHolder {
	background: var(--ci-code-bg) !important;
	border: 1px solid var(--outline-gray-2) !important;
	border-radius: 12px !important;
	padding: 0 !important;
	box-shadow: none !important;
}
.codeBoxTextArea {
	background: transparent !important;
	color: var(--ink-gray-9) !important;
	border: 0 !important;
	border-radius: 12px !important;
	padding: 16px 20px !important;
	font-size: 14px !important;
	line-height: 1.6 !important;
}

/* Lektionstext: Links, Zitate und Inline-Code wie auf computeillustrated.com */
.ProseMirror a,
.prose a,
.ce-paragraph a {
	color: var(--ink-blue-link);
	text-decoration: none;
}
.ProseMirror a:hover,
.prose a:hover,
.ce-paragraph a:hover {
	text-decoration: underline;
}
.prose blockquote,
.ProseMirror blockquote {
	border-left: 3px solid var(--ci-violet);
	background: var(--surface-gray-1);
	border-radius: 0 12px 12px 0;
	padding: 12px 20px;
	font-style: normal;
}
.inline-code,
.prose :not(pre) > code {
	background: var(--ci-code-bg);
	border: 1px solid var(--outline-gray-2);
	border-radius: 6px;
	padding: 1px 5px;
	font-size: 0.9em;
}
/* Tailwind typography setzt Backticks vor und hinter Inline-Code (Kursbeschreibung); der Kasten reicht. */
.prose :not(pre) > code::before,
.prose :not(pre) > code::after {
	content: none;
}
/* Aufgabe einer Programmierübung: Das LMS setzt Listen dort auf list-style none, Schritte verlieren ihre Nummern. */
[data-testid="problem-pane"] ol { list-style: decimal; padding-left: 1.5em; }
[data-testid="problem-pane"] ul { list-style: disc; padding-left: 1.5em; }
[data-testid="problem-pane"] li { margin: 0.25em 0; }

/* „Zum Nachdenken“ und Musterlösungen (details-Blöcke aus baue_kurs.py) als Karte mit Violett-Kante */
.prose details,
details {
	border: 1px solid var(--outline-gray-2);
	border-left: 3px solid var(--ci-violet);
	border-radius: 12px;
	padding: 12px 16px;
	margin: 12px 0 24px;
	background: var(--surface-gray-1);
}
details > summary {
	cursor: pointer;
}
details[open] > summary {
	margin-bottom: 8px;
}

/* Kurskarte ohne eigenes Bild: das LMS färbt sie mit einem Verlauf nach dem Titel
   (hier rot-schwarz). Stattdessen flach in Ink mit dem Zeichen unten rechts. */
[style*='linear-gradient(to top right, black'] {
	background: var(--ci-ink) url('/assets/ci_theme/images/mark-color.svg') no-repeat right 16px bottom 14px / 36px !important;
	border-color: var(--outline-gray-2) !important;
}

/* Bunny-Player in Lektionen: Das LMS setzt eine feste Höhe (30rem, schmal 15rem), die Breite folgt
   der Spalte; der Player füllt den Rest mit hellen Balken. Die Videos sind 16:9. */
iframe[src*='mediadelivery.net'] {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
}

/* Links zu Impressum, Datenschutz, AGB, Widerruf (public/js/anpassen.js) */
.ci-rechtliches {
	overflow: hidden;
	font-size: 11px;
	line-height: 1.6;
	color: var(--ink-gray-5, #94a3b8);
	padding: 4px 8px;
}
.ci-rechtliches a {
	color: inherit;
	text-decoration: underline;
}
.ci-bestellung {
	padding: 6px 0 0;
	font-size: 12px;
}
/* Ohne Seitenleiste (Handy): Fußzeile unter dem Inhalt, groß genug zum Tippen */
.ci-rechtliches-unten {
	flex-shrink: 0;
	margin-top: auto;
	padding: 20px 16px 24px;
	font-size: 13px;
	text-align: center;
	border-top: 1px solid var(--outline-gray-1, #1e293b);
}

/* Kursseite als Landing Page (public/js/anpassen.js: landingPage) */
.ci-hero {
	margin: -4px 0 28px;
}
.ci-hero img {
	display: block;
	width: 100%;
	aspect-ratio: 3272 / 707;
	object-fit: cover;
	border-radius: 12px;
}
.ci-kennzahlen {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.ci-kennzahlen span {
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 13px;
	color: var(--ink-gray-8, #e2e8f0);
	background: color-mix(in srgb, var(--ci-akzent, #3b82f6) 16%, transparent);
	border: 1px solid color-mix(in srgb, var(--ci-akzent, #3b82f6) 35%, transparent);
}
.ci-gratis {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	margin-top: 18px;
	padding: 16px 20px;
	border-radius: 12px;
	border: 1px solid color-mix(in srgb, var(--ci-akzent, #3b82f6) 45%, transparent);
	background: color-mix(in srgb, var(--ci-akzent, #3b82f6) 9%, transparent);
}
.ci-gratis strong { font-size: 16px; color: var(--ink-gray-9, #f1f5f9); }
.ci-gratis p { margin: 4px 0 0; font-size: 14px; color: var(--ink-gray-7, #94a3b8); max-width: 52ch; }
.ci-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.ci-knopf {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	border: 1px solid var(--outline-gray-3, #334155);
	color: var(--ink-gray-9, #f1f5f9);
	text-decoration: none;
}
.ci-knopf-primaer {
	background: var(--ci-akzent, #3b82f6);
	border-color: var(--ci-akzent, #3b82f6);
	color: #fff;
}

/* Programmierübung am Handy: Das LMS gibt der Karte feste 900px, darin teilen sich Aufgabe, Editor,
   Konsole und Testfälle den Platz, und für den Editor bleibt eine Zeile. Untereinander bekommt
   jeder Teil seine eigene Höhe, die Karte wächst mit. */
@media (max-width: 767px) {
	.h-\[900px\]:has([data-testid="problem-pane"]) { height: auto; }
	[data-testid="problem-pane"] { max-height: 40vh; }
	.exercise-editor { flex: none; height: 55vh; min-height: 280px; }
}

/* Widerrufsfunktion (§ 356a BGB): hervorgehoben über den übrigen Rechtslinks */
.ci-rechtliches a.ci-widerrufen {
	display: inline-block;
	margin-bottom: 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ink-gray-8, #e2e8f0);
}
.ci-rechtliches-unten a.ci-widerrufen { font-size: 14px; }
/* Kursseite: Pflichtangaben unter dem Preis (anpassen.js: landingPage) */
.ci-preisangaben {
	margin: 6px 0 4px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--ink-gray-6, #94a3b8);
}
.ci-preisangaben a { color: inherit; text-decoration: underline; }
