/* cofe.css — cofez custom layer (what theme.json cannot do).
   Theme.json is the single source of truth for tokens; this file only adds
   behavioural + adaptive visuals. No hardcoded hex — only preset vars. */

/* 1) Remove Gutenberg's automatic top gap between top-level site blocks/sections (Brief C.10) */
.wp-site-blocks > * + * {
	margin-block-start: 0 !important;
}
.wp-block-post-content.is-layout-flow > * + *,
.wp-block-post-content.is-layout-constrained > * + * {
	margin-block-start: 0 !important;
}
.wp-site-blocks {
	--wp--style--block-gap: 1.4rem;
}

/* 2) Mobile-first utilities — single breakpoint matches the WP Navigation overlay threshold (782px) */
@media (max-width: 782px) {
	.cofe-show-mobile { display: block !important; }
	.cofe-hide-mobile  { display: none !important; }
}
@media (min-width: 783px) {
	.cofe-show-mobile { display: none !important; }
	.cofe-hide-mobile  { display: block !important; }
}

/* 3) Sticky header: translucent brand bg + blur + soft shadow on scroll */
.cofe-sticky-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0);
	z-index: 30;
	align-self: flex-start;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 88%, transparent);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--wp--preset--color--secondary);
	box-shadow: var(--wp--preset--shadow--subtle);
	transition: background-color .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.cofe-sticky-header.cofe-scrolled {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 94%, transparent);
	box-shadow: var(--wp--preset--shadow--strong);
}
@media (prefers-reduced-motion: reduce) {
	.cofe-sticky-header { transition: none; }
}

/* focus rings — visible, offset */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--tertiary);
	outline-offset: 2px;
}

/* 4) Mobile Navigation Overlay (WP 7.0) — CSS-only slide animation (Brief F.18) */
@media (max-width: 782px) {
	@media (prefers-reduced-motion: no-preference) {
		.wp-block-navigation__responsive-dialog {
			@starting-style {
				transform: translateX(100%);
				opacity: 0;
			}
			transform: translateX(0);
			opacity: 1;
			transition: transform .32s cubic-bezier(.22,1,.28,1), opacity .22s ease;
		}
		/* exit uses display toggling; allow discrete so it can collapse */
		.wp-block-navigation__responsive-container {
			transition-behavior: allow-discrete;
		}
	}
	/* whole-tile clickable nav items (Brief F.151): stretched-link to the tile */
	.cofe-nav-tile a { position: relative; }
	.cofe-nav-tile .cofe-tile-link::after {
		content: "";
		position: absolute;
		inset: 0;
	}
	.cofe-nav-tile .cofe-tile-link { position: relative; }
}

/* 5) WooCommerce block styling (Brief E.11/E.16) */
.wc-block-components-input,
.wc-block-components-input[type="text"],
.wc-block-components-input[type="email"],
.wc-block-components-input[type="tel"],
.wc-block-components-input[type="password"] {
	border-radius: 8px !important;
	border: 1px solid var(--wp--preset--color--secondary) !important;
}
.wc-block-components-input:focus-visible {
	border-color: var(--wp--preset--color--tertiary) !important;
	outline: 2px solid var(--wp--preset--color--tertiary);
	outline-offset: 2px;
}
.wc-block-checkout__order,
.wc-block-cart__side {
	position: sticky;
	top: 20px;
	align-self: flex-start;
}
.wc-block-components-product-cta .wp-element-button,
.wp-block-button .wp-block-button__link {
	/* brand button already styled in global styles (cream bg / dark text, fill-flip hover) */
}
.wc-block-components-price-currency-symbol {
	font-size: 0.85em;
}
.wc-block-components-product-title {
	font-family: var(--wp--preset--font-family--inter);
	font-weight: 400;
}
.wc-block-components-title {
	font-family: var(--wp--preset--font-family--inter);
}

/* 6) Product card (best sellers / catalog grid) */
.cofe-product-card {
	border-radius: 10px;
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--subtle);
	transition: transform .15s ease, box-shadow .15s ease;
	background: var(--wp--preset--color--base);
}
.cofe-product-card:hover {
	box-shadow: var(--wp--preset--shadow--strong);
}
.cofe-product-card .wp-block-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.cofe-product-card .wp-block-buttons {
	margin-block-start: .5rem;
}
@media (prefers-reduced-motion: reduce) {
	.cofe-product-card { transition: none; }
}

/* 7) Logo strip */
.cofe-logo-strip img {
	max-height: 48px;
	width: auto;
	filter: grayscale(0);
	transition: transform .15s ease;
}
.cofe-logo-strip img:hover {
	transform: scale(1.04);
}

/* 8) Newsletter form confirmation */
.cofe-news-confirm[role="status"] {
	font-family: var(--wp--preset--font-family--inter);
	font-weight: 500;
	color: var(--wp--preset--color--tertiary);
}
