/*
 * Charte graphique Cycle Divide — voir CHARTE-GRAPHIQUE.md.
 * Toutes les règles sont préfixées par body.cd-charte (classe ajoutée par l'extension).
 */

body.cd-charte {
	--cd-nuit: #092a3c;
	--cd-orange: #e95319;
	--cd-ardoise: #334155;
	--cd-brume: #f0f5fa;
	--cd-blanc: #fff;
	--cd-ombre: 0 2px 14px rgba(9, 42, 60, .08);
	--cd-rayon: 8px;
	--cd-section: 80px;
	--cd-gouttiere: 20px;
	color: var(--cd-ardoise);
}

@media (max-width: 921px) {
	body.cd-charte {
		--cd-section: 56px;
	}
}

/* ---------- En-tête ---------- */

body.cd-charte .ast-primary-header-bar,
body.cd-charte .main-header-bar {
	border-bottom: 1px solid #e3e9ef !important;
}

body.cd-charte .main-header-menu .menu-item > .menu-link {
	color: var(--cd-nuit);
}

body.cd-charte .main-header-menu .menu-item:hover > .menu-link,
body.cd-charte .main-header-menu .current-menu-item > .menu-link,
body.cd-charte .main-header-menu .current-menu-ancestor > .menu-link {
	color: var(--cd-orange) !important;
}

/* ---------- Typographie ---------- */

/* Les blocs Spectra conservés (bandeaux de l'accueil) gardent leurs couleurs et tailles propres */
body.cd-charte .entry-content :where(h1, h2, h3):where(:not(.wp-block-spectra-content)) {
	font-family: 'Noland', sans-serif;
	font-weight: 700;
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: .01em;
	color: var(--cd-nuit);
	line-height: 1.1;
}

body.cd-charte .entry-content h1:where(:not(.wp-block-spectra-content)) { font-size: 48px; }
body.cd-charte .entry-content h2:where(:not(.wp-block-spectra-content)) { font-size: 34px; margin-top: 0; margin-bottom: 18px; }
body.cd-charte .entry-content h3:where(:not(.wp-block-spectra-content)) { font-size: 20px; margin-top: 0; margin-bottom: 10px; }

@media (max-width: 921px) {
	body.cd-charte .entry-content h1:where(:not(.wp-block-spectra-content)) { font-size: 34px; }
	body.cd-charte .entry-content h2:where(:not(.wp-block-spectra-content)) { font-size: 26px; }
	body.cd-charte .entry-content h3:where(:not(.wp-block-spectra-content)) { font-size: 18px; }
}

body.cd-charte .entry-content :where(p, li):where(:not(.wp-block-spectra-content):not(.wp-block-spectra-list-child-item)) {
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.65;
	color: var(--cd-ardoise);
}

body.cd-charte .entry-content p.cd-surtitre {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--cd-orange);
	margin-top: 0;
	margin-bottom: 10px;
}

body.cd-charte .entry-content p.cd-intro {
	font-size: 18px;
	max-width: 780px;
}

body.cd-charte .entry-content .cd-centre {
	text-align: center !important;
	margin-left: auto;
	margin-right: auto;
}

body.cd-charte .entry-content .has-text-align-center.cd-intro,
body.cd-charte .entry-content .cd-texte {
	margin-left: auto;
	margin-right: auto;
}

/* Filet orange sous les titres de section */
body.cd-charte .entry-content h2.cd-titre::after {
	content: "";
	display: block;
	width: 48px;
	height: 3px;
	margin: 18px 0 0;
	background: var(--cd-orange);
}

body.cd-charte .entry-content h2.cd-titre.has-text-align-center::after {
	margin-left: auto;
	margin-right: auto;
}

/* Liens dans le texte */
body.cd-charte .entry-content p a:not(.cd-lien-contact) {
	color: var(--cd-orange);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Boutons ---------- */

body.cd-charte .entry-content .wp-block-button__link {
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	padding: 14px 28px;
	border-radius: 4px;
	border: 2px solid var(--cd-orange);
	background: var(--cd-orange);
	color: var(--cd-blanc);
	text-transform: none;
	transition: background-color .2s, border-color .2s, color .2s;
}

body.cd-charte .entry-content .wp-block-button__link:hover,
body.cd-charte .entry-content .wp-block-button__link:focus {
	background: var(--cd-nuit);
	border-color: var(--cd-nuit);
	color: var(--cd-blanc);
}

/* Secondaire : contour */
body.cd-charte .entry-content .is-style-outline .wp-block-button__link {
	background: transparent !important;
	border-color: var(--cd-nuit) !important;
	color: var(--cd-nuit) !important;
}

body.cd-charte .entry-content .is-style-outline .wp-block-button__link:hover,
body.cd-charte .entry-content .is-style-outline .wp-block-button__link:focus {
	background: var(--cd-orange) !important;
	border-color: var(--cd-orange) !important;
	color: var(--cd-blanc) !important;
}

body.cd-charte .entry-content .cd-sombre .is-style-outline .wp-block-button__link,
body.cd-charte .entry-content .cd-hero .is-style-outline .wp-block-button__link {
	border-color: var(--cd-blanc) !important;
	color: var(--cd-blanc) !important;
}

body.cd-charte .entry-content .wp-block-buttons {
	gap: 12px;
	margin-top: 28px;
}

/* Même taille pour tous les boutons, quel que soit l'appareil */
body.cd-charte .entry-content .wp-block-button .wp-block-button__link {
	font-size: 15px !important;
	padding: 14px 28px !important;
	line-height: 1.2 !important;
}

@media (max-width: 544px) {
	body.cd-charte .entry-content .wp-block-buttons > .wp-block-button {
		width: 100%;
	}
	body.cd-charte .entry-content .wp-block-buttons > .wp-block-button .wp-block-button__link {
		display: block;
		width: 100%;
		text-align: center;
	}
}

/* ---------- Sections ---------- */

body.cd-charte .entry-content > .cd-section {
	padding: var(--cd-section) var(--cd-gouttiere);
	margin: 0;
}

body.cd-charte .entry-content > .cd-section.cd-fond-brume {
	background: var(--cd-brume);
}

body.cd-charte .entry-content > .cd-section > * {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* Deux colonnes texte + photo */
body.cd-charte .entry-content .cd-colonnes {
	gap: 56px;
	align-items: center;
}

body.cd-charte .entry-content .cd-colonnes figure img {
	border-radius: var(--cd-rayon);
	width: 100%;
	height: auto;
}

@media (max-width: 781px) {
	body.cd-charte .entry-content .cd-colonnes {
		gap: 28px;
	}
}

/* ---------- Bandeau de page ---------- */

body.cd-charte .entry-content > .cd-hero {
	min-height: 420px;
	padding: 60px var(--cd-gouttiere);
	margin: 0;
}

body.cd-charte .entry-content > .cd-hero .wp-block-cover__inner-container {
	max-width: 900px;
	text-align: center;
}

body.cd-charte .entry-content > .cd-hero h1 {
	color: var(--cd-blanc);
	margin: 0 0 14px;
}

body.cd-charte .entry-content > .cd-hero p {
	color: rgba(255, 255, 255, .92);
}

body.cd-charte .entry-content > .cd-hero p.cd-surtitre {
	color: var(--cd-orange);
	/* Lisible même sur une photo claire (bois de l'atelier) */
	text-shadow: 0 1px 2px rgba(9, 42, 60, .9), 0 0 12px rgba(9, 42, 60, .7);
}

/* Logos : en-tête redessiné en haute définition (1152 × 384) affiché à la taille d'origine ; pied = logo officiel « trait blanc » */
body.cd-charte .custom-logo-link img.custom-logo {
	width: 288px;
	height: auto;
}

body.cd-charte .cd-pied-logo {
	width: 88px;
	height: auto;
}

/* Atelier : photo très claire (mur d'outils sur bois), voile un peu plus dense */
body.cd-charte.page-id-30 .entry-content > .cd-hero .wp-block-cover__background {
	opacity: .7 !important;
}

body.cd-charte .entry-content > .cd-hero p.cd-intro {
	font-size: 18px;
	margin: 0 auto;
}

@media (max-width: 921px) {
	body.cd-charte .entry-content > .cd-hero {
		min-height: 300px;
	}
}

/* ---------- Cartes ---------- */

body.cd-charte .entry-content .cd-grille {
	gap: 24px;
	margin-top: 40px;
}

body.cd-charte .entry-content .cd-carte {
	background: var(--cd-blanc);
	border-radius: var(--cd-rayon);
	box-shadow: var(--cd-ombre);
	padding: 28px 24px;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: stretch;
}

body.cd-charte .entry-content .cd-carte > * {
	margin: 0;
}

body.cd-charte .entry-content .cd-carte.cd-carte-num {
	border-top: 3px solid var(--cd-orange);
}

body.cd-charte .entry-content .cd-carte p.cd-numero {
	font-family: 'Noland', sans-serif;
	font-weight: 700;
	font-size: 28px;
	line-height: 1;
	color: var(--cd-orange);
	margin-bottom: 6px;
}

/* Carte avec photo en haut (bord à bord) */
body.cd-charte .entry-content .cd-carte.cd-carte-photo {
	padding: 0 0 24px;
	overflow: hidden;
}

body.cd-charte .entry-content .cd-carte-photo > :not(figure) {
	padding-left: 24px;
	padding-right: 24px;
}

body.cd-charte .entry-content .cd-carte-photo > figure {
	margin: 0 0 12px;
}

body.cd-charte .entry-content .cd-carte-photo > figure img {
	display: block;
	width: 100%;
	transition: transform .3s;
}

body.cd-charte .entry-content .cd-carte-photo > figure a:hover img {
	transform: scale(1.03);
}

body.cd-charte .entry-content .cd-carte-photo > figure a {
	display: block;
	overflow: hidden;
}

body.cd-charte .entry-content .cd-carte-photo > .wp-block-buttons {
	margin-top: auto;
	padding-top: 12px;
}

body.cd-charte .entry-content .cd-carte-photo .wp-block-button__link {
	padding: 10px 20px !important;
	font-size: 14px !important;
}

/* Logos de marques : 3 colonnes sur téléphone */
@media (max-width: 544px) {
	body.cd-charte .entry-content .cd-grille:has(.cd-logo) {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}

/* Page Contact */
body.cd-charte .entry-content .cd-carte-contact {
	align-items: center;
	text-align: center;
	gap: 6px;
}

body.cd-charte .entry-content .cd-carte-contact .cd-icone {
	margin-bottom: 8px !important;
}

body.cd-charte .entry-content .cd-carte-contact .cd-icone svg {
	fill: var(--cd-orange) !important;
	color: var(--cd-orange) !important;
}

body.cd-charte .entry-content p.cd-contact-ligne {
	font-family: 'Noland', sans-serif;
	font-size: 18px;
	color: var(--cd-nuit);
}

body.cd-charte .entry-content .cd-colonnes-haut {
	align-items: flex-start;
}

body.cd-charte .entry-content .cd-carte-formulaire {
	padding: 36px;
}

body.cd-charte .entry-content .cd-colonnes-haut h3:not(:first-child) {
	margin-top: 28px;
}

body.cd-charte .entry-content .cd-carte-formulaire .formlayer-submit,
body.cd-charte .entry-content .cd-carte-formulaire button[type="submit"] {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	border-radius: 4px;
}

body.cd-charte .entry-content > .cd-carte-google {
	margin-top: 0;
	margin-bottom: 0;
	padding: 0 !important;
	line-height: 0;
}

/* Liens de coordonnées dans le contenu : bleu nuit, orange au survol */
body.cd-charte .entry-content a.cd-lien-contact {
	color: var(--cd-nuit) !important;
	text-decoration: none;
	border-bottom: 1px solid rgba(233, 83, 25, .5);
}

body.cd-charte .entry-content a.cd-lien-contact:hover {
	color: var(--cd-orange) !important;
	border-bottom-color: var(--cd-orange);
}

@media (max-width: 781px) {
	body.cd-charte .entry-content .cd-carte-formulaire {
		padding: 24px 20px;
	}
}

body.cd-charte .entry-content > .cd-carte-google .spectra-google-map {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
}

body.cd-charte .entry-content > .cd-carte-google iframe {
	display: block;
	width: 100%;
}

/* Listes d'articles (blocs « Derniers articles ») en cartes */
body.cd-charte .entry-content .wp-block-latest-posts.cd-articles {
	gap: 24px !important;
	margin: 40px auto 0 !important;
	padding: 0;
}

body.cd-charte .entry-content .cd-articles > li {
	background: var(--cd-blanc);
	border-radius: var(--cd-rayon);
	box-shadow: var(--cd-ombre);
	overflow: hidden;
	margin: 0 !important;
	padding: 0 0 24px;
	display: flex;
	flex-direction: column;
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__featured-image {
	margin: 0 0 16px;
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__featured-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__post-title {
	display: block;
	padding: 0 24px;
	margin: 0 0 8px;
	font-family: 'Noland', sans-serif;
	font-size: 20px;
	text-transform: uppercase;
	color: var(--cd-nuit);
	text-decoration: none;
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__post-title:hover {
	color: var(--cd-orange);
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__post-excerpt {
	padding: 0 24px;
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--cd-ardoise);
}

body.cd-charte .entry-content .cd-articles .wp-block-latest-posts__post-excerpt a {
	color: var(--cd-orange);
	font-weight: 600;
}

@media (max-width: 781px) {
	body.cd-charte .entry-content .wp-block-latest-posts.cd-articles {
		grid-template-columns: 1fr !important;
	}
}

/* Section d'articles sans article (ex. Actus au lancement) : masquée, réapparaît à la première publication */
body.cd-charte .entry-content > .cd-section:has(.cd-articles:empty) {
	display: none;
}

/* Blocs Spectra conservés : pas de graisse fine, listes en Inter (charte §2) */
body.cd-charte .entry-content p.wp-block-spectra-content {
	font-weight: 400;
}

body.cd-charte .entry-content .wp-block-spectra-list .wp-block-spectra-content {
	font-family: 'Inter', sans-serif;
	font-weight: 500;
}

/* Cartes produits (accueil, catégories) */
body.cd-charte ul.products li.product {
	background: var(--cd-blanc);
	border-radius: var(--cd-rayon);
	box-shadow: var(--cd-ombre);
	overflow: hidden;
	padding-bottom: 18px !important;
	text-align: left;
}

body.cd-charte ul.products li.product .astra-shop-thumbnail-wrap {
	margin-bottom: 14px;
}

body.cd-charte ul.products li.product .astra-shop-summary-wrap {
	padding: 0 18px;
}

body.cd-charte ul.products li.product .ast-woo-product-category {
	font-family: 'Inter', sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--cd-orange);
	opacity: 1;
}

body.cd-charte ul.products li.product .woocommerce-loop-product__title {
	font-family: 'Noland', sans-serif;
	font-size: 17px;
	text-transform: uppercase;
	color: var(--cd-nuit);
	line-height: 1.2;
}

body.cd-charte ul.products li.product .price {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--cd-ardoise);
}

body.cd-charte ul.products li.product:hover .woocommerce-loop-product__title {
	color: var(--cd-orange);
}

/* ---------- Éléments hors contenu : titres de page/archive, fiche produit, filtres, 404 ---------- */

body.cd-charte :is(.ast-archive-title, .woocommerce-products-header__title, .page-title, .entry-title, .product_title) {
	font-family: 'Noland', sans-serif !important;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--cd-nuit);
	line-height: 1.1;
}

body.cd-charte :is(.ast-archive-title, .woocommerce-products-header__title, .page-title) {
	font-size: 40px;
}

body.cd-charte .single-post .entry-title,
body.cd-charte.single-post .entry-title {
	font-size: 44px;
}

@media (max-width: 921px) {
	body.cd-charte :is(.ast-archive-title, .woocommerce-products-header__title, .page-title) { font-size: 30px; }
	body.cd-charte.single-post .entry-title { font-size: 32px; }
}

body.cd-charte .woocommerce-breadcrumb,
body.cd-charte .ast-breadcrumbs {
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	color: var(--cd-ardoise);
}

/* Fiche produit : catégorie en surtitre */
body.cd-charte.single-product .summary :is(.ast-woo-product-category, .single-product-category),
body.cd-charte.single-product .summary .single-product-category a {
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--cd-orange);
}

body.cd-charte.single-product .product_meta {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
}

/* Colonne de filtres */
body.cd-charte #secondary .widget-title {
	font-family: 'Noland', sans-serif;
	font-size: 18px;
	text-transform: uppercase;
	color: var(--cd-nuit);
	margin-bottom: 14px;
}

body.cd-charte #secondary .widget li,
body.cd-charte #secondary .widget li a {
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: var(--cd-nuit);
}

body.cd-charte #secondary .widget li a:hover,
body.cd-charte #secondary .widget li.current-cat > a,
body.cd-charte #secondary .widget li.chosen > a {
	color: var(--cd-orange);
}

body.cd-charte #secondary .widget .count {
	color: #7a8794;
	font-weight: 400;
}

/* Page 404 */
body.cd-charte .error-404 .page-sub-title {
	font-family: 'Inter', sans-serif;
	font-size: 17px;
	font-weight: 400;
	text-transform: none;
	color: var(--cd-ardoise);
}

/* Pages de texte long (articles, mentions) : intertitres plus sobres, titre de page le plus grand */
body.cd-charte .entry-content > h2:where(:not(.wp-block-spectra-content)) {
	font-size: 26px;
	margin-top: 1.6em;
}

body.cd-charte .entry-content > h3:where(:not(.wp-block-spectra-content)) {
	font-size: 20px;
	margin-top: 1.4em;
}

body.cd-charte.page .entry-header .entry-title {
	font-size: 40px;
	margin-bottom: 24px;
}

@media (max-width: 921px) {
	body.cd-charte .entry-content > h2:where(:not(.wp-block-spectra-content)) { font-size: 22px; }
	body.cd-charte.page .entry-header .entry-title { font-size: 30px; }
}

/* Bandeau bicolore de l'accueil (exception charte §5) : image d'origine, rendu d'origine sur ordinateur */
/* Écrans étroits : la séparation devient horizontale (texte dans le bleu, vélo à cheval sur la ligne) */
@media (max-width: 921px) {
	body.cd-charte .cd-hero-bicolore {
		padding: 48px 24px 0 !important;
		min-height: 0 !important;
		background-size: cover !important;
		background-position: 50% 50% !important;
	}
	body.cd-charte .cd-hero-bicolore::before {
		background-image: linear-gradient(180deg, #092a3c 0, #092a3c calc(100% - 150px), #e95319 calc(100% - 150px)) !important;
	}
	body.cd-charte .cd-hero-bicolore > * {
		padding-bottom: 300px !important;
	}
}

@media (max-width: 544px) {
	body.cd-charte .cd-hero-bicolore::before {
		background-image: linear-gradient(180deg, #092a3c 0, #092a3c calc(100% - 110px), #e95319 calc(100% - 110px)) !important;
	}
	body.cd-charte .cd-hero-bicolore > * {
		padding-bottom: 210px !important;
	}
}
