/* ==========================================================================
   Thème Artben — feuille de styles principale
   Jetons de design : accent injecté depuis les réglages (--accent)
   ========================================================================== */

:root {
	--accent: #0057FF; /* remplacé par les réglages du thème */
	--bg: #f6f7f9;
	--surface: #ffffff;
	--text: #101418;
	--muted: #5f6b7a;
	--border: #e4e8ee;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 28px -14px rgba(16, 24, 40, 0.16);
	--radius: 16px;
	--radius-lg: 22px;
	--header-h: 68px;
	--container: 1200px;
	--narrow: 760px;
	--font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
	--bg: #0b0e13;
	--surface: #131820;
	--text: #e8edf4;
	--muted: #8b97a7;
	--border: #222a35;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 30px -14px rgba(0, 0, 0, 0.6);
	color-scheme: dark;
}

/* Base
   ========================================================================== */

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.65;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
}

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

.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.screen-reader-text:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	background: var(--surface);
	padding: 0.6rem 1rem;
	border-radius: 8px;
	box-shadow: var(--shadow);
}

/* En-tête
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 84%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.admin-bar .site-header {
	top: 32px;
}

.site-header.scrolled {
	border-color: var(--border);
}

.header-inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 1.25rem;
	height: var(--header-h);
	display: flex;
	align-items: center;
	gap: 1.75rem;
}

.site-branding {
	display: flex;
	align-items: center;
}

.site-logo {
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.035em;
	color: var(--text);
	text-decoration: none;
}

.site-logo .dot,
.intro-title .dot {
	color: var(--accent);
}

.custom-logo {
	max-height: 44px;
	width: auto;
	display: block;
}

.main-nav {
	margin-left: auto;
}

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

.main-nav a {
	display: block;
	padding: 0.5rem 0.8rem;
	border-radius: 10px;
	color: var(--muted);
	font-weight: 500;
	font-size: 0.95rem;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
	color: var(--text);
	background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Sous-menus (survol, bureau) */
.main-nav li {
	position: relative;
}

.main-nav ul ul {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 0.35rem;
	box-shadow: var(--shadow);
	display: none;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.main-nav li:hover > ul,
.main-nav li:focus-within > ul {
	display: flex;
}

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

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
	color: var(--text);
	background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.theme-toggle .icon-sun {
	display: none;
}

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

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

.burger {
	display: none;
}

/* Recherche repliable sous l'en-tête */
.header-search {
	display: none;
	border-top: 1px solid var(--border);
	background: var(--surface);
	padding: 0.9rem 1.25rem;
}

body.search-open .header-search {
	display: block;
}

.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: var(--container);
	margin: 0 auto;
}

.search-field {
	flex: 1;
	padding: 0.65rem 1rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
}

.search-submit {
	padding: 0.65rem 1.1rem;
	border: 0;
	border-radius: 12px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.search-submit:hover {
	filter: brightness(1.08);
}

/* Intro de l'accueil
   ========================================================================== */

.site-intro {
	padding: 3.25rem 0 0.5rem;
	max-width: 780px;
}

.intro-title {
	margin: 0;
	font-size: clamp(2.1rem, 5vw, 3.2rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1.05;
}

.intro-text {
	margin: 0.9rem 0 0;
	color: var(--muted);
	font-size: clamp(1.05rem, 1.8vw, 1.2rem);
	line-height: 1.6;
}

/* Filtres de catégories (pastilles)
   ========================================================================== */

.cat-pills {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	margin: 1.9rem 0;
	overflow-x: auto;
	padding-bottom: 0.25rem;
	scrollbar-width: none;
}

.cat-pills::-webkit-scrollbar {
	display: none;
}

.pill {
	flex: 0 0 auto;
	padding: 0.45rem 1rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.pill:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.pill.is-active {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* Article mis en avant
   ========================================================================== */

.featured-post {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: 0;
	align-items: stretch;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin: 0 0 1.75rem;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-post:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}

.featured-body {
	padding: 2.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
	justify-content: center;
}

.featured-title {
	margin: 0;
	font-size: clamp(1.4rem, 2.6vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.2;
}

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

.featured-title a:hover {
	color: var(--accent);
}

.featured-excerpt {
	margin: 0;
	color: var(--muted);
	line-height: 1.65;
}

.featured-media {
	display: block;
	min-height: 280px;
}

.featured-media img,
.featured-media .media-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Grille d'articles
   ========================================================================== */

.post-grid {
	display: grid;
	gap: 1.6rem;
	grid-template-columns: repeat(3, 1fr);
	margin: 0 0 2.5rem;
}

.post-grid.cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow);
}

.card-media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

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

.media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 180px;
	background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #101828));
}

.card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.2rem 1.3rem 1.3rem;
}

.card-title {
	margin: 0;
	font-size: 1.13rem;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.35;
}

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

.card-title a:hover {
	color: var(--accent);
}

.card-excerpt {
	margin: 0;
	color: var(--muted);
	font-size: 0.94rem;
	line-height: 1.6;
}

/* Badge et méta
   ========================================================================== */

.badge {
	align-self: flex-start;
	padding: 0.28rem 0.65rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	color: var(--accent);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}

.badge:hover {
	background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.post-meta {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.9rem;
	color: var(--muted);
	font-size: 0.85rem;
}

.post-meta span::before {
	content: "·";
	margin-right: 0.9rem;
}

/* En-têtes d'archives et recherche
   ========================================================================== */

.archive-header {
	padding: 3rem 0 0.25rem;
	max-width: 780px;
}

.archive-title {
	margin: 0;
	font-size: clamp(1.7rem, 4vw, 2.5rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.1;
}

.archive-description {
	margin-top: 0.7rem;
	color: var(--muted);
}

/* Article seul et pages
   ========================================================================== */

.single-article {
	padding-top: 2.75rem;
}

.entry-header {
	max-width: var(--narrow);
	margin: 0 auto 1.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	text-align: left;
}

.entry-title {
	margin: 0;
	font-size: clamp(1.8rem, 4.2vw, 2.7rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.12;
}

.entry-header .post-meta {
	margin-top: 0;
}

.entry-thumbnail {
	margin: 0 0 2.25rem;
}

.entry-thumbnail img {
	width: 100%;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
}

.entry-content {
	max-width: var(--narrow);
	margin: 0 auto;
	font-size: 1.08rem;
	line-height: 1.78;
}

.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.35rem;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 2.4rem;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.entry-content h2 {
	font-size: 1.65rem;
}

.entry-content h3 {
	font-size: 1.3rem;
}

.entry-content a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.entry-content img {
	border-radius: 12px;
}

.entry-content figcaption,
.wp-caption-text {
	color: var(--muted);
	font-size: 0.88rem;
	text-align: center;
	margin-top: 0.5rem;
}

.entry-content blockquote {
	margin: 1.8rem 0;
	padding: 0.3rem 0 0.3rem 1.4rem;
	border-left: 3px solid var(--accent);
	color: var(--muted);
	font-style: italic;
}

.entry-content code {
	font-family: var(--mono);
	font-size: 0.9em;
	background: color-mix(in srgb, var(--accent) 9%, transparent);
	padding: 0.15em 0.4em;
	border-radius: 6px;
}

.entry-content pre {
	background: #0d1117;
	color: #e6edf3;
	padding: 1.2rem 1.4rem;
	border-radius: 14px;
	overflow-x: auto;
	font-size: 0.92rem;
	line-height: 1.6;
}

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

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

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

.entry-content th {
	background: color-mix(in srgb, var(--accent) 7%, transparent);
}

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

.entry-content .wp-block-embed iframe {
	max-width: 100%;
}

.alignwide {
	max-width: 980px;
	margin-left: 50%;
	transform: translateX(-50%);
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.page-links {
	color: var(--muted);
}

.entry-footer {
	max-width: var(--narrow);
	margin: 2rem auto 0;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tag-list a {
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 0.83rem;
	text-decoration: none;
}

.tag-list a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* Navigation entre articles
   ========================================================================== */

.post-navigation {
	max-width: var(--narrow);
	margin: 2.75rem auto 0;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 1rem 1.2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.post-navigation a:hover {
	border-color: var(--accent);
}

.post-navigation .nav-next {
	text-align: right;
}

.nav-label {
	color: var(--muted);
	font-size: 0.82rem;
	font-weight: 600;
}

.nav-title {
	color: var(--text);
	font-weight: 700;
	line-height: 1.35;
}

/* Pagination
   ========================================================================== */

.pagination {
	margin: 0 0 3rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 0.95rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none;
}

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

.pagination .page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* Commentaires
   ========================================================================== */

.comments-area {
	max-width: var(--narrow);
	margin: 3.25rem auto 0;
	padding-top: 2.25rem;
	border-top: 1px solid var(--border);
}

.comments-title,
.comment-reply-title {
	font-size: 1.35rem;
	letter-spacing: -0.02em;
}

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

.comment-list .children {
	list-style: none;
	margin: 1rem 0 0;
	padding-left: 1.5rem;
	border-left: 2px solid var(--border);
}

.comment-body {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.1rem 1.25rem;
	margin-bottom: 1rem;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 700;
}

.comment-author .avatar {
	border-radius: 50%;
}

.comment-metadata {
	font-size: 0.82rem;
}

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

.reply a {
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
}

.comment-form label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
	font-size: 0.92rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.7rem 0.95rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	border-color: transparent;
}

.form-submit .submit,
.btn {
	display: inline-block;
	padding: 0.7rem 1.5rem;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.form-submit .submit:hover,
.btn:hover {
	filter: brightness(1.08);
}

/* 404 et états vides
   ========================================================================== */

.error-404,
.no-results {
	max-width: 640px;
	margin: 0 auto;
	padding: 4.5rem 0;
	text-align: center;
}

.code-404 {
	margin: 0;
	font-size: clamp(4rem, 12vw, 7rem);
	font-weight: 800;
	letter-spacing: -0.05em;
	line-height: 1;
	color: var(--accent);
}

.error-404 h1 {
	margin: 0.5rem 0 0.75rem;
	letter-spacing: -0.03em;
}

.error-404 p,
.no-results p {
	color: var(--muted);
}

.error-404 .search-form,
.no-results .search-form {
	margin: 1.5rem 0;
}

/* Pied de page
   ========================================================================== */

.site-footer {
	margin-top: 4rem;
	border-top: 1px solid var(--border);
	background: var(--surface);
}

.footer-inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 2.4rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.footer-text {
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.footer-nav .footer-menu,
.footer-nav ul {
	list-style: none;
	margin: 0.6rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.2rem;
}

.footer-nav a {
	color: var(--muted);
	font-size: 0.9rem;
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--accent);
}

.socials {
	display: flex;
	gap: 0.55rem;
}

.socials a {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--muted);
	transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.socials a:hover {
	color: var(--accent);
	border-color: var(--accent);
	transform: translateY(-2px);
}

/* Responsive
   ========================================================================== */

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

@media (max-width: 860px) {
	.burger {
		display: inline-flex;
	}

	.main-nav {
		display: none;
		position: fixed;
		top: var(--header-h);
		left: 0;
		right: 0;
		z-index: 49;
		margin: 0;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		padding: 0.75rem 1.25rem 1.25rem;
		box-shadow: var(--shadow);
	}

	.admin-bar .main-nav {
		top: calc(var(--header-h) + 32px);
	}

	body.nav-open .main-nav {
		display: block;
	}

	.main-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.main-nav a {
		padding: 0.7rem 0.6rem;
		font-size: 1.02rem;
	}

	.main-nav ul ul {
		position: static;
		display: flex;
		border: 0;
		box-shadow: none;
		background: transparent;
		padding: 0 0 0 1rem;
	}

	.featured-post {
		grid-template-columns: 1fr;
	}

	.featured-media {
		order: -1;
		min-height: 0;
		aspect-ratio: 16 / 9;
	}

	.featured-body {
		padding: 1.5rem;
	}
}

@media (max-width: 620px) {
	.post-grid,
	.post-grid.cols-2 {
		grid-template-columns: 1fr;
	}

	.site-intro {
		padding-top: 2.25rem;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		text-align: left;
	}

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

/* Accessibilité : mouvement réduit
   ========================================================================== */

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

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