/* Blog: one readable column, system fonts, light and dark themes. */
:root {
	--bg: #ffffff;
	--text: #1f2328;
	--muted: #656d76;
	--accent: rgb(47, 111, 143);
	--border: #d8dee4;
	--surface: #f6f8fa;
	--callout: #eef5f9;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1115;
		--text: #e6e8eb;
		--muted: #9aa3ad;
		--accent: #7cbcdc;
		--border: #2d333b;
		--surface: #161a20;
		--callout: #13232c;
	}
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 1.125rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
	text-rendering: optimizeLegibility;
}

.page {
	max-width: 70ch;
	margin: 0 auto;
	padding: 24px 20px 64px;
}

/* Top navigation */
.site-nav {
	display: flex;
	gap: 16px;
	align-items: baseline;
	font-size: 0.9375rem;
	margin-bottom: 3rem;
}
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }
.site-nav .home { margin-right: auto; color: var(--text); }

/* Headings */
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 2.1em; margin: 0 0 12px; }
h2 { font-size: 1.4em; margin: 2.2em 0 0.6em; }
h3 { font-size: 1.15em; margin: 1.8em 0 0.4em; }
h2 a.anchor, h3 a.anchor {
	color: var(--muted);
	text-decoration: none;
	margin-left: 0.3em;
	opacity: 0;
	transition: opacity .15s;
}
h2:hover a.anchor, h3:hover a.anchor, a.anchor:focus-visible { opacity: 1; }

.meta { color: var(--muted); font-size: 0.9375rem; margin: 0 0 2rem; }

/* Text */
p, ul, ol, blockquote, figure, pre { margin: 0 0 1.2em; }
p, li, figcaption { text-wrap: pretty; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.25em 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }

/* TL;DR callout */
.tldr {
	background: var(--callout);
	border-radius: 10px;
	padding: 16px 20px;
	margin: 0 0 2em;
	font-size: 0.95em;
}
.tldr p:first-child { margin: 0 0 0.4em; font-weight: 700; }
.tldr ul { margin: 0; }

/* Quotes */
blockquote {
	margin-left: 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--border);
	color: var(--muted);
	font-style: italic;
}
blockquote footer { font-style: normal; font-size: 0.9em; margin-top: 0.4em; }

/* Code */
code, pre {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.85em;
}
:not(pre) > code {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 0.1em 0.35em;
}
pre {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px 16px;
	overflow-x: auto;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
pre code { font-size: inherit; }

/* Figures: the diagrams have a white background, kept as is in both themes */
figure { margin: 2em 0; }
figure a.zoom { display: block; cursor: zoom-in; }
figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: #fff;
}
figcaption {
	margin-top: 0.6em;
	color: var(--muted);
	font-size: 0.9em;
	font-style: italic;
	text-align: center;
}

/* Blog index */
.post-list { list-style: none; padding: 0; }
.post-list li { margin: 0 0 32px; }
.post-list h2 { margin: 0 0 4px; font-size: 1.3em; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); }
.post-list p { margin: 4px 0 0; }

.site-footer {
	margin-top: 64px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.9375rem;
}
.site-footer a { color: var(--muted); }

@media (max-width: 600px) {
	body { font-size: 1.0625rem; }
	h1 { font-size: 1.75em; }
	.site-nav { margin-bottom: 2rem; }
	/* Narrow columns: break long French words cleanly instead of leaving gaps */
	p, li, figcaption { hyphens: auto; -webkit-hyphens: auto; }
	/* Names in links (tools, authors) stay whole */
	a, code { hyphens: manual; -webkit-hyphens: manual; }
}

/* Leave some room above an anchor target */
[id] { scroll-margin-top: 1.5rem; }

/* Reviewer thanks at the end of an article */
.thanks { margin-top: 2.5rem; padding: 0.75rem 1rem; background: var(--callout); border-left: 3px solid var(--accent); border-radius: 4px; }
