/*
 * Dark mode for the Isabelle child theme.
 * Active when <html data-theme="dark"> is set by the inline script in functions.php
 * (visitor's saved choice, otherwise their system setting).
 * Selectors are prefixed with html[data-theme="dark"] so they outrank style.css and
 * the Customizer's inline CSS (lib/output.php), including its !important rules.
 */

html[data-theme="dark"] {
	--dm-bg: #1c1b19;
	--dm-surface: #242320;
	--dm-surface-2: #2e2d29;
	--dm-border: #3b3934;
	--dm-text: #dedad1;
	--dm-heading: #f2efe9;
	--dm-muted: #a8a397;
	--dm-link: #c2bdaf;
	--dm-link-hover: #f2efe9;
	--dm-accent: #e2a3a3;
	--dm-btn-border: #55524b;
	color-scheme: dark;
	background-color: var(--dm-bg);
}

/* ---------- Page surfaces ---------- */

html[data-theme="dark"] body,
html[data-theme="dark"] .site-container,
html[data-theme="dark"] .site-inner,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .nav-primary,
html[data-theme="dark"] .nav-primary.fixed,
html[data-theme="dark"] .js .nav-primary,
html[data-theme="dark"] .entry,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .archive-description,
html[data-theme="dark"] .author-box,
html[data-theme="dark"] .comment-respond,
html[data-theme="dark"] .entry-comments,
html[data-theme="dark"] .entry-pings,
html[data-theme="dark"] .sidebar .widget,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .bcs-instagram,
html[data-theme="dark"] .bcs-instagram-full-width,
html[data-theme="dark"] .flexslider,
html[data-theme="dark"] .genesis-nav-menu .sub-menu a {
	background-color: var(--dm-bg) !important;
	color: var(--dm-text);
}

html[data-theme="dark"] .nav-primary.fixed {
	box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .footer-widgets,
html[data-theme="dark"] .bcs-newsletter,
html[data-theme="dark"] blockquote {
	background: var(--dm-surface) !important;
}

html[data-theme="dark"] .bcs-newsletter .widget {
	background: var(--dm-bg) !important;
	outline-color: rgba(28, 27, 25, 0.5);
}

/* Borders and dividers */
html[data-theme="dark"] .sidebar .widget,
html[data-theme="dark"] .home .content .entry,
html[data-theme="dark"] .category-index .featured-content,
html[data-theme="dark"] .genesis-nav-menu .sub-menu,
html[data-theme="dark"] .genesis-nav-menu .sub-menu a,
html[data-theme="dark"] .footer-widgets .widget-title,
html[data-theme="dark"] .bcs-newsletter .enews-widget p:after,
html[data-theme="dark"] hr,
html[data-theme="dark"] tbody,
html[data-theme="dark"] td,
html[data-theme="dark"] .gallery img,
html[data-theme="dark"] fieldset,
html[data-theme="dark"] blockquote,
html[data-theme="dark"] pre {
	border-color: var(--dm-border) !important;
}

/* ---------- Text ---------- */

html[data-theme="dark"] body,
html[data-theme="dark"] .content p,
html[data-theme="dark"] .sidebar p,
html[data-theme="dark"] .entry-content,
html[data-theme="dark"] .entry-content li,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .footer-widgets,
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] label,
html[data-theme="dark"] mark {
	color: var(--dm-text);
}

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"] .entry-title,
html[data-theme="dark"] .entry-title a,
html[data-theme="dark"] .content .entry-title,
html[data-theme="dark"] .content .entry-title a,
html[data-theme="dark"] .widget-title,
html[data-theme="dark"] .sidebar .widget-title a,
html[data-theme="dark"] .footer-widgets .widget-title,
html[data-theme="dark"] .category-index .widget-title,
html[data-theme="dark"] .bcs-instagram .widget-title,
html[data-theme="dark"] .site-title a,
html[data-theme="dark"] .bcs-home-slider .flexslider h2 a,
html[data-theme="dark"] .bcs-home-slider-full-width .flexslider h2 a {
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] .entry-header .entry-meta,
html[data-theme="dark"] .entry-header .entry-meta a,
html[data-theme="dark"] .entry-categories a,
html[data-theme="dark"] .entry-time,
html[data-theme="dark"] .comment-meta,
html[data-theme="dark"] .comment-meta a,
html[data-theme="dark"] .share-after::before,
html[data-theme="dark"] .sharrre .share,
html[data-theme="dark"] .wp-caption-text,
html[data-theme="dark"] figcaption {
	color: var(--dm-muted) !important;
}

/* ---------- Links ---------- */

html[data-theme="dark"] a,
html[data-theme="dark"] .content a,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .archive-pagination a,
html[data-theme="dark"] .prev-next-navigation a {
	color: var(--dm-link);
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus,
html[data-theme="dark"] .content a:hover,
html[data-theme="dark"] .sidebar a:hover,
html[data-theme="dark"] .entry-title a:hover,
html[data-theme="dark"] .archive-pagination a:hover,
html[data-theme="dark"] .archive-pagination .active a {
	color: var(--dm-link-hover) !important;
}

html[data-theme="dark"] .archive-pagination a,
html[data-theme="dark"] .archive-pagination li,
html[data-theme="dark"] .archive-pagination .active a {
	background: transparent !important;
}

/* ---------- Navigation ---------- */

html[data-theme="dark"] .genesis-nav-menu a,
html[data-theme="dark"] .genesis-nav-menu .current-menu-item > a,
html[data-theme="dark"] .nav-primary .simple-social-icons ul li a,
html[data-theme="dark"] .nav-primary .simple-social-icons ul li a:hover,
html[data-theme="dark"] .nav-primary .simple-social-icons ul li a:focus,
html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .sub-menu-toggle {
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] .genesis-nav-menu a:hover,
html[data-theme="dark"] .genesis-nav-menu a:focus {
	color: var(--dm-muted) !important;
}

html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .sub-menu-toggle,
html[data-theme="dark"] .js nav button:hover,
html[data-theme="dark"] .js .menu-toggle:hover,
html[data-theme="dark"] .js nav button:focus,
html[data-theme="dark"] .js .menu-toggle:focus {
	background-color: var(--dm-bg) !important;
	color: var(--dm-heading) !important;
}

/* Social icon widgets: the plugin styles them by widget ID with !important,
   so :not(#dm-none) lifts these rules to ID-level specificity.
   Only the icon links: the widget box keeps its border from .sidebar .widget. */
html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a,
html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a:hover,
html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a:focus {
	background-color: transparent !important;
	border-color: transparent !important;
}

html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a {
	color: var(--dm-heading) !important;
}

html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a:hover,
html[data-theme="dark"]:not(#dm-none) .simple-social-icons ul li a:focus {
	color: var(--dm-muted) !important;
}

html[data-theme="dark"] .simple-social-icons svg[class^="social-"],
html[data-theme="dark"] .simple-social-icons svg {
	fill: currentColor !important;
}

/* Logo is a transparent PNG with dark script: flip it to light */
html[data-theme="dark"] .header-image .site-title > a,
html[data-theme="dark"] .header-image .site-title a {
	filter: invert(1) hue-rotate(180deg);
}

/* Amber's signature (About page, transparent PNG): pink in light mode, white in dark */
html[data-theme="dark"] .amber-signature img,
html[data-theme="dark"] img[src*="/uploads/amber-signature"] {
	filter: brightness(0) invert(1);
}

/* ---------- Slider and featured-post overlays ---------- */

.bcs-home-slider-full-width .bcs-hero-glow {
	display: none;
}

.bcs-home-slider-full-width .bcs-hero-glow-filter {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

html[data-theme="dark"] .bcs-home-slider-full-width {
	position: relative;
	isolation: isolate;
}

html[data-theme="dark"] .bcs-home-slider-full-width .bcs-hero-glow {
	display: block;
	position: absolute;
	top: -100px;
	right: 0;
	bottom: -45px;
	left: 0;
	z-index: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.8) 100px, #000 130px, #000 84%, transparent);
	mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.8) 100px, #000 130px, #000 84%, transparent);
	pointer-events: none;
}

html[data-theme="dark"] .bcs-home-slider-full-width .bcs-hero-glow img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--frame-height, 100%);
	top: 50%;
	object-fit: cover;
	filter: url(#bcs-hero-vertical-blur);
	transform: translateY(-50%) scaleY(var(--vertical-scale, 1.04));
	opacity: 0;
	transition: opacity 1s ease;
}

html[data-theme="dark"] .bcs-home-slider-full-width .bcs-hero-glow img.is-visible {
	opacity: 0.25;
}

html[data-theme="dark"] .bcs-home-slider-full-width > .widget {
	position: relative;
	z-index: 1;
}

#genesis-responsive-slider .flex-control-nav li a:not(.active) {
	background: radial-gradient(circle at 6.5px 5.5px, var(--inactive-dot-color, #888) 3px, transparent 3.75px);
	filter: none;
	box-shadow: none;
}

html[data-theme="dark"] #genesis-responsive-slider {
	--inactive-dot-color: #6b6b6b;
}

html[data-theme="dark"] #genesis-responsive-slider .flex-control-nav li a.active {
	background-position: 0 0 !important;
	filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.75));
}

html[data-theme="dark"] .bcs-home-slider .flexslider .slide-excerpt-border,
html[data-theme="dark"] .bcs-home-slider-full-width .flexslider .slide-excerpt-border {
	background: rgba(28, 27, 25, 0.65) !important;
	outline-color: rgba(28, 27, 25, 0.45) !important;
}

html[data-theme="dark"] .sidebar .featured-content .entry-header,
html[data-theme="dark"] .bcs-home-ctas .featured-content .entry-header {
	background: rgba(28, 27, 25, 0.82) !important;
	outline-color: rgba(28, 27, 25, 0.45) !important;
}

html[data-theme="dark"] #genesis-responsive-slider .slide-excerpt,
html[data-theme="dark"] #genesis-responsive-slider p {
	color: var(--dm-text) !important;
}

html[data-theme="dark"] .bcs-home-slider #genesis-responsive-slider p.bcs-more-paragraph a,
html[data-theme="dark"] .bcs-home-slider-full-width #genesis-responsive-slider p.bcs-more-paragraph a {
	background: var(--dm-surface-2) !important;
	border-color: var(--dm-btn-border) !important;
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] .bcs-home-slider #genesis-responsive-slider p.bcs-more-paragraph a:hover,
html[data-theme="dark"] .bcs-home-slider-full-width #genesis-responsive-slider p.bcs-more-paragraph a:hover {
	background: var(--dm-text) !important;
	border-color: var(--dm-text) !important;
	color: var(--dm-bg) !important;
}

html[data-theme="dark"] .bcs-home-slider #genesis-responsive-slider p a:hover,
html[data-theme="dark"] .bcs-home-slider-full-width #genesis-responsive-slider p a:hover {
	background: rgba(28, 27, 25, 0.7) !important;
}

/* ---------- Buttons ---------- */

html[data-theme="dark"] button,
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] input[type="reset"],
html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] .button,
html[data-theme="dark"] .more-link,
html[data-theme="dark"] .content .more-link,
html[data-theme="dark"] .content .more-from-category a,
html[data-theme="dark"] .content button,
html[data-theme="dark"] .enews-widget input[type="submit"],
html[data-theme="dark"] .sidebar .enews-widget input[type="submit"],
html[data-theme="dark"] .bcs-newsletter .enews-widget input[type="submit"],
html[data-theme="dark"] .footer-widgets input[type="submit"],
html[data-theme="dark"] #subscribe-submit input[type="submit"] {
	background: var(--dm-surface-2) !important;
	border-color: var(--dm-btn-border) !important;
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] button:hover,
html[data-theme="dark"] button:focus,
html[data-theme="dark"] input[type="button"]:hover,
html[data-theme="dark"] input[type="reset"]:hover,
html[data-theme="dark"] input[type="submit"]:hover,
html[data-theme="dark"] input[type="submit"]:focus,
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .more-link:hover,
html[data-theme="dark"] .content .more-link:hover,
html[data-theme="dark"] .content .more-from-category a:hover,
html[data-theme="dark"] .content button:hover,
html[data-theme="dark"] .enews-widget input[type="submit"]:hover {
	background: var(--dm-text) !important;
	border-color: var(--dm-text) !important;
	color: var(--dm-bg) !important;
}

/* Nav search and the dark-mode toggle keep their icon-only look */
html[data-theme="dark"] .nav-primary .search-form input[type="submit"],
html[data-theme="dark"] .nav-primary .dark-mode-toggle {
	background: transparent !important;
	border-color: transparent !important;
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] .site-container button:disabled,
html[data-theme="dark"] .site-container input:disabled {
	background-color: var(--dm-surface-2) !important;
	color: var(--dm-muted) !important;
}

/* ---------- Forms ---------- */

html[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .nav-primary .search input,
html[data-theme="dark"] .email.signup:not([type="submit"]) {
	background-color: var(--dm-surface) !important;
	border-color: var(--dm-border) !important;
	color: var(--dm-heading) !important;
}

html[data-theme="dark"] ::placeholder,
html[data-theme="dark"] .nav-primary .search ::placeholder {
	color: var(--dm-muted) !important;
	opacity: 1;
}

html[data-theme="dark"] :focus {
	outline-color: var(--dm-muted);
}

html[data-theme="dark"] .screen-reader-text:focus,
html[data-theme="dark"] .screen-reader-shortcut:focus {
	background: var(--dm-surface) !important;
	color: var(--dm-heading) !important;
}

/* ---------- Content details ---------- */

html[data-theme="dark"] .entry-content code {
	background-color: var(--dm-surface-2);
	color: var(--dm-heading);
}

html[data-theme="dark"] mark {
	background-color: #6b5f1e;
}

html[data-theme="dark"] .gallery img:hover,
html[data-theme="dark"] .gallery img:focus {
	border-color: var(--dm-muted) !important;
}

html[data-theme="dark"] .bcs-post-affiliate,
html[data-theme="dark"] .sidebar .widget.enews-widget,
html[data-theme="dark"] .sidebar .jetpack_subscription_widget {
	background: var(--dm-surface) !important;
	border-color: var(--dm-bg) !important;
	outline-color: var(--dm-surface) !important;
}

html[data-theme="dark"] .content .share-filled .count {
	color: var(--dm-text) !important;
	border-color: var(--dm-text) !important;
}

html[data-theme="dark"] .content .share-filled .share {
	background: var(--dm-bg) !important;
}

/* Back-to-top button, light mode: same light gray as the sign-up button,
   with the arrow (images/to-top.svg, white) redrawn in #333 so it stays visible */
html:not([data-theme="dark"]) .to-top {
	background-color: #eee !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon fill='%23333333' points='8,2.8 16,10.7 13.6,13.1 8.1,7.6 2.5,13.2 0,10.7'/%3E%3C/svg%3E") !important;
}

html:not([data-theme="dark"]) .no-touch .to-top:hover,
html:not([data-theme="dark"]) .to-top:hover {
	background-color: #ddd !important;
}

/* Back-to-top button, dark mode */
html[data-theme="dark"] .to-top {
	background-color: var(--dm-surface-2);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* WP Recipe Maker cards */
html[data-theme="dark"] .wprm-recipe,
html[data-theme="dark"] .wprm-recipe-container .wprm-recipe {
	background-color: var(--dm-surface) !important;
	border-color: var(--dm-border) !important;
	color: var(--dm-text) !important;
}

html[data-theme="dark"] .wprm-recipe * {
	border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .wprm-recipe-name,
html[data-theme="dark"] .wprm-recipe-header {
	color: var(--dm-heading) !important;
}

/* Block editor content with light backgrounds */
html[data-theme="dark"] .wp-block-table td,
html[data-theme="dark"] .wp-block-table th {
	border-color: var(--dm-border);
}

html[data-theme="dark"] .wp-block-separator {
	border-color: var(--dm-border);
	background-color: var(--dm-border);
}

/* Jetpack sharing / likes */
html[data-theme="dark"] .sharedaddy .sd-title,
html[data-theme="dark"] .sd-content ul li a.sd-button {
	color: var(--dm-text) !important;
}

html[data-theme="dark"] .sd-content ul li a.sd-button {
	background: var(--dm-surface) !important;
	border-color: var(--dm-border) !important;
	box-shadow: none !important;
}

/* ---------- Toggle button (both modes) ---------- */

.genesis-nav-menu .dark-mode-toggle-item {
	display: inline-block;
	vertical-align: middle;
}

.dark-mode-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0 4px;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 50%;
	color: inherit !important;
	cursor: pointer;
	line-height: 1;
}

.dark-mode-toggle,
.dark-mode-toggle:hover,
.dark-mode-toggle:focus,
.dark-mode-toggle:active,
html[data-theme="dark"] .dark-mode-toggle:focus {
	outline: none !important;
	box-shadow: none !important;
}

.dark-mode-toggle:hover,
.dark-mode-toggle:focus-visible {
	opacity: 0.65;
}

/* ---------- Slower button hover (both modes; theme default is 0.1s) ---------- */

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.more-link,
.more-from-category a,
#genesis-responsive-slider p.bcs-more-paragraph a {
	transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease, opacity 400ms ease;
}

/* ---------- Fade between modes (1000ms) ---------- */

/* Browsers with View Transitions: cross-fade the whole page */
::view-transition-old(root),
::view-transition-new(root) {
	animation-duration: 1000ms;
	animation-timing-function: ease;
}

/* Fallback: transition colors while .theme-fading is on <html> (set by dark-mode.js) */
html.theme-fading,
html.theme-fading *,
html.theme-fading *::before,
html.theme-fading *::after {
	transition: background-color 1000ms ease, color 1000ms ease, border-color 1000ms ease,
		outline-color 1000ms ease, fill 1000ms ease, stroke 1000ms ease, filter 1000ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
	::view-transition-old(root),
	::view-transition-new(root) {
		animation: none;
	}
}

.dark-mode-toggle svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.dark-mode-toggle .dm-icon-sun,
html[data-theme="dark"] .dark-mode-toggle .dm-icon-moon {
	display: none;
}

html[data-theme="dark"] .dark-mode-toggle .dm-icon-sun {
	display: block;
}

@media print {
	html[data-theme="dark"],
	html[data-theme="dark"] body {
		background: #fff !important;
		color-scheme: light;
	}

	html[data-theme="dark"] .header-image .site-title a {
		filter: none;
	}

	.dark-mode-toggle-item {
		display: none !important;
	}
}

/* Let the homepage halo show through the mobile navigation toggle. */
html[data-theme="dark"] body.home:has(.bcs-hero-glow) button.menu-toggle,
html[data-theme="dark"] body.home:has(.bcs-hero-glow) button.menu-toggle:is(:hover, :focus, :active) {
	background: transparent !important;
	color: var(--dm-heading) !important;
}

/* Hero action spacing in both color modes. */
.bcs-home-slider-full-width #genesis-responsive-slider p.bcs-more-paragraph {
	margin-top: 20px;
	margin-bottom: 4px;
}

#genesis-responsive-slider .slide-excerpt-border p:not(.bcs-more-paragraph) {
	line-height: 1.5;
	text-align: left;
}

/* Sitewide heading rhythm in both color modes. */
body h2 {
	line-height: 1.4 !important;
}

#genesis-responsive-slider .slide-excerpt-border:has(.bcs-more-paragraph) {
	padding-bottom: 20px !important;
}
#genesis-responsive-slider .bcs-more-paragraph ~ p:empty {
	display: none;
}

html[data-theme="dark"] body button.menu-toggle,
html[data-theme="dark"] body button.menu-toggle:is(:hover, :focus, :active) {
	outline: none !important;
	border: 0 !important;
	box-shadow: none !important;
}
html[data-theme="dark"] body button.menu-toggle:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* The slider's centered excerpt wrapper already spans half the image. */
.bcs-home-slider-full-width #genesis-responsive-slider .slide-excerpt-border {
	width: 100% !important;
	box-sizing: border-box;
}

.bcs-home-slider-full-width #genesis-responsive-slider .slide-excerpt-border {
	padding-top: 26px !important;
}
.bcs-home-slider-full-width #genesis-responsive-slider .slide-excerpt-border h2 {
	margin-bottom: 16px;
}

.bcs-home-slider-full-width #genesis-responsive-slider .slide-excerpt-border {
	outline-color: rgba(251, 251, 251, 0.40) !important;
}
html[data-theme="dark"] .bcs-home-slider-full-width #genesis-responsive-slider .slide-excerpt-border {
	outline-color: rgba(28, 27, 25, 0.36) !important;
}

/* Extend each post preview's permalink over its card. */
main article.post:has(.entry-title a[rel="bookmark"]):has(.more-link) {
	position: relative;
	isolation: isolate;
}
main article.post:has(.more-link) .entry-title a[rel="bookmark"]::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
main article.post:has(.more-link) :is(.entry-meta, .entry-content, .entry-footer) a {
	position: relative;
	z-index: 2;
}

/* Keep the opening lines together when the drop cap spans two paragraphs. */
.single-post .entry-content > p.has-drop-cap:has(+ p.wp-block-paragraph) {
	margin-bottom: 0;
}
.single-post .entry-content > p.has-drop-cap + p.wp-block-paragraph {
	margin-top: 0;
}

/* Float beside three body lines; the fourth line uses the full width. */
.single-post .entry-content p.has-drop-cap:not(:focus)::first-letter {
	font-size: 6.5em;
}
