/* Matjari base. The contract is docs/DESIGN-SYSTEM.md, 5.5 and section 7.

   Reset, element defaults, the ONE input anatomy, focus, the container, the
   shared section head, the product grid, merchant-written rich text and the
   reduced-motion block. Everything here is by element selector or a single
   class, so any component rule and any Look rule out-specifies it.

   Logical properties only. Hover lives behind (hover: hover) and
   (pointer: fine). Text inside a field is never under 16px.

   !important stands in three places and no other (section 7, H12): [hidden],
   the reduced-motion block, and the one rule that sets aside a colour pasted
   into rich text, which an inline style would otherwise win. */

*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	font-synthesis: none; /* a weight a face does not have is never faked (2.1) */
	scroll-behavior: smooth;
	scroll-padding-block-start: var(--m-header-clear); /* an in-page anchor lands under the sticky header otherwise */
}

body {
	margin: 0;
	padding-block-end: var(--m-bottom-clear); /* the last line of the footer is never under a fixed bar (2.9) */
	background-color: var(--m-ground);
	color: var(--m-c-ink);
	font-family: var(--m-font-text);
	font-weight: var(--m-fw-body);
	font-size: var(--m-fs-body);
	line-height: var(--m-lh-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
/* The scroll lock while an overlay is open. A state the overlay script sets
   and removes, not a layout: nothing sticky is on screen behind an overlay. */
body.m-locked { overflow: hidden; }

/* ---- Element defaults ---- */
/* The page's own title (.m-title) is always an <h1>: it is this h1. */
h1, h2, h3, h4 { margin-block: 0 var(--m-sp-3); margin-inline: 0; line-height: var(--m-lh-heading); text-wrap: balance; }
h1, h2 { font-family: var(--m-font-heading); font-weight: var(--m-fw-heading); }
h1 { font-size: var(--m-fs-h1); }
h2 { font-size: var(--m-fs-h2); }
h3, h4 { font-family: var(--m-font-subhead); font-weight: var(--m-fw-subhead); font-size: var(--m-fs-h3); }
p { margin-block: 0 var(--m-sp-3); margin-inline: 0; text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---- The one input anatomy (2.5). By element selector, so a field looks the
   same in checkout, the filter, search, reviews and the account. Four visible
   sides on every Look. The types are listed, not excluded: a chain of :not()
   would out-specify every component that restyles a field. ---- */
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=url], input[type=date], input:not([type]), select, textarea {
	display: block;
	width: 100%;
	min-height: var(--m-input-h);
	margin: 0;
	padding-block: 0;
	padding-inline-start: var(--m-input-px);
	padding-inline-end: var(--m-input-px);
	border: var(--m-input-bw) solid var(--m-input-edge);
	border-radius: var(--m-input-r);
	background-color: var(--m-input-bg);
	color: var(--m-input-ink);
	font-family: var(--m-font-ui);
	font-weight: var(--m-fw-body);
	font-size: var(--m-fs-input);
	line-height: var(--m-lh-control);
	transition: border-color var(--m-dur-press) var(--m-ease), box-shadow var(--m-dur-press) var(--m-ease);
}
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=url], input:not([type]), textarea { -webkit-appearance: none; appearance: none; }
/* A note field is never a stadium: its own radius, capped at 16px by the token. */
textarea {
	min-height: calc(var(--m-input-h) * 2.5);
	padding-block: var(--m-sp-3);
	border-radius: var(--m-input-r-multi);
	line-height: var(--m-lh-ui);
	resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--m-input-placeholder); opacity: 1; }
/* Keyed on :focus, which every engine has. The outline is made transparent,
   never removed, so it still draws in forced-colours mode. */
input[type=text]:focus, input[type=tel]:focus, input[type=email]:focus, input[type=password]:focus, input[type=search]:focus,
input[type=number]:focus, input[type=url]:focus, input[type=date]:focus, input:not([type]):focus, select:focus, textarea:focus {
	border-color: var(--m-input-edge-focus);
	box-shadow: var(--m-input-ring);
	outline-color: transparent;
}
input:disabled, select:disabled, textarea:disabled, button:disabled { opacity: var(--m-disabled); cursor: not-allowed; }
label { font-size: var(--m-label-fs); font-weight: var(--m-label-fw); }

/* ---- Focus: one ring, in the context's own text colour, so it shows on a
   primary band and on the footer. Alone in its rule: one unknown pseudo drops
   a whole selector list below the floor. ---- */
:focus-visible { outline: var(--m-bw-focus) solid var(--m-c-focus); outline-offset: var(--m-focus-offset); }

::selection { background-color: rgba(var(--m-primary-rgb), .22); }

[hidden] { display: none !important; }

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.m-skip {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: -999px;
	z-index: var(--m-z-skip);
	padding: var(--m-sp-2) var(--m-sp-4);
	border-radius: 0 0 var(--m-r-thumb) var(--m-r-thumb);
	background-color: var(--m-primary);
	color: var(--m-on-primary);
}
.m-skip:focus { inset-inline-start: var(--m-sp-4); }

/* ---- Layout (2.12). Longhands on purpose: the lower browser tier still has
   gutters and a centred page. The header, every section's content, the footer
   and the hero text all use this, so every edge lines up at every width. ---- */
.m-container {
	width: 100%;
	max-width: calc(var(--m-container-max) + 2 * var(--m-gutter));
	margin-inline-start: auto;
	margin-inline-end: auto;
	padding-inline-start: var(--m-gutter);
	padding-inline-end: var(--m-gutter);
}

/* ---- The shared section head (4.9). Laid out from the Look's two title
   tokens; the title STYLE is painted by the Look. A part that still prints a
   bare title, outside a head, gets the same face and the same gap. ---- */
.m-section__head {
	display: grid;
	justify-items: var(--m-section-title-align);
	gap: var(--m-sp-2);
	margin-block-end: var(--m-section-head-gap);
	text-align: var(--m-section-title-align);
}
.m-section__title {
	margin-block: 0 var(--m-section-head-gap);
	margin-inline: 0;
	font-family: var(--m-font-heading);
	font-weight: var(--m-fw-heading);
	font-size: var(--m-section-title-fs);
	line-height: var(--m-lh-heading);
	text-align: var(--m-section-title-align);
}
.m-section__head > .m-section__title { margin-block-end: 0; }
.m-section__eyebrow {
	margin: 0;
	color: var(--m-section-mark);
	font-size: var(--m-fs-small);
	font-weight: var(--m-fw-strong);
	line-height: var(--m-lh-control);
	letter-spacing: var(--m-ls-caps);
	text-transform: var(--m-tt-caps);
}
.m-section__num, .m-section__count {
	color: var(--m-c-ink-2);
	font-size: var(--m-fs-small);
	font-weight: var(--m-fw-strong);
	font-variant-numeric: var(--m-fvn);
}
.m-section__sub { max-width: var(--m-measure); margin: 0; color: var(--m-c-ink-2); font-size: var(--m-fs-lead); }
.m-section__more { color: var(--m-c-link); font-size: var(--m-fs-ui); font-weight: var(--m-fw-strong); }

/* ---- The product grid, on the Look's column tokens. minmax(0, 1fr), never a
   bare 1fr: a bare track cannot shrink under its content, and one unbreakable
   price line then scrolls the phone sideways. ---- */
.m-grid {
	display: grid;
	grid-template-columns: repeat(var(--m-grid-cols), minmax(0, 1fr));
	gap: var(--m-gap-grid-y) var(--m-gap-grid-x);
	margin: 0;
	padding: 0;
	list-style: none;
}

.m-icon { flex: none; inline-size: 20px; block-size: 20px; }
.m-num { font-variant-numeric: var(--m-fvn); }

/* ---- Rich text the merchant wrote: product description, content pages,
   the rich_text section. One treatment. ---- */
.m-rich { max-width: var(--m-measure); font-size: var(--m-fs-body); line-height: var(--m-lh-body); }
/* Each block takes the direction of its own first letter, not the page's:
   text she has not translated (Arabic on an English page, or the reverse)
   reads from its own side, and its full stop lands at its own end. A list
   item and a quotation keep their lines beside their marker and their rule,
   which follow the page: the prefixed value is the one Chromium and WebKit
   resolve to a side. */
.m-rich, .m-rich p, .m-rich h2, .m-rich h3, .m-rich h4, .m-rich li, .m-rich blockquote { unicode-bidi: plaintext; }
.m-rich li, .m-rich blockquote, .m-rich blockquote p { text-align: match-parent; text-align: -webkit-match-parent; }
.m-rich h2 { margin-block-start: var(--m-sp-8); font-size: var(--m-fs-h3); }
.m-rich h3 { margin-block-start: var(--m-sp-6); font-size: var(--m-fs-lead); }
.m-rich a { color: var(--m-c-link); text-decoration: underline; text-underline-offset: 3px; }
/* A colour or a ground that came with text she pasted (Word, Google Docs,
   another site) is right in one form at most: black words on a dark page, a
   white box or a yellow highlight on it. Neither is honoured, however it was
   written (COLOR in capitals, the background shorthand, Word's highlight):
   the words take the page's ink and stand on the page. An inline style
   outranks every rule, so this is the one place a colour is !important (H12
   lists it); <font color> is only a hint and needs none. */
.m-rich [style] { color: inherit !important; background: transparent !important; }
.m-rich font { color: inherit; }
.m-rich ul, .m-rich ol { margin-block: 0 var(--m-sp-3); padding-inline-start: var(--m-sp-6); }
.m-rich img { margin-block: var(--m-sp-4); border-radius: var(--m-r-image); }
.m-rich blockquote {
	margin-block: var(--m-sp-6);
	margin-inline: 0;
	padding-block: var(--m-sp-2);
	padding-inline-start: var(--m-sp-6);
	border-inline-start: var(--m-bw-strong) var(--m-bs-rule) var(--m-c-line-strong);
	color: var(--m-c-ink-2);
}

/* ---- Reduced motion (12.1.4): the shopper's own device beats every level and
   every Look, which is why these are !important. Every duration token is
   nothing; what a press and a pointer move is neutral; the hero's photo does
   not drift (its last frame would be held); and whatever still animates is
   cut short WITH NO DELAY, so a staggered part is not left at its start for
   the length of its wait. What waits for the entrance is not named: fx.js
   arms nothing here, so no start state is ever applied. ---- */
@media (prefers-reduced-motion: reduce) {
	html {
		--m-dur-press: .01ms !important; --m-dur-panel: .01ms !important; --m-dur-panel-out: .01ms !important; --m-dur-emph: .01ms !important;
		--m-dur-zoom: .01ms !important; --m-dur-chrome: .01ms !important; --m-dur-tone: .01ms !important; --m-dur-tone-in: .01ms !important;
		--m-dur-spin: .01ms !important; --m-dur-enter: .01ms !important; --m-dur-img: .01ms !important; --m-dur-hero: .01ms !important;
		--m-dur-drift: .01ms !important; --m-dur-rotate: .01ms !important;
		--m-btn-press: none !important; --m-press-scale: 1 !important; --m-press-opacity: 1 !important;
		--m-hover-lift: 0px !important; --m-hover-x: 0px !important; --m-hover-rot: 0deg !important; --m-img-zoom: 1 !important;
		--m-drift: none !important;
	}
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-delay: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		transition-delay: .01ms !important;
		scroll-behavior: auto !important;
	}
}
