/*
Theme Name: Les Imprimantes
Theme URI: https://les-imprimantes.com
Author: Les Imprimantes
Description: Thème blog high-tech rapide et optimisé SEO pour les-imprimantes.com : encadrés d'avis produits, emplacements publicitaires, sommaire automatique, fil d'Ariane, temps de lecture et mode sombre.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lesimprimantes
Tags: blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #f6f8fb;
	--surface: #ffffff;
	--surface-2: #eef2f7;
	--text: #0f172a;
	--muted: #5b6678;
	--border: #e2e8f0;
	--primary: #0b63ce;
	--primary-2: #06b6d4;
	--primary-ink: #ffffff;
	--accent: #f59e0b;
	--good: #16a34a;
	--bad: #dc2626;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .06);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--wrap: 1200px;
}
html[data-theme="dark"] {
	--bg: #0b1220;
	--surface: #111a2e;
	--surface-2: #17223a;
	--text: #e5ecf6;
	--muted: #94a3b8;
	--border: #22304a;
	--primary: #4f9cf9;
	--primary-2: #22d3ee;
	--primary-ink: #04101f;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.7 var(--font);
	transition: background .2s, color .2s;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .6em; scroll-margin-top: 90px; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.7rem); }
h3 { font-size: 1.2rem; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--surface-2); padding: 1rem; border-radius: 10px; overflow: auto; }
:not(pre) > code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; }
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95em; }
@media (max-width: 700px) { .entry-content table { display: block; overflow-x: auto; white-space: nowrap; } }
th, td { padding: .6em .8em; border: 1px solid var(--border); text-align: left; }
th { background: var(--surface-2); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto; clip: auto; background: var(--surface); padding: .5em 1em; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.site-branding { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.site-branding img { max-height: 44px; width: auto; }
.site-title { font-size: 1.25rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.site-title a { color: var(--text); }
.site-title a:hover { text-decoration: none; }
.site-title .dot { color: var(--primary); }
.logo-mark {
	width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
	background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.main-nav a { display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--text); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item > a { background: var(--surface-2); text-decoration: none; color: var(--primary); }
.main-nav li { position: relative; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: .4rem; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.icon-btn {
	width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
	background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-toggle { display: none; }
.header-search { display: none; padding: 0 0 1rem; }
.header-search.is-open { display: block; }
.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; padding: .7rem 1rem; border-radius: 10px; border: 1px solid var(--border);
	background: var(--surface); color: var(--text); font: inherit;
}
.btn, .search-form button, input[type="submit"] {
	white-space: nowrap; flex: none;
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	padding: .7rem 1.2rem; border-radius: 10px; border: 0; cursor: pointer;
	background: var(--primary); color: var(--primary-ink); font: 600 .95rem var(--font);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover, .search-form button:hover { filter: brightness(1.08); text-decoration: none; }
.btn-accent { background: var(--accent); color: #1f1300; }

@media (max-width: 900px) {
	.menu-toggle { display: inline-grid; }
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 16px 1rem; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding-left: 1rem; }
}

/* ---------- Ads ---------- */
.ad-slot { margin: 1.5rem auto; text-align: center; min-height: 1px; }
.ad-slot .ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.ad-header { margin: 1rem auto 0; }

/* ---------- Layout ---------- */
.site-main { padding: 2rem 0 3rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: 820px; margin: 0 auto; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Hero / featured ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; margin-bottom: 2.5rem; }
.hero .hero-side { display: grid; gap: 1.25rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }
.hero-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 200px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: var(--shadow); }
.hero-card.is-main { min-height: 420px; }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-card .hero-body { position: absolute; inset: auto 0 0 0; padding: 1.25rem; color: #fff; background: linear-gradient(transparent, rgba(2, 6, 23, .55) 30%, rgba(2, 6, 23, .9)); }
.hero-card h2, .hero-card h3 { margin: .4rem 0 0; color: #fff; }
.hero-card.is-main h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.hero-card a { color: #fff; }
.hero-card a::after { content: ""; position: absolute; inset: 0; }

/* ---------- Section title ---------- */
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; margin: 0 0 1.25rem; }
.section-title::before { content: ""; width: 6px; height: 1.3em; border-radius: 3px; background: linear-gradient(var(--primary), var(--primary-2)); }

/* ---------- Cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card {
	position: relative; display: flex; flex-direction: column;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); }
.card-thumb { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-title { font-size: 1.08rem; margin: 0; }
.card-title a { color: var(--text); }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:hover { text-decoration: none; color: var(--primary); }
.card-excerpt { color: var(--muted); font-size: .93rem; margin: 0; }
.card-meta { margin-top: auto; }
.cat-badge {
	position: relative; z-index: 2; align-self: flex-start;
	display: inline-block; padding: .2rem .6rem; border-radius: 999px;
	font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.hero-card .cat-badge { background: rgba(255, 255, 255, .2); color: #fff; }
.score-pill { position: absolute; top: .7rem; right: .7rem; z-index: 2; background: var(--accent); color: #1f1300; font-weight: 800; font-size: .85rem; padding: .25rem .55rem; border-radius: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }
.meta svg { width: 15px; height: 15px; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 .8rem; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .3rem; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Single ---------- */
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.2rem, 4vw, 2.5rem); box-shadow: var(--shadow); }
.entry-header h1 { margin: .5rem 0 1rem; }
.entry-thumb { margin: 1.5rem 0; border-radius: 12px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content img { border-radius: 10px; }
.entry-content .alignwide { margin-left: -2rem; margin-right: -2rem; max-width: none; }
.entry-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-link { padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .82rem; }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* Updated notice */
.updated-note { font-size: .85rem; background: var(--surface-2); border-radius: 8px; padding: .4rem .8rem; display: inline-block; color: var(--muted); }

/* ---------- TOC ---------- */
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin: 0 0 2rem; }
.toc summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.3rem; color: var(--primary); }
.toc[open] summary::after { content: "–"; }
.toc ol { margin: .8rem 0 0; padding-left: 1.2em; font-size: .95rem; }
.toc li { margin: .25rem 0; }
.toc li.toc-h3 { margin-left: 1rem; list-style: circle; }

/* ---------- Review box ---------- */
.review-box { border: 2px solid var(--primary); border-radius: var(--radius); overflow: hidden; margin: 2rem 0; background: var(--surface); }
.review-head { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.review-score {
	--p: 0; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
	background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--border) 0);
}
.review-score span { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: flex; align-items: baseline; justify-content: center; padding-top: 20px; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.review-score small { font-size: .7rem; color: var(--muted); font-weight: 600; margin-left: 1px; }
.review-title { margin: 0; font-size: 1.2rem; }
.review-verdict { margin: .3rem 0 0; color: var(--muted); font-size: .95rem; }
.review-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.review-cols > div { padding: 1.1rem 1.25rem; }
.review-cols > div + div { border-left: 1px solid var(--border); }
.review-cols h4 { margin: 0 0 .6rem; font-size: 1rem; }
.review-cols ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.review-cols li { padding-left: 1.6rem; position: relative; margin-bottom: .4rem; }
.review-pros h4 { color: var(--good); }
.review-cons h4 { color: var(--bad); }
.review-pros li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.review-cons li::before { content: "✕"; position: absolute; left: 0; color: var(--bad); font-weight: 800; }
.review-cta { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.review-cta .price { font-weight: 800; font-size: 1.2rem; }
.review-cta .note { font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) {
	.review-cols { grid-template-columns: 1fr; }
	.review-cols > div + div { border-left: 0; border-top: 1px solid var(--border); }
	.review-cta .btn { width: 100%; }
}

/* Comparison table shortcode */
.compare-table td.best { background: color-mix(in srgb, var(--good) 10%, transparent); font-weight: 700; }

/* ---------- Author box / related ---------- */
.author-box { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; padding: 1.25rem; background: var(--surface-2); border-radius: 12px; }
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 .2rem; font-size: 1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .92rem; }
.related { margin-top: 2.5rem; }

/* ---------- Sidebar ---------- */
.sidebar { display: grid; gap: 1.25rem; position: sticky; top: 90px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); font-size: .95rem; }
.widget-title { margin: 0 0 .8rem; font-size: 1rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.widget li:last-child { border-bottom: 0; }
.widget.ad-widget { background: transparent; border: 0; box-shadow: none; padding: 0; }
.mini-post { display: flex; gap: .75rem; align-items: center; }
.mini-post img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.mini-post a { color: var(--text); font-weight: 600; font-size: .92rem; line-height: 1.35; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 2rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.comment-meta { font-size: .85rem; color: var(--muted); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: .4rem; }
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea {
	width: 100%; padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit;
}

/* ---------- Archive header ---------- */
.archive-header { margin-bottom: 2rem; }
.archive-header h1 { margin: 0 0 .4rem; }
.archive-header .desc { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; font-size: .93rem; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.site-footer .widget { background: transparent; border: 0; box-shadow: none; padding: 0; }
.footer-bottom { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--muted); }
.footer-bottom ul { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0; }
.footer-bottom a { color: var(--muted); }
.back-to-top { position: fixed; right: 16px; bottom: 16px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 3rem 0; }
.error-404 .big { font-size: 6rem; font-weight: 900; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- WP core ---------- */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; }
.sticky .card { border-color: var(--primary); }
.bypostauthor > .comment-body { border-color: var(--primary); }
.gallery-caption { font-size: .85rem; }

@media (max-width: 480px) {
	body { font-size: 16px; }
	.site-title { font-size: 1.05rem; }
	.logo-mark { width: 32px; height: 32px; }
	.header-inner { gap: .5rem; }
	.review-head { padding: 1rem; gap: 1rem; }
}
