/*
Theme Name: Maker & AI
Theme URI: https://example.com/maker-ai
Author: Jessy — Built by a Maker
Author URI: https://example.com
Description: Thème WordPress sur mesure pour un blog technique : développement, maker culture, IA et hacking éthique. Design sombre par défaut (sélecteur clair/sombre), typographie monospace pour les titres et le code, cartes d'articles avec badge de catégorie, temps de lecture, sommaire automatique, blocs Gutenberg natifs et zéro dépendance externe.
Version: 1.0.0
Requires at least: 6.2
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: maker-ai
Tags: blog, dark-mode, custom-menu, featured-images, block-styles, wide-blocks, translation-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
	/* Fonts — lecture locale, aucun appel réseau : les polices sont utilisées
	   si elles sont installées, sinon on retombe sur les piles système. */
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	/* Couleurs de marque (stables dans les deux thèmes) */
	--blue-600: #2563eb;
	--blue-500: #3b82f6;
	--cyan-500: #06b6d4;
	--navy-950: #0b0f19;
	--navy-900: #0f172a;

	/* Thème sombre (par défaut) */
	--bg: #0b0f19;
	--bg-glow: rgba(37, 99, 235, 0.18);
	--header-bg: rgba(11, 15, 25, 0.82);
	--surface: #0f172a;
	--surface-2: #131f38;
	--surface-3: #182541;
	--text: #e7eef9;
	--text-soft: #c7d5e8;
	--muted: #8fa3bf;
	--border: #1e2a44;
	--border-strong: #2a3a5c;
	--primary: var(--blue-500);
	--primary-strong: var(--blue-600);
	--primary-contrast: #ffffff;
	--accent: var(--cyan-500);
	--accent-soft: rgba(6, 182, 212, 0.12);
	--code-bg: #080d18;
	--code-border: #1b2942;
	--ring: rgba(59, 130, 246, 0.45);
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 18px 40px -22px rgba(0, 0, 0, 0.9);

	/* Rythme & largeurs */
	--content: 720px;
	--wide: 1120px;
	--wrap: 1200px;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--header-h: 72px;
	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;
	--speed: 180ms;
}

/* Thème clair, activé par le sélecteur (attribut posé dès le <head>) */
:root[data-theme="light"] {
	--bg: #f8fafc;
	--bg-glow: rgba(37, 99, 235, 0.1);
	--header-bg: rgba(248, 250, 252, 0.86);
	--surface: #ffffff;
	--surface-2: #f1f5f9;
	--surface-3: #e7edf6;
	--text: #0f172a;
	--text-soft: #1e293b;
	--muted: #55657f;
	--border: #e2e8f0;
	--border-strong: #cbd5e1;
	--primary: var(--blue-600);
	--primary-strong: #1d4ed8;
	--accent: #0891b2;
	--accent-soft: rgba(8, 145, 178, 0.1);
	--code-bg: #0f172a; /* le code reste sur fond sombre pour la lisibilité */
	--code-border: #1e293b;
	--ring: rgba(37, 99, 235, 0.35);
	--shadow-md: 0 18px 40px -26px rgba(15, 23, 42, 0.35);
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	/* halo subtil : identité "tech" sans nuire à la lisibilité */
	background-image:
		radial-gradient(60rem 32rem at 80% -12%, var(--bg-glow), transparent 70%),
		radial-gradient(40rem 24rem at 0% 0%, rgba(6, 182, 212, 0.08), transparent 65%);
	background-repeat: no-repeat;
	background-attachment: fixed;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
}

img {
	border-radius: var(--radius-sm);
}

a {
	color: var(--primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color var(--speed) ease;
}

a:hover,
a:focus-visible {
	color: var(--accent);
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 2.5rem 0;
}

::selection {
	background: var(--accent);
	color: #04121a;
}

/* ==========================================================================
   3. Titres & texte
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-mono);
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: -0.02em;
	color: var(--text);
	margin: 0 0 0.6em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
	font-size: clamp(1.45rem, 3.2vw, 1.9rem);
}

h3 {
	font-size: clamp(1.2rem, 2.4vw, 1.4rem);
}

p,
ul,
ol,
dl,
table,
figure,
pre,
blockquote {
	margin: 0 0 1.35rem;
}

strong {
	color: var(--text);
	font-weight: 650;
}

small {
	font-size: 0.875rem;
}

/* ==========================================================================
   4. Utilitaires & accessibilité
   ========================================================================== */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 12px;
	left: 12px;
	width: auto;
	height: auto;
	clip: auto;
	z-index: 999;
	padding: 0.75rem 1.1rem;
	background: var(--primary);
	color: #fff;
	border-radius: var(--radius-sm);
	font-family: var(--font-mono);
	font-size: 0.875rem;
	text-decoration: none;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ==========================================================================
   5. Boutons, badges, pastilles
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.15rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: transform var(--speed) ease, border-color var(--speed) ease,
		background-color var(--speed) ease, color var(--speed) ease;
}

.btn:hover,
.btn:focus-visible {
	transform: translateY(-2px);
	border-color: var(--accent);
	color: var(--text);
}

.btn--primary {
	background: linear-gradient(135deg, var(--primary-strong), var(--primary));
	border-color: transparent;
	color: var(--primary-contrast);
	box-shadow: 0 12px 26px -14px var(--blue-600);
}

.btn--primary:hover,
.btn--primary:focus-visible {
	color: #fff;
	box-shadow: 0 16px 30px -12px var(--blue-600);
}

.btn--ghost {
	background: transparent;
}

.btn--icon {
	padding: 0.55rem;
	border-radius: 10px;
	line-height: 0;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	border: 1px solid rgba(6, 182, 212, 0.35);
	background: var(--accent-soft);
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

.badge--cat {
	border-color: var(--border-strong);
	background: var(--surface-2);
	color: var(--text-soft);
}

a.badge--cat:hover,
a.badge--cat:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

.meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.55rem 0.9rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
}

.meta__sep::before {
	content: "//";
	margin-right: 0.9rem;
	color: var(--border-strong);
}

/* ==========================================================================
   6. Header
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid var(--border);
	background: var(--header-bg);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	min-height: var(--header-h);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--text);
	text-decoration: none;
	font-family: var(--font-mono);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.brand:hover,
.brand:focus-visible {
	color: var(--text);
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid rgba(6, 182, 212, 0.4);
	background: linear-gradient(150deg, rgba(37, 99, 235, 0.35), rgba(6, 182, 212, 0.12));
	color: var(--accent);
	font-size: 0.9rem;
	box-shadow: inset 0 0 18px rgba(6, 182, 212, 0.15);
}

.brand__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 1.02rem;
}

.brand__tag {
	align-self: flex-start;
	padding: 0.12rem 0.45rem;
	border: 1px solid rgba(6, 182, 212, 0.4);
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 0.55rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.5;
	text-transform: uppercase;
	white-space: nowrap;
}

.brand .custom-logo {
	max-height: 40px;
	width: auto;
	border-radius: 8px;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

/* Icônes soleil / lune selon le thème actif */
.theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
	display: block;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
	display: none;
}

/* Navigation principale */
.site-nav {
	margin-left: auto;
}

.site-nav ul {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav a {
	display: block;
	padding: 0.5rem 0.8rem;
	border-radius: 8px;
	color: var(--text-soft);
	font-family: var(--font-mono);
	font-size: 0.84rem;
	text-decoration: none;
	transition: color var(--speed) ease, background-color var(--speed) ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
	background: var(--surface-2);
	color: var(--accent);
}

.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a {
	background: var(--accent-soft);
	color: var(--accent);
}

.site-nav .sub-menu {
	position: absolute;
	top: calc(100% + 0.4rem);
	left: 0;
	display: none;
	flex-direction: column;
	align-items: stretch;
	min-width: 200px;
	padding: 0.4rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-md);
}

.site-nav li {
	position: relative;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu {
	display: flex;
}

.nav-toggle {
	display: none;
}

/* Panneau de recherche */
.search-panel {
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}

.search-panel[hidden] {
	display: none;
}

.search-panel__inner {
	padding-block: 1.1rem;
}

/* ==========================================================================
   7. Héro d'accueil
   ========================================================================== */

.hero {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--border);
	padding-block: clamp(3rem, 7vw, 5.5rem);
}

.hero::before {
	/* grille technique en fond */
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, var(--border) 1px, transparent 1px),
		linear-gradient(to bottom, var(--border) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(70% 60% at 30% 20%, #000 0%, transparent 100%);
	-webkit-mask-image: radial-gradient(70% 60% at 30% 20%, #000 0%, transparent 100%);
	opacity: 0.5;
	pointer-events: none;
}

.hero__grid {
	position: relative;
	display: grid;
	gap: clamp(2rem, 5vw, 3.5rem);
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	align-items: center;
}

.hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.1rem;
}

.status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.hero h1 {
	font-size: clamp(2.15rem, 5.4vw, 3.6rem);
	margin-bottom: 1rem;
}

.hero h1 .highlight {
	color: var(--accent);
}

.hero__lead {
	max-width: 34rem;
	font-size: clamp(1.02rem, 1.6vw, 1.15rem);
	color: var(--text-soft);
}

.hero__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.5rem 0 1.9rem;
	padding: 0;
	list-style: none;
}

.hero__chips li {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
	padding: 0.28rem 0.65rem;
	border: 1px dashed var(--border-strong);
	border-radius: 999px;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
}

/* Fenêtre "terminal" décorative */
.terminal {
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: linear-gradient(165deg, var(--surface-2), var(--surface));
	box-shadow: var(--shadow-md);
	overflow: hidden;
}

.terminal__bar {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.6rem 0.9rem;
	border-bottom: 1px solid var(--border);
	background: var(--surface-3);
}

.terminal__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--border-strong);
}

.terminal__dot:nth-child(1) {
	background: #f87171;
}

.terminal__dot:nth-child(2) {
	background: #fbbf24;
}

.terminal__dot:nth-child(3) {
	background: #34d399;
}

.terminal__title {
	margin-left: auto;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--muted);
}

.terminal__body {
	margin: 0;
	padding: 1.2rem 1.3rem;
	font-family: var(--font-mono);
	font-size: 0.82rem;
	line-height: 1.9;
	color: var(--text-soft);
	overflow-x: auto;
	background: none;
	border: 0;
	border-radius: 0;
}

.terminal__prompt {
	color: var(--accent);
}

.terminal__out {
	color: var(--muted);
}

.terminal__cursor {
	display: inline-block;
	width: 8px;
	height: 1.05em;
	vertical-align: text-bottom;
	background: var(--accent);
	animation: blink 1.2s steps(2, start) infinite;
}

@keyframes blink {
	to {
		visibility: hidden;
	}
}

/* ==========================================================================
   8. Sections & cartes d'articles
   ========================================================================== */

.section {
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.section__head h2,
.section__head .page-title {
	margin: 0;
	font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.section__head h2::before,
.page-title::before {
	content: "# ";
	color: var(--accent);
}

.section__head p {
	margin: 0;
	color: var(--muted);
	font-size: 0.875rem;
	font-family: var(--font-mono);
}

.post-grid {
	display: grid;
	gap: 1.4rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Carte article */
.card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	overflow: hidden;
	transition: transform var(--speed) ease, border-color var(--speed) ease,
		box-shadow var(--speed) ease;
}

.card:hover,
.card:focus-within {
	transform: translateY(-4px);
	border-color: rgba(6, 182, 212, 0.45);
	box-shadow: var(--shadow-md);
}

.card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background:
		linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(6, 182, 212, 0.12)),
		var(--surface-2);
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 400ms ease;
}

.card:hover .card__media img {
	transform: scale(1.04);
}

.card__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	font-family: var(--font-mono);
	font-size: 1.35rem;
	color: var(--accent);
	opacity: 0.75;
}

.card__body {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 1.15rem 1.25rem 1.3rem;
	flex: 1;
}

.card__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.card__title {
	margin: 0;
	font-size: 1.08rem;
	line-height: 1.35;
}

.card__title a {
	color: var(--text);
	text-decoration: none;
}

.card__title a:hover,
.card__title a:focus-visible {
	color: var(--accent);
}

.card__excerpt {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
	line-height: 1.65;
}

.card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 0.9rem;
	border-top: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--muted);
}

.card__arrow {
	color: var(--accent);
	transition: transform var(--speed) ease;
}

.card:hover .card__arrow {
	transform: translateX(4px);
}

/* ==========================================================================
   9. Article seul
   ========================================================================== */

.entry-header {
	padding-block: clamp(2.2rem, 5vw, 3.2rem) 1.5rem;
	border-bottom: 1px solid var(--border);
}

.entry-header__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.entry-title {
	font-size: clamp(1.9rem, 4.6vw, 3rem);
	margin-bottom: 1rem;
}

.entry-lead {
	color: var(--text-soft);
	font-size: 1.08rem;
	max-width: 46rem;
}

.entry-footer {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.entry-breadcrumb {
	margin-bottom: 0.9rem;
	font-size: 0.75rem;
	gap: 0.4rem;
}

.entry-breadcrumb a {
	color: var(--muted);
	text-decoration: none;
}

.entry-breadcrumb a:hover,
.entry-breadcrumb a:focus-visible {
	color: var(--accent);
}

.entry-header .meta {
	margin-top: 0.75rem;
}

/* Image à la une, pleine largeur du conteneur */
.entry-hero {
	margin: 0 0 0.5rem;
}

.entry-hero__img {
	width: 100%;
	max-height: 540px;
	object-fit: cover;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.entry-hero figcaption {
	margin-top: 0.6rem;
	color: var(--muted);
	font-size: 0.8rem;
	text-align: center;
}

.entry-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 264px;
	gap: clamp(2rem, 4vw, 3.25rem);
	align-items: start;
	padding-block: 2.5rem;
}

.entry-layout__main {
	min-width: 0;
}

.entry-layout__aside {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	max-height: calc(100vh - var(--header-h) - 3rem);
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Sommaire */
.toc {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	padding: 1rem 1.1rem;
}

.toc__title {
	margin: 0 0 0.7rem;
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
}

.toc__title::before {
	content: "> ";
}

.toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: toc;
	font-size: 0.84rem;
	line-height: 1.5;
}

.toc li {
	counter-increment: toc;
	margin-bottom: 0.35rem;
}

.toc li::before {
	content: counter(toc, decimal-leading-zero) " ";
	color: var(--border-strong);
	font-family: var(--font-mono);
	font-size: 0.7rem;
}

.toc li.toc__item--h3 {
	padding-left: 1rem;
	font-size: 0.8rem;
}

.toc a {
	color: var(--muted);
	text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible,
.toc a.is-active {
	color: var(--accent);
}

/* Contenu éditorial */
.entry-content {
	font-size: 1.05rem;
	color: var(--text-soft);
}

.entry-content > * {
	max-width: var(--content);
}

.entry-content > .alignwide {
	max-width: var(--wide);
}

.entry-content > .alignfull {
	max-width: none;
	width: 100%;
}

/* Dans la grille article + sommaire, un bloc « large » reste contenu dans sa
   colonne pour ne jamais chevaucher le sommaire flottant. */
.entry-layout__main .entry-content > .alignwide,
.entry-layout__main .entry-content > .alignfull {
	max-width: none;
	width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 2.4em;
	margin-bottom: 0.7em;
	scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.entry-content h2 {
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--border);
}

.entry-content h2::before {
	content: "## ";
	color: var(--accent);
	font-size: 0.8em;
	opacity: 0.8;
}

.entry-content h3::before {
	content: "### ";
	color: var(--accent);
	font-size: 0.75em;
	opacity: 0.7;
}

.entry-content a {
	text-decoration: underline;
	text-decoration-color: rgba(59, 130, 246, 0.45);
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.35rem;
}

.entry-content li {
	margin-bottom: 0.45rem;
}

.entry-content li::marker {
	color: var(--accent);
}

.entry-content img {
	height: auto;
	border: 1px solid var(--border);
}

.entry-content figure {
	margin-inline: 0;
}

.entry-content figcaption,
.wp-block-image figcaption,
.wp-block-table figcaption {
	color: var(--muted);
	font-size: 0.8rem;
	text-align: center;
	margin-top: 0.55rem;
}

.entry-content blockquote,
.wp-block-quote {
	margin-inline: 0;
	padding: 1rem 1.25rem;
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--accent-soft);
	color: var(--text);
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content blockquote cite {
	display: block;
	margin-top: 0.6rem;
	color: var(--muted);
	font-size: 0.82rem;
	font-style: normal;
	font-family: var(--font-mono);
}

.entry-content code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	padding: 0.12em 0.36em;
	border: 1px solid var(--border);
	border-radius: 5px;
	background: var(--surface-2);
	color: var(--accent);
	overflow-wrap: anywhere;
}

.entry-content kbd {
	font-family: var(--font-mono);
	font-size: 0.82em;
	padding: 0.1em 0.4em;
	border: 1px solid var(--border-strong);
	border-bottom-width: 2px;
	border-radius: 5px;
	background: var(--surface-2);
}

/* Blocs de code (Gutenberg + code classique) */
.entry-content pre,
.wp-block-code,
.terminal__body {
	tab-size: 2;
}

.entry-content pre {
	position: relative;
	max-width: var(--wide);
	padding: 1.15rem 1.25rem;
	border: 1px solid var(--code-border);
	border-radius: var(--radius);
	background: var(--code-bg);
	color: #e6edf7;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	line-height: 1.65;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.entry-content pre code {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
}

/* Enveloppe ajoutée en JS pour la barre "copier" */
.code-block {
	position: relative;
	max-width: var(--wide);
	margin-bottom: 1.35rem;
}

.code-block pre {
	margin: 0;
	padding-top: 2.4rem; /* place pour la barre d'outils */
}

.code-toolbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.45rem 0.65rem 0.45rem 1rem;
	border-bottom: 1px solid var(--code-border);
	background: rgba(255, 255, 255, 0.03);
	border-radius: var(--radius) var(--radius) 0 0;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: #8fa3bf;
	text-transform: uppercase;
	letter-spacing: 0.09em;
}

.code-copy {
	padding: 0.25rem 0.6rem;
	border: 1px solid #2a3a5c;
	border-radius: 6px;
	background: #101a2e;
	color: #c7d5e8;
	font-family: var(--font-mono);
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: border-color var(--speed) ease, color var(--speed) ease;
}

.code-copy:hover,
.code-copy:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

.code-copy[data-copied="true"] {
	border-color: #34d399;
	color: #34d399;
}

/* Tables Gutenberg */
.entry-content table,
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.entry-content th,
.entry-content td {
	padding: 0.65rem 0.8rem;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

.entry-content thead th {
	background: var(--surface-2);
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--accent);
}

.entry-content tbody tr:hover {
	background: var(--surface-2);
}

/* Tags */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.tags a {
	display: inline-block;
	padding: 0.22rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-decoration: none;
}

.tags a:hover,
.tags a:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

/* Bloc auteur */
.author-box {
	display: flex;
	gap: 1.1rem;
	padding: 1.4rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	margin-bottom: 2rem;
}

.author-box img {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 2px solid var(--accent);
	padding: 2px;
	object-fit: cover;
}

.author-box__name {
	margin: 0 0 0.25rem;
	font-size: 1rem;
	color: var(--text);
}

.author-box__role {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.author-box p {
	margin: 0.5rem 0 0.75rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.author-box__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
}

/* Navigation article précédent / suivant */
.post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 2.5rem;
}

.post-nav a {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	font-family: var(--font-mono);
	font-size: 0.88rem;
	line-height: 1.4;
	transition: border-color var(--speed) ease, transform var(--speed) ease;
}

.post-nav a:hover,
.post-nav a:focus-visible {
	border-color: var(--accent);
	transform: translateY(-2px);
	color: var(--text);
}

.post-nav span {
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.post-nav .is-next {
	text-align: right;
	align-items: flex-end;
}

/* ==========================================================================
   10. Commentaires
   ========================================================================== */

.comments-area {
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.comments-title,
.comment-reply-title {
	font-size: 1.1rem;
}

.comments-title span {
	color: var(--accent);
}

.comment-list {
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.comment-list ol.children {
	margin: 0;
	padding: 0 0 0 1.2rem;
	list-style: none;
	border-left: 1px dashed var(--border-strong);
}

.comment-body {
	padding: 1rem 0;
	border-bottom: 1px solid var(--border);
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
}

.comment-meta img {
	border-radius: 50%;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text);
	font-weight: 600;
}

.comment-metadata a {
	color: var(--muted);
	text-decoration: none;
}

.comment-content {
	font-size: 0.95rem;
}

.comment-content p:last-child {
	margin-bottom: 0;
}

.comment-content .says {
	display: none;
}

.reply {
	font-family: var(--font-mono);
	font-size: 0.75rem;
}

.comment-form {
	display: grid;
	gap: 0.9rem;
	max-width: 44rem;
}

.comment-form p {
	margin: 0;
}

.comment-form label {
	display: block;
	margin-bottom: 0.3rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
}

.comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.comment-form .comment-form-cookies-consent label {
	margin: 0;
	text-transform: none;
	letter-spacing: 0;
	font-family: var(--font-sans);
	font-size: 0.82rem;
	color: var(--muted);
}

.comment-form .submit {
	justify-self: start;
	cursor: pointer;
}

.comment-respond {
	margin-top: 2rem;
}

.comment-notes,
.logged-in-as {
	color: var(--muted);
	font-size: 0.82rem;
}

/* ==========================================================================
   11. Formulaires
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 0.95rem;
	transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}

input::placeholder,
textarea::placeholder {
	color: var(--muted);
	opacity: 0.75;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--accent);
	outline: none;
	box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

/* Formulaire de recherche */
.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 46rem;
}

.search-form .search-field {
	flex: 1;
	font-family: var(--font-mono);
}

.search-form .search-submit {
	white-space: nowrap;
}

/* ==========================================================================
   12. Pagination
   ========================================================================== */

.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 2.5rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding-inline: 0.6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text-soft);
	font-family: var(--font-mono);
	font-size: 0.82rem;
	text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

.pagination .current {
	background: var(--primary-strong);
	border-color: var(--primary-strong);
	color: #fff;
}

.pagination .dots {
	border-color: transparent;
	background: none;
	color: var(--muted);
}

/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer {
	margin-top: clamp(3rem, 6vw, 5rem);
	border-top: 1px solid var(--border);
	background: var(--surface);
	padding-block: 2.5rem 1.5rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
	gap: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--border);
}

.footer-brand p {
	max-width: 26rem;
	margin: 0.9rem 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.footer-col h2 {
	margin: 0 0 0.9rem;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.footer-col ul {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-mono);
	font-size: 0.82rem;
}

.footer-col a {
	color: var(--text-soft);
	text-decoration: none;
}

.footer-col a:hover,
.footer-col a:focus-visible {
	color: var(--accent);
}

.socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 1.1rem;
}

.social-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-soft);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-decoration: none;
	transition: border-color var(--speed) ease, color var(--speed) ease;
}

.social-link:hover,
.social-link:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

.social-link svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-top: 1.25rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--muted);
}

.footer-bottom nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-bottom a {
	color: var(--muted);
	text-decoration: none;
}

.footer-bottom a:hover,
.footer-bottom a:focus-visible {
	color: var(--accent);
}

.signature {
	color: var(--text-soft);
}

.signature .signature__cursor {
	display: inline-block;
	width: 7px;
	height: 0.95em;
	margin-left: 3px;
	vertical-align: text-bottom;
	background: var(--accent);
	animation: blink 1.2s steps(2, start) infinite;
}

/* ==========================================================================
   14. États : archives, 404, aucun résultat
   ========================================================================== */

.archive-header {
	padding-block: clamp(2rem, 4vw, 3rem) 1.5rem;
	border-bottom: 1px solid var(--border);
	margin-bottom: 2.5rem;
}

.archive-header__meta {
	margin: 0.75rem 0 0;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 0.82rem;
}

.archive-header__desc {
	max-width: 40rem;
	margin-top: 0.75rem;
	color: var(--text-soft);
}

.archive-header .search-form {
	margin-top: 1.25rem;
}

.empty-state {
	padding: clamp(2rem, 5vw, 3.5rem);
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	text-align: center;
}

.empty-state h2 {
	font-size: 1.25rem;
}

.empty-state p {
	color: var(--muted);
	max-width: 34rem;
	margin-inline: auto;
}

.empty-state .search-form {
	margin: 1.5rem auto 0;
	justify-content: center;
}

.error-code,
.empty-state p.error-code {
	font-family: var(--font-mono);
	font-size: clamp(3.5rem, 12vw, 7rem);
	line-height: 1;
	margin: 0 0 0.5rem;
	color: var(--accent);
	text-shadow: 0 0 40px rgba(6, 182, 212, 0.35);
}

/* ==========================================================================
   15. Responsive
   ========================================================================== */

@media (max-width: 1080px) {
	.entry-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.entry-layout__aside {
		position: static;
		order: -1;
	}

	.toc ol {
		columns: 2;
		column-gap: 2rem;
	}

	.hero__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.terminal {
		max-width: 32rem;
	}
}

@media (max-width: 980px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.site-nav {
		display: none;
		position: absolute;
		top: var(--header-h);
		left: 0;
		right: 0;
		margin: 0;
		padding: 0.75rem var(--gutter) 1.1rem;
		border-bottom: 1px solid var(--border);
		background: var(--surface);
		box-shadow: var(--shadow-md);
	}

	.site-nav.is-open {
		display: block;
	}

	.site-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0.2rem;
	}

	.site-nav a {
		padding: 0.7rem 0.6rem;
		font-size: 0.92rem;
	}

	.site-nav .sub-menu {
		position: static;
		display: flex;
		padding: 0 0 0 0.9rem;
		border: 0;
		box-shadow: none;
		background: none;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.footer-brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	body {
		font-size: 1rem;
	}

	.post-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-nav .is-next {
		text-align: left;
		align-items: flex-start;
	}

	.toc ol {
		columns: 1;
	}

	.author-box {
		flex-direction: column;
	}

	.comment-list ol.children {
		padding-left: 0.6rem;
	}

	.search-form {
		flex-direction: column;
	}

	.search-form .search-submit {
		width: 100%;
		justify-content: center;
	}

	.footer-bottom {
		flex-direction: column;
		align-items: flex-start;
	}

	.brand__tag {
		display: none;
	}

	.hero h1 {
		font-size: clamp(1.9rem, 8vw, 2.5rem);
	}
}

/* ==========================================================================
   16. Préférences système
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.card:hover,
	.card:focus-within,
	.btn:hover,
	.post-nav a:hover {
		transform: none;
	}
}

/* ==========================================================================
   17. Polices locales (optionnel)
   ========================================================================== */

/*
 * Par défaut le thème n'appelle aucun service externe et utilise les piles
 * système (voir --font-sans / --font-mono). Pour embarquer les polices :
 * déposer les fichiers .woff2 dans assets/fonts/, puis décommenter.
 *
 * @font-face {
 *   font-family: "Inter";
 *   src: url("assets/fonts/inter-var.woff2") format("woff2");
 *   font-weight: 100 900;
 *   font-style: normal;
 *   font-display: swap;
 * }
 *
 * @font-face {
 *   font-family: "JetBrains Mono";
 *   src: url("assets/fonts/jetbrains-mono-var.woff2") format("woff2");
 *   font-weight: 100 800;
 *   font-style: normal;
 *   font-display: swap;
 * }
 */

/* Impression : on garde le contenu, on retire le décor */
@media print {
	.site-header,
	.site-footer,
	.toc,
	.comments-area,
	.post-nav,
	.author-box,
	.search-panel {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}

	.entry-layout {
		display: block;
	}

	a {
		color: #000;
	}

	.entry-content pre {
		background: #f5f5f5;
		color: #000;
		border-color: #ccc;
	}
}
