/*
Theme Name: Sichuan Xifu Foods
Theme URI: https://d.muxin.ltd
Author: Telex
Description: A heritage-proud, warm, and premium WordPress block theme for Sichuan Xifu Foods — an artisanal condiment manufacturer rooted in traditional Sichuan fermentation craft. Features rich crimson and gold accents, generous spacing, and culturally grounded serif typography paired with modern sans-serif body copy.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sichuan-xifu-foods
Tags: block-patterns, full-site-editing, wide-blocks, custom-colors, custom-fonts, translation-ready, food-and-drink
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ==========================================================================
   Foundation
   ========================================================================== */

:root,
body,
.wp-site-blocks {
	overflow: visible;
}

/* Anti-aliased text rendering for warmth */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header — fixed overlay + scrolled-state chrome
   ========================================================================== */

/* Fixed position so header overlays the hero at scroll=0 */
.wp-site-blocks > header.wp-block-template-part {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
}

/* Backdrop pseudo — visually paints the scrolled-state chrome without
   setting backdrop-filter on the header itself, so the mobile nav overlay
   position:fixed inset:0 still targets the viewport. */
.wp-site-blocks > header.wp-block-template-part::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	transition: background 0.4s ease, box-shadow 0.4s ease;
}

body.is-scrolled .wp-site-blocks > header.wp-block-template-part::before {
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 0 var(--wp--preset--color--sand);
}

/* Gold accent line beneath header on scroll */
body.is-scrolled .wp-site-blocks > header.wp-block-template-part::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		var(--wp--preset--color--gold) 20%,
		var(--wp--preset--color--saffron) 50%,
		var(--wp--preset--color--gold) 80%,
		transparent 100%
	);
	opacity: 0.5;
	pointer-events: none;
	z-index: 1;
}

/* ==========================================================================
   Typography polish
   ========================================================================== */

/* Headings — warmth via letter-spacing */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
	letter-spacing: 0.02em;
}

h1, .wp-block-heading:where([class*="has-huge-font-size"]) {
	letter-spacing: 0.03em;
}

/* Italic Display font usage — for subtitles, mottos, decorative English text */
.has-italic-display-font-family {
	font-style: italic;
}

/* Paragraph legibility */
p {
	letter-spacing: 0.01em;
}

/* Small text helper */
.has-small-font-size {
	letter-spacing: 0.03em;
}

/* ==========================================================================
   Link styles
   ========================================================================== */

a {
	transition: color 0.2s ease;
}

/* Underline treatment for inline links — warm, recessed */
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content),
.entry-content a:not(.wp-block-button__link) {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--sand);
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1.5px;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover,
.entry-content a:not(.wp-block-button__link):hover {
	text-decoration-color: var(--wp--preset--color--crimson);
}

/* ==========================================================================
   Button styles — pill shape, warm hover lift
   ========================================================================== */

.wp-block-button__link,
.wp-element-button {
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(139, 26, 26, 0.3);
}

.wp-block-button__link:active,
.wp-element-button:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(139, 26, 26, 0.2);
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 2px;
	border-style: solid;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(139, 26, 26, 0.15);
}

/* ==========================================================================
   Navigation polish
   ========================================================================== */

.wp-block-navigation-item__content {
	transition: color 0.2s ease;
}

/* Nav CTA pill button inside navigation */
.wp-block-navigation .wp-block-button__link {
	border-radius: 24px;
}

/* ==========================================================================
   Image treatments — warm, slightly rounded
   ========================================================================== */

.wp-block-image img {
	border-radius: 8px;
}

.wp-block-image figcaption {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal-light);
	margin-top: 0.75em;
	font-style: normal;
}

/* Cover images — subtle warm vignette */
.wp-block-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
	box-shadow: inset 0 0 120px rgba(139, 26, 26, 0.08);
}

/* Gallery consistency */
.wp-block-gallery .wp-block-image img {
	border-radius: 6px;
}

/* ==========================================================================
   Quote / Pullquote — gold left border, heritage serif
   ========================================================================== */

.wp-block-quote {
	padding-left: var(--wp--preset--spacing--40);
}

.wp-block-quote cite,
.wp-block-pullquote cite {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	color: var(--wp--preset--color--charcoal-light);
	letter-spacing: 0.05em;
	display: block;
	margin-top: 1em;
}

.wp-block-pullquote {
	border-top: 3px solid var(--wp--preset--color--gold);
	border-bottom: 3px solid var(--wp--preset--color--gold);
	padding: var(--wp--preset--spacing--50) 0;
}

.wp-block-pullquote blockquote p {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.5;
	color: var(--wp--preset--color--charcoal-dark);
}

/* ==========================================================================
   Separator — warm sand tone
   ========================================================================== */

.wp-block-separator {
	border-color: var(--wp--preset--color--sand);
	opacity: 1;
}

.wp-block-separator:not(.is-style-dots) {
	border-bottom-width: 1px;
}

.wp-block-separator.is-style-wide {
	border-bottom-width: 2px;
}

/* ==========================================================================
   Card surfaces — subtle warm shadows
   ========================================================================== */

.wp-block-group.has-white-background-color,
.has-white-background-color {
	box-shadow: 0 2px 12px rgba(51, 51, 51, 0.06);
}

/* Product card–like groups with rounded corners */
.wp-block-group.has-white-background-color {
	border-radius: 8px;
}

/* ==========================================================================
   Columns — responsive adjustments
   ========================================================================== */

@media (max-width: 781px) {
	.wp-block-columns {
		gap: var(--wp--preset--spacing--40);
	}
}

/* ==========================================================================
   Site title polish
   ========================================================================== */

.wp-block-site-title a {
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-site-title a:hover {
	color: var(--wp--preset--color--crimson-dark);
}

/* ==========================================================================
   Category / tag pills — warm muted style
   ========================================================================== */

.wp-block-post-terms a {
	display: inline-block;
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--charcoal);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	padding: 0.25em 0.75em;
	border-radius: 20px;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-post-terms a:hover {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--charcoal-dark);
}

/* ==========================================================================
   Post template / query loop card polish
   ========================================================================== */

.wp-block-post-template .wp-block-post-featured-image img {
	border-radius: 8px;
	transition: transform 0.3s ease;
}

.wp-block-post-template .wp-block-post-featured-image:hover img {
	transform: scale(1.02);
}

.wp-block-post-template .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--charcoal-dark);
	transition: color 0.2s ease;
}

.wp-block-post-template .wp-block-post-title a:hover {
	color: var(--wp--preset--color--crimson);
}

/* ==========================================================================
   Mobile hamburger overlay
   ========================================================================== */

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* ==========================================================================
   Invert-on-scroll header variant
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	.wp-site-blocks > header.wp-block-template-part > .wp-block-group {
		transition: background-color 0.35s ease, color 0.35s ease;
	}

	body.is-scrolled .wp-site-blocks > header.wp-block-template-part > .wp-block-group {
		color: var(--wp--preset--color--charcoal-dark);
	}

	/* Make nav links legible on scrolled white surface */
	body.is-scrolled .wp-block-navigation a:not(.wp-block-button__link) {
		color: var(--wp--preset--color--charcoal);
	}

	body.is-scrolled .wp-block-navigation a:not(.wp-block-button__link):hover {
		color: var(--wp--preset--color--crimson);
	}

	body.is-scrolled .wp-block-site-title a {
		color: var(--wp--preset--color--crimson);
	}
}

/* ==========================================================================
   Decorative utilities — large quotation glyphs for motto banners
   ========================================================================== */

.has-gold-color {
	color: var(--wp--preset--color--gold);
}

/* Large decorative quote marks for motto/blockquote sections */
.wp-block-quote.is-style-large::before,
.motto-quote::before {
	content: "\201C";
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(3rem, 6vw, 5rem);
	line-height: 1;
	color: var(--wp--preset--color--gold);
	display: block;
	margin-bottom: 0.25em;
}

/* ==========================================================================
   Smooth scroll for anchor links
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ==========================================================================
   Table styling — warm, heritage-appropriate
   ========================================================================== */

.wp-block-table table {
	border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
	border-color: var(--wp--preset--color--sand);
	padding: 0.75em 1em;
}

.wp-block-table thead {
	border-bottom: 2px solid var(--wp--preset--color--gold);
}

.wp-block-table thead th {
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	color: var(--wp--preset--color--charcoal-dark);
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--wp--preset--color--sand);
}

/* ==========================================================================
   Details / Accordion — for FAQ-style content
   ========================================================================== */

.wp-block-details summary {
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 600;
	color: var(--wp--preset--color--charcoal-dark);
	cursor: pointer;
	padding: 0.75em 0;
	border-bottom: 1px solid var(--wp--preset--color--sand);
	transition: color 0.2s ease;
}

.wp-block-details summary:hover {
	color: var(--wp--preset--color--crimson);
}

.wp-block-details[open] summary {
	color: var(--wp--preset--color--crimson);
	border-bottom-color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   Selection color — warm gold highlight
   ========================================================================== */

::selection {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--charcoal-dark);
}

/* ==========================================================================
   Loop layout utilities
   ========================================================================== */
/* These classes are wired to the wp:query blocks emitted by content/pages and
   templates. Do not rename. Tune colours and spacing to theme.json tokens. */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: var(--wp--preset--spacing--20);
}

.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
	flex: 0 0 320px;
	scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
	border-bottom: 1px solid var(--wp--preset--color--sand);
	padding-block: var(--wp--preset--spacing--30);
}

.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
	border-bottom: 0;
}

/* Zigzag — flip the columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
	flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
	position: relative;
	padding-inline-start: 2.5rem;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0.5rem;
	width: 2px;
	background: var(--wp--preset--color--gold);
	opacity: 0.25;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
	position: relative;
}

.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
	content: "";
	position: absolute;
	inset-inline-start: -2.25rem;
	inset-block-start: 0.6rem;
	width: 1rem;
	height: 1rem;
	border: 2px solid var(--wp--preset--color--crimson);
	border-radius: 50%;
	background: var(--wp--preset--color--offwhite);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
	grid-column: span 2;
}

@media (max-width: 600px) {
	.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
		grid-column: auto;
	}
}