/* JRRVF Blog Masonry – mode sombre pour tout le site (thème Divi 4).
 * Les couleurs viennent de Réglages › JRRVF Masonry (variables --jbm-d-*).
 * Une section ou un module portant la classe CSS « jbm-no-dark » garde ses couleurs d'origine.
 */

/* ---------- Bouton de bascule ---------- */

.jbm-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 50%;
	background: #fff;
	color: #2a2620;
	cursor: pointer;
	transition: background .3s, color .3s, transform .2s, box-shadow .2s;
}
.jbm-theme-toggle:hover { transform: scale(1.06); }
.jbm-theme-toggle:focus-visible { outline: 2px solid var(--jbm-d-link, #d9b26a); outline-offset: 3px; }
.jbm-theme-toggle__sun { display: none; }
html.jbm-dark .jbm-theme-toggle__sun { display: block; }
html.jbm-dark .jbm-theme-toggle__moon { display: none; }
html.jbm-dark .jbm-theme-toggle {
	background: var(--jbm-d-surface);
	color: var(--jbm-d-link);
	border-color: var(--jbm-d-border);
}
.jbm-theme-toggle--floating {
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.jbm-theme-toggle--bottom-right { right: 20px; }
.jbm-theme-toggle--bottom-left { left: 20px; }
/* Laisse la place au bouton « retour en haut » de Divi. */
.et_pb_scroll_top ~ .jbm-theme-toggle--bottom-right,
body:has(.et_pb_scroll_top.et-visible) .jbm-theme-toggle--bottom-right { bottom: 76px; }
@media print { .jbm-theme-toggle { display: none !important; } }

/* Transition douce au moment de la bascule uniquement. */
html.jbm-theme-switching,
html.jbm-theme-switching *,
html.jbm-theme-switching *::before,
html.jbm-theme-switching *::after {
	transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important;
}

/* ---------- Base ---------- */

html.jbm-dark { color-scheme: dark; background: var(--jbm-d-bg); }

html.jbm-dark body,
html.jbm-dark #page-container,
html.jbm-dark #et-main-area,
html.jbm-dark #main-content,
html.jbm-dark .et_pb_pagebuilder_layout #main-content {
	background-color: var(--jbm-d-bg) !important;
	color: var(--jbm-d-text);
}

/* Sections, y compris celles des modèles du Theme Builder. */
html.jbm-dark #page-container .et_pb_section:not(.jbm-no-dark),
html.jbm-dark .et-l--body .et_pb_section:not(.jbm-no-dark) {
	background-color: var(--jbm-d-bg) !important;
}
html.jbm-dark .et-l--header .et_pb_section:not(.jbm-no-dark),
html.jbm-dark .et-l--footer .et_pb_section:not(.jbm-no-dark) {
	background-color: var(--jbm-d-surface) !important;
}

/* Textes et titres */
html.jbm-dark #page-container :is(.et_pb_module, .entry-content, .et_pb_post, #sidebar, #comment-wrap, #main-footer):not(.jbm-no-dark *) :is(p, li, td, th, dd, dt, label, blockquote, figcaption, address, small):not(.jbm *),
html.jbm-dark #page-container .et_pb_module:not(.jbm-no-dark):not(.jbm-no-dark *),
html.jbm-dark #page-container .et_pb_text_inner {
	color: var(--jbm-d-text) !important;
}
html.jbm-dark #page-container :is(h1, h2, h3, h4, h5, h6):not(.jbm-no-dark *):not(.jbm *),
html.jbm-dark #page-container :is(h1, h2, h3, h4, h5, h6):not(.jbm-no-dark *):not(.jbm *) a,
html.jbm-dark #page-container .entry-title,
html.jbm-dark #page-container .entry-title a {
	color: var(--jbm-d-heading) !important;
}
html.jbm-dark #page-container :is(.et_pb_text, .entry-content, .post-content, .et_pb_post_content, #sidebar, .et_pb_widget, #comment-wrap, .et_pb_blurb_description):not(.jbm-no-dark *) a:not(.et_pb_button):not(.jbm *) {
	color: var(--jbm-d-link) !important;
}
html.jbm-dark #page-container .post-meta,
html.jbm-dark #page-container .post-meta a,
html.jbm-dark #page-container .et_pb_post .post-meta,
html.jbm-dark #page-container .comment_date,
html.jbm-dark #page-container .wp-caption-text {
	color: var(--jbm-d-muted) !important;
}

/* ---------- En-tête Divi classique ---------- */

html.jbm-dark #main-header,
html.jbm-dark #main-header.et-fixed-header,
html.jbm-dark .et_header_style_left #et-top-navigation,
html.jbm-dark #main-header .nav li ul,
html.jbm-dark .et_mobile_menu,
html.jbm-dark #et_search_outer,
html.jbm-dark .et_search_form_container {
	background-color: var(--jbm-d-surface) !important;
	box-shadow: 0 1px 0 var(--jbm-d-border) !important;
}
html.jbm-dark #top-menu a,
html.jbm-dark #main-header .nav li ul a,
html.jbm-dark .et_mobile_menu li a,
html.jbm-dark #et_top_search #et_search_icon:before,
html.jbm-dark .mobile_menu_bar:before,
html.jbm-dark .et_close_search_field:after,
html.jbm-dark .et-search-form input {
	color: var(--jbm-d-text) !important;
}
html.jbm-dark #top-menu li.current-menu-item > a,
html.jbm-dark #top-menu a:hover,
html.jbm-dark .et_mobile_menu li a:hover { color: var(--jbm-d-link) !important; opacity: 1; }
html.jbm-dark .et_mobile_menu li a { border-bottom-color: var(--jbm-d-border) !important; }

/* En-tête du Theme Builder (module Menu) */
html.jbm-dark .et_pb_menu:not(.jbm-no-dark),
html.jbm-dark .et_pb_fullwidth_menu:not(.jbm-no-dark),
html.jbm-dark .et_pb_menu .et-menu-nav > ul ul,
html.jbm-dark .et_pb_menu .et_mobile_menu,
html.jbm-dark .et_pb_fullwidth_menu .et_mobile_menu {
	background-color: var(--jbm-d-surface) !important;
}
html.jbm-dark .et_pb_menu .et-menu a,
html.jbm-dark .et_pb_fullwidth_menu .et-menu a,
html.jbm-dark .et_pb_menu .mobile_menu_bar:before,
html.jbm-dark .et_pb_menu__icon,
html.jbm-dark .et_pb_menu .et_mobile_menu a {
	color: var(--jbm-d-text) !important;
}
html.jbm-dark .et_pb_menu .et-menu .current-menu-item > a { color: var(--jbm-d-link) !important; }

/* ---------- Pied de page ---------- */

html.jbm-dark #main-footer,
html.jbm-dark #footer-bottom,
html.jbm-dark #et-footer-nav {
	background-color: var(--jbm-d-surface) !important;
	color: var(--jbm-d-muted) !important;
}
html.jbm-dark #footer-info,
html.jbm-dark #footer-info a,
html.jbm-dark #footer-widgets .footer-widget,
html.jbm-dark #footer-widgets .footer-widget a,
html.jbm-dark .bottom-nav a { color: var(--jbm-d-muted) !important; }
html.jbm-dark #footer-bottom { border-top: 1px solid var(--jbm-d-border); }

/* ---------- Articles, blog natif Divi, barre latérale, commentaires ---------- */

html.jbm-dark .et_pb_blog_grid .et_pb_post,
html.jbm-dark .et_pb_posts .et_pb_post.et_pb_no_thumb,
html.jbm-dark .et_pb_toggle,
html.jbm-dark .et_pb_tabs,
html.jbm-dark .et_pb_tabs_controls li,
html.jbm-dark .et_pb_pricing_table,
html.jbm-dark .et_pb_testimonial:not(.jbm-no-dark),
html.jbm-dark .comment-body,
html.jbm-dark .et_pb_post .et_pb_image_container + .post-content {
	background-color: var(--jbm-d-surface) !important;
	border-color: var(--jbm-d-border) !important;
}
html.jbm-dark .et_pb_tabs_controls li.et_pb_tab_active { background-color: var(--jbm-d-bg) !important; }
html.jbm-dark .et_pb_tabs_controls li a { color: var(--jbm-d-text) !important; }
html.jbm-dark #sidebar,
html.jbm-dark .container:before,
html.jbm-dark #left-area { border-color: var(--jbm-d-border) !important; }
html.jbm-dark .et_pb_widget_area_left,
html.jbm-dark .et_pb_widget_area_right { border-color: var(--jbm-d-border) !important; }
html.jbm-dark .tagcloud a,
html.jbm-dark .wp-block-tag-cloud a {
	background: var(--jbm-d-surface) !important;
	color: var(--jbm-d-text) !important;
	border: 1px solid var(--jbm-d-border);
}
html.jbm-dark .tagcloud a:hover { color: var(--jbm-d-link) !important; border-color: var(--jbm-d-link); }

html.jbm-dark .et_pb_pagination a,
html.jbm-dark .pagination a,
html.jbm-dark .wp-pagenavi a,
html.jbm-dark .wp-pagenavi span { color: var(--jbm-d-text) !important; border-color: var(--jbm-d-border) !important; }

/* ---------- Formulaires ---------- */

html.jbm-dark input[type="text"],
html.jbm-dark input[type="email"],
html.jbm-dark input[type="url"],
html.jbm-dark input[type="search"],
html.jbm-dark input[type="password"],
html.jbm-dark input[type="number"],
html.jbm-dark input[type="tel"],
html.jbm-dark select,
html.jbm-dark textarea,
html.jbm-dark .et_pb_contact_form .input,
html.jbm-dark .et_pb_search input.et_pb_s,
html.jbm-dark .et_pb_newsletter_form input,
html.jbm-dark #commentform input:not([type="submit"]),
html.jbm-dark #commentform textarea {
	background-color: var(--jbm-d-surface) !important;
	color: var(--jbm-d-text) !important;
	border-color: var(--jbm-d-border) !important;
}
html.jbm-dark ::placeholder { color: var(--jbm-d-muted) !important; opacity: 1; }
html.jbm-dark .et_pb_search,
html.jbm-dark .et_pb_search .et_pb_searchsubmit { border-color: var(--jbm-d-border) !important; }
html.jbm-dark .et_pb_search .et_pb_searchsubmit { background-color: var(--jbm-d-surface) !important; color: var(--jbm-d-text) !important; }

/* ---------- Éléments divers ---------- */

html.jbm-dark hr,
html.jbm-dark .et_pb_divider:before { border-color: var(--jbm-d-border) !important; }
html.jbm-dark blockquote { border-color: var(--jbm-d-link) !important; }
html.jbm-dark pre,
html.jbm-dark code,
html.jbm-dark kbd {
	background-color: var(--jbm-d-surface) !important;
	color: var(--jbm-d-text) !important;
	border-color: var(--jbm-d-border) !important;
}
html.jbm-dark table,
html.jbm-dark th,
html.jbm-dark td { border-color: var(--jbm-d-border) !important; }
html.jbm-dark th { background-color: var(--jbm-d-surface) !important; }
html.jbm-dark ::selection { background: var(--jbm-d-link); color: var(--jbm-d-bg); }
html.jbm-dark .et_pb_scroll_top.et-pb-icon { background: var(--jbm-d-surface) !important; color: var(--jbm-d-link) !important; }
html.jbm-dark .et_overlay { background-color: rgba(0, 0, 0, .6) !important; border-color: var(--jbm-d-border) !important; }
