/* Mode sombre du thème « julie » (chargé après site.css et shop.css, sur le site seulement : l'éditeur reste clair).
   Automatique selon la préférence du système, ou forcé par le bouton « Mode sombre » (data-theme sur <html>, mémorisé
   dans localStorage, appliqué avant le premier rendu par le petit script de l'en-tête). Palette chaude, jamais du noir pur ;
   contrastes AA vérifiés (texte 13:1, texte secondaire 6,5:1 au moins, accents 6,3:1 au moins). Photos inchangées.
   Chaque règle existe en deux variantes : préférence système (sauf clair forcé) et sombre forcé. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  /* Palette de theme.json (toutes les couleurs de la maquette en dérivent) */
  --wp--preset--color--encre: #f3ece2;
  --wp--preset--color--encre-2: #d9cfc2;
  --wp--preset--color--terre: var(--wp--preset--color--terre-sombre, #e597ae);
  --wp--preset--color--terre-2: var(--wp--preset--color--terre-sombre-2, #f0b3c4);
  --wp--preset--color--rose: var(--wp--preset--color--rose-sombre, #45222f);
  --wp--preset--color--sauge: #a6c0a2;
  --wp--preset--color--sauge-50: #26302a;
  --wp--preset--color--sable: #2e2c30;
  --wp--preset--color--sable-50: #211f23;
  --wp--preset--color--creme: #19181b;
  --wp--preset--color--blanc: #27252a;
  --wp--preset--color--texte: #e8e0d4;
  --wp--preset--color--texte-2: #b3a796;
  /* Jetons d'usage */
  --trait: #3a373d;
  --surface: #27252a;
  --plein: #121010;
  --chip-on: #f3ece2;
  --chip-on-txt: #19181b;
  --opt-on: var(--wp--preset--color--rose-sombre, #45222f);
  --top-bg: rgba(25, 24, 27, .94);
  --champ: #4a433b;
  --ombre: 0 18px 40px -24px rgba(0, 0, 0, .8);
  }
  :root:not([data-theme="light"]) .map svg { filter: brightness(.6) saturate(.8); }
  :root:not([data-theme="light"]) .map .btn.w { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
  :root:not([data-theme="light"]) .wp-block-group.is-style-band { border: 1px solid var(--trait); }
  :root:not([data-theme="light"]) .foot { border-top: 1px solid var(--trait); }
  :root:not([data-theme="light"]) .wp-block-gallery img, :root:not([data-theme="light"]) .u img, :root:not([data-theme="light"]) .hero-ph img { filter: none; }
  :root:not([data-theme="light"]) mark { background: #5a4a1e; color: #f3ece2; }
  :root:not([data-theme="light"]) .okto-gift-form, :root:not([data-theme="light"]) .okto-gift-scan, :root:not([data-theme="light"]) .okto-gift-redeem { --okto-gift-text: #e8e0d4 !important; --okto-gift-background: #1b1815 !important; --okto-gift-line: #3b352e !important; --okto-gift-soft: rgba(224, 146, 122, .12) !important; }
  :root:not([data-theme="light"]) .okto-gift-form input:not([type=radio]):not([type=checkbox]), :root:not([data-theme="light"]) .okto-gift-form textarea, :root:not([data-theme="light"]) .okto-gift-redeem input { background: var(--surface) !important; color: var(--texte) !important; border-color: var(--champ) !important; }
  :root:not([data-theme="light"]) .okto-gift-form .okto-gift-link, :root:not([data-theme="light"]) .okto-gift-scan a:not(.button):not([class*=btn]) { color: var(--terre-2) !important; }
  :root:not([data-theme="light"]) .wc-block-components-text-input input, :root:not([data-theme="light"]) .wc-block-components-textarea, :root:not([data-theme="light"]) .wc-blocks-components-select__select, :root:not([data-theme="light"]) .wc-block-components-combobox .components-combobox-control__input, :root:not([data-theme="light"]) .wc-block-components-form .wc-block-components-text-input input { background: var(--surface) !important; color: var(--texte) !important; border-color: var(--champ) !important; }
  :root:not([data-theme="light"]) .wc-block-components-text-input label, :root:not([data-theme="light"]) .wc-blocks-components-select__label, :root:not([data-theme="light"]) .wc-block-components-combobox .components-base-control__label { color: var(--texte-2) !important; }
  :root:not([data-theme="light"]) .wc-blocks-components-select__container, :root:not([data-theme="light"]) .wc-block-components-radio-control__option, :root:not([data-theme="light"]) .wc-block-components-radio-control-accordion-option, :root:not([data-theme="light"]) .wc-block-components-panel, :root:not([data-theme="light"]) .wc-block-components-totals-wrapper, :root:not([data-theme="light"]) .wc-block-components-order-summary-item { border-color: var(--trait) !important; }
  :root:not([data-theme="light"]) .wc-block-components-radio-control__input, :root:not([data-theme="light"]) .wc-block-components-checkbox__input[type=checkbox] { background: var(--surface) !important; border-color: var(--champ) !important; }
  :root:not([data-theme="light"]) .wc-block-components-radio-control__input:checked::before { background: var(--terre) !important; }
  :root:not([data-theme="light"]) .wc-block-checkout, :root:not([data-theme="light"]) .wc-block-cart, :root:not([data-theme="light"]) .wp-block-woocommerce-order-confirmation-summary, :root:not([data-theme="light"]) .wc-block-order-confirmation-totals, :root:not([data-theme="light"]) .wc-block-order-confirmation-downloads { color: var(--texte); }
  :root:not([data-theme="light"]) .wc-block-components-notice-banner { background: var(--surface); color: var(--texte); border-color: var(--trait); }
  :root:not([data-theme="light"]) .woocommerce-table, :root:not([data-theme="light"]) .wc-block-order-confirmation-totals table, :root:not([data-theme="light"]) .woocommerce-account .woocommerce form .input-text { color: var(--texte); background: var(--surface); border-color: var(--trait); }
  :root:not([data-theme="light"]) .wc-block-components-order-summary-item__quantity { background: var(--surface); color: var(--texte); border-color: var(--champ); box-shadow: none; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Palette de theme.json (toutes les couleurs de la maquette en dérivent) */
  --wp--preset--color--encre: #f3ece2;
  --wp--preset--color--encre-2: #d9cfc2;
  --wp--preset--color--terre: var(--wp--preset--color--terre-sombre, #e597ae);
  --wp--preset--color--terre-2: var(--wp--preset--color--terre-sombre-2, #f0b3c4);
  --wp--preset--color--rose: var(--wp--preset--color--rose-sombre, #45222f);
  --wp--preset--color--sauge: #a6c0a2;
  --wp--preset--color--sauge-50: #26302a;
  --wp--preset--color--sable: #2e2c30;
  --wp--preset--color--sable-50: #211f23;
  --wp--preset--color--creme: #19181b;
  --wp--preset--color--blanc: #27252a;
  --wp--preset--color--texte: #e8e0d4;
  --wp--preset--color--texte-2: #b3a796;
  /* Jetons d'usage */
  --trait: #3a373d;
  --surface: #27252a;
  --plein: #121010;
  --chip-on: #f3ece2;
  --chip-on-txt: #19181b;
  --opt-on: var(--wp--preset--color--rose-sombre, #45222f);
  --top-bg: rgba(25, 24, 27, .94);
  --champ: #4a433b;
  --ombre: 0 18px 40px -24px rgba(0, 0, 0, .8);
}
  :root[data-theme="dark"] .map svg { filter: brightness(.6) saturate(.8); }
  :root[data-theme="dark"] .map .btn.w { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
  :root[data-theme="dark"] .wp-block-group.is-style-band { border: 1px solid var(--trait); }
  :root[data-theme="dark"] .foot { border-top: 1px solid var(--trait); }
  :root[data-theme="dark"] .wp-block-gallery img, :root[data-theme="dark"] .u img, :root[data-theme="dark"] .hero-ph img { filter: none; }
  :root[data-theme="dark"] mark { background: #5a4a1e; color: #f3ece2; }
  :root[data-theme="dark"] .okto-gift-form, :root[data-theme="dark"] .okto-gift-scan, :root[data-theme="dark"] .okto-gift-redeem { --okto-gift-text: #e8e0d4 !important; --okto-gift-background: #1b1815 !important; --okto-gift-line: #3b352e !important; --okto-gift-soft: rgba(224, 146, 122, .12) !important; }
  :root[data-theme="dark"] .okto-gift-form input:not([type=radio]):not([type=checkbox]), :root[data-theme="dark"] .okto-gift-form textarea, :root[data-theme="dark"] .okto-gift-redeem input { background: var(--surface) !important; color: var(--texte) !important; border-color: var(--champ) !important; }
  :root[data-theme="dark"] .okto-gift-form .okto-gift-link, :root[data-theme="dark"] .okto-gift-scan a:not(.button):not([class*=btn]) { color: var(--terre-2) !important; }
  :root[data-theme="dark"] .wc-block-components-text-input input, :root[data-theme="dark"] .wc-block-components-textarea, :root[data-theme="dark"] .wc-blocks-components-select__select, :root[data-theme="dark"] .wc-block-components-combobox .components-combobox-control__input, :root[data-theme="dark"] .wc-block-components-form .wc-block-components-text-input input { background: var(--surface) !important; color: var(--texte) !important; border-color: var(--champ) !important; }
  :root[data-theme="dark"] .wc-block-components-text-input label, :root[data-theme="dark"] .wc-blocks-components-select__label, :root[data-theme="dark"] .wc-block-components-combobox .components-base-control__label { color: var(--texte-2) !important; }
  :root[data-theme="dark"] .wc-blocks-components-select__container, :root[data-theme="dark"] .wc-block-components-radio-control__option, :root[data-theme="dark"] .wc-block-components-radio-control-accordion-option, :root[data-theme="dark"] .wc-block-components-panel, :root[data-theme="dark"] .wc-block-components-totals-wrapper, :root[data-theme="dark"] .wc-block-components-order-summary-item { border-color: var(--trait) !important; }
  :root[data-theme="dark"] .wc-block-components-radio-control__input, :root[data-theme="dark"] .wc-block-components-checkbox__input[type=checkbox] { background: var(--surface) !important; border-color: var(--champ) !important; }
  :root[data-theme="dark"] .wc-block-components-radio-control__input:checked::before { background: var(--terre) !important; }
  :root[data-theme="dark"] .wc-block-checkout, :root[data-theme="dark"] .wc-block-cart, :root[data-theme="dark"] .wp-block-woocommerce-order-confirmation-summary, :root[data-theme="dark"] .wc-block-order-confirmation-totals, :root[data-theme="dark"] .wc-block-order-confirmation-downloads { color: var(--texte); }
  :root[data-theme="dark"] .wc-block-components-notice-banner { background: var(--surface); color: var(--texte); border-color: var(--trait); }
  :root[data-theme="dark"] .woocommerce-table, :root[data-theme="dark"] .wc-block-order-confirmation-totals table, :root[data-theme="dark"] .woocommerce-account .woocommerce form .input-text { color: var(--texte); background: var(--surface); border-color: var(--trait); }
  :root[data-theme="dark"] .wc-block-components-order-summary-item__quantity { background: var(--surface); color: var(--texte); border-color: var(--champ); box-shadow: none; }
/* Icône du bouton : soleil quand le sombre est actif */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mode .moon { display: none; }
  :root:not([data-theme="light"]) .mode .sun { display: block; }
}
:root[data-theme="dark"] .mode .moon { display: none; }
:root[data-theme="dark"] .mode .sun { display: block; }
/* okto-gift : textes colorés en « primary » (terre foncée, 3,3:1 sur fond sombre) → accent clair ; les boutons gardent
   la terre en fond (texte blanc 5,3:1) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .okto-gift-chip input:checked + span, :root:not([data-theme="light"]) .okto-gift-option input:checked + span,
  :root:not([data-theme="light"]) .okto-gift-option input:checked + span *, :root:not([data-theme="light"]) .okto-gift-button--ghost,
  :root:not([data-theme="light"]) .okto-gift-datebtn svg, :root:not([data-theme="light"]) .okto-gift-link { color: var(--terre-2) !important; }
}
:root[data-theme="dark"] .okto-gift-chip input:checked + span, :root[data-theme="dark"] .okto-gift-option input:checked + span,
:root[data-theme="dark"] .okto-gift-option input:checked + span *, :root[data-theme="dark"] .okto-gift-button--ghost,
:root[data-theme="dark"] .okto-gift-datebtn svg, :root[data-theme="dark"] .okto-gift-link { color: var(--terre-2) !important; }
