/* ============================================================
   COMPARABOIS — base.css
   Reset + variables + typo + @font-face + composants globaux
   ============================================================ */

/* ============================================================
   1. @FONT-FACE (fonts auto-hébergées)
   ============================================================ */
@font-face {
	font-family: 'League Spartan';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/league-spartan-600.woff2') format('woff2');
}
@font-face {
	font-family: 'League Spartan';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/league-spartan-700.woff2') format('woff2');
}
@font-face {
	font-family: 'League Spartan';
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url('../fonts/league-spartan-800.woff2') format('woff2');
}
@font-face {
	font-family: 'Sanchez';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/sanchez-regular.woff2') format('woff2');
}
@font-face {
	font-family: 'Sanchez';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/sanchez-italic.woff2') format('woff2');
}

/* ============================================================
   2. VARIABLES CSS (charte graphique)
   ============================================================ */
:root {
	/* Couleurs brandées */
	--cb-brun:         #3d2a1e;
	--cb-brun-dark:    #2a1f17;
	--cb-brun-light:   #7a5c45;
	--cb-brun-border:  #d4b896;
	--cb-orange:       #c0622a;
	--cb-orange-dark:  #a8521f;
	--cb-beige:        #f5f0e8;
	--cb-beige-dark:   #ede5d8;
	--cb-blanc:        #fdfaf6;
	--cb-texte:        #2a1f17;
	--cb-texte-mute:   #5c4a3e;

	/* Couleurs utilitaires */
	--cb-success:      #2d7a3f;
	--cb-danger:       #b53838;

	/* Typographie */
	--cb-font-titre:   'League Spartan', Georgia, serif;
	--cb-font-texte:   'Sanchez', Georgia, serif;

	/* Espacements */
	--cb-radius:       12px;
	--cb-radius-lg:    16px;
	--cb-radius-sm:    8px;

	/* Ombres */
	--cb-shadow:       0 2px 12px rgba(61, 42, 30, 0.10);
	--cb-shadow-lg:    0 8px 32px rgba(61, 42, 30, 0.15);

	/* Container */
	--cb-container:    1200px;
	--cb-container-sm: 800px;

	/* Breakpoints (utilisés en custom media queries) */
	--cb-bp-mobile:    640px;
	--cb-bp-tablet:    1024px;

	/* Header height (pour scroll-padding et sticky) */
	--cb-header-h:     80px;
}

/* ============================================================
   3. RESET minimal
   ============================================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	padding: 0;
	background: var(--cb-beige);
	color: var(--cb-texte);
	font-family: var(--cb-font-texte);
	font-size: 18px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--cb-font-titre);
	color: var(--cb-brun);
	line-height: 1.15;
	margin: 0 0 0.5em;
	font-weight: 700;
	letter-spacing: -0.01em;
}

h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; }
h2 { font-size: clamp(28px, 4vw, 46px); }
h3 { font-size: clamp(22px, 3vw, 34px); }
h4 { font-size: clamp(18px, 2.5vw, 26px); }
h5 { font-size: clamp(16px, 2vw, 20px); }
h6 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.05em; }

p {
	margin: 0 0 1em;
}

a {
	color: var(--cb-orange);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover,
a:focus-visible {
	color: var(--cb-brun);
	text-decoration: underline;
}

a:focus-visible {
	outline: 2px solid var(--cb-orange);
	outline-offset: 2px;
	border-radius: 2px;
}

img,
picture,
video,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

ul, ol {
	padding-left: 1.25em;
	margin: 0 0 1em;
}

li {
	margin-bottom: 0.25em;
}

blockquote {
	margin: 1.5em 0;
	padding: 1em 1.5em;
	border-left: 4px solid var(--cb-orange);
	background: var(--cb-blanc);
	border-radius: 0 var(--cb-radius) var(--cb-radius) 0;
	font-style: italic;
}

code, pre {
	font-family: ui-monospace, 'SF Mono', Consolas, monospace;
	background: var(--cb-beige-dark);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}

pre {
	padding: 1em;
	overflow-x: auto;
}

pre code {
	padding: 0;
	background: none;
}

button {
	font-family: inherit;
	cursor: pointer;
}

input, textarea, select, button {
	font-family: inherit;
	font-size: inherit;
}

/* ============================================================
   4. ACCESSIBILITÉ
   ============================================================ */
.cb-skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--cb-brun);
	color: #fff;
	padding: 12px 24px;
	z-index: 10000;
	border-radius: 0 0 var(--cb-radius) 0;
	font-family: var(--cb-font-titre);
	font-weight: 700;
}

.cb-skip-link:focus {
	top: 0;
	color: #fff;
	text-decoration: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Respect du prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ============================================================
   5. CONTAINER & SECTIONS
   ============================================================ */
.cb-container {
	width: 100%;
	max-width: var(--cb-container);
	margin: 0 auto;
	padding: 0 24px;
}

.cb-container-sm {
	max-width: var(--cb-container-sm);
}

.cb-section {
	padding: clamp(48px, 8vw, 96px) 0;
}

.cb-section-sm {
	padding: clamp(32px, 5vw, 64px) 0;
}

.cb-section-center {
	text-align: center;
}

/* ============================================================
   6. BOUTONS
   ============================================================ */
.cb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border-radius: var(--cb-radius);
	font-family: var(--cb-font-titre);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s ease;
	text-decoration: none;
	white-space: nowrap;
}

.cb-btn:focus-visible {
	outline: 2px solid var(--cb-orange);
	outline-offset: 3px;
	text-decoration: none;
}

.cb-btn:hover {
	text-decoration: none;
}

/* Tailles */
.cb-btn-sm {
	padding: 10px 20px;
	font-size: 14px;
}

.cb-btn-lg {
	padding: 18px 36px;
	font-size: 18px;
}

/* Variantes */
.cb-btn-primary {
	background: var(--cb-orange);
	color: #fff;
	border-color: var(--cb-orange);
}

.cb-btn-primary:hover {
	background: var(--cb-orange-dark);
	border-color: var(--cb-orange-dark);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: var(--cb-shadow);
}

.cb-btn-outline {
	background: transparent;
	color: var(--cb-brun);
	border-color: var(--cb-brun);
}

.cb-btn-outline:hover {
	background: var(--cb-brun);
	color: #fff;
}

.cb-btn-outline-orange {
	background: transparent;
	color: var(--cb-orange);
	border-color: var(--cb-orange);
}

.cb-btn-outline-orange:hover {
	background: var(--cb-orange);
	color: #fff;
}

.cb-btn-ghost {
	background: transparent;
	color: var(--cb-brun);
	border-color: transparent;
}

.cb-btn-ghost:hover {
	background: var(--cb-beige-dark);
	color: var(--cb-brun);
}

.cb-btn-group {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

/* ============================================================
   7. UTILITAIRES
   ============================================================ */
.cb-text-orange { color: var(--cb-orange); }
.cb-text-brun   { color: var(--cb-brun); }
.cb-text-mute   { color: var(--cb-texte-mute); }
.cb-text-center { text-align: center; }
.cb-text-left   { text-align: left; }
.cb-text-right  { text-align: right; }

.cb-bg-brun   { background: var(--cb-brun); color: #fff; }
.cb-bg-beige  { background: var(--cb-beige); }
.cb-bg-blanc  { background: var(--cb-blanc); }
.cb-bg-orange { background: var(--cb-orange); color: #fff; }

.cb-bg-brun h1,
.cb-bg-brun h2,
.cb-bg-brun h3,
.cb-bg-brun h4,
.cb-bg-orange h1,
.cb-bg-orange h2,
.cb-bg-orange h3,
.cb-bg-orange h4 {
	color: #fff;
}

/* Hiérarchie prose (contenu éditorial) */
.cb-prose {
	max-width: 760px;
	margin: 0 auto;
}

.cb-prose > * + * {
	margin-top: 1em;
}

.cb-prose h2 {
	margin-top: 1.5em;
}

.cb-prose h3 {
	margin-top: 1.2em;
}

.cb-prose img {
	border-radius: var(--cb-radius);
	margin: 1.5em 0;
}

.cb-lead {
	font-size: 1.2em;
	color: var(--cb-texte-mute);
}

.cb-meta {
	font-size: 14px;
	color: var(--cb-texte-mute);
	display: flex;
	gap: 8px;
	align-items: center;
}

.cb-meta a {
	color: var(--cb-orange);
}

/* ============================================================
   8. ICÔNES
   ============================================================ */
.cb-icon {
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}

/* ============================================================
   9. RESET WP (clean les wrappers inutiles)
   ============================================================ */
body.cb-body {
	margin: 0;
}

.cb-body > main {
	min-height: 50vh;
}

/* Admin bar compensation */
.admin-bar .cb-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .cb-header {
		top: 46px;
	}
}
