/*
Theme Name: Bilan
Theme URI: https://example.com/bilan
Author: Bilan
Description: Thème professionnel pour publier des articles de fiscalité, audit, finance et comptabilité, avec partage de fichiers Excel et de maquettes téléchargeables.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bilan
Tags: blog, news, two-columns, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--navy: #0b1f3a;
	--navy-2: #132c4f;
	--ink: #1b2533;
	--muted: #5d6a7a;
	--bg: #f7f6f2;
	--card: #ffffff;
	--line: #e5e2da;
	--accent: #0f766e;
	--heading: #0b1f3a;
	--surface-2: #faf9f6;
	--quote: #fbf8f1;
	--code: #f1efe9;
	--header-bg: rgba(255, 255, 255, .92);
	--gold: #b8893b;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(11, 31, 58, .04), 0 8px 24px rgba(11, 31, 58, .06);
	--shadow-hover: 0 2px 4px rgba(11, 31, 58, .06), 0 16px 40px rgba(11, 31, 58, .12);
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--wrap: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 17px/1.7 var(--sans);
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--heading); }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	color: var(--heading);
	line-height: 1.22;
	font-weight: 650;
	letter-spacing: -.01em;
	margin: 0 0 .6em;
}
p { margin: 0 0 1.2em; }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 1000; top: 10px; left: 10px;
	background: var(--card); padding: 10px 16px; border-radius: 8px;
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- Buttons & badges ---------- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	padding: .8em 1.35em; border-radius: 10px; border: 1px solid transparent;
	font: 600 15px/1 var(--sans); cursor: pointer; transition: all .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--heading); background: var(--card); }
.btn-ghost:hover { border-color: var(--heading); color: var(--heading); }
.badge {
	--c: var(--accent);
	display: inline-flex; align-items: center; gap: .4em;
	padding: .32em .75em; border-radius: 999px;
	font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
	color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card));
}
a.badge:hover { color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.eyebrow {
	display: inline-block; font: 600 12.5px/1 var(--sans); letter-spacing: .14em;
	text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}

/* ---------- Header ---------- */
.topbar { background: var(--navy); color: #c9d3e0; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 16px; }
.topbar a { color: #c9d3e0; }
.topbar a:hover { color: #fff; }
.social { display: flex; gap: 14px; align-items: center; }
.social svg { width: 16px; height: 16px; }

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--header-bg);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand-mark {
	width: 40px; height: 40px; border-radius: 10px; background: var(--navy);
	display: grid; place-items: center; color: #fff; font: 700 20px/1 var(--serif);
	box-shadow: inset 0 -4px 0 var(--gold);
}
.brand-name { font: 700 22px/1.1 var(--serif); letter-spacing: -.01em; }
.brand-tag { display: block; font: 500 12px/1.2 var(--sans); color: var(--muted); }
.custom-logo { max-height: 48px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
	display: block; padding: 10px 14px; border-radius: 8px;
	color: var(--ink); font-weight: 500; font-size: 15px;
}
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a,
.main-nav .current-category-ancestor > a, .main-nav .current-post-ancestor > a { color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.main-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px; display: block;
	background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
	box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
	width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
	border: 1px solid var(--line); background: var(--card); color: var(--heading); cursor: pointer;
}
.icon-btn:hover { border-color: var(--heading); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

/* Search overlay */
.search-overlay {
	position: fixed; inset: 0; z-index: 100; background: rgba(11, 31, 58, .55);
	backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.search-overlay.is-open { display: flex; }
.search-overlay .search-form { width: min(680px, 92vw); }
.search-form { display: flex; background: var(--card); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.search-form input[type=search] {
	flex: 1; border: 0; padding: 18px 20px; font: 400 17px var(--sans); color: var(--ink); background: transparent; min-width: 0;
}
.search-form input[type=search]:focus { outline: none; }
.search-form button { border: 0; background: var(--accent); color: #fff; padding: 0 22px; cursor: pointer; font: 600 15px var(--sans); }
.search-form button:hover { background: var(--navy); }

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden; color: #dfe6ef;
	background:
		radial-gradient(900px 400px at 85% -10%, rgba(184, 137, 59, .22), transparent 60%),
		radial-gradient(700px 400px at 0% 110%, rgba(15, 118, 110, .35), transparent 60%),
		var(--navy);
	padding: 92px 0 104px;
}
.hero::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
	background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
	background-size: 44px 44px;
	mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(34px, 4.6vw, 56px); margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: #e9c27d; }
.hero p.lead { font-size: 19px; color: #c3cfdd; max-width: 560px; margin-bottom: 30px; }
.hero .search-form { max-width: 560px; border: 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 14px; }
.hero-tags span { color: #9fb0c4; }
.hero-tags a { color: #fff; border: 1px solid rgba(255, 255, 255, .2); padding: 4px 12px; border-radius: 999px; }
.hero-tags a:hover { background: rgba(255, 255, 255, .1); }
.hero-panel {
	background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 18px; padding: 26px; backdrop-filter: blur(6px);
}
.hero-panel h3 { color: #fff; font-size: 18px; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 14px; }
.stat b { display: block; font: 700 26px/1 var(--serif); color: #fff; }
.stat small { color: #9fb0c4; font-size: 12.5px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { border-top: 1px solid rgba(255, 255, 255, .1); }
.mini-list a { display: flex; gap: 10px; padding: 12px 0; color: #e7edf5; font-size: 15px; line-height: 1.45; }
.mini-list a:hover { color: #e9c27d; }
.mini-list .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--c, var(--gold)); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); margin: 0; }
.section-head p { color: var(--muted); margin: 8px 0 0; max-width: 560px; }
.link-arrow { font-weight: 600; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s; }
.link-arrow:hover svg { transform: translateX(3px); }

/* Domains */
.domains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: -56px; position: relative; z-index: 2; }
.domain {
	--c: var(--accent);
	display: flex; gap: 16px; align-items: flex-start; padding: 22px;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow); color: var(--ink); transition: .2s;
}
.domain:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--ink); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.domain-icon {
	flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
	color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--card));
}
.domain-icon svg { width: 24px; height: 24px; }
.domain h3 { font-size: 19px; margin: 2px 0 4px; }
.domain p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.domain .count { font: 600 12px var(--sans); color: var(--c); margin-top: 8px; display: block; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 26px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
	display: flex; flex-direction: column; background: var(--card);
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	transition: .22s; box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-media { position: relative; aspect-ratio: 16/10; background: var(--navy); overflow: hidden; display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-placeholder {
	--c: var(--accent);
	width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .9);
	background:
		radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--c) 70%, transparent), transparent 60%),
		linear-gradient(135deg, var(--navy), var(--navy-2));
}
.card-placeholder svg { width: 54px; height: 54px; opacity: .9; }
.card-file {
	position: absolute; top: 12px; right: 12px; background: #fff; color: #0b1f3a;
	font: 700 11px/1 var(--sans); letter-spacing: .06em; padding: 7px 10px; border-radius: 8px;
	display: flex; gap: 6px; align-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.card-file svg { width: 13px; height: 13px; color: var(--accent); }
.card-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body .badge { align-self: flex-start; margin-bottom: 12px; }
.card-title { font-size: 21px; margin: 0 0 10px; }
.card-title a { color: var(--heading); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13.5px; align-items: center; }
.meta span { display: inline-flex; gap: 6px; align-items: center; }
.meta svg { width: 15px; height: 15px; opacity: .75; }
.card .meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* Featured (first post on archives) */
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.card-featured .card-media { aspect-ratio: auto; min-height: 340px; }
.card-featured .card-body { padding: 40px; justify-content: center; }
.card-featured .card-title { font-size: clamp(26px, 2.6vw, 34px); }

/* Resource cards */
.resource {
	display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--card);
	border: 1px solid var(--line); border-radius: var(--radius); transition: .2s;
}
.resource:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.file-icon {
	width: 52px; height: 60px; border-radius: 8px; position: relative; display: grid; place-items: end center;
	padding-bottom: 9px; color: #fff; font: 800 11px var(--sans); letter-spacing: .05em;
	background: var(--fc, #15803d); clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.file-icon::before { content: ""; position: absolute; top: 0; right: 0; width: 28%; height: 22%; background: rgba(255, 255, 255, .35); }
.resource h3 { font-size: 18px; margin: 0; }
.resource h3 a { color: var(--heading); }
.resource p { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.55; }
.resource .btn { margin-top: auto; align-self: flex-start; padding: .65em 1.1em; font-size: 14px; }

/* Newsletter / CTA */
.cta {
	display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
	background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #c9d3e0;
	border-radius: 22px; padding: 52px; position: relative; overflow: hidden;
}
.cta::before {
	content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%;
	background: radial-gradient(circle, rgba(184, 137, 59, .35), transparent 70%);
}
.cta h2 { color: #fff; font-size: clamp(26px, 3vw, 34px); }
.cta p { margin: 0; }
.cta-actions { position: relative; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.cta .btn-ghost:hover { border-color: #fff; }

/* ---------- Page headers ---------- */
.page-hero { background: var(--navy); color: #c3cfdd; padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero::after {
	content: ""; position: absolute; inset: 0; opacity: .06; pointer-events: none;
	background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
	background-size: 44px 44px;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px; }
.page-hero p, .page-hero .archive-description p { max-width: 680px; font-size: 18px; margin: 0; }
.breadcrumbs { font-size: 13.5px; margin-bottom: 18px; color: #9fb0c4; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { color: #c9d3e0; }
.breadcrumbs a:hover { color: #fff; }
.breadcrumbs .sep { opacity: .5; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cat-pills a { color: #fff; border: 1px solid rgba(255, 255, 255, .2); padding: 6px 14px; border-radius: 999px; font-size: 14px; }
.cat-pills a:hover, .cat-pills a.is-active { background: #fff; color: #0b1f3a; }

/* ---------- Single ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); z-index: 200; }
.article-hero { background: var(--navy); padding: 60px 0 120px; color: #c3cfdd; position: relative; overflow: hidden; }
.article-hero::after {
	content: ""; position: absolute; inset: 0; opacity: .06; pointer-events: none;
	background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
	background-size: 44px 44px;
}
.article-hero .wrap { position: relative; z-index: 1; max-width: 900px; }
.article-hero .badge { background: rgba(255, 255, 255, .1); color: #fff; }
.article-hero h1 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); margin: 16px 0 18px; }
.article-hero .lead { font-size: 19px; color: #c3cfdd; margin-bottom: 24px; }
.article-hero .meta { color: #9fb0c4; font-size: 14.5px; }
.author-chip { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; }
.author-chip img { width: 36px; height: 36px; border-radius: 50%; }

.article-cover { margin-top: -84px; position: relative; z-index: 2; }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow-hover); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding: 48px 0 80px; }
.article-layout.no-cover { margin-top: -72px; position: relative; z-index: 2; }
.article-main { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 52px 56px; box-shadow: var(--shadow); min-width: 0; }
.article-aside { display: flex; flex-direction: column; gap: 20px; }
.sticky { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-title { font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.toc li.lvl-3 a { padding-left: 28px; font-size: 13.5px; }
.toc li a:hover { color: var(--heading); }
.toc li a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* Entry content typography */
.entry-content { font-size: 18px; line-height: 1.8; }
.entry-content > * + * { margin-top: 0; }
.entry-content h2 { font-size: 30px; margin: 1.8em 0 .6em; scroll-margin-top: 100px; }
.entry-content h3 { font-size: 23px; margin: 1.6em 0 .5em; scroll-margin-top: 100px; }
.entry-content h4 { font-size: 19px; margin: 1.4em 0 .5em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--accent); }
.entry-content a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.entry-content blockquote {
	margin: 1.8em 0; padding: 22px 26px; border-left: 4px solid var(--gold); background: var(--quote);
	border-radius: 0 12px 12px 0; font: italic 400 20px/1.6 var(--serif); color: var(--heading);
}
.entry-content blockquote p:last-child { margin: 0; }
.entry-content blockquote cite { display: block; margin-top: 10px; font: 600 14px var(--sans); color: var(--muted); font-style: normal; }
.entry-content img, .entry-content figure img { border-radius: 12px; }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15.5px; display: block; overflow-x: auto; }
.entry-content table thead th { background: var(--navy); color: #fff; font-weight: 600; text-align: left; }
.entry-content th, .entry-content td { padding: 12px 14px; border: 1px solid var(--line); }
.entry-content tbody tr:nth-child(even) td { background: var(--surface-2); }
.entry-content .wp-block-table { margin: 1.6em 0; overflow-x: auto; }
.entry-content code { background: var(--code); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.entry-content pre { background: var(--navy); color: #e7edf5; padding: 20px; border-radius: 12px; overflow-x: auto; font-size: 14.5px; }
.entry-content pre code { background: none; padding: 0; }
.entry-content hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.entry-content .wp-block-button__link { background: var(--accent); border-radius: 10px; text-decoration: none; }
.entry-content .alignwide { margin-inline: -30px; }
.entry-content .alignfull { margin-inline: -56px; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .alignleft { float: left; margin: .3em 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.5em; }
/* Callouts: add class "note", "warning" or "tip" to a paragraph/group block */
.entry-content .note, .entry-content .tip, .entry-content .warning {
	--c: #1d4ed8; padding: 18px 22px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 25%, var(--card));
	background: color-mix(in srgb, var(--c) 6%, var(--card)); margin: 1.6em 0; font-size: 16.5px;
}
.entry-content .tip { --c: #15803d; }
.entry-content .warning { --c: #b45309; }

/* Download box */
.download-box {
	display: flex; gap: 18px; align-items: center; padding: 22px; margin: 0 0 32px;
	border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 14px;
	background: color-mix(in srgb, var(--accent) 4%, var(--card));
}
.download-box .info { flex: 1; min-width: 0; }
.download-box strong { display: block; color: var(--heading); font-size: 17px; line-height: 1.35; }
.download-box small { color: var(--muted); font-size: 13.5px; }
.article-aside .download-box { flex-direction: column; align-items: flex-start; margin: 0; }
.article-aside .download-box .btn { width: 100%; justify-content: center; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.tags a { font-size: 13.5px; color: var(--muted); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.tags a:hover { color: var(--accent); border-color: var(--accent); }

.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share a, .share button {
	width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
	border: 1px solid var(--line); color: var(--heading); background: var(--card); cursor: pointer;
}
.share a:hover, .share button:hover { background: var(--navy); color: #fff; border-color: var(--heading); }
.share svg { width: 17px; height: 17px; }
.share .copied { background: var(--accent); color: #fff; border-color: var(--accent); }

.author-box { display: flex; gap: 20px; margin-top: 44px; padding: 26px; border-radius: 14px; background: var(--bg); }
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.author-box h4 { margin: 0 0 4px; font-size: 18px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; color: var(--heading); font-family: var(--serif); font-weight: 600; line-height: 1.4; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; font: 600 12px var(--sans); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.post-nav .next { text-align: right; }

/* Comments */
.comments-area { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.comment-list { list-style: none; padding: 0; margin: 0 0 30px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.comment-author img { border-radius: 50%; float: left; margin-right: 12px; }
.comment-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-meta a { color: var(--muted); }
.comment-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--card);
}
.comment-form .submit { background: var(--accent); color: #fff; border: 0; padding: 12px 22px; border-radius: 10px; font: 600 15px var(--sans); cursor: pointer; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
	min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 14px; border-radius: 10px;
	border: 1px solid var(--line); background: var(--card); color: var(--heading); font-weight: 600;
}
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--navy); color: #fff; border-color: var(--heading); }

/* ---------- Page ---------- */
.page-content { max-width: 860px; margin: -48px auto 80px; position: relative; z-index: 2; }

/* Empty / 404 */
.empty { text-align: center; padding: 60px 20px; max-width: 620px; margin: 0 auto; }
.empty .big { font: 700 110px/1 var(--serif); color: var(--heading); opacity: .12; margin-bottom: 10px; }
.empty .search-form { margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: #081629; color: #9fb0c4; padding: 72px 0 0; margin-top: 0; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 56px; }
.site-footer h4 { color: #fff; font: 700 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #c9d3e0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; margin-bottom: 18px; }
.site-footer .brand-tag { color: #9fb0c4; }
.site-footer .social { margin-top: 20px; gap: 10px; }
.site-footer .social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .12); }
.site-footer .social a:hover { background: rgba(255, 255, 255, .08); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 22px 0; font-size: 13.5px; }
.footer-bottom .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.widget { margin-bottom: 28px; }
.widget-title { color: #fff; }

.back-top {
	position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 12px;
	background: var(--navy); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; box-shadow: var(--shadow-hover); z-index: 40;
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top svg { width: 20px; height: 20px; }



/* ---------- Bibliothèque ---------- */
.lib-toolbar {
	display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 14px; margin: -38px 0 30px; position: relative; z-index: 2; box-shadow: var(--shadow);
}
.lib-search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.lib-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.lib-search input { flex: 1; border: 0; background: transparent; padding: 12px 0; font: 400 15px var(--sans); color: var(--ink); min-width: 0; }
.lib-search input:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	--c: var(--accent);
	border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
	padding: 9px 14px; border-radius: 999px; font: 600 14px/1 var(--sans); display: inline-flex; gap: 8px; align-items: center;
}
.chip .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip:hover { border-color: var(--c); }
.chip.is-active { background: var(--c); border-color: var(--c); color: #fff; }
.chip.is-active .n { color: rgba(255, 255, 255, .8); }
.lib-select {
	padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
	color: var(--ink); font: 500 14px var(--sans);
}
.lib-count { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.lib-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.lib-item .head { display: flex; gap: 16px; align-items: flex-start; }
.lib-item .head .badge { margin-bottom: 8px; }
.lib-item .facts { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.lib-item .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.lib-item .actions .btn { margin: 0; }
.lib-item[hidden] { display: none; }
@media (max-width: 1080px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .lib-grid { grid-template-columns: 1fr; } .lib-toolbar { margin-top: -28px; } }

/* ---------- Mode sombre ---------- */
html[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0a1322;
	--card: #101c30;
	--line: #22324b;
	--ink: #d5dce7;
	--muted: #94a3b8;
	--heading: #eef2f8;
	--surface-2: #0d182a;
	--quote: #15233a;
	--code: #1a2940;
	--header-bg: rgba(10, 19, 34, .88);
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
	--shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .hero,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .article-hero { background-color: #071020; }
html[data-theme="dark"] .hero { background:
	radial-gradient(900px 400px at 85% -10%, rgba(184, 137, 59, .18), transparent 60%),
	radial-gradient(700px 400px at 0% 110%, rgba(15, 118, 110, .28), transparent 60%), #071020; }
html[data-theme="dark"] .topbar { background: #050c18; }
html[data-theme="dark"] .site-footer { background: #050c18; }
html[data-theme="dark"] .cta { background: linear-gradient(135deg, #132c4f, #0d2140); border: 1px solid var(--line); }
html[data-theme="dark"] .brand-mark { background: #1a3560; }
html[data-theme="dark"] .entry-content thead th { background: #1a3560; }
html[data-theme="dark"] .entry-content pre { background: #050c18; }
html[data-theme="dark"] .btn-primary:hover { background: #1a3560; }
html[data-theme="dark"] .pagination .page-numbers.current,
html[data-theme="dark"] .pagination .page-numbers:hover { background: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .share a:hover, html[data-theme="dark"] .share button:hover { background: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .back-top { background: var(--accent); }
html[data-theme="dark"] .card-placeholder { background:
	radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--c) 60%, transparent), transparent 60%),
	linear-gradient(135deg, #0b1a30, #132c4f); }
html[data-theme="dark"] img { filter: brightness(.92); }
.theme-toggle span { display: grid; }
.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: grid; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
	.hero .wrap { grid-template-columns: 1fr; }
	.hero-panel { display: none; }
	.article-layout { grid-template-columns: 1fr; }
	.article-aside .sticky { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.domains { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
	.menu-toggle { display: grid; }
	.main-nav {
		position: fixed; inset: 74px 0 auto 0; background: var(--card); border-bottom: 1px solid var(--line);
		padding: 12px 20px 20px; display: none; max-height: calc(100vh - 74px); overflow-y: auto; box-shadow: var(--shadow-hover);
	}
	.admin-bar .main-nav { top: 120px; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; }
	.header-actions { margin-left: auto; }
	.card-featured { grid-template-columns: 1fr; }
	.card-featured .card-media { min-height: 0; aspect-ratio: 16/10; }
	.card-featured .card-body { padding: 26px; }
	.cta { grid-template-columns: 1fr; padding: 36px 28px; }
	.cta-actions { justify-content: flex-start; }
	.article-main { padding: 32px 24px; }
	.entry-content { font-size: 17px; }
	.entry-content .alignfull { margin-inline: -24px; }
	.entry-content .alignwide { margin-inline: 0; }
	.topbar .tagline { display: none; }
}
@media (max-width: 600px) {
	body { font-size: 16px; }
	.grid, .grid-4, .domains, .footer-grid, .post-nav { grid-template-columns: 1fr; }
	.hero { padding: 64px 0 90px; }
	.section { padding: 56px 0; }
	.section-head { flex-direction: column; align-items: flex-start; }
	.brand-tag { display: none; }
	.download-box { flex-direction: column; align-items: flex-start; }
	.admin-bar .site-header { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
	.topbar, .site-header, .site-footer, .article-aside, .share, .post-nav, .comments-area, .back-top, .progress { display: none !important; }
	.article-hero { background: none; color: #000; padding: 0; }
	.article-hero h1 { color: #000; }
	.article-main { border: 0; box-shadow: none; padding: 0; }
	.article-layout { display: block; }
}
