/*
 * Fesheni Africa child theme: dark mode.
 *
 * Every rule is scoped to html.fesheni-is-dark: a small script at the top of
 * the page adds that class when the site should be dark (the visitor's own
 * choice from the Light/Dark pill, else the setting in Customise), so dark
 * mode can switch instantly and survives WP-Optimize merging stylesheets.
 * Previously: loaded only when it applies, with a "prefers-color-scheme: dark" media
 * query when the site follows the visitor's device, or always when set to
 * dark. Colours come from Appearance > Customise > Light and dark mode.
 *
 * Built from Anymag's own colour rules. Anything inside an Elementor layout
 * (".elementor") or a cover headline (".cover-title", which sits on a photo)
 * keeps its own colours, so light Elementor sections never end
 * up with light text. Images, category labels and buttons keep theirs too.
 */

html.fesheni-is-dark { color-scheme: dark; }

/* Page and panel backgrounds. */
html.fesheni-is-dark body,
html.fesheni-is-dark body .site-wrapper,
html.fesheni-is-dark body .magheader,
html.fesheni-is-dark body .magcontent,
html.fesheni-is-dark body #main-area,
html.fesheni-is-dark body #content-header,
html.fesheni-is-dark body .turn-left,
html.fesheni-is-dark body .post-format,
html.fesheni-is-dark body .magcover,
html.fesheni-is-dark body .searchform-overlay,
html.fesheni-is-dark body .top-menu-button {
	background-color: var(--fd-bg, #121317) !important;
}

/* Top bar and side menu. */
html.fesheni-is-dark body #top-bar-right,
html.fesheni-is-dark body #content-header,
html.fesheni-is-dark body .magheader {
	background-color: transparent !important;
}
html.fesheni-is-dark body #hidden-sidebar .widgets-side,
html.fesheni-is-dark body #hidden-sidebar.active .widgets-side,
html.fesheni-is-dark body .nav-panel {
	background-color: var(--fd-menu-bg, #16181e) !important;
}

/* Fields, quotes, comment and author boxes. */
html.fesheni-is-dark body input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not(.elementor *),
html.fesheni-is-dark body select:not(.elementor *),
html.fesheni-is-dark body textarea:not(.elementor *),
html.fesheni-is-dark body pre:not(.elementor *),
html.fesheni-is-dark body .author-content,
html.fesheni-is-dark body .thecomment,
html.fesheni-is-dark body #wp-calendar caption,
html.fesheni-is-dark body .owl-nav button {
	background-color: var(--fd-surface, #1b1d23) !important;
	color: var(--fd-text, #d9dbe1) !important;
	border-color: var(--fd-line, #2e313a) !important;
}

/* Body text. */
html.fesheni-is-dark body,
html.fesheni-is-dark body p:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body li:not(.elementor *),
html.fesheni-is-dark body blockquote:not(.elementor *),
html.fesheni-is-dark body label:not(.elementor *),
html.fesheni-is-dark body figcaption:not(.elementor *),
html.fesheni-is-dark body .post-content:not(.elementor *),
html.fesheni-is-dark body .post-entry:not(.elementor *),
html.fesheni-is-dark body .sidebar,
html.fesheni-is-dark body .widget:not(.elementor *),
html.fesheni-is-dark body .searchform-overlay p,
html.fesheni-is-dark body .searchform-overlay .search-field {
	color: var(--fd-text, #d9dbe1) !important;
}

/* Titles. */
html.fesheni-is-dark body h1:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body h2:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body h3:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body h4:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body h5:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body h6:not(.elementor *):not(.cover-title *),
html.fesheni-is-dark body .post-title a,
html.fesheni-is-dark body .entry-title,
html.fesheni-is-dark body .section-title h2,
html.fesheni-is-dark body .related-posts-title h2,
html.fesheni-is-dark body .sidebar .widget-title,
html.fesheni-is-dark body .category-box h1,
html.fesheni-is-dark body .intro-line h1,
html.fesheni-is-dark body .post-readmore a,
html.fesheni-is-dark body .thecomment .comment-text h6.author,
html.fesheni-is-dark body .thecomment .comment-text h6.author a,
html.fesheni-is-dark body .item-related h5 a,
html.fesheni-is-dark body .latest-posts-text h4 a,
html.fesheni-is-dark body .sidebar .widget_recent_entries ul li a {
	color: var(--fd-heading, #fff) !important;
}

/* Links in text. */
html.fesheni-is-dark body .post-content a:not(.elementor *):not(.wp-block-button__link),
html.fesheni-is-dark body .post-entry a:not(.elementor *):not(.wp-block-button__link),
html.fesheni-is-dark body .sidebar a,
html.fesheni-is-dark body .widget a:not(.elementor *),
html.fesheni-is-dark body .comment-text a,
html.fesheni-is-dark body .post-comments span.reply a {
	color: var(--fd-link, #fff) !important;
}

/* Dates, authors and details. */
html.fesheni-is-dark body .post-meta,
html.fesheni-is-dark body .post-meta li,
html.fesheni-is-dark body .post-meta li span,
html.fesheni-is-dark body .post-meta a,
html.fesheni-is-dark body .list-date,
html.fesheni-is-dark body .list-date span,
html.fesheni-is-dark body .widget-date,
html.fesheni-is-dark body .comment-text .date,
html.fesheni-is-dark body .content-part .post-meta,
html.fesheni-is-dark body .content-part .post-meta a {
	color: var(--fd-muted, #9aa0ad) !important;
}

/* Excerpts. */
html.fesheni-is-dark body .post-list-entry p {
	color: var(--fd-excerpt, #d9dbe1) !important;
}

/* Menu, top bar and plain social icons. */
html.fesheni-is-dark body #nav-wrapper .nav-menu li a,
html.fesheni-is-dark body #nav-wrapper ul.nav-menu ul a,
html.fesheni-is-dark body .slicknav_nav a,
html.fesheni-is-dark body #top-search a.search {
	color: var(--fd-menu-link, #fff) !important;
}
html.fesheni-is-dark body #top-search a.search,
html.fesheni-is-dark body .sub-menu-toggle::after,
html.fesheni-is-dark body .header-social-links a:not(.fsp),
html.fesheni-is-dark body:not(.fesheni-pills) .header-social-links a,
html.fesheni-is-dark body .cart-contents,
html.fesheni-is-dark body .user-contents {
	color: var(--fd-menu-link, #fff) !important;
}

/* The + button for the hidden sidebar (drawn with lines in its text colour). */
html.fesheni-is-dark body .hidden-sidebar-button a.open-hidden-sidebar,
html.fesheni-is-dark body .hidden-sidebar-button a.open-hidden-sidebar span {
	color: var(--fd-menu-link, #fff) !important;
	border-color: currentColor !important;
}
html.fesheni-is-dark body #top-bar-right i,
html.fesheni-is-dark body #top-search a.search i,
html.fesheni-is-dark body .cart-contents i,
html.fesheni-is-dark body .user-contents i {
	color: var(--fd-menu-link, #fff) !important;
}
html.fesheni-is-dark body .top-menu-button span,
html.fesheni-is-dark body #nav-wrapper .simplebar-scrollbar::before {
	background: var(--fd-heading, #fff) !important;
}

/* Lines and borders. */
html.fesheni-is-dark body hr,
html.fesheni-is-dark body blockquote,
html.fesheni-is-dark body fieldset,
html.fesheni-is-dark body .category-box h1,
html.fesheni-is-dark body .category-descr p,
html.fesheni-is-dark body .cover-descr h3,
html.fesheni-is-dark body .section-title h2,
html.fesheni-is-dark body .related-posts-title h2,
html.fesheni-is-dark body .sidebar .widget-title,
html.fesheni-is-dark body ul.post-meta li:not(:last-child)::after {
	border-color: var(--fd-line, #2e313a) !important;
}

/* Footer. */
html.fesheni-is-dark body #footer,
html.fesheni-is-dark body #footer-copyright {
	background-color: var(--fd-footer-bg, #1b1d23) !important;
	color: var(--fd-footer-text, #9aa0ad) !important;
}
html.fesheni-is-dark body #footer p,
html.fesheni-is-dark body #footer li {
	color: var(--fd-footer-text, #9aa0ad) !important;
}
html.fesheni-is-dark body #footer a {
	color: var(--fd-footer-link, #fff) !important;
}

/* The theme's paper-fold shadows are drawn for white pages. */
html.fesheni-is-dark body .fold-shadow,
html.fesheni-is-dark body .fold-shadow-left,
html.fesheni-is-dark body .fold-shadow-right {
	opacity: 0.06 !important;
}


/* The phone drawer and its button. */
html.fesheni-is-dark body .fsp-wrap .fsp-drawer {
	--fsp-sheet-bg: var(--fd-surface, #1b1d23);
	--fsp-sheet-handle: rgba(255, 255, 255, 0.25);
}
html.fesheni-is-dark body .fsp-wrap .fsp-toggle {
	--fsp-toggle-bg: var(--fd-heading, #fff);
	--fsp-toggle-fg: var(--fd-bg, #121317);
}

/* Black pills (X, TikTok) get a faint outline so they stand out on dark. */
html.fesheni-is-dark body .header-social-links a.fsp {
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* Pills that follow light and dark mode: light pills on the dark site. */
html.fesheni-is-dark body.fesheni-pills-theme .fsp-wrap a.fsp {
	--fsp-bg: var(--fd-pill-bg, #f2f3f5);
	--fsp-fg: var(--fd-pill-fg, #111);
}
html.fesheni-is-dark body .fsp-wrap .fsp-drawer {
	--fsp-sheet-fg: var(--fd-heading, #fff);
}

/* Dark-mode images (About widget): the dark version replaces the light one. */
html.fesheni-is-dark body .anymag-dark-only { display: inline-block !important; }
html.fesheni-is-dark body .anymag-light-only { display: none !important; }


/* Post title links on the home, category and search pages. */
html.fesheni-is-dark body .magcontent :is(h1, h2, h3, h4, h5, h6):not(.elementor *):not(.cover-title *) a:not(.cvr-heading) {
	color: var(--fd-list-link, var(--fd-heading, #fff)) !important;
}
html.fesheni-is-dark body .magcontent :is(h1, h2, h3, h4, h5, h6):not(.elementor *):not(.cover-title *) a:not(.cvr-heading):hover,
html.fesheni-is-dark body .magcontent :is(h1, h2, h3, h4, h5, h6):not(.elementor *):not(.cover-title *) a:not(.cvr-heading):focus {
	color: var(--fd-list-link-hover, #cfd2d9) !important;
}

/* Strips and buttons in dark mode. */
html.fesheni-is-dark body .fsp-wrap .fsp-drawer {
	--fsp-strip-bg: rgba(27, 29, 35, 0.94);
}
html.fesheni-is-dark body .header-social-links .fsp-toggle {
	--fsp-toggle-fg: var(--fd-menu-link, #fff);
}
