/*
 Theme Name:   Atomic Signs
 Description:  The Atomic Signs / Papaya Stickers theme. Built fresh against the design handoff. No parent, no framework.
 Author:       Atomic Signs
 Version:      0.1.0
 Text Domain:  atomic-signs
 Requires PHP: 8.0
*/

/*
 * ─── WHY THIS EXISTS, WHEN themes/atomic ALREADY WORKS ───────────────────────
 *
 * themes/atomic is the old theme with its parent absorbed. It renders, and
 * every route returns 200. It is also five years of accumulated inheritance,
 * and one afternoon of looking at it in a browser turned up: a missing parent
 * function that fataled six templates, nine silently dropped widget areas,
 * eight hardcoded production URLs that would have broken only after deploying,
 * Bootstrap entirely absent, a catch-all template shadowing two others,
 * fourteen hooks fired twice so every product drew two configurators, body
 * padding reserving space for a navbar that no longer exists, and a nav that
 * highlighted the same item on every page.
 *
 * None of that was written for this business. It is what a theme built on a
 * starter kit accumulates, and de-parenting inherited all of it. So: fresh.
 *
 * ─── WHAT CAME ACROSS ────────────────────────────────────────────────────────
 *
 * Only what is genuinely ours and genuinely clean:
 *
 *   css/tokens.css, css/primitives.css   the design system from the handoff
 *   template-parts/header.php + assets   the site header
 *   template-banner-stand-product.php    the rebuilt slice
 *   inc/acf-fallback.php                 boots without ACF
 *   inc/no-org-updates.php               see the file; it is not optional
 *
 * NOT: Bootstrap, Font Awesome, bootscore's templates, custom.css's 1,400
 * lines, or the sixteen legacy page templates. Those get rebuilt route by
 * route, which is what the handoff asks for anyway.
 *
 * ─── WHAT IS NOT HERE AND DOES NOT NEED TO BE ────────────────────────────────
 *
 * The uploader, the cutline studio, the proof and print queues, order stages,
 * the customer's progress view — none of it lives in a theme. It is all in
 * Centro and Sticker Studio, which is why switching themes cannot break an
 * order going through the shop. That was the point of building the platform
 * plugin-first, and this is where it pays.
 *
 * ─── LAYOUT PRIMITIVES ONLY ──────────────────────────────────────────────────
 *
 * No CSS framework. primitives.css defines the four components the handoff
 * specifies (button, card, chip, section header) and tokens.css the values
 * they read. Anything else a route needs is written for that route, in
 * css/route-*.css, loaded only there.
 */

/* Reset — deliberately small. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-sans, 'Poppins', system-ui, -apple-system, sans-serif);
	font-size: var(--text-body, 15px);
	line-height: 1.6;
	color: var(--color-text, #2D384B);
	background: var(--color-surface, #fff);
	-webkit-font-smoothing: antialiased;
}

/*
 * Deliberately NOT `height: auto` on a bare img/svg selector.
 *
 * That reaches into every plugin's UI: it overrides the HTML height attribute
 * and beats any rule that loses on specificity, so a logo sized `height="34"`
 * or by a single-class rule can end up filling its container. Sticker Studio's
 * modal renders its own header and its own logo, and a theme reset is not
 * entitled to resize it.
 *
 * max-width still stops anything overflowing, which is the part a reset is
 * actually for. Images this theme owns get their height from their own rules.
 */
img, svg, video { max-width: 100%; }
img, svg, video { display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--atomic-blue, #1AB0E0); }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; font-weight: 700; }
p { margin: 0 0 1em; }

/* Wide content must scroll inside itself rather than the page. */
table { width: 100%; border-collapse: collapse; }
.as-scroll-x { overflow-x: auto; }

.screen-reader-text {
	position: absolute; width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap;
}

/*
 * ─── A HIDDEN *INPUT* STAYS HIDDEN WHEN IT IS FOCUSED ────────────────────────
 *
 * WordPress core's block-library CSS ships `.screen-reader-text:focus` — the
 * skip-link rule: `clip-path: none; width: auto; height: auto; top: 5px;
 * left: 5px; background-color: #ddd`. It exists so "Skip to content" appears
 * when somebody tabs to it, and it fires on anything wearing the class.
 *
 * Our substrate and swatch radios wear it, because the thing a sighted
 * customer clicks is the label drawn around them. So picking a material
 * focused one, core un-hid it, and a native 13px radio painted itself on a
 * #ddd square at the top-left of `.product` — the nearest positioned ancestor,
 * hence `top: 5px` landing nowhere near the control it belongs to. Reported by
 * Dennis as "an off blue dot that appears when I pick another substrate"; off
 * blue because it was Chrome's own accent colour rather than ours.
 *
 * A LINK revealed on focus is the whole point of that rule. An INPUT revealed
 * on focus is a control escaping the thing drawn in its place, and there is no
 * case where we want it: if it has a visible proxy it should stay behind it,
 * and if it has not, it should not be carrying this class.
 *
 * `input.` is (0,2,1) against core's (0,2,0), so it wins on specificity and
 * needs no !important.
 *
 * Focus is NOT lost. Both proxies already draw it themselves —
 * `.as-bn__swatch:focus-within` and `.as-bn__matrow:focus-within` in
 * route-banner.css — which is where a keyboard user should see it anyway.
 */
input.screen-reader-text:focus {
	position: absolute; width: 1px; height: 1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap; background: none; top: auto; left: auto;
}
