/* =========================================================================
   Zen Aura — shared styles (resets, buttons, links, arches, waves, grain)
   Every value comes from theme.json tokens (--wp--preset--* / --wp--custom--*).
   ZA-MARKER: shared-styles
   ========================================================================= */

:root {
	--za-icon-whatsapp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 20.6l1.4-4.3a8.7 8.7 0 1 1 3.3 3.1z'/%3E%3Cpath d='M8.9 8.3c.1 3.4 3.3 6.7 6.8 6.9.7 0 1.3-.6 1.4-1.3l-1.9-1-1 .9c-1.2-.5-2.3-1.6-2.8-2.8l.9-1-1-1.9c-.7.1-1.4.6-1.4 1.2z'/%3E%3C/svg%3E");
	--za-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.6 16.6v3a2 2 0 0 1-2.2 2 19.7 19.7 0 0 1-8.6-3.1 19.4 19.4 0 0 1-6-6A19.7 19.7 0 0 1 1.8 3.9 2 2 0 0 1 3.8 1.7h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.4 2.1L7.7 9.6a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
	--za-icon-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.8 12.3c5.4-.4 10.8-.3 16.1 0'/%3E%3Cpath d='M14.3 6.8c1.9 2 3.7 3.6 5.7 5.4-2 1.8-3.9 3.5-5.7 5.6'/%3E%3C/svg%3E");
	--za-icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.2c2.1 2 4 3.9 6 5.9 2-2 3.9-3.9 6-5.9'/%3E%3C/svg%3E");
	--za-icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 7.2c5.6-.4 11.2-.3 16.8 0'/%3E%3Cpath d='M3.6 12.1c4.3-.3 8.5-.2 12.8.1'/%3E%3Cpath d='M3.6 17c5.6-.3 11.2-.2 16.8 0'/%3E%3C/svg%3E");
	--za-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.4 5.6c4.4 4.1 8.8 8.6 13.2 12.8'/%3E%3Cpath d='M18.6 5.4c-4.5 4.3-8.7 8.6-13.2 13'/%3E%3C/svg%3E");
	--za-wave-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 70C160 30 330 8 520 30s390 80 600 66c150-10 250-46 320-62V120H0z'/%3E%3C/svg%3E");
	--za-wave-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 88c210-44 470-74 730-60 250 14 470 54 710 24V120H0z'/%3E%3C/svg%3E");
	--za-wave-c: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 36c180 44 360 70 560 52S920 8 1110 18c140 7 250 40 330 62V120H0z'/%3E%3C/svg%3E");
}

/* Sinhala: taller letters, so more line height, slightly smaller display sizes, no tracking */
:root:lang(si) {
	--wp--preset--font-size--xxxl: clamp(2.25rem, 1.5rem + 3.4vw, 4.4rem);
	--wp--preset--font-size--xxl: clamp(1.85rem, 1.4rem + 1.9vw, 3.1rem);
	--wp--preset--font-size--xl: clamp(1.55rem, 1.3rem + 1vw, 2.2rem);
	--wp--custom--leading--display: 1.25;
	--wp--custom--leading--heading: 1.4;
	--wp--custom--leading--snug: 1.6;
	--wp--custom--leading--body: 1.9;
	--wp--custom--tracking--display: 0;
	--wp--custom--tracking--heading: 0;
	--wp--custom--measure: 58ch;
}

:lang(si) {
	font-synthesis: weight;
}

body:lang(si) {
	font-weight: var(--wp--custom--weight--regular);
	line-height: var(--wp--custom--leading--body);
}

:lang(si) :is(h1, h2, h3, h4) {
	line-height: var(--wp--custom--leading--heading);
	letter-spacing: 0;
}

/* Resets ----------------------------------------------------------------- */
[class*="za-"],
[class*="za-"]::before,
[class*="za-"]::after,
[class*="za-"] * {
	box-sizing: border-box;
}

[class*="za-"] :is(h1, h2, h3, h4, p, ul, ol, figure) {
	margin: 0;
}

[class*="za-"] :is(ul, ol)[role="list"] {
	list-style: none;
	padding: 0;
}

[class*="za-"] img {
	display: block;
	max-width: 100%;
	height: auto;
}

[class*="za-"] :is(h1, h2, h3, h4) {
	text-wrap: balance;
}

[class*="za-"] p {
	text-wrap: pretty;
}

html {
	scroll-padding-top: calc(var(--wp--custom--header-height) + var(--wp--preset--spacing--50));
}

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

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.wp-site-blocks {
	overflow-x: clip;
}

/* Paper grain over the whole page */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 80;
	pointer-events: none;
	background-image: var(--wp--custom--texture--grain);
	background-size: 256px 256px;
	opacity: var(--wp--custom--texture--grain-opacity);
	mix-blend-mode: multiply;
}

::selection {
	background: var(--wp--preset--color--plum-pale);
	color: var(--wp--preset--color--deep);
}

/* Focus: keyboard only, on brand gold */
:focus:not(:focus-visible) {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-strong);
	outline-offset: 3px;
	border-radius: var(--wp--custom--radius--s);
}

/* Theme spacing puts a gap above every root sibling and top-level section; the design has none */
.wp-site-blocks > * {
	margin-block-start: 0;
}

.entry-content > [class*="za-"],
.entry-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Sections can end on a fractional pixel, leaving a hairline of the dark background under a wave.
   Every section is opaque (cream unless it sets its own colour), and each one overlaps the one
   above by 1px, painted on top, so that hairline is always covered. */
:where(.entry-content > [class*="za-"]) {
	background-color: var(--wp--preset--color--base);
}

.entry-content > [class*="za-"] + [class*="za-"] {
	position: relative;
	z-index: 1;
	margin-block-start: -1px;
}

/* the page content also covers the footer's top edge */
.wp-site-blocks > .za-main,
.wp-site-blocks > main {
	position: relative;
	z-index: 1;
	background-color: var(--wp--preset--color--base);
}

/* Helpers ----------------------------------------------------------------- */
.za-container {
	width: min(100% - 2 * var(--wp--custom--gutter), var(--wp--custom--container));
	margin-inline: auto;
}

.za-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.za-icon {
	display: inline-block;
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

.za-lead {
	font-size: var(--wp--preset--font-size--md);
	line-height: var(--wp--custom--leading--snug);
	max-width: var(--wp--custom--measure-narrow);
}

.za-prose {
	max-width: var(--wp--custom--measure);
	color: var(--wp--preset--color--soft);
}

/* Buttons — soft pills ---------------------------------------------------- */
.za-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	min-height: 3.25rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	border-radius: var(--wp--custom--radius--pill);
	border: 1px solid transparent;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--weight--medium);
	letter-spacing: var(--wp--custom--tracking--label);
	line-height: 1.2;
	text-decoration: none;
	transition:
		background-color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		border-color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		box-shadow var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		transform var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle);
}

.za-btn:focus-visible,
.wp-block-button__link:focus-visible {
	outline: none;
	box-shadow: var(--wp--custom--focus-ring);
}

.za-btn--primary {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--soft);
}

.za-btn--primary:hover {
	background: var(--wp--preset--color--brand-hover);
	color: var(--wp--preset--color--base);
	transform: translateY(-2px);
}

.za-btn--outline,
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid var(--wp--custom--line--strong);
	color: var(--wp--preset--color--brand);
	background: transparent;
	box-shadow: none;
}

.za-btn--outline:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--brand);
	background: var(--wp--preset--color--raised);
	color: var(--wp--preset--color--brand);
}

.za-btn--small,
.wp-block-button.za-btn-small > .wp-block-button__link {
	min-height: 2.75rem;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
}

.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	min-height: 3.25rem;
	transition:
		background-color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		border-color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle),
		transform var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	transform: translateY(-2px);
}

/* A WhatsApp icon before a core button's text: add the class "za-icon-whatsapp" to the button */
.wp-block-button.za-icon-whatsapp > .wp-block-button__link::before,
.wp-block-button.za-icon-phone > .wp-block-button__link::before {
	content: "";
	width: 1.25em;
	height: 1.25em;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--za-icon-whatsapp) center / contain no-repeat;
	mask: var(--za-icon-whatsapp) center / contain no-repeat;
}

.wp-block-button.za-icon-phone > .wp-block-button__link::before {
	-webkit-mask-image: var(--za-icon-phone);
	mask-image: var(--za-icon-phone);
}

.za-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

/* A quiet underlined text link with a hand-drawn arrow */
.za-text-link,
.za-text-link-p a {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--weight--medium);
	color: var(--wp--preset--color--brand);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.35em;
	transition: gap var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle), color var(--wp--custom--duration--quick) var(--wp--custom--ease--gentle);
}

.za-text-link:hover,
.za-text-link-p a:hover {
	gap: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--brand-hover);
}

.za-text-link-p a::after {
	content: "";
	width: 1.25em;
	height: 1.25em;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--za-icon-arrow-right) center / contain no-repeat;
	mask: var(--za-icon-arrow-right) center / contain no-repeat;
}

/* Arch-topped photo frame -------------------------------------------------- */
.za-arch {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--arch);
	isolation: isolate;
}

.za-arch img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* WooCommerce pages (the Shop, cart...) add ".woocommerce-page img { height: auto }"; keep photo frames filled */
.woocommerce-page :is(.za-arch, .za-shop-custom__media, .za-hero__pebble, .za-offer__blob, .za-stone-panel__swatch, .za-type-tile__media, .za-picker__option, .za-product-card__media, .za-shop-hero__arch) img {
	height: 100%;
}

/* Wave dividers: inline SVGs on a section's bottom (or top) edge, filled with the neighbour's colour */
.za-wave {
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 100%;
	height: var(--wp--custom--wave-height);
	color: var(--za-wave-color, var(--wp--preset--color--base));
	pointer-events: none;
	z-index: 1;
}

.za-wave--top {
	top: -1px;
	bottom: auto;
	transform: scaleY(-1);
}

/* Tiny stone colour dots ------------------------------------------------- */
.za-stone-dots {
	display: flex;
	gap: 0.3rem;
}

.za-stone-dots span {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: var(--wp--custom--radius--round);
	background: var(--za-dot);
	box-shadow: inset 0 -2px 3px rgb(30 4 36 / 0.25), 0 0 0 1px rgb(71 7 84 / 0.12);
}

/* Round icon button (carousel controls) ------------------------------------ */
.za-round-btn {
	width: 3.25rem;
	height: 3.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	border-radius: var(--wp--custom--radius--round);
	border: 1px solid var(--wp--custom--line--strong);
	color: var(--wp--preset--color--brand);
	background: var(--wp--preset--color--raised);
	transition: background-color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle), color var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle), opacity var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle);
}

.za-round-btn:hover:not(:disabled) {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
}

.za-round-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

/* Glow ---------------------------------------------------------------------
   Calm crystal light: glowing buttons, a breathing aura behind main photos,
   a shimmer across product photos, and slow floating light motes. */

/* Glowing buttons */
.za-btn--primary,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	box-shadow: 0 0.6rem 1.6rem -0.7rem rgb(201 163 90 / 0.6), 0 0 0 1px rgb(201 163 90 / 0.15);
}

.za-btn--primary:hover,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	box-shadow: 0 0 1.6rem rgb(201 163 90 / 0.55), 0 0 0 1px rgb(201 163 90 / 0.35);
}

.za-btn--outline:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	box-shadow: 0 0 1.2rem rgb(201 163 90 / 0.35);
}

/* Breathing aura: add "za-aura" to the element that holds a main photo */
.za-aura {
	position: relative;
	isolation: isolate;
}

.za-aura::before {
	content: "";
	position: absolute;
	inset: -16%;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgb(196 166 202 / 0.6), rgb(201 163 90 / 0.28) 55%, transparent 78%);
	filter: blur(14px);
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	.za-aura::before {
		animation: za-breathe-aura 7s var(--wp--custom--ease--breath) infinite alternate;
	}
}

@keyframes za-breathe-aura {
	from { opacity: 0.5; transform: scale(0.94); }
	to { opacity: 1; transform: scale(1.06); }
}

/* Floating light motes: an empty <span class="za-motes"> inside a section */
.za-motes {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.za-motes::before,
.za-motes::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 12% 18%, rgb(220 192 138 / 0.9) 0 1.5px, transparent 3px),
		radial-gradient(circle at 34% 72%, rgb(236 220 184 / 0.8) 0 1px, transparent 2.5px),
		radial-gradient(circle at 58% 36%, rgb(220 192 138 / 0.7) 0 2px, transparent 4px),
		radial-gradient(circle at 81% 64%, rgb(236 220 184 / 0.9) 0 1.5px, transparent 3px),
		radial-gradient(circle at 92% 12%, rgb(220 192 138 / 0.6) 0 1px, transparent 2.5px);
	background-size: 420px 420px;
	opacity: 0.7;
}

.za-motes::after {
	background-size: 640px 640px;
	background-position: 200px 120px;
	opacity: 0.45;
}

@media (prefers-reduced-motion: no-preference) {
	.za-motes::before {
		animation: za-drift-a 46s linear infinite, za-twinkle 6s ease-in-out infinite alternate;
	}

	.za-motes::after {
		animation: za-drift-b 70s linear infinite, za-twinkle 9s ease-in-out 2s infinite alternate;
	}
}

@keyframes za-drift-a {
	to { background-position: 40px -420px; }
}

@keyframes za-drift-b {
	to { background-position: 140px -520px; }
}

@keyframes za-twinkle {
	from { opacity: 0.3; }
	to { opacity: 0.8; }
}

/* Product photos cut as a crystal point: hexagonal, thin gold edge, soft glow, shimmer on hover */
:root {
	--za-crystal: polygon(50% 0, 100% 14%, 100% 88%, 50% 100%, 0 88%, 0 14%);
	--za-crystal-inner: polygon(50% 2px, calc(100% - 2px) calc(14% + 1px), calc(100% - 2px) calc(88% - 1px), 50% calc(100% - 2px), 2px calc(88% - 1px), 2px calc(14% + 1px));
}

:is(.za-product-card__media, .za-shop-card__media) {
	position: relative;
	isolation: isolate;
	filter: drop-shadow(0 0.9rem 1.1rem rgb(61 26 71 / 0.16));
	transition: filter var(--wp--custom--duration--calm) var(--wp--custom--ease--gentle);
}

.za-shop-card__media.za-arch {
	overflow: visible;
	border-radius: 0;
}

/* every photo fills the same 4:5 crystal, whatever its own proportions */
:is(.za-product-card__media, .za-shop-card__media) {
	min-height: 0;
}

:is(.za-shop-card__media > img, .za-product-card__media > a, .za-product-card__media > img) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* gold edge */
:is(.za-product-card__media, .za-shop-card__media)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	clip-path: var(--za-crystal);
	background: linear-gradient(160deg, var(--wp--preset--color--gold-light), var(--wp--preset--color--accent) 45%, var(--wp--preset--color--gold-pale) 70%, var(--wp--preset--color--accent-strong));
}

:is(.za-product-card__media, .za-shop-card__media) img {
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	clip-path: var(--za-crystal-inner);
	background: var(--wp--preset--color--linen);
}

/* shimmer */
:is(.za-product-card__media, .za-shop-card__media)::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	clip-path: var(--za-crystal);
	background: linear-gradient(115deg, transparent 42%, rgb(255 250 240 / 0.5) 50%, transparent 58%);
	background-size: 300% 100%;
	background-position: 100% 0;
	background-repeat: no-repeat;
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	:is(.za-product-card__media, .za-shop-card__media)::after {
		transition: background-position 1.3s var(--wp--custom--ease--gentle);
	}

	:is(li.wc-block-product, .za-shop-card):hover :is(.za-product-card__media, .za-shop-card__media)::after {
		background-position: 0 0;
	}
}

:is(li.wc-block-product, .za-shop-card):hover :is(.za-product-card__media, .za-shop-card__media) {
	filter: drop-shadow(0 0 1.4rem rgb(201 163 90 / 0.55)) drop-shadow(0 0.9rem 1.1rem rgb(61 26 71 / 0.14));
}

/* Shared motion --------------------------------------------------------- */
@keyframes za-rise {
	from { opacity: 0; transform: translateY(1.25rem); }
	to { opacity: 1; transform: none; }
}

@keyframes za-fade-in {
	to { opacity: 1; }
}

@keyframes za-orbit {
	to { rotate: 360deg; }
}

@keyframes za-draw {
	to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
	[class*="za-"],
	[class*="za-"]::before,
	[class*="za-"]::after,
	[class*="za-"] * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
