/**
 * Base styles: typography, buttons, form fields, tags. Built on tokens.css.
 */

/* iOS Safari enlarges text in wide boxes (the green bar's moving message)
   unless this is set. */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--color-page);
	color: var(--color-text);
	font-family: var(--font-body);
	font-weight: var(--weight-gilroy-regular);
	font-size: var(--text-body);
	line-height: var(--leading-body);
	-webkit-font-smoothing: antialiased;
}

/* Selected text: white on the brand's dark sage; burgundy while the home page
   header is in its Christmas style (Customizer; inc/home-hero.php). */
::selection {
	background: var(--color-dark-sage);
	color: #fff;
}

.is-christmas ::selection {
	background: #651d25;
	color: #fff;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-weight: var(--weight-mont-regular);
}

h1 { font-size: var(--text-h1); line-height: var(--leading-h1); font-weight: var(--weight-mont-bold); }
h2 { font-size: var(--text-h2); line-height: var(--leading-h2); }
h3 { font-size: var(--text-h3); line-height: var(--leading-h3); }
h4 { font-size: var(--text-h4); line-height: var(--leading-h4); }
h5 { font-size: var(--text-h5); line-height: var(--leading-h5); font-weight: var(--weight-mont-bold); }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; }

:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

/* Translations: a long word that doesn't fit its line in a heading (German,
   Dutch, Finnish compounds like "Feuchtigkeitsmanagement") is split with a
   hyphen, by the language's rules; only words of 13 letters or more. English
   is left as it is. */
:root:not(:lang(en)) :is(h1, h2, h3, h4, h5, h6, .gift-guide__title, .material__text) {
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 13 5 5;
	/* Where the browser has no hyphenation for the language: split anyway,
	   so the word never runs out of its box or column. */
	overflow-wrap: anywhere;
}

/* A dialog or a mobile menu screen takes the focus itself when it opens
   (site.js); it is not a control, so no ring. */
dialog:focus,
[data-panel]:focus {
	outline: none;
}

.eyebrow {
	font-family: var(--font-heading);
	font-weight: var(--weight-mont-bold);
	font-size: var(--text-eyebrow);
	line-height: var(--leading-eyebrow);
	text-transform: uppercase;
}

.text-body-l { font-size: var(--text-body-l); line-height: var(--leading-body-l); }
.text-small { font-size: var(--text-small); line-height: var(--leading-small); }

/* Buttons: pills, Dark Sage, hover Deep Slate. WooCommerce buttons share the look;
   the .woocommerce selectors match the specificity of WooCommerce's own button colours. */
.button,
button.button,
.single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--button-height);
	padding: 0 var(--space-9);
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-primary);
	color: var(--color-on-primary);
	font-family: var(--font-heading);
	font-weight: var(--weight-mont-bold);
	font-size: var(--text-button);
	line-height: var(--leading-button);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.button:hover,
.single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
	background: var(--color-primary-hover);
	color: var(--color-on-primary);
}

.button.button--secondary,
.woocommerce button.button.button--secondary {
	background: var(--color-surface);
	color: var(--color-primary);
}

.button.button--secondary:hover,
.woocommerce button.button.button--secondary:hover {
	background: var(--color-pale-oat);
	color: var(--color-primary);
}

/* Phones: the buttons in a page run the full width of their column, so they
   line up with both edges and sit under the thumb, whatever the text beside
   them does (client, 2026-11-06). Not the ones that belong to something
   smaller: product cards and forms, the cart, checkout, account, notices. */
@media (max-width: 767px) {
	main .button:not(.button--card, .product-card .button, .search-pill .button, form.cart .button, .how-wizard .button, .woocommerce-cart-form .button, .cart_totals .button, .woocommerce-checkout .button, .woocommerce-MyAccount-content .button, .woocommerce-message .button, .woocommerce-info .button, .woocommerce-error .button) {
		box-sizing: border-box;
		width: 100%;
	}
}

/* Prices: Deep Slate instead of WooCommerce's olive. */
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price {
	color: var(--color-deep-slate);
}

.button--card {
	min-height: var(--card-button-height);
	border-radius: var(--radius-card-button);
	font-size: 15px;
	line-height: 22px;
}

.button:disabled,
.button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Form fields. Labels use Gilroy Medium (the design's Gilroy Bold is not loaded). */
label {
	color: var(--color-heading);
	font-weight: var(--weight-gilroy-medium);
	font-size: 14px;
	line-height: 21px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--input-height);
	padding: 11px 16px;
	border: 1px solid var(--color-input-border);
	border-radius: 0;
	background: var(--color-warm-off-white);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 24px;
}

textarea { min-height: 120px; resize: vertical; }

/* Text fields and selects: no focus outline on click; the border turns sage.
   Checkboxes, radios and buttons keep the keyboard focus ring. */
input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="range"], [type="color"], [type="file"]):focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--color-focus);
}

::placeholder { color: var(--color-placeholder); opacity: 1; }

/* Tags and labels on cards */
/* Not a fixed height: a longer translation ("Saatavilla olevat vaihtoehdot")
   takes two lines inside the tag. */
.how-tag {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-height: var(--tag-height);
	padding: 1px var(--tag-padding);
	background: var(--color-pale-oat);
	color: var(--color-text);
	font-family: var(--font-body);
	font-weight: var(--weight-gilroy-medium);
	font-size: var(--text-tag);
	line-height: var(--leading-tag);
	text-transform: uppercase;
}

.how-tag--bestseller { background: var(--color-soft-ivory); color: var(--color-deep-slate); }
.how-tag--sale { background: var(--color-deep-slate); color: var(--color-warm-off-white); }
.how-tag--popular { background: var(--color-pale-sage); color: var(--color-dark-sage); }

.how-badge-discount {
	display: inline-flex;
	align-items: center;
	height: 35px;
	padding: 0 var(--space-3);
	background: var(--color-deep-slate);
	color: var(--color-warm-off-white);
	font-family: var(--font-body);
	font-weight: var(--weight-gilroy-medium);
	font-size: 16px;
}

/* Accessibility helpers */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip-path: none;
	height: auto;
	left: 8px;
	padding: 12px 16px;
	top: 8px;
	width: auto;
	z-index: 100000;
	background: var(--color-warm-off-white);
}

/* Every hover and focus change on an interactive element eases (0.2s). :where()
   keeps it at zero specificity, so components with their own transition keep it. */
@media (prefers-reduced-motion: no-preference) {
	:where(a, button, .button, input, select, textarea, label, summary, [role="button"], .wapf-custom, .wapf-swatch > label) {
		transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, text-decoration-color 0.2s ease;
	}
}

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