/* ==========================================================================
   Mode sombre — à la demande uniquement (bouton lune/soleil de l’en-tête).
   Il ne suit pas le réglage du système : le site reste clair tant que le
   visiteur ne l’a pas choisi. Le choix est mémorisé (localStorage « ese-theme »).
   Contrastes vérifiés : texte ≥ 5,3:1 sur toutes les surfaces sombres.
   ========================================================================== */

html[data-theme="dark"] {
	color-scheme: dark;
	--ese-fond: #16181B;          /* page */
	--ese-surface: #1C1F23;       /* surfaces secondaires (ex-Papier grisé) */
	--ese-carte: #22252A;         /* cartes, panneaux, champs */
	--ese-texte: #E7EAED;         /* 12,7:1 sur carte */
	--ese-texte-2: #C9CDD1;       /* 9,6:1 */
	--ese-texte-3: #A9AFB5;       /* 6,9:1 */
	--ese-texte-4: #959BA1;       /* 5,5:1 */
	--ese-bordure: #2E3237;
	--ese-bordure-2: #3A3F45;
	--ese-bleu-tint: #1B2836;     /* lavis bleus (tuiles d’icônes, lignes sélectionnées) */
	--ese-lien: #6EC1EC;          /* bleu-texte devenu azur clair : 7,7:1 sur carte */
}

/* En-tête translucide sombre et marque claire (comme sur les pages créatives) */
html[data-theme="dark"] .site-header { background: rgba(22, 24, 27, .86); border-bottom-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .brand__name { color: #fff; }
html[data-theme="dark"] .ese-mark__drop { fill: var(--ese-azur); }
html[data-theme="dark"] .ese-mark__cut { fill: var(--ese-fond); }
html[data-theme="dark"] .ese-mark__cut-line { stroke: var(--ese-fond); }
html[data-theme="dark"] .ese-mark__stand { stroke: #fff; }
html[data-theme="dark"] .burger span { background: #fff; }

/* Sélection, focus, filets */
html[data-theme="dark"] ::selection { background: var(--ese-azur); color: var(--ese-sombre-creatif); }
html[data-theme="dark"] { caret-color: var(--ese-azur); scrollbar-color: #3A3F45 transparent; }

/* Champs natifs, WooCommerce et Contact Form 7 */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
	background-color: var(--ese-carte);
	color: var(--ese-texte);
	border-color: var(--ese-bordure-2);
}
html[data-theme="dark"] ::placeholder { color: var(--ese-texte-4); }
html[data-theme="dark"] .wc-block-components-text-input label,
html[data-theme="dark"] .wc-block-components-select .wc-block-components-select__label,
html[data-theme="dark"] .wc-block-components-textarea { color: var(--ese-texte-3); }
html[data-theme="dark"] .wc-block-components-text-input input,
html[data-theme="dark"] .wc-blocks-components-select__select,
html[data-theme="dark"] .wc-block-components-select select { background-color: var(--ese-carte) !important; color: var(--ese-texte) !important; border-color: var(--ese-bordure-2) !important; }
html[data-theme="dark"] .wc-block-components-panel,
html[data-theme="dark"] .wc-block-components-totals-wrapper,
html[data-theme="dark"] .wc-block-components-radio-control__option { color: var(--ese-texte); }

/* Rares surfaces restées blanches à dessein, adaptées ici */
html[data-theme="dark"] .thanks__card--failed { background: var(--ese-carte); }
html[data-theme="dark"] .entry__content blockquote { border-left-color: var(--ese-azur); }

/* Interrupteur de thème */
.theme-toggle { background: transparent; border: 0; padding: 0; font: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; } /* même rendu que les icônes-liens voisines */
.theme-toggle:focus-visible { outline: 2px solid var(--ese-azur); outline-offset: 2px; }
.theme-toggle .theme-toggle__sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }

/* Couverture blanche (recueil gratuit) : un livre blanc reste un objet blanc, en clair comme en sombre. */
html[data-theme="dark"] .cover--light { color: #26292E; box-shadow: 18px 26px 50px rgba(0, 0, 0, .4), inset 0 0 0 1px #ECECE8; }
html[data-theme="dark"] .cover--light::before { background: #EAF2FA; }
html[data-theme="dark"] .cover--light .cover__top { color: #1F6FB2; }

/* Bouton des notices WooCommerce (« Voir le panier ») : lavis azur sur fond sombre (2,8:1 → 7,7:1). */
html[data-theme="dark"] .woocommerce-message .button,
html[data-theme="dark"] .woocommerce-info .button,
html[data-theme="dark"] .woocommerce-error .button { background: rgba(110, 193, 236, .14) !important; color: var(--ese-lien) !important; border-color: rgba(110, 193, 236, .3) !important; }
/* Étiquette du sélecteur de pays (bloc Commande) : WooCommerce écrit « wc-blocks-components… ». */
html[data-theme="dark"] .wc-blocks-components-select__label,
html[data-theme="dark"] .wc-blocks-components-select .wc-blocks-components-select__label { color: var(--ese-texte-3) !important; }
html[data-theme="dark"] .wc-blocks-components-select__container { background-color: var(--ese-carte) !important; }
/* Illustration « bibliothèque vide » : le livre anthracite passerait inaperçu sur le lavis sombre. */
html[data-theme="dark"] .library-empty__books span:nth-child(2) { background: var(--ese-texte-2); }
