/* ==========================================================================
   Haramain Pure - Design System
   Tokens, typography and base layer.

   Strategy: Woodmart 7.x exposes its own CSS custom properties (--wd-*).
   Redefining those propagates through the parent theme's entire stylesheet
   without specificity fights, so most of the retheme happens right here.
   Component-level work lives in hp-components.css.
   ========================================================================== */

:root {
	/* --- Brand palette ---------------------------------------------------
	   Built outward from #114639, the green already in the logo and the
	   theme's existing primary, so the new system stays recognisably the
	   same brand rather than an unrelated repaint. */
	--hp-green-950: #07211A;   /* near-black green - deep sections, footer  */
	--hp-green-900: #0B3227;
	--hp-green-800: #114639;   /* PRIMARY - the existing brand green        */
	--hp-green-700: #175A49;
	--hp-green-600: #1E7259;
	--hp-green-500: #2A8F6F;
	--hp-green-400: #4FAE8B;
	--hp-green-300: #82C9AE;
	--hp-green-200: #B4E0D0;
	--hp-green-100: #DCEFE7;
	--hp-green-50:  #EFF7F3;   /* the pale wash already used in the hero    */

	--hp-ink:       #14181A;   /* near-black for text - softer than #000    */
	--hp-ink-soft:  #4A5457;
	--hp-ink-mute:  #77838A;
	--hp-white:     #FFFFFF;
	--hp-paper:     #FBFCFB;   /* barely-there off-white for alternating    */
	--hp-line:      #E4EBE7;   /* hairlines, tinted green not neutral grey  */

	/* Warm accent, used ONLY where meaning requires it: star ratings, sale
	   badges. Deliberately restrained - the brief is green/white/black, and
	   this replaces Woodmart's default #fbbc34, which was far too loud. */
	--hp-honey:     #C08A2E;

	/* --- Radius ----------------------------------------------------------
	   The old design set every radius to 0. Hard 90-degree corners on cards,
	   buttons, inputs and images are the strongest single signal of a dated
	   layout. */
	--hp-r-xs:   6px;
	--hp-r-sm:   10px;
	--hp-r-md:   14px;
	--hp-r-lg:   20px;
	--hp-r-xl:   28px;
	--hp-r-pill: 999px;

	/* --- Elevation -------------------------------------------------------
	   Layered, low-opacity, tinted green rather than flat black - shadows
	   over a warm white read as dirty when they are pure grey. */
	--hp-shadow-xs: 0 1px 2px rgba(11, 50, 39, .06);
	--hp-shadow-sm: 0 2px 6px rgba(11, 50, 39, .06), 0 1px 2px rgba(11, 50, 39, .04);
	--hp-shadow-md: 0 6px 18px rgba(11, 50, 39, .08), 0 2px 6px rgba(11, 50, 39, .05);
	--hp-shadow-lg: 0 16px 40px rgba(11, 50, 39, .12), 0 4px 12px rgba(11, 50, 39, .06);
	--hp-shadow-ring: 0 0 0 3px rgba(42, 143, 111, .28);

	/* --- Spacing ---------------------------------------------------------
	   A single 4px-based scale. Section padding is fluid so vertical rhythm
	   compresses sensibly on phones instead of leaving dead space. */
	--hp-s-1: 4px;
	--hp-s-2: 8px;
	--hp-s-3: 12px;
	--hp-s-4: 16px;
	--hp-s-5: 24px;
	--hp-s-6: 32px;
	--hp-s-7: 48px;
	--hp-s-8: 64px;
	--hp-s-9: 96px;
	--hp-section-y: clamp(48px, 7vw, 104px);

	/* --- Motion ----------------------------------------------------------
	   Two curves only. `out` for things entering or responding to the user,
	   `spring` for a slight overshoot on hover lifts. */
	--hp-ease-out:    cubic-bezier(.22, .61, .36, 1);
	--hp-ease-spring: cubic-bezier(.34, 1.36, .64, 1);
	--hp-t-fast: 140ms;
	--hp-t-mid:  260ms;
	--hp-t-slow: 520ms;

}

/* ==========================================================================
   Map onto Woodmart's own tokens
   This is what makes the retheme reach the parent theme's components.

   The selector is `html:root`, not `:root`, and that detail is load-bearing.
   Woodmart prints its theme-options CSS into an inline <style> block in the
   document head, *after* enqueued stylesheets, and that block also targets
   `:root`. Equal specificity plus later source order means it would win -
   which is exactly what happened on the first pass: --wd-brd-radius stayed
   at 0px and every corner on the site remained square.

   `html:root` scores 0-1-1 against `:root`'s 0-1-0, so it wins on specificity
   regardless of order. Preferable to !important, which would also block the
   theme options panel from ever overriding anything again.
   ========================================================================== */

html:root {
	--wd-primary-color: var(--hp-green-800);
	--wd-alternative-color: var(--hp-green-600);
	--wd-text-color: var(--hp-ink-soft);
	--wd-title-color: var(--hp-ink);
	--wd-link-color: var(--hp-green-800);
	--wd-link-color-hover: var(--hp-green-600);
	--wd-main-bgcolor: var(--hp-white);

	--wd-brd-radius: var(--hp-r-md);
	--wd-form-brd-radius: var(--hp-r-sm);

	--btn-default-bgcolor: var(--hp-green-50);
	--btn-default-color: var(--hp-green-800);
	--btn-accented-bgcolor: var(--hp-green-800);
	--btn-accented-bgcolor-hover: var(--hp-green-700);
	--btn-accented-color: var(--hp-white);

	--color-gray-100: var(--hp-green-50);
	--color-gray-200: var(--hp-line);
	--color-gray-300: var(--hp-line);
	--color-gray-800: var(--hp-ink);

	--wd-form-brd-color: var(--hp-line);
	--wd-form-brd-color-focus: var(--hp-green-500);
}

/* ==========================================================================
   Typography
   The custom "Haramain" webfont is kept - it is brand identity. What changes
   is the scale: body text was 15px with default line-height, which reads
   cramped. Sizes are fluid via clamp() so they resolve per viewport without
   a cascade of breakpoints.
   ========================================================================== */

body {
	font-size: clamp(15.5px, .35vw + 14.6px, 17px);
	line-height: 1.65;
	color: var(--hp-ink-soft);
	background-color: var(--hp-white);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.title, .wd-entities-title, .product-title {
	color: var(--hp-ink);
	line-height: 1.18;
	letter-spacing: -.015em;   /* large type set tighter reads more modern */
	font-weight: 600;
}

h1, .title-size-large    { font-size: clamp(32px, 4.2vw, 58px); }
h2                       { font-size: clamp(26px, 3.1vw, 42px); }
h3                       { font-size: clamp(21px, 2.1vw, 28px); }
h4                       { font-size: clamp(18px, 1.5vw, 22px); }

p { margin-bottom: var(--hp-s-4); }

/* Long-form copy is easier to read when the measure is capped. */
.wd-entry-content p,
.woocommerce-product-details__short-description p,
.entry-content p {
	max-width: 68ch;
}

a {
	color: var(--hp-green-800);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
	transition: color var(--hp-t-fast) var(--hp-ease-out);
}
a:hover { color: var(--hp-green-600); }

/* ==========================================================================
   Accessibility baseline
   Woodmart ships with weak focus indication. Anything reachable by keyboard
   gets a visible ring - required for keyboard and screen-magnifier users,
   and a legal consideration for a commercial store.
   ========================================================================== */

:focus-visible {
	outline: 2px solid var(--hp-green-600);
	outline-offset: 2px;
	border-radius: var(--hp-r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Skip-link, revealed on focus. */
.hp-skip-link {
	position: absolute;
	left: -9999px;
	top: var(--hp-s-3);
	z-index: 10000;
	padding: var(--hp-s-3) var(--hp-s-5);
	background: var(--hp-green-800);
	color: var(--hp-white);
	border-radius: var(--hp-r-pill);
	font-weight: 600;
}
.hp-skip-link:focus {
	left: var(--hp-s-3);
	color: var(--hp-white);
}

/* Minimum touch target on coarse pointers. Below ~44px, tap accuracy drops
   sharply, and this store's traffic is predominantly mobile. */
@media (pointer: coarse) {
	.wd-tools-element > a,
	.wd-nav > li > a,
	.button, .btn,
	.wd-buttons a {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
}

/* ==========================================================================
   Reduced motion
   Honour the OS-level preference. Users who set it often do so because
   movement triggers nausea or migraine, so this is not optional polish.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.hp-reveal { opacity: 1 !important; transform: none !important; }
}

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