/* ==========================================================================
   Hale by Pencilino — design tokens, reset and layout primitives
   --------------------------------------------------------------------------
   Every token is namespaced with --hale- so nothing collides with WordPress
   core, the Media Library modal Pencilino renders on the frontend, or other
   plugins.

   The reset is scoped to .hale-app rather than applied globally. That keeps
   the UA margin/padding reset and button styling away from the WordPress
   Media Library modal and the Pencilino editing toolbar, both of which live
   outside the .hale-app wrapper.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Currency glyph.
   Calistoga and Cabin Condensed, the two typefaces the design uses for prices
   and totals, draw the Naira sign (U+20A6) as a bare "N". Nigerian shoppers
   read that as a wrong price, so the naira is drawn from a single-glyph subset
   of Plus Jakarta Sans, which has a correct ₦. The unicode-range means this
   face only ever supplies that one character: every other glyph continues to
   come from the design fonts.
   -------------------------------------------------------------------------- */
@font-face {
	font-family: "Hale Currency";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/hale-currency.woff2") format("woff2");
	unicode-range: U+20A6;
}

:root {
	/* Surfaces */
	--hale-cream: #faf7f0;
	--hale-warm-white: #ffffff;
	--hale-paper: #f4efe6;
	--hale-paper-card: #ffffff;

	/* Brand greens */
	--hale-forest: #0d2818;
	--hale-leaf: #1e5132;
	--hale-lime: #d4e95f;
	--hale-lime-soft: #edf5cc;
	--hale-lime-bright: #e2f477;

	/* Accents */
	--hale-citrus: #e8590c;
	--hale-citrus-bright: #ff6b35;
	--hale-amber: #f59f00;
	--hale-berry: #8a1934;
	--hale-pink: #d6477e;
	--hale-pop: #f59f00;
	--hale-whatsapp: #25d366;

	/* Text */
	--hale-ink: #0d2818;
	--hale-body: rgba(13, 40, 24, 0.76);
	--hale-body-light: rgba(13, 40, 24, 0.58);
	--hale-on-dark: rgba(255, 255, 255, 0.82);
	--hale-on-dark-soft: rgba(255, 255, 255, 0.68);
	--hale-on-dark-faint: rgba(255, 255, 255, 0.55);

	/* Lines */
	--hale-line: rgba(13, 40, 24, 0.1);
	--hale-line-subtle: rgba(13, 40, 24, 0.06);
	--hale-line-on-dark: rgba(255, 255, 255, 0.16);
	--hale-line-lime: rgba(212, 233, 95, 0.22);

	/* Radii */
	--hale-radius-sm: 10px;
	--hale-radius-md: 18px;
	--hale-radius-lg: 26px;
	--hale-radius-pill: 9999px;

	/* Type */
	--hale-display: "Hale Currency", "Calistoga", Georgia, "Times New Roman", serif;
	--hale-cond: "Hale Currency", "Cabin Condensed", "Arial Narrow", sans-serif;
	--hale-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	/* Elevation */
	--hale-shadow-soft: 0 14px 40px rgba(13, 40, 24, 0.08);
	--hale-shadow-card: 0 20px 50px rgba(13, 40, 24, 0.1);
	--hale-shadow-pop: 0 25px 65px rgba(13, 40, 24, 0.16);

	/* Motion */
	--hale-spring: cubic-bezier(0.34, 1.35, 0.44, 1);
	--hale-ease: cubic-bezier(0.22, 1, 0.36, 1);

	/* Layout */
	--hale-wrap-max: 1240px;
	--hale-wrap-gutter: 28px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	background: var(--hale-cream);
	width: 100%;
	overflow-x: clip;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--hale-sans);
	background: var(--hale-cream);
	color: var(--hale-ink);
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
	overflow-x: clip;
	width: 100%;
}

/* The reset applies only inside the theme wrapper. */
.hale-app,
.hale-app *,
.hale-app *::before,
.hale-app *::after {
	box-sizing: border-box;
}

.hale-app *,
.hale-app *::before,
.hale-app *::after {
	margin: 0;
	padding: 0;
}

.hale-app {
	position: relative;
	width: 100%;
}

/*
 * A component's own display value always beats the user-agent [hidden] rule,
 * so the cart badge, the drawer footer, the empty-bag panel and the filter
 * count would stay visible when JavaScript sets .hidden = true. Guarding the
 * attribute here keeps "hidden means hidden" true for every theme element.
 */
.hale-app [hidden] {
	display: none !important;
}

/*
 * The element reset is written with :where() so it contributes no specificity
 * beyond the element itself. A plain `.hale-app button { background: none }`
 * scores (0,1,1) and silently outranks component classes at (0,1,0), which
 * made `.hale-icon-btn-cart` and `.hale-burger` transparent on the dark bar.
 * With :where() a class rule always wins, while the reset still applies to
 * every unstyled element.
 */
:where(.hale-app) a { color: inherit; text-decoration: none; }

:where(.hale-app) button,
:where(.hale-app) input,
:where(.hale-app) select,
:where(.hale-app) textarea {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}

:where(.hale-app) button {
	cursor: pointer;
	border: none;
	background: none;
}

.hale-app img,
.hale-app svg { display: block; }

.hale-app img { max-width: 100%; }

.hale-app ul,
.hale-app ol { list-style: none; }

/* Skip link and visually-hidden utility.
   Deliberately NOT named .screen-reader-text / .hidden, which WordPress core
   styles and the Media Library modal relies on. */
.hale-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 4000;
	background: var(--hale-forest);
	color: var(--hale-lime);
	padding: 12px 20px;
	border-radius: 0 0 var(--hale-radius-sm) 0;
	font-weight: 700;
}

.hale-skip-link:focus { left: 0; }

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

/* ---------- Layout primitive ---------- */
.hale-wrap {
	max-width: var(--hale-wrap-max);
	margin: 0 auto;
	padding: 0 var(--hale-wrap-gutter);
}

@media (max-width: 768px) {
	.hale-wrap { padding: 0 18px; }
}

/* Admin bar offset for the sticky navigation. */
body.admin-bar { --hale-adminbar: 32px; }

@media screen and (max-width: 782px) {
	body.admin-bar { --hale-adminbar: 46px; }
}

/* ---------- Rich text fields ---------- */
.pencil-richtext p { margin-bottom: 0.9em; }
.pencil-richtext p:last-child { margin-bottom: 0; }
.pencil-richtext ul,
.pencil-richtext ol { margin: 0 0 0.9em 1.2em; }
.pencil-richtext ul { list-style: disc; }
.pencil-richtext ol { list-style: decimal; }
.pencil-richtext li { margin-bottom: 0.35em; }
.pencil-richtext a { text-decoration: underline; text-underline-offset: 2px; }
.pencil-richtext strong { font-weight: 800; }
.pencil-richtext img { max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
	.hale-app *,
	.hale-app *::before,
	.hale-app *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
