/*
 * Talha Store base styles: element defaults, layout helpers and block styles.
 * Tokens come from theme.json (--wp--preset--*, --wp--custom--*).
 * Font-size slugs 2xl/3xl/4xl are emitted as --wp--preset--font-size--2-xl etc.
 * sm-plus 15px and lg-plus 20px complete BRIEF's desktop scale (14/15/16/18/20/22/30/40/56).
 */

/* ---------- Document ---------- */
/* scroll-padding: a control focused at the viewport edge (Tab, Shift+Tab, scrollIntoView, a #fragment
   jump with JS off) scrolls in with its 3px ring (+2 offset) visible. 12px also clears the search box's
   3px focus halo around an input sitting 6px inside it (§1: no clipped rings).
   Longhands only: phones add the fixed bottom nav's height to the bottom (src/bottom-nav/style.css). */
/* No browser tap highlight: Chrome's default (Android blue, a square box) painted over every control while a
   finger was down. Each control has its own :active state (INTERACTIONS §1, §2), so nothing is lost. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 12px; scroll-padding-bottom: 8px; -webkit-tap-highlight-color: transparent; }
body { margin: 0; }
/* Phone scale 14/20 (theme.json); desktop body text is 15/22 like the D- boards. */
@media (min-width: 1024px) {
	html body { font-size: var(--wp--preset--font-size--sm-plus); line-height: 22px; }
}

/* Headings: expanded width, heavy, slight negative tracking (BRIEF). */
:where(h1, h2, h3, h4, h5, h6) { font-stretch: 125%; text-wrap: balance; }
.is-style-expanded, .x { font-stretch: 125%; }

/* Links: same colour as the text, 1px underline offset 3px (INTERACTIONS §3).
   Specificity 0,0,2 on purpose: theme.json's global styles emit a:where(:not(.wp-element-button))
   { text-decoration: underline } (0,0,1), and that shorthand resets the thickness to auto. This rule
   wins regardless of stylesheet order. Component classes (0,1,0+) and the 2px hover rule in
   interactions.css (0,1,0) still override it. */
a { color: inherit; }
body a:where(:not(.wp-element-button):not(.wp-block-button__link)) {
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

img, svg { max-width: 100%; }
.ico { display: block; flex-shrink: 0; }
button, input, select, textarea { font: inherit; }

/* ---------- Page layout ---------- */
/* Parts sit flush (no root block gap between header, main and footer). */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks > main { flex-grow: 1; }

/* Content width: 1200 centred on desktop, 16px gutters on phones. */
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; box-sizing: border-box; }
@media (min-width: 1024px) {
	.wrap { width: min(1200px, 100% - 48px); }
}

/* Desktop shell at 1024px and up; phone shell below. */
@media (max-width: 1023.98px) { .ts-desk { display: none !important; } }
@media (min-width: 1024px) { .ts-mob { display: none !important; } }

/* Visually hidden, still read by screen readers. */
.screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip-path: none; height: auto; width: auto; margin: 0; padding: 12px 16px; z-index: 100000;
	background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink);
	left: 8px; top: 8px; border-radius: var(--wp--custom--radius--btn);
}

/* ---------- Group styles ---------- */
.is-style-on-dark { background-color: var(--wp--preset--color--petrol); color: var(--wp--preset--color--white); }

/* ---------- Button block styles (INTERACTIONS §2) ---------- */
.wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 52px; box-sizing: border-box; cursor: pointer; text-decoration: none;
}
.wp-block-button.is-style-cta .wp-block-button__link {
	min-height: 56px; padding: 0 28px; border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--sunflower); color: var(--wp--preset--color--ink);
	font-weight: 900; font-stretch: 112%; font-size: 17px; line-height: 1.2;
}
@media (min-width: 1024px) { .wp-block-button.is-style-cta .wp-block-button__link { font-size: 18px; } }
.wp-block-button.is-style-add .wp-block-button__link {
	min-height: 44px; padding: 0 16px; border-radius: var(--wp--custom--radius--btn);
	background: var(--wp--preset--color--ink); color: var(--wp--preset--color--sunflower);
	font-weight: 800; font-size: 14px; gap: 6px;
}
@media (min-width: 1024px) { .wp-block-button.is-style-add .wp-block-button__link { font-size: var(--wp--preset--font-size--sm-plus); } }
.wp-block-button.is-style-wa .wp-block-button__link {
	min-height: 48px; padding: 0 24px; border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--wa); color: var(--wp--preset--color--white);
	font-weight: 800; font-size: var(--wp--preset--font-size--sm-plus);
}
@media (min-width: 1024px) { .wp-block-button.is-style-wa .wp-block-button__link { min-height: 52px; font-size: 16px; } }
.wp-block-button.is-style-wa .wp-block-button__link::before {
	content: ""; width: 24px; height: 24px; flex-shrink: 0; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='translate(1.2 1.2) scale(.9)' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='translate(1.2 1.2) scale(.9)' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wp-block-button.is-style-ghost .wp-block-button__link {
	min-height: 52px; padding: 0 24px; border-radius: var(--wp--custom--radius--card);
	background: transparent; color: var(--wp--preset--color--ink);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--ink); font-weight: 800; font-size: 16px;
}

/* Hover only where hover exists (INTERACTIONS §1). */
@media (hover: hover) and (pointer: fine) {
	.wp-block-button.is-style-cta .wp-block-button__link:hover { background: #FFD066; }
	.wp-block-button.is-style-add .wp-block-button__link:hover,
	.wp-element-button:where(:not(.is-style-cta *, .is-style-wa *, .is-style-ghost *)):hover { background: #1E2B2B; }
	.wp-block-button.is-style-wa .wp-block-button__link:hover { background: #0B6634; }
	.wp-block-button.is-style-ghost .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--sunflower); }
}
/* Pressed colours (scale comes from interactions.css). */
.wp-block-button.is-style-cta .wp-block-button__link:active { background: #E6A800; }
.wp-block-button.is-style-add .wp-block-button__link:active { background: #000; }
.wp-block-button.is-style-wa .wp-block-button__link:active { background: #095A2E; }
.wp-block-button.is-style-ghost .wp-block-button__link:active { background: #000; color: var(--wp--preset--color--sunflower); }
/* Disabled. */
.wp-block-button.is-style-cta .wp-block-button__link:is([aria-disabled="true"], :disabled) { background: #2E3A3A; color: #C9D1CF; }
.wp-block-button.is-style-add .wp-block-button__link:is([aria-disabled="true"], :disabled) { opacity: .4; }
.wp-block-button.is-style-ghost .wp-block-button__link:is([aria-disabled="true"], :disabled) { color: #7B8483; box-shadow: inset 0 0 0 2px #7B8483; background: transparent; }

/* ---------- Generic page wrappers (index/singular templates) ---------- */
.ts-page { padding: 32px 0 48px; }

/* ---------- Home and shop sections (Home / D-Home boards) ---------- */
/* Page body under the hero: phone gap 32, desktop 64. The bottom nav's own padding sits under it. */
.home-body { display: flex; flex-direction: column; gap: 32px; padding: 8px 0 32px; }
/* "Can't find your part?" is in the HTML once, before the guides (D-Home order), and every width draws it
   there, so the tab and reading order follow the drawing. The Home board (390) draws it after the guides;
   that small deviation is logged in BUILD-LOG (Task 4 review round 2). */
.wp-site-blocks .home-body > *, .wp-site-blocks .ts-home > * { margin-block: 0; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec-head { padding: 0 12px 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sec-h { margin: 0; font-size: 18px; line-height: 1.15; font-weight: 800; font-stretch: 125%; color: #101A1A; letter-spacing: -.01em; }
.more {
	min-height: 44px; display: flex; align-items: center; padding: 0 4px; font-size: 14px; font-weight: 700; color: #101A1A;
	text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; flex-shrink: 0;
}
@media (min-width: 1024px) {
	.home-body { gap: 64px; padding: 16px 0 80px; }
	.sec { width: min(1200px, 100% - 48px); margin-inline: auto; gap: 20px; }
	.sec-head { padding: 0; align-items: flex-end; gap: 24px; }
	.sec-h { font-size: 30px; line-height: 1.1; letter-spacing: -.015em; }
	.more { padding: 0; font-size: var(--wp--preset--font-size--sm-plus); color: #0F3D3E; text-underline-offset: 4px; }
}
@media (hover: hover) and (pointer: fine) {
	.more:hover { text-decoration-thickness: 2px; }
}
.more:active { color: #0F3D3E; }
/* Desktop "See all" links rest in Petrol (D-Home), so pressing darkens them to Ink (§1: text links
   darken, never scale). */
@media (min-width: 1024px) {
	.more:active { color: #101A1A; }
}
