/* Farmah's – dark mode. Turned on by html[data-theme="dark"] (set before paint from the visitor's choice or the device setting). */

html[data-theme="dark"] {
	color-scheme: dark;
	--fm-bg: #15130F;
	--fm-surface: #1E1B16;
	--fm-surface-2: #26221B;
	--fm-gold: #F6D58A;
	--fm-link: #F6D58A;
	--wp--preset--color--sand: #24211B;
	--wp--preset--color--ink: #F3EDE2;
	--wp--preset--color--line: #36302A;
	--wp--preset--color--muted: #BDB4A3;
	--wp--preset--color--tile-lentil: #33281A;
	--wp--preset--color--tile-rose: #33221D;
	--wp--preset--color--tile-rice: #2A261F;
	--wp--preset--color--tile-turmeric: #352A15;
	--wp--preset--color--tile-leaf: #1B2B22;
	--wp--preset--color--tile-lavender: #29222F;
	--wp--preset--color--tile-sky: #1C242E;
	--wp--preset--color--tile-mango: #33251B;
	--wp--preset--color--photo-stone: #2E281F;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .wp-site-blocks { background: var(--fm-bg); color: var(--wp--preset--color--ink); }

/* Header: logo, tagline, account, links that use the brand colour as text */
html[data-theme="dark"] header,
html[data-theme="dark"] .fm-header { background: var(--fm-bg); }
html[data-theme="dark"] .fm-logo,
html[data-theme="dark"] .fm-logo a,
html[data-theme="dark"] .fm-logo-name,
html[data-theme="dark"] .fm-logo-name a { color: var(--fm-gold) !important; }
html[data-theme="dark"] .fm-logo svg,
html[data-theme="dark"] .fm-logo svg * { fill: var(--fm-gold); }
html[data-theme="dark"] .fm-mark { background-color: var(--fm-gold) !important; }
html[data-theme="dark"] .fm-logo img { filter: brightness(0) invert(86%) sepia(38%) saturate(620%) hue-rotate(340deg); }
html[data-theme="dark"] .fm-logo-sub { color: #D9B76A !important; }
html[data-theme="dark"] .fm-header-actions a,
html[data-theme="dark"] .fm-header-actions .label,
html[data-theme="dark"] .wc-block-customer-account a { color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .wc-block-customer-account svg { fill: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-catnav a { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-search input { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; border-color: var(--wp--preset--color--line) !important; }
html[data-theme="dark"] .fm-search input::placeholder { color: var(--wp--preset--color--muted); }

/* Text in brand / accent colours that was meant for a light background */
html[data-theme="dark"] .fm-eyebrow { color: #F39A6B !important; }
html[data-theme="dark"] .fm-section-head a,
html[data-theme="dark"] .has-primary-color,
html[data-theme="dark"] .entry-content a:not(.wp-element-button):not([class*="btn"]),
html[data-theme="dark"] .wp-block-post-content a:not(.wp-element-button):not([class*="btn"]):not(.fm-rcard a),
html[data-theme="dark"] .fm-credit a { color: var(--fm-link) !important; }
html[data-theme="dark"] .has-spice-color { color: #E2B76B !important; }
html[data-theme="dark"] .has-chili-color { color: #F39A6B !important; }
html[data-theme="dark"] .has-forest-color { color: #A9D9BF !important; }
html[data-theme="dark"] .has-muted-color { color: var(--wp--preset--color--muted) !important; }

/* White surfaces → dark cards */
html[data-theme="dark"] .has-white-background-color,
html[data-theme="dark"] .has-base-background-color { background-color: var(--fm-surface) !important; }
html[data-theme="dark"] .has-white-color { color: #fff !important; }
html[data-theme="dark"] .wp-block-button.is-style-outline > .wp-block-button__link,
html[data-theme="dark"] .wp-block-button__link.has-white-background-color { background: transparent !important; color: var(--wp--preset--color--ink) !important; border-color: #5A5246 !important; }
html[data-theme="dark"] .fm-brands .wp-block-button__link,
html[data-theme="dark"] .wp-block-buttons .wp-block-button:not(.is-style-fill) > .wp-block-button__link[style*="background-color:#fff"],
html[data-theme="dark"] .wp-block-buttons .wp-block-button > .wp-block-button__link.has-white-background-color { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; }

/* Product cards: dark card, packshot keeps a soft cream tile so packs look natural */
html[data-theme="dark"] li.product,
html[data-theme="dark"] .wc-block-grid__product,
html[data-theme="dark"] .wc-block-product,
html[data-theme="dark"] .fm-pcard { background: var(--fm-surface) !important; border-color: var(--wp--preset--color--line) !important; color: var(--wp--preset--color--ink); }
html[data-theme="dark"] li.product img,
html[data-theme="dark"] .wc-block-grid__product-image img,
html[data-theme="dark"] .woocommerce-product-gallery img { background: #F6F1E7; border-radius: 12px; }
html[data-theme="dark"] li.product .woocommerce-loop-product__title,
html[data-theme="dark"] li.product .price,
html[data-theme="dark"] li.product .price *,
html[data-theme="dark"] .wgm-info,
html[data-theme="dark"] .wgm-info a,
html[data-theme="dark"] .versandkosten { color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .fm-unit-price,
html[data-theme="dark"] .wgm-info { color: var(--wp--preset--color--muted) !important; }
html[data-theme="dark"] .price del, html[data-theme="dark"] .fm-low30 { color: #A79E8E !important; }
html[data-theme="dark"] .price ins { color: #FFB38A !important; }

/* Product page, food box, recipe pages */
html[data-theme="dark"] .fm-food-box,
html[data-theme="dark"] .fm-al-filter__pop,
html[data-theme="dark"] .woocommerce-tabs,
html[data-theme="dark"] .fm-rcard { background: var(--fm-surface) !important; border-color: var(--wp--preset--color--line) !important; color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-rcard a { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-facts li { background: var(--fm-surface-2); }
html[data-theme="dark"] .fm-facts li.fm-famous { background: transparent; border-color: #E7A94A; }

/* Forms, tables, cart, checkout */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; border-color: #4A4339 !important; }
html[data-theme="dark"] table, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: var(--wp--preset--color--line) !important; }
html[data-theme="dark"] .woocommerce-info, html[data-theme="dark"] .woocommerce-message, html[data-theme="dark"] .woocommerce-error { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; }
/* Newer WooCommerce notices (e.g. "Have a coupon?" on the checkout) */
html[data-theme="dark"] .wc-block-components-notice-banner { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; border-color: #4A4339 !important; }
html[data-theme="dark"] .wc-block-components-notice-banner a { color: var(--fm-gold) !important; }
html[data-theme="dark"] .wc-block-components-notice-banner > svg { background: var(--fm-gold) !important; fill: #15130F !important; }

/* Footer keeps its deep brand colour; text that used a light tile colour stays light */
html[data-theme="dark"] .fm-footer { color: #EDE5D5 !important; }
html[data-theme="dark"] .fm-footer a { color: #F6E7C4 !important; }

/* Cookie banner button */
html[data-theme="dark"] .cmplz-manage-consent { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; }

/* Festival art: the lamps glow at night */
html[data-theme="dark"] .fa-flicker { animation: fm-glow 2.4s ease-in-out infinite alternate; }
@keyframes fm-glow {
	from { filter: drop-shadow(0 0 3px #FFD166) drop-shadow(0 0 10px rgba(255, 150, 30, .8)) drop-shadow(0 0 20px rgba(255, 120, 0, .4)); }
	to   { filter: drop-shadow(0 0 6px #FFE29A) drop-shadow(0 0 16px rgba(255, 160, 40, 1)) drop-shadow(0 0 34px rgba(255, 120, 0, .7)); }
}
@media (prefers-reduced-motion: reduce) {
	html[data-theme="dark"] .fa-flicker { animation: none; filter: drop-shadow(0 0 5px #FFD166) drop-shadow(0 0 14px rgba(255, 150, 30, .85)); }
}
html[data-theme="dark"] .fm-fest__garland svg { filter: saturate(1.1); }

/* Photos a touch softer at night */
html[data-theme="dark"] .fm-hero img,
html[data-theme="dark"] .wp-block-post-featured-image img,
html[data-theme="dark"] .fm-rslide__img img { filter: brightness(.93); }

/* Theme switch */
.fm-theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--wp--preset--color--sand); color: var(--wp--preset--color--ink); cursor: pointer; flex: 0 0 auto; }
.fm-theme-toggle:hover { filter: brightness(1.08); }
.fm-theme-toggle:focus-visible { outline: 3px solid var(--wp--preset--color--saffron); outline-offset: 2px; }
.fm-theme-toggle svg { width: 20px; height: 20px; }
.fm-theme-toggle .fm-sun { display: none; }
html[data-theme="dark"] .fm-theme-toggle .fm-sun { display: block; color: var(--fm-gold); }
html[data-theme="dark"] .fm-theme-toggle .fm-moon { display: none; }
@media (max-width: 781px) { .fm-theme-toggle { width: 34px; height: 34px; } }

/* Links that use the theme's brand link colour (breadcrumbs, categories, brands, text links) */
html[data-theme="dark"] a:where(:not(.wp-element-button):not(.button)) { color: var(--fm-link); }
html[data-theme="dark"] .woocommerce-breadcrumb,
html[data-theme="dark"] .woocommerce-breadcrumb a,
html[data-theme="dark"] .wc-block-breadcrumbs a,
html[data-theme="dark"] .product_meta a { color: var(--fm-link) !important; }
html[data-theme="dark"] li.product a,
html[data-theme="dark"] .wc-block-grid__product a,
html[data-theme="dark"] .fm-catnav a,
html[data-theme="dark"] .fm-header-actions a { color: var(--wp--preset--color--ink); }

/* Product page texts with fixed dark colours */
html[data-theme="dark"] .woocommerce-product-details__short-description,
html[data-theme="dark"] .woocommerce-product-details__short-description p,
html[data-theme="dark"] .woocommerce-Tabs-panel,
html[data-theme="dark"] .woocommerce-Tabs-panel p,
html[data-theme="dark"] .woocommerce-tabs .tabs a { color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .woocommerce-product-gallery__trigger { background: var(--fm-surface-2) !important; }

/* "Recipes with this product" cards on the product page */
html[data-theme="dark"] .fm-m-recipe { background: var(--fm-surface) !important; border-color: var(--wp--preset--color--line) !important; color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .fm-m-recipe * { color: inherit; }
html[data-theme="dark"] .fm-m-recipe li,
html[data-theme="dark"] .fm-m-recipe span:not(.fm-m-recipe__img) { color: var(--wp--preset--color--muted); }

/* Every surface the main stylesheet paints white (generated from style.css) */
html[data-theme="dark"] #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-deny,
html[data-theme="dark"] #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-save-preferences,
html[data-theme="dark"] #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences,
html[data-theme="dark"] .fm-al-filter form,
html[data-theme="dark"] .fm-al-filter summary,
html[data-theme="dark"] .fm-brands .wp-block-button__link,
html[data-theme="dark"] .fm-catnav a,
html[data-theme="dark"] .fm-food-box,
html[data-theme="dark"] .fm-guide__names,
html[data-theme="dark"] .fm-m-recipe,
html[data-theme="dark"] .fm-placeholder,
html[data-theme="dark"] .fm-rcard,
html[data-theme="dark"] .fm-rchip,
html[data-theme="dark"] .fm-rsearch__box,
html[data-theme="dark"] .fm-rsearch__none,
html[data-theme="dark"] .fm-sp,
html[data-theme="dark"] .fm-spice,
html[data-theme="dark"] .wc-block-grid__product,
html[data-theme="dark"] .woocommerce .cart-collaterals .cart_totals table.shop_table,
html[data-theme="dark"] .woocommerce-cart table.cart .quantity,
html[data-theme="dark"] .woocommerce-cart table.cart tr.cart_item,
html[data-theme="dark"] .woocommerce-checkout #order_review table.shop_table,
html[data-theme="dark"] .woocommerce-checkout #payment,
html[data-theme="dark"] .wp-block-button.is-style-outline > .wp-block-button__link,
html[data-theme="dark"] ul.products li.product { background-color: var(--fm-surface) !important; color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .woocommerce .quantity .qty,
html[data-theme="dark"] .woocommerce .select2-container .select2-selection--single,
html[data-theme="dark"] .woocommerce .woocommerce-ordering select,
html[data-theme="dark"] .woocommerce div.product table.variations select,
html[data-theme="dark"] .woocommerce form .input-text,
html[data-theme="dark"] .woocommerce form select,
html[data-theme="dark"] .woocommerce form textarea,
html[data-theme="dark"] .woocommerce-page form .input-text,
html[data-theme="dark"] .woocommerce-page form select,
html[data-theme="dark"] .woocommerce-page form textarea,
html[data-theme="dark"] .wpcf7 input[type=email],
html[data-theme="dark"] .wpcf7 input[type=tel],
html[data-theme="dark"] .wpcf7 input[type=text],
html[data-theme="dark"] .wpcf7 input[type=url],
html[data-theme="dark"] .wpcf7 select,
html[data-theme="dark"] .wpcf7 textarea { background-color: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink) !important; border-color: #4A4339 !important; }
html[data-theme="dark"] .fm-spice details summary,
html[data-theme="dark"] .fm-spice a { color: var(--fm-link) !important; }
html[data-theme="dark"] .fm-sp a,
html[data-theme="dark"] .fm-sp .price,
html[data-theme="dark"] .fm-sp .price * { color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .fm-sp img { background: #F6F1E7; border-radius: 12px; }
html[data-theme="dark"] .fm-guide__names td { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-guide__names .is-first { background: var(--fm-surface-2); color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-al-filter summary { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-al-filter form { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .fm-al-filter label { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-catnav a:hover { background-color: var(--fm-surface-2) !important; }
html[data-theme="dark"] .fm-catnav::before { background: linear-gradient(90deg, var(--fm-bg), transparent) !important; }
html[data-theme="dark"] .fm-catnav::after { background: linear-gradient(270deg, var(--fm-bg), transparent) !important; }
html[data-theme="dark"] .cart_totals tr.fm-freeship td { background: var(--fm-surface-2) !important; }
@media (min-width: 1025px) { html[data-theme="dark"] .fm-catnav a { background-color: transparent !important; } html[data-theme="dark"] .fm-catnav a:hover { background-color: var(--fm-surface-2) !important; } }
/* Allergen code badges (A–R) */
html[data-theme="dark"] .fm-al { background: #3A2E14; color: #F6D58A; border-color: #C9962E; }
html[data-theme="dark"] .fm-al.is-trace { background: transparent; color: #CFC6B4; border-color: #8E8574; }
html[data-theme="dark"] .fm-al-filter input[type="checkbox"] { accent-color: #F2B544; }
html[data-theme="dark"] .fm-al-filter summary:hover,
html[data-theme="dark"] .fm-al-filter[open] summary,
html[data-theme="dark"] .fm-al-filter.is-active summary { border-color: #F2B544 !important; }
html[data-theme="dark"] .fm-sp--compact .fm-sp__img img { background: #F6F1E7 !important; border-color: transparent; }

/* Headings that are links (category tiles, card titles) keep the heading colour */
html[data-theme="dark"] :is(h1,h2,h3,h4,h5) a:where(:not(.wp-element-button)) { color: inherit; }
html[data-theme="dark"] .fm-rbtn--saffron { color: #2A1A04; }
html[data-theme="dark"] .fm-more-btn { color: var(--fm-gold); }
html[data-theme="dark"] .fm-usps .wp-block-column::before { background: #24342B url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239FD8B4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 24px no-repeat; }
html[data-theme="dark"] .fm-rcard__more { color: var(--fm-gold); }
/* Text that is dark blue in light mode reads gold in dark mode */
html[data-theme="dark"] :is(.fm-infobox svg, .fm-drawer__shop a, .fm-spice details summary, .fm-spice__shop, .fm-guide .fm-sp__body .added_to_cart, .fm-food-label-link, .fm-food-none, .fm-food-box summary, .fm-m-recipe__text em, .fm-low30.is-cut, .fm-mini-recipe-title a:hover, #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links a, #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-link) { color: var(--fm-gold) !important; }
html[data-theme="dark"] :is(.fm-rcard:hover, .fm-rcard:focus-within, .fm-m-recipe:hover, .fm-rchip:hover, .fm-brands .wp-block-button__link:hover) { border-color: var(--fm-gold); }

/* Phone menu drawer: dark panel (it stayed white, so the light dark-mode link colours were unreadable) */
html[data-theme="dark"] .fm-drawer__panel { background: var(--fm-surface) !important; box-shadow: 4px 0 24px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .fm-drawer__list a { color: var(--wp--preset--color--ink) !important; }
html[data-theme="dark"] .fm-drawer__list li { border-bottom-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .fm-drawer__list .fm-hot a { color: #F2B544 !important; }
html[data-theme="dark"] .fm-drawer__list a:active, html[data-theme="dark"] .fm-drawer__list a:hover { background: var(--fm-surface-2); }
html[data-theme="dark"] .fm-drawer__shop { background: var(--fm-surface-2) !important; color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-chip { background: var(--fm-surface-2); border-color: var(--wp--preset--color--line); color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-chip.is-on { background: #2F4F9A; border-color: #2F4F9A; color: #fff; }
html[data-theme="dark"] .fm-catnav .fm-mega > * { background: var(--fm-surface); border-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .fm-catnav .fm-mega a { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .fm-catnav .fm-mega a:hover { background: var(--fm-surface-2) !important; }
html[data-theme="dark"] .fm-catnav .fm-sale a { color: #F2B544; }
html[data-theme="dark"] .fm-drawer__sub { background: var(--fm-surface-2); }
html[data-theme="dark"] .fm-catnav .fm-catnav__list > li { --fm-acc: var(--fm-surface-2); }
html[data-theme="dark"] .fm-catnav .fm-mega__box { background: var(--fm-surface); border-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .fm-catnav .fm-mega__top { background: var(--fm-surface-2); }
html[data-theme="dark"] .fm-catnav .fm-mega__badge { background: var(--fm-bg); color: var(--fm-gold); }
html[data-theme="dark"] .fm-catnav .fm-mega .fm-mega__all, html[data-theme="dark"] .fm-catnav .fm-discover > a { color: var(--fm-gold); }
html[data-theme="dark"] .fm-catnav .fm-catnav__list > li > a .fm-ico, html[data-theme="dark"] .fm-drawer__list a .fm-ico { color: var(--fm-gold); }
html[data-theme="dark"] .fm-catnav .fm-sale > a, html[data-theme="dark"] .fm-catnav .fm-sale > a .fm-ico { color: #fff !important; }
html[data-theme="dark"] .fm-cat-note { background: var(--fm-surface-2); }
html[data-theme="dark"] .fm-cat__icon { background: var(--fm-bg); color: var(--fm-gold); }
html[data-theme="dark"] .fm-pickup-badge, html[data-theme="dark"] .fm-pickup-note { background: #1B2B22; color: #F3EDE2; }
html[data-theme="dark"] .fm-rfacts__warn { background: #3A1F18 !important; color: #F7C6B8 !important; }
html[data-theme="dark"] .fm-catnav .fm-sale > a, html[data-theme="dark"] .fm-catnav .fm-sale > a:hover { background: #C9472B !important; color: #fff !important; border-radius: 999px; }

/* Recipe search: one even pill – no darker box behind or inside it */
html[data-theme="dark"] .fm-rsearch { background: transparent !important; border: 0 !important; }
html[data-theme="dark"] .fm-rsearch__box { background: var(--fm-surface-2) !important; }
html[data-theme="dark"] .fm-rsearch__box input,
html[data-theme="dark"] .fm-rsearch__box input:focus { background: transparent !important; border: 0 !important; box-shadow: none !important; }
