/* ==========================================================================
   Shared Styles — M RO Sigiriya Homestay
   Resets, focus rings, buttons, hand-drawn lines and motion used by every
   section. All values come from the theme (Appearance → Editor → Styles).
   ========================================================================== */

/* ---------- Resets WordPress does not ship ---------- */
[class*="mro-"],
[class*="mro-"]::before,
[class*="mro-"]::after,
[class*="mro-"] * {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wp--custom--header--height) + var(--wp--preset--spacing--40) + var(--wp-admin--admin-bar--height, 0px));
	-webkit-text-size-adjust: 100%;
}

body {
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

/* sections butt up against each other — no theme gap between them */
.wp-site-blocks > * { margin-block-start: 0; }
.entry-content > [class*="mro-"],
.wp-block-post-content > [class*="mro-"] { margin-block-start: 0; }

main { overflow-x: clip; }

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

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

/* keyboard-only focus ring, on brand */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
	outline: var(--wp--custom--stroke--focus) solid var(--wp--preset--color--accent-strong);
	outline-offset: 3px;
	border-radius: var(--wp--custom--radius--sm);
}

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

/* paper grain over the whole page, very faint (front end only) */
body:not(.editor-styles-wrapper)::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: var(--wp--custom--layer--grain);
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='grain' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.118  0 0 0 0 0.169  0 0 0 0 0.141  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23grain)'/%3E%3C/svg%3E") repeat;
	background-size: 240px 240px;
	opacity: 0.07;
	mix-blend-mode: multiply;
}

/* ---------- Hand-drawn line ---------- */
.mro-sketch-line {
	fill: none;
	stroke: var(--wp--preset--color--accent);
	stroke-width: var(--wp--custom--stroke--hand);
	stroke-linecap: round;
	stroke-linejoin: round;
}
.mro-sketch-line--thin { stroke-width: 1.4; opacity: 0.7; }

/* ---------- Buttons (used by the custom section blocks) ---------- */
.mro-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--30);
	min-height: 3.25rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--pill);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--weight--bold);
	line-height: var(--wp--custom--leading--snug);
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--wp--custom--duration--quick) var(--wp--custom--ease--gentle),
		border-color var(--wp--custom--duration--quick) var(--wp--custom--ease--gentle),
		color var(--wp--custom--duration--quick) var(--wp--custom--ease--gentle),
		transform var(--wp--custom--duration--base) var(--wp--custom--ease--gentle),
		box-shadow var(--wp--custom--duration--base) var(--wp--custom--ease--gentle);
}
.mro-button .mro-icon { flex: none; }
.mro-button:hover { transform: translateY(-2px); }
.mro-button:active { transform: translateY(0); }

.mro-button--primary {
	background: var(--wp--preset--color--accent-strong);
	color: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--button);
}
.mro-button--primary:hover,
.mro-button--primary:focus-visible {
	background: var(--wp--preset--color--accent-stronger);
	color: var(--wp--preset--color--base);
}

.mro-button--ghost {
	border-color: var(--wp--preset--color--accent-strong);
	color: var(--wp--preset--color--accent-strong);
	background: transparent;
}
.mro-button--ghost:hover,
.mro-button--ghost:focus-visible {
	background: var(--wp--preset--color--mint-faint);
	color: var(--wp--preset--color--accent-stronger);
}

.mro-button--small {
	min-height: 2.75rem;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--sm);
}

/* ---------- Motion ---------- */
@keyframes mro-settle {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}
@keyframes mro-draw { to { stroke-dashoffset: 0; } }
@keyframes mro-spin { to { transform: rotate(360deg); } }
@keyframes mro-drift {
	from { transform: translate(0, 0) rotate(0deg) scale(1); }
	to { transform: translate(-3%, 4%) rotate(8deg) scale(1.04); }
}
@keyframes mro-drop {
	from { opacity: 0; transform: translateY(-0.75rem); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	[class*="mro-"],
	[class*="mro-"]::before,
	[class*="mro-"]::after,
	[class*="mro-"] * {
		animation: none !important;
		transition-duration: 0ms !important;
	}
}
