/* =========================================================================
   MODE SOMBRE — unchoix-uneroute
   Activé par html[data-theme="dark"] (posé par le script anti-FOUC du <head>
   + la bascule .theme-toggle). Clair = défaut (aucun de ces styles ne s'applique).

   unchoix est un thème legacy (main-style.css) aux couleurs codées en dur, sans
   variables CSS : on recolore donc explicitement les grandes surfaces. Ce fichier
   est chargé EN DERNIER ; le préfixe html[data-theme="dark"] (specificité élevée)
   + !important passent devant main-style.css et les styles inline.

   Le masthead (.header) et le footer (.footer) sont DÉJÀ #272727 dans les 2 modes :
   on n'y touche quasiment pas. L'overlay #top-search est déjà sombre.
   Palette : fond #17140f · surface #1e1a13 · carte #241f17 · encre #e9e0d3 ·
             encre douce #cabfae · sourdine #9b9182 · filets #38312a · accent #e8975a.
   ========================================================================= */

html[data-theme="dark"] { color-scheme: dark; }

/* ----- Fonds globaux ----- */
html[data-theme="dark"] body {
    background: #17140f !important;
    color: #e3d9cb !important;
}
html[data-theme="dark"] .content-holder {
    background-color: #1b1711 !important;
}
html[data-theme="dark"] .home-extra,
html[data-theme="dark"] .container { background-color: transparent !important; }

html[data-theme="dark"] ::selection { background: #6a3f17; color: #fff; }

/* ----- Texte courant + titres ----- */
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] dd,
html[data-theme="dark"] td,
html[data-theme="dark"] blockquote,
html[data-theme="dark"] .category-description,
html[data-theme="dark"] .home-featured_excerpt {
    color: #d4cab9;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .title-header,
html[data-theme="dark"] .title-header small,
html[data-theme="dark"] .title-box_primary,
html[data-theme="dark"] .post-title,
html[data-theme="dark"] .post-title a,
html[data-theme="dark"] .home-featured_title,
html[data-theme="dark"] .post_content h2,
html[data-theme="dark"] .post_content h3,
html[data-theme="dark"] .post_content h4 {
    color: #f1e9dc !important;
}

/* ----- Liens (accent terracotta éclairci pour le contraste) ----- */
html[data-theme="dark"] a { color: #e8975a; }
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus { color: #f2ab73; }
html[data-theme="dark"] .post_content a { color: #eca06a; }

/* ----- Méta / sourdine ----- */
html[data-theme="dark"] .post_date,
html[data-theme="dark"] .post_views,
html[data-theme="dark"] .post-card_meta,
html[data-theme="dark"] .post-card_time,
html[data-theme="dark"] .post_meta,
html[data-theme="dark"] time,
html[data-theme="dark"] .home-featured_time,
html[data-theme="dark"] .footer-text,
html[data-theme="dark"] .breadcrumb {
    color: #9b9182 !important;
}

/* ----- Cartes / blocs surélevés ----- */
html[data-theme="dark"] .post__holder,
html[data-theme="dark"] .post_wrapper,
html[data-theme="dark"] .continue-in,
html[data-theme="dark"] .home-extra {
    background-color: transparent;
}
/* Widgets sidebar = cartes claires (#sidebar .widget, specificité 110) → !important. */
html[data-theme="dark"] .widget {
    background-color: #1f1b14 !important;
    border-color: #38312a !important;
}
html[data-theme="dark"] .home-featured {
    background-color: #241f17 !important;
    border: 1px solid #38312a;
    border-radius: 14px;
    overflow: hidden;
}
html[data-theme="dark"] .home-featured_cat { color: #e8975a !important; }

/* Citation d'accueil */
html[data-theme="dark"] .home-citation { background: transparent !important; }
html[data-theme="dark"] .home-citation_bq p { color: #ece3d4 !important; }
html[data-theme="dark"] .home-citation_author { color: #9b9182 !important; }

/* « Explorer par thème » */
html[data-theme="dark"] .home-themes_item a {
    background: #241f17 !important;
    border-color: #38312a !important;
    color: #e3d9cb !important;
}
html[data-theme="dark"] .home-themes_item a:hover { background: #2c2519 !important; }
html[data-theme="dark"] .home-themes_count { background: #d06e0a !important; color: #fff !important; }

/* CTA « tous les articles » */
html[data-theme="dark"] .home-allposts {
    background: #241f17 !important;
    border-color: #38312a !important;
    color: #f1e9dc !important;
}

/* ----- Sidebar (widgets) ----- */
html[data-theme="dark"] .widget-title { color: #f1e9dc !important; }
html[data-theme="dark"] .widget-title:before,
html[data-theme="dark"] .widget-title:after { border-color: #38312a !important; background: #38312a !important; }
html[data-theme="dark"] .widget a { color: #e3d9cb; }
html[data-theme="dark"] .widget a:hover { color: #e8975a; }
html[data-theme="dark"] .cat-count-side,
html[data-theme="dark"] .badge-count { color: #9b9182 !important; }
html[data-theme="dark"] .post-list_h a { color: #e9e0d3 !important; }
html[data-theme="dark"] .post-list_h a:hover { color: #e8975a !important; }

/* Champ de recherche de la sidebar (widget_search) */
html[data-theme="dark"] .search-form_it,
html[data-theme="dark"] #s {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #f1ece6 !important;
}

/* ----- Dropdown autocomplete (sidebar/mobile-panel ; le #top-search est déjà sombre) ----- */
html[data-theme="dark"] .ac-results {
    background: #211d16 !important;
    border-color: #38312a !important;
}
html[data-theme="dark"] .ac-item { color: #e3d9cb !important; border-bottom-color: #322c24 !important; }
html[data-theme="dark"] .ac-item.is-active,
html[data-theme="dark"] .ac-item:hover { background: #2c2519 !important; }
html[data-theme="dark"] .ac-title { color: #f1ece6 !important; }
html[data-theme="dark"] .ac-cat { color: #e0954a !important; }

/* ----- Pages catégorie : barre d'outils, tri, toggle, pagination ----- */
html[data-theme="dark"] .category-toolbar { border-bottom-color: #38312a !important; }
html[data-theme="dark"] .category-count { color: #9b9182 !important; }
html[data-theme="dark"] .category-sort select {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #e3d9cb !important;
}
html[data-theme="dark"] .view-switch_btn {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #cabfae !important;
}
html[data-theme="dark"] .view-switch_btn[aria-pressed="true"] {
    background: #d06e0a !important;
    border-color: #d06e0a !important;
    color: #fff !important;
}
html[data-theme="dark"] .continue-cta {
    background: #241f17 !important;
    border-color: #38312a !important;
    color: #f1e9dc !important;
}

/* ----- Index « tous les articles par catégorie » (.cat-index_*) ----- */
html[data-theme="dark"] .cat-index_bar { background: rgba(23,20,15,.92) !important; border-bottom-color: #38312a !important; }
html[data-theme="dark"] .cat-index_search input {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #f1ece6 !important;
}
html[data-theme="dark"] .cat-index_chips a { background: #241f17 !important; border-color: #38312a !important; color: #d4cab9 !important; }
html[data-theme="dark"] .cat-index_chips a:hover { background: #2c2519 !important; }
html[data-theme="dark"] .cat-index_card { background: #1e1a13 !important; border-color: #38312a !important; }
html[data-theme="dark"] .cat-index_cardhead { background: linear-gradient(120deg, #2a2118 0%, #241d14 100%) !important; border-bottom-color: #38312a !important; }
html[data-theme="dark"] .cat-index_cardhead h2 a { color: #f0b277 !important; }
html[data-theme="dark"] .cat-index_list a { color: #d4cab9 !important; }
html[data-theme="dark"] .cat-index_list a:hover { background: #2c2519 !important; color: #f0a868 !important; }
html[data-theme="dark"] .cat-index_status { background: #241f17 !important; color: #f0b277 !important; }

/* ----- Panneaux mobiles (thèmes) ----- */
html[data-theme="dark"] .mobile-panel { background: #1b1711 !important; }
html[data-theme="dark"] .mobile-panel_head { background: #1b1711 !important; }
html[data-theme="dark"] .mobile-panel_title { color: #f0b277 !important; }
html[data-theme="dark"] .mobile-panel_cats a { color: #e3d9cb !important; border-bottom-color: #2c2519 !important; }

/* ----- Barre basse mobile ----- */
html[data-theme="dark"] .mobile-bottombar { background: #201b14 !important; border-top-color: #38312a !important; }

/* ----- Tableaux, filets, champs ----- */
html[data-theme="dark"] hr { border-color: #38312a !important; }
html[data-theme="dark"] table, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: #38312a !important; }
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] textarea {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #f1ece6 !important;
}
html[data-theme="dark"] ::placeholder { color: #9b9182 !important; }

/* ----- Page article (single) : corps de texte, sommaire, blocs « next path » -----
   Les règles legacy .post_content p / body.single … sont plus spécifiques que
   html[data-theme] : on force en !important pour rendre le texte lisible. */
html[data-theme="dark"] .post__holder { background: transparent !important; }
html[data-theme="dark"] .post_content,
html[data-theme="dark"] .post_content p,
html[data-theme="dark"] .post_content li,
html[data-theme="dark"] .post_content strong,
html[data-theme="dark"] .post_content b,
html[data-theme="dark"] .post_content td,
html[data-theme="dark"] .post_content dd {
    color: #dad1c3 !important;
}
html[data-theme="dark"] .post_content a { color: #eca96f !important; }
html[data-theme="dark"] .post_content a:hover { color: #f4ba85 !important; }

/* Citations littéraires dans les articles */
html[data-theme="dark"] .post_content blockquote {
    background: #211c15 !important;
    border-left-color: #d06e0a !important;
}
html[data-theme="dark"] .post_content blockquote p,
html[data-theme="dark"] .post_content blockquote em { color: #ece3d4 !important; }

/* Sommaire (.article-toc) */
html[data-theme="dark"] .article-toc {
    background: #1f1b14 !important;
    border-color: #38312a !important;
}
html[data-theme="dark"] .article-toc a { color: #d4cab9 !important; }
html[data-theme="dark"] .article-toc a:hover { color: #f0a868 !important; }
html[data-theme="dark"] .article-toc-title,
html[data-theme="dark"] .article-toc strong,
html[data-theme="dark"] .article-toc > p { color: #f0b277 !important; }

/* Bloc « continuer la lecture / next path » en bas d'article */
html[data-theme="dark"] .next-path,
html[data-theme="dark"] .next-path_citation {
    background: #1f1b14 !important;
    border-color: #38312a !important;
}
html[data-theme="dark"] .next-path_item-title,
html[data-theme="dark"] .next-path_citation p { color: #e6dccd !important; }
html[data-theme="dark"] .next-path_item-excerpt { color: #b3a999 !important; }
html[data-theme="dark"] .next-path_continue-label,
html[data-theme="dark"] .next-path_item-cat { color: #e8975a !important; }

/* Méta d'article : catégorie, tags (chips clairs → sombres), auteur de citation */
html[data-theme="dark"] .post_category a { color: #e8975a !important; }
html[data-theme="dark"] .post_tags a {
    background: #2a241b !important;
    border-color: #3a342a !important;
    color: #d4cab9 !important;
}
html[data-theme="dark"] .post_tags a:hover { background: #332c20 !important; color: #f0a868 !important; }
html[data-theme="dark"] cite,
html[data-theme="dark"] .home-citation_author { color: #e8975a !important; }

/* ----- Page citations (.testimonial / .testi-item) ----- */
html[data-theme="dark"] .testimonial,
html[data-theme="dark"] .testi-item,
html[data-theme="dark"] .testimonials .testi-item {
    background: #1f1b14 !important;
    border-color: #38312a !important;
}
html[data-theme="dark"] .testimonial blockquote,
html[data-theme="dark"] .testi-item blockquote,
html[data-theme="dark"] .testimonial p,
html[data-theme="dark"] .testi-text { color: #e6dccd !important; }
html[data-theme="dark"] span.user,
html[data-theme="dark"] .testimonial .user,
html[data-theme="dark"] .testi-author { color: #f0b277 !important; }

/* ----- Pagination (pastilles) — toutes pages ----- */
html[data-theme="dark"] .pagination ul li a,
html[data-theme="dark"] .pagination ul li span,
html[data-theme="dark"] .pagination.pagination__posts ul li a,
html[data-theme="dark"] .pagination.pagination__posts ul li span {
    background: #241f17 !important;
    border-color: #38312a !important;
    color: #d4cab9 !important;
}
html[data-theme="dark"] .pagination ul li.active span,
html[data-theme="dark"] .pagination ul li a:hover,
html[data-theme="dark"] .pagination.pagination__posts ul li.active span,
html[data-theme="dark"] .pagination.pagination__posts ul li a:hover {
    background: #d06e0a !important;
    border-color: #d06e0a !important;
    color: #fff !important;
}

/* ----- Audit : surfaces repérées à la visite ----- */

/* Menu déroulant desktop (Articles → catégories) : panneau clair → sombre. */
html[data-theme="dark"] #topnav .sub-menu {
    background: #211c15 !important;
    border-color: #38312a !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5) !important;
}
html[data-theme="dark"] #topnav .sub-menu a { color: #d8cfc1 !important; }
html[data-theme="dark"] #topnav .sub-menu li > a:hover,
html[data-theme="dark"] #topnav .sub-menu li.sfHover > a,
html[data-theme="dark"] #topnav .sub-menu li.current-menu-item > a {
    background: #2c2519 !important;
    color: #f0a868 !important;
}
html[data-theme="dark"] #topnav .sub-menu .badge-count { color: #9b9182 !important; }

/* Surlignage de recherche (<mark>) : ambre sombre pour rester lisible. */
html[data-theme="dark"] mark,
html[data-theme="dark"] .ac-results mark,
html[data-theme="dark"] .search-results mark {
    background: #6b4d1f !important;
    color: #ffe8c0 !important;
}

/* Compteur de résultats de recherche (terracotta trop sombre → éclairci). */
html[data-theme="dark"] .search-count { color: #e8975a !important; }

/* Bouton « fermer » des panneaux mobiles (cercle clair → sombre). */
html[data-theme="dark"] .mobile-panel_close { background: #3a342a !important; color: #e8e2da !important; }

/* Bloc « Continuer dans › … » en bas des listes catégorie (textes #3a3a3a illisibles). */
html[data-theme="dark"] .continue-in { border-top-color: #38312a !important; }
html[data-theme="dark"] .continue-in h2 { color: #f0b277 !important; }
html[data-theme="dark"] .continue-grid a,
html[data-theme="dark"] .continue-grid span { color: #d4cab9 !important; }
html[data-theme="dark"] .continue-grid a:hover span { color: #f0a868 !important; }

/* Page résultats de recherche : snippet + état vide. */
html[data-theme="dark"] .search-snippet,
html[data-theme="dark"] .search-empty { color: #b3a999 !important; }

/* Barre basse mobile : labels/icônes (defaut #8a7a68 ~4.1:1 → éclairci). */
html[data-theme="dark"] .mobile-bottombar_btn { color: #b3a999 !important; }
html[data-theme="dark"] .mobile-bottombar_btn.is-active,
html[data-theme="dark"] .mobile-bottombar_btn[aria-expanded="true"] { color: #f0a868 !important; }

/* Crédit image sous les visuels d'article (#666 → éclairci). */
html[data-theme="dark"] .featured-thumbnail figcaption,
html[data-theme="dark"] .image-credit {
    color: #9b9182 !important;
    border-top-color: #38312a !important;
}

/* Code / pré-formaté dans les articles. */
html[data-theme="dark"] .post_content pre,
html[data-theme="dark"] .post_content code,
html[data-theme="dark"] .post_content kbd {
    background: #211d16 !important;
    color: #e6dccd !important;
    border-color: #38312a !important;
}

/* Formulaire Contact Form 7 (pages statiques). */
html[data-theme="dark"] .wpcf7 select,
html[data-theme="dark"] .wpcf7-form input,
html[data-theme="dark"] .wpcf7-form textarea {
    background: #241f17 !important;
    border-color: #4a4136 !important;
    color: #f1ece6 !important;
}
html[data-theme="dark"] .wpcf7-form label { color: #d8cfc1 !important; }
html[data-theme="dark"] .wpcf7-response-output { color: #e6dccd !important; border-color: #4a4136 !important; }

/* Images : léger adoucissement pour ne pas éblouir sur fond sombre */
html[data-theme="dark"] .post_content img,
html[data-theme="dark"] .featured-thumbnail img { filter: brightness(.92); }
