/*
Theme Name: InspiredByStitches
Description: Shabby-chic block theme for the InspiredByStitches handmade crochet shop — faded pastels, textured surfaces, vintage romance. Design contract: ../../DESIGN.md.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: inspiredbystitches
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready
*/

/* Everything below is only for what theme.json cannot express:
   textures, the dashed "stitch" motif, hover/press states, and motion. */

/* --- Textures ----------------------------------------------------------
   Linen grain, generated in-page (no network request). Kept under the
   10% opacity cap from DESIGN.md; applied to surfaces, never under text. */

.linen-grain,
.linen-grain::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.29 0 0 0 0 0.25 0 0 0 0 0.22 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.linen-grain::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.linen-grain {
	position: relative;
}

/* --- Dashed "stitch" motif --------------------------------------------- */

/* Sticky navigation: Antique White with grain, 1px dashed stitch underline
   on the active item (DESIGN.md "Navigation"). */
.is-sticky {
	position: sticky;
	top: 0;
	z-index: 100; /* z-index contract: sticky nav = 100 */
}

.is-stitch-top {
	border-top: 1px dashed var(--wp--preset--color--neutral);
}

.is-stitch-bottom {
	border-bottom: 1px dashed var(--wp--preset--color--neutral);
}

.wp-block-navigation .has-current > a,
.wp-block-navigation .has-current > .items-wrapper > ul > li > a {
	border-bottom: 1px dashed var(--wp--preset--color--deep-rose);
}

/* --- Buttons -----------------------------------------------------------
   Primary: hover = deep-rose-hover + subtle lift; active = 1px press-down.
   Ghost: transparent fill, 1.5px deep-rose border, blush hover. */

.wp-block-button__link {
	transition: background-color 200ms ease-out, box-shadow 200ms ease-out,
		border-color 200ms ease-out, transform 200ms ease-out;
}

.wp-block-button__link:hover {
	background-color: var(--wp--preset--color--deep-rose-hover);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); /* shadow.lift */
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

.is-style-ghost .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--deep-rose);
	border: 1.5px solid var(--wp--preset--color--deep-rose);
	box-shadow: none;
}

.is-style-ghost .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--blush);
}

/* --- Block style variations (registered in functions.php) --------------- */

.is-style-card {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	border: 1px solid rgba(164, 184, 196, 0.4);
	border-radius: var(--wp--custom--rounded--sm);
	padding: 24px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* shadow.whisper */
}

.is-style-card-blush {
	background-color: var(--wp--preset--color--blush);
	color: var(--wp--preset--color--ink);
	border: 1px solid rgba(164, 184, 196, 0.4);
	border-radius: var(--wp--custom--rounded--sm);
	padding: 24px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Product card: Antique White surface so photography leads; 12px radius;
   overflow hidden lets the top image bleed to the card corners. The card
   carries no padding itself - an inner group (16px padding per DESIGN.md)
   holds the title/price text while the image sits flush at the top. */
.is-style-product-card {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--ink);
	border: 1px solid rgba(164, 184, 196, 0.4);
	border-radius: var(--wp--custom--rounded--md);
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Badge/sticker: pill, lavender fill, label voice, hand-stamped -2deg. */
.is-style-badge {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--rounded--full);
	padding: 6px 12px;
	font-family: var(--wp--preset--font-family--lora);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transform: rotate(-2deg);
	display: inline-block;
}

/* --- Footer -------------------------------------------------------------
   Three columns on desktop, stacked below 768px (DESIGN.md layout rule). */

.footer-cols {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--lg);
}

@media (min-width: 768px) {
	.footer-cols {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

/* On the sage footer band, deep-rose links fall short of 4.5:1, so links
   there read in Espresso Ink (still brand color — ink is the house text).
   The global deep-rose link rule stays for all pale surfaces. */
.wp-site-blocks footer a {
	color: var(--wp--preset--color--ink);
}

/* Empty-state botanical (404): a faded sprig from the theme assets, kept
   under the texture cap. No inline SVG — stays plain block markup. */
.botanical-mark {
	width: 64px;
	height: 64px;
	background: url(../assets/botanical.svg) center / contain no-repeat;
	opacity: 0.9;
}

/* Home hero: stacked tonal panels (lavender behind, blush in front),
   offset + gently rotated for the hand-placed feel. */
.hero-panels {
	position: relative;
	min-height: 320px;
}

.hero-panels .hero-panel-back {
	position: absolute;
	inset: 0 0 24px 24px;
	transform: rotate(1.5deg);
	z-index: 0;
}

.hero-panels .hero-panel-front {
	position: relative;
	z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
	.hero-panel-front,
	.hero-panel-back {
		transition: transform 250ms ease-out;
	}

	.hero-panels:hover .hero-panel-front {
		transform: translateY(-4px);
	}
}

/* About teaser: the sage disc centers its content. */
.about-disc {
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* --- Motion ------------------------------------------------------------
   Subtle only (4/10). Animate transform/opacity; honor reduced motion. */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
