/*
 * Cuirden appearance layer.
 * Core light values remain unchanged; dark mode remaps the shared design tokens.
 */
:root {
	color-scheme: light;
	--hc-canvas: var(--hc-ivory);
	--hc-surface: var(--hc-soft-white);
	--hc-surface-raised: #fffdfa;
	--hc-control-bg: var(--hc-soft-white);
	--hc-leather: #8a6a52;
	--hc-on-dark: #f3eee6;
	--hc-success: #315d46;
	--hc-success-bg: #e6f0e9;
	--hc-error: #8a3c35;
	--hc-error-bg: #f5e7e4;
	--hc-info: #3f5668;
	--hc-info-bg: #e8eef1;
	--hc-disabled-bg: #ece7de;
	--hc-disabled-text: #777066;
}

html[data-theme="dark"] {
	color-scheme: dark;
	--hc-ink: #eee8df;
	--hc-charcoal: #c8beb3;
	--hc-ivory: #1b1917;
	--hc-soft-white: #25221f;
	--hc-stone: #38332e;
	--hc-line: #4a433c;
	--hc-taupe: #ada297;
	--hc-canvas: #1b1917;
	--hc-surface: #25221f;
	--hc-surface-raised: #2b2723;
	--hc-control-bg: #24211e;
	--hc-leather: #bc9271;
	--hc-on-dark: #f3eee6;
	--hc-success: #a8ceb4;
	--hc-success-bg: #213229;
	--hc-error: #e6aaa3;
	--hc-error-bg: #3b2523;
	--hc-info: #b1cad8;
	--hc-info-bg: #243139;
	--hc-disabled-bg: #302c28;
	--hc-disabled-text: #91877d;
}

body,
.wp-site-blocks {
	background: var(--hc-canvas);
	color: var(--hc-ink);
}

input,
select,
textarea {
	background-color: var(--hc-control-bg);
	color: var(--hc-ink);
	border-color: var(--hc-line);
}

::placeholder {
	color: var(--hc-taupe);
	opacity: 1;
}

::selection {
	background: var(--hc-ink);
	color: var(--hc-ivory);
}

/* Header utilities */
.hc-header-spacer {
	min-width: 1px;
}

.hc-header-utilities {
	gap: .15rem !important;
	position: relative;
}

.cuirden-header-search,
.cuirden-appearance {
	position: relative;
	margin: 0;
}

.cuirden-header-search > summary {
	list-style: none;
}

.cuirden-header-search > summary::-webkit-details-marker {
	display: none;
}

.cuirden-utility-button {
	display: inline-grid;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--hc-ink);
	cursor: pointer;
}

.cuirden-utility-button:hover {
	background: transparent;
	opacity: .62;
}

.cuirden-utility-button svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.45;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cuirden-search-popover,
.cuirden-appearance-menu {
	position: absolute;
	z-index: 1001;
	top: calc(100% + .6rem);
	right: 0;
	border: 1px solid var(--hc-line);
	background: var(--hc-surface-raised);
	color: var(--hc-ink);
	box-shadow: 0 12px 30px rgba(23, 23, 23, .08);
}

.cuirden-search-popover {
	width: min(360px, calc(100vw - 2rem));
	padding: .8rem;
}

.cuirden-search-popover form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: .5rem;
}

.cuirden-search-popover input,
.cuirden-search-popover button {
	min-height: 44px;
}

.cuirden-search-popover button {
	padding: .65rem 1rem;
	border: 1px solid var(--hc-ink);
	background: var(--hc-ink);
	color: var(--hc-ivory);
}

.cuirden-appearance-menu {
	width: 190px;
	padding: .55rem;
}

.cuirden-appearance-menu[hidden] {
	display: none;
}

.cuirden-appearance-title {
	margin: .35rem .55rem .45rem;
	color: var(--hc-taupe);
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.cuirden-appearance-menu button,
.cuirden-mobile-appearance-options button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 44px;
	padding: .65rem .7rem;
	border: 0;
	background: transparent;
	color: var(--hc-ink);
	text-align: left;
	cursor: pointer;
}

.cuirden-appearance-menu button:hover,
.cuirden-appearance-menu button:focus-visible,
.cuirden-mobile-appearance-options button:hover,
.cuirden-mobile-appearance-options button:focus-visible {
	background: var(--hc-stone);
	opacity: 1;
}

.cuirden-option-check {
	visibility: hidden;
	font-size: .8rem;
}

[aria-checked="true"] > .cuirden-option-check {
	visibility: visible;
}

.cuirden-icon-moon {
	display: none;
}

.cuirden-appearance-trigger[data-effective-theme="dark"] .cuirden-icon-sun {
	display: none;
}

.cuirden-appearance-trigger[data-effective-theme="dark"] .cuirden-icon-moon {
	display: block;
}

.cuirden-mobile-appearance {
	display: none;
}

/* WordPress and WooCommerce state colors */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background: var(--hc-surface-raised) !important;
	color: var(--hc-ink) !important;
	border-color: var(--hc-line) !important;
}

.woocommerce-message {
	border-top-color: var(--hc-success) !important;
}

.woocommerce-info {
	border-top-color: var(--hc-info) !important;
}

.woocommerce-error {
	border-top-color: var(--hc-error) !important;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.disabled,
[aria-disabled="true"] {
	background-color: var(--hc-disabled-bg);
	color: var(--hc-disabled-text);
	opacity: 1;
}

/* Warm editorial dark surfaces. Media itself is never filtered. */
html[data-theme="dark"] img,
html[data-theme="dark"] video,
html[data-theme="dark"] picture {
	filter: none;
}

html[data-theme="dark"] .cuirden-header-shell,
html[data-theme="dark"] .cuirden-desktop-nav,
html[data-theme="dark"] .cuirden-mega,
html[data-theme="dark"] .cuirden-mobile-drawer,
html[data-theme="dark"] .wc-block-mini-cart__drawer,
html[data-theme="dark"] .wc-block-components-drawer,
html[data-theme="dark"] .wc-block-mini-cart__drawer .wc-block-components-drawer__content {
	background-color: var(--hc-canvas);
	color: var(--hc-ink);
}

html[data-theme="dark"] .wc-block-components-modal__screen-overlay {
	background: rgba(10, 9, 8, .72);
}

html[data-theme="dark"] .wc-block-components-button,
html[data-theme="dark"] .wp-element-button,
html[data-theme="dark"] .wp-block-button__link,
html[data-theme="dark"] .single_add_to_cart_button,
html[data-theme="dark"] .button {
	border-color: var(--hc-ink);
}

html[data-theme="dark"] .woocommerce table.shop_table,
html[data-theme="dark"] .woocommerce form.checkout,
html[data-theme="dark"] .woocommerce form.login,
html[data-theme="dark"] .woocommerce form.register,
html[data-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation,
html[data-theme="dark"] .woocommerce-account .woocommerce-MyAccount-content,
html[data-theme="dark"] .cart_totals,
html[data-theme="dark"] .woocommerce-checkout-review-order,
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-container--default .select2-selection--single {
	background: var(--hc-surface);
	color: var(--hc-ink);
	border-color: var(--hc-line);
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-results__option {
	color: var(--hc-ink);
}

html[data-theme="dark"] .select2-results__option[aria-selected="true"],
html[data-theme="dark"] .select2-results__option--highlighted {
	background: var(--hc-stone);
	color: var(--hc-ink);
}

/* Existing full-bleed photographic/editorial heroes retain deliberate light copy. */
html[data-theme="dark"] .hc-hero,
html[data-theme="dark"] .hc-parent-category-hero,
html[data-theme="dark"] .hc-shop-hero,
html[data-theme="dark"] .hc-journal-hero {
	color: var(--hc-on-dark);
}

html[data-theme="dark"] .hc-editorial-band,
html[data-theme="dark"] .hc-article-newsletter,
html[data-theme="dark"] .hc-journal-newsletter {
	background: #24211e;
	color: var(--hc-on-dark);
}

html[data-theme="dark"] .hc-editorial-band a,
html[data-theme="dark"] .hc-article-newsletter a,
html[data-theme="dark"] .hc-journal-newsletter a {
	color: var(--hc-on-dark);
	border-color: #756b62;
}

html[data-theme="dark"] .woocommerce div.product .woocommerce-product-gallery__image,
html[data-theme="dark"] .woocommerce ul.products li.product a img,
html[data-theme="dark"] .hc-product-card-media,
html[data-theme="dark"] .hc-category-card-media,
html[data-theme="dark"] .hc-journal-card-media,
html[data-theme="dark"] .hc-search-result-media {
	background-color: var(--hc-surface);
}

html[data-theme="dark"] .woocommerce-tabs,
html[data-theme="dark"] .hc-product-accordion,
html[data-theme="dark"] .hc-shop-sidebar,
html[data-theme="dark"] .hc-journal-sidebar,
html[data-theme="dark"] .hc-article-sidebar,
html[data-theme="dark"] .hc-search-result,
html[data-theme="dark"] .hc-policy {
	border-color: var(--hc-line);
}

@media (max-width: 900px) {
	.cuirden-appearance-desktop,
	.cuirden-header-search {
		display: none;
	}

	.cuirden-mobile-appearance {
		display: block;
		margin: 1rem 0;
		padding: 1rem 0;
		border-top: 1px solid var(--hc-line);
		border-bottom: 1px solid var(--hc-line);
	}

	.cuirden-mobile-appearance > p {
		margin: 0 0 .45rem;
		color: var(--hc-taupe);
		font-size: .7rem;
		font-weight: 600;
		letter-spacing: .1em;
		text-transform: uppercase;
	}

	.cuirden-mobile-appearance-options {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: .35rem;
	}

	.cuirden-mobile-appearance-options button {
		justify-content: center;
		gap: .45rem;
		border: 1px solid var(--hc-line);
		padding-inline: .45rem;
	}

	.cuirden-mobile-appearance-options button[aria-checked="true"] {
		border-color: var(--hc-ink);
		background: var(--hc-stone);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cuirden-appearance-menu,
	.cuirden-search-popover {
		transition: none !important;
	}
}
