/*
 * Solkarra BYOTCG: the sticker shop look, on every page.
 *
 * Loaded after the parent's sheet. The parent writes its ten colour tokens inline at :root, so the
 * mapping below doubles the selector (:root:root) to win without !important. Pages this theme has
 * no template for (the shop, the cart, My Account, section pages) take the look from that mapping
 * alone: paper ground, ink text, pink actions, lime marks, the two faces.
 */

/* Both faces are served from the theme: the parent's rule is zero outbound requests. */
@font-face {
	font-family: "Bowlby One SC";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bowlby-one-sc-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Sofia Sans";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/sofia-sans-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--bt-paper: oklch(95.7% 0.013 82);
	--bt-paper-2: oklch(92.8% 0.021 79);
	--bt-paper-3: oklch(99.4% 0.007 89);
	--bt-ink: oklch(21% 0.011 81);
	--bt-ink-2: oklch(30% 0.013 78);
	--bt-muted: oklch(50% 0.017 64);
	--bt-rule: oklch(89.7% 0.02 80);
	--bt-white: oklch(99.5% 0.003 82);
	--bt-pink: oklch(56% 0.225 2);
	--bt-pink-deep: oklch(49% 0.205 2);
	--bt-lime: oklch(87.6% 0.179 119);
	--bt-slot: oklch(95% 0.021 355);
	--bt-edge: oklch(56% 0.017 70);
	--bt-error: oklch(52% 0.19 27);
	/* The sheet colours never flip, so a lime or pink fill keeps dark ink inside the dark band. */
	--bt-ink-sheet: oklch(21% 0.011 81);
	--bt-shadow-ink: oklch(21% 0.011 81);

	--bt-ff-display: "Bowlby One SC", "Arial Black", sans-serif;
	--bt-ff-text: "Sofia Sans", ui-sans-serif, system-ui, sans-serif;

	--bt-s-3xs: 2px;
	--bt-s-2xs: 4px;
	--bt-s-xs: 8px;
	--bt-s-sm: 12px;
	--bt-s-md: 16px;
	--bt-s-lg: 24px;
	--bt-s-xl: 40px;
	--bt-s-2xl: 64px;
	--bt-s-3xl: 96px;

	--bt-t-xs: 0.8125rem;
	--bt-t-sm: 0.875rem;
	--bt-t-md: 1rem;
	--bt-t-lg: 1.25rem;
	--bt-t-xl: 1.5625rem;
	--bt-t-2xl: 1.953rem;
	--bt-t-3xl: 2.441rem;
	--bt-t-section: clamp(2rem, 2.5vw + 1rem, 3.25rem);
	--bt-t-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);

	--bt-r-card: 18px;
	--bt-r-pill: 999px;
	--bt-ring: 5px;
	--bt-shadow: 5px 6px 0 var(--bt-shadow-ink, oklch(21% 0.011 81));
	--bt-ease: cubic-bezier(0.16, 1, 0.3, 1);

	/* The gutter and the gaps grow with the screen, so no width sits between two fixed sizes. */
	--bt-container: 1440px;
	--bt-gutter: clamp(16px, 4.4vw, 64px);
	--bt-gap: clamp(16px, 2.2vw, 32px);
	--bt-section: clamp(56px, 8.4vw, 120px);
}

:root:root {
	--skc-c-surface: var(--bt-paper, oklch(95.7% 0.013 82));
	--skc-c-on-surface: var(--bt-ink, oklch(21% 0.011 81));
	--skc-c-surface-alt: var(--bt-paper-2, oklch(92.8% 0.021 79));
	--skc-c-line: var(--bt-rule, oklch(89.7% 0.02 80));
	--skc-c-accent: var(--bt-pink, oklch(56% 0.225 2));
	--skc-c-on-accent: var(--bt-white, oklch(99.5% 0.003 82));
	--skc-c-note: var(--bt-lime, oklch(87.6% 0.179 119));
	--skc-note-ink: var(--bt-ink-sheet, oklch(21% 0.011 81));
	--skc-c-muted: var(--bt-muted, oklch(50% 0.017 64));
	--skc-c-danger: var(--bt-error, oklch(52% 0.19 27));
	--skc-c-focus: var(--bt-pink, oklch(56% 0.225 2));
	--skc-ff-display: var(--bt-ff-display, "Bowlby One SC", "Arial Black", sans-serif);
	--skc-ff-text: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	--skc-r: var(--bt-r-card, 18px);

	/* Read by BYO TCG Cards 2.0.0, which draws its own sticker look from these. */
	--skc-ff-body: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	--skc-c-action: var(--bt-pink, oklch(56% 0.225 2));
	--skc-c-on-action: var(--bt-white, oklch(99.5% 0.003 82));
	--skc-c-mark: var(--bt-lime, oklch(87.6% 0.179 119));
	--skc-c-on-mark: var(--bt-ink-sheet, oklch(21% 0.011 81));
	--skc-c-ink: var(--bt-ink, oklch(21% 0.011 81));
}

/* ---------------------------------------------------------------- base */

html,
body.bt {
	overflow-x: clip;
}

/* The ground and the ink are written here as the sRGB values of --bt-paper and --bt-ink, not as the
   tokens. WooPayments reads the body's computed background to choose light or dark text for its
   payment frames, with a parser that knows no oklch(): an oklch ground read as black, and the
   Afterpay line on the cart printed white on cream. Change these two with the tokens. */
body.bt {
	margin: 0;
	background: #f5f0e7;
	color: #1b1813;
	font-family: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: var(--bt-t-md, 1rem);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.bt ::selection {
	background: var(--bt-lime, oklch(87.6% 0.179 119));
	color: var(--bt-ink-sheet, oklch(21% 0.011 81));
}

.bt :focus-visible {
	outline: 2px solid var(--bt-pink, oklch(56% 0.225 2));
	outline-offset: 2px;
}

/* Every heading on the site takes the display face. Size, measure and colour are set only inside
   this theme's own templates: the parent's pages and the plugin's screens centre their headings
   and put some on dark grounds. */
.bt h1,
.bt h2,
.bt h3 {
	font-family: var(--bt-ff-display, "Bowlby One SC", "Arial Black", sans-serif);
	font-weight: 400;
	/* Bowlby has one weight: a browser's faked bold smears it. */
	font-synthesis: none;
	letter-spacing: 0.005em;
}

.bt-main h1,
.bt-main h2,
.bt-main h3 {
	margin: 0;
	line-height: 1.02;
	color: var(--bt-ink, oklch(21% 0.011 81));
	overflow-wrap: break-word;
	text-wrap: balance;
	min-width: 0;
}

.bt-main h1 {
	font-size: clamp(2.5rem, 4.4vw, 4rem);
	max-width: 20ch;
}

.bt-main h2 {
	font-size: var(--bt-t-section, clamp(2rem, 2.5vw + 1rem, 3.25rem));
	max-width: 16ch;
}

.bt-main h3 {
	font-size: var(--bt-t-xl, 1.5625rem);
	line-height: 1.08;
}

.bt-main p {
	margin: 0;
	text-wrap: pretty;
}

.bt-main ul,
.bt-main ol,
.bt-main dl,
.bt-main dd,
.bt-main figure,
.bt-nav ul,
.bt-foot ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bt-main img,
.bt-foot img {
	display: block;
	max-width: 100%;
	height: auto;
}

.bt-main section {
	scroll-margin-top: var(--bt-s-lg, 24px);
}

.bt-container {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--bt-container, 1440px);
	margin-inline: auto;
	padding-left: max(var(--bt-gutter, clamp(16px, 4.4vw, 64px)), env(safe-area-inset-left, 0px));
	padding-right: max(var(--bt-gutter, clamp(16px, 4.4vw, 64px)), env(safe-area-inset-right, 0px));
}

.bt-lead {
	font-size: var(--bt-t-lead, clamp(1.125rem, 0.35vw + 1rem, 1.375rem));
	line-height: 1.45;
	max-width: 52ch;
	color: var(--bt-ink-2, oklch(30% 0.013 78));
}

.bt-legend {
	font-size: var(--bt-t-sm, 0.875rem);
	font-weight: 700;
	color: var(--bt-muted, oklch(50% 0.017 64));
}

.bt-bowl {
	font-family: var(--bt-ff-display, "Bowlby One SC", "Arial Black", sans-serif);
	font-weight: 400;
	letter-spacing: 0.005em;
	line-height: 1;
}

/* Set figures keep their own widths, so a 1 sits close to its neighbours. */
.bt-bowl.bt-num {
	font-variant-numeric: proportional-nums;
}

.bt-num {
	font-variant-numeric: tabular-nums;
}

.bt-k1 {
	margin-inline: -0.04em -0.1em;
}

/* ---------------------------------------------------------------- surfaces */

.bt-diecut {
	box-sizing: border-box;
	border: 6px solid var(--bt-white, oklch(99.5% 0.003 82));
	border-radius: var(--bt-r-card, 18px);
	box-shadow: var(--bt-shadow, 5px 6px 0 oklch(21% 0.011 81));
}

.bt-tag {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	margin: 0;
	padding: 0 var(--bt-s-sm, 12px);
	border-radius: var(--bt-r-pill, 999px);
	font-family: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: var(--bt-t-sm, 0.875rem);
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.bt-tag--pink {
	background: var(--bt-pink, oklch(56% 0.225 2));
	color: var(--bt-white, oklch(99.5% 0.003 82));
}

.bt-tag--lime {
	background: var(--bt-lime, oklch(87.6% 0.179 119));
	color: var(--bt-ink-sheet, oklch(21% 0.011 81));
}

/* ---------------------------------------------------------------- controls */

.bt-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 var(--bt-s-lg, 24px);
	border: 0;
	border-radius: var(--bt-r-pill, 999px);
	background: transparent;
	color: var(--bt-ink, oklch(21% 0.011 81));
	font-family: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: var(--bt-t-md, 1rem);
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	box-shadow: inset 0 0 0 2px var(--bt-ink, oklch(21% 0.011 81));
	transition: translate 120ms var(--bt-ease, cubic-bezier(0.16, 1, 0.3, 1)), rotate 120ms var(--bt-ease, cubic-bezier(0.16, 1, 0.3, 1)), box-shadow 120ms var(--bt-ease, cubic-bezier(0.16, 1, 0.3, 1)), background-color 120ms var(--bt-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.bt-btn:hover {
	background: var(--bt-paper-2, oklch(92.8% 0.021 79));
	color: var(--bt-ink, oklch(21% 0.011 81));
}

.bt-btn:active {
	translate: 0 1px;
}

.bt-btn:focus-visible {
	outline: 2px solid var(--bt-pink, oklch(56% 0.225 2));
	outline-offset: 3px;
}

.bt-btn--sm {
	min-height: 44px;
	padding: 0 var(--bt-s-md, 16px);
	font-size: var(--bt-t-sm, 0.875rem);
}

/* The primary button is a sticker: a white ring, then the hard shadow. The margin keeps the ring
   inside the button's own box, so it never hangs over a neighbour. */
.bt-btn--primary {
	margin: var(--bt-ring, 5px);
	background: var(--bt-pink, oklch(56% 0.225 2));
	color: var(--bt-white, oklch(99.5% 0.003 82));
	box-shadow: 0 0 0 var(--bt-ring, 5px) var(--bt-white, oklch(99.5% 0.003 82)), 5px 6px 0 var(--bt-ring, 5px) var(--bt-shadow-ink, oklch(21% 0.011 81));
}

.bt-btn--primary:hover {
	background: var(--bt-pink-deep, oklch(49% 0.205 2));
	color: var(--bt-white, oklch(99.5% 0.003 82));
	translate: 0 -2px;
	rotate: -1deg;
}

.bt-btn--primary:active {
	translate: 4px 5px;
	rotate: 0deg;
	box-shadow: 0 0 0 var(--bt-ring, 5px) var(--bt-white, oklch(99.5% 0.003 82)), 1px 1px 0 var(--bt-ring, 5px) var(--bt-shadow-ink, oklch(21% 0.011 81));
}

.bt-btn--primary:focus-visible {
	outline-offset: calc(var(--bt-ring, 5px) + 3px);
}

.bt-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0 var(--bt-s-md, 16px);
	border: 2px solid var(--bt-ink, oklch(21% 0.011 81));
	border-radius: var(--bt-r-card, 18px);
	background: var(--bt-white, oklch(99.5% 0.003 82));
	color: var(--bt-ink, oklch(21% 0.011 81));
	font: inherit;
	font-weight: 600;
}

.bt-input:focus-visible {
	outline: 2px solid var(--bt-pink, oklch(56% 0.225 2));
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- header */

.bt-nav__in {
	display: flex;
	align-items: center;
	gap: var(--bt-s-lg, 24px);
	min-height: 76px;
}

.bt-wordmark {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--bt-ff-display, "Bowlby One SC", "Arial Black", sans-serif);
	font-size: var(--bt-t-xl, 1.5625rem);
	letter-spacing: 0.005em;
	line-height: 1;
	color: var(--bt-ink, oklch(21% 0.011 81));
	text-decoration: none;
	white-space: nowrap;
}

.bt-wordmark--lg {
	font-size: var(--bt-t-3xl, 2.441rem);
}

.bt-nav__nav,
.bt-nav__back {
	margin-left: auto;
}

.bt-nav__links {
	display: flex;
	gap: var(--bt-s-2xs, 4px);
}

.bt-nav__links a,
.bt-foot__links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--bt-s-sm, 12px);
	font-size: var(--bt-t-sm, 0.875rem);
	font-weight: 700;
	color: var(--bt-ink, oklch(21% 0.011 81));
	text-decoration: none;
}

.bt-nav__links a:hover,
.bt-foot__links a:hover,
.bt-wordmark:hover {
	color: var(--bt-ink, oklch(21% 0.011 81));
	text-decoration: underline;
	text-decoration-color: var(--bt-pink, oklch(56% 0.225 2));
	text-decoration-thickness: 3px;
	text-underline-offset: 0.3em;
}

.bt-cart {
	position: relative;
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: var(--bt-r-pill, 999px);
	color: var(--bt-ink, oklch(21% 0.011 81));
	text-decoration: none;
	box-shadow: inset 0 0 0 2px var(--bt-ink, oklch(21% 0.011 81));
}

.bt-cart:hover {
	background: var(--bt-paper-2, oklch(92.8% 0.021 79));
	color: var(--bt-ink, oklch(21% 0.011 81));
}

.bt-cart__bag {
	display: block;
	width: 22px;
	height: 22px;
}

.bt-cart .skc-cart__count[aria-hidden] {
	position: absolute;
	top: -6px;
	right: -6px;
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: var(--bt-r-pill, 999px);
	background: var(--bt-pink, oklch(56% 0.225 2));
	color: var(--bt-white, oklch(99.5% 0.003 82));
	font-size: var(--bt-t-xs, 0.8125rem);
	font-weight: 800;
	line-height: 1;
}

/* An empty cart shows the bag alone: a pink 0 reads as a notification. The server prints the
   class and theme.js keeps it in step with the count. */
.bt-cart--empty .skc-cart__count[aria-hidden] {
	display: none;
}

/* Below a tablet the five links leave the header: the same five are in the footer, and the header
   keeps the wordmark, Build your pack and the cart. */
@media (max-width: 60rem) {
	.bt-nav__nav {
		display: none;
	}

	.bt-nav__cta {
		margin-left: auto;
	}

	.bt-nav__in {
		gap: var(--bt-s-sm, 12px);
	}
}

@media (max-width: 22.5rem) {
	.bt-wordmark:not(.bt-wordmark--lg) {
		font-size: var(--bt-t-lg, 1.25rem);
	}

	.bt-nav .bt-btn--sm {
		padding: 0 var(--bt-s-sm, 12px);
	}
}

/* ---------------------------------------------------------------- footer */

.bt-foot {
	padding-block: var(--bt-s-2xl, 64px) var(--bt-s-xl, 40px);
	border-top: 2px dashed var(--bt-rule, oklch(89.7% 0.02 80));
	background: var(--bt-paper, oklch(95.7% 0.013 82));
	color: var(--bt-ink, oklch(21% 0.011 81));
}

.bt-foot__in {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--bt-gap, clamp(16px, 2.2vw, 32px));
	row-gap: var(--bt-s-lg, 24px);
	align-items: start;
}

.bt-foot__in > .bt-wordmark {
	grid-column: 1 / span 4;
	grid-row: 1 / span 3;
	justify-self: start;
	align-self: start;
}

.bt-foot__nav,
.bt-foot__search,
.bt-foot__colophon {
	grid-column: 6 / -1;
}

.bt-foot__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bt-s-2xs, 4px) var(--bt-s-md, 16px);
	margin-left: calc(-1 * var(--bt-s-sm, 12px));
}

.bt-foot__search {
	display: grid;
	gap: var(--bt-s-2xs, 4px);
	max-width: 30rem;
}

.bt-foot__search label {
	font-size: var(--bt-t-sm, 0.875rem);
	font-weight: 700;
	color: var(--bt-muted, oklch(50% 0.017 64));
}

.bt-foot__searchrow {
	display: flex;
	gap: var(--bt-s-xs, 8px);
}

.bt-foot__searchrow .bt-input {
	min-height: 44px;
	border-radius: var(--bt-r-pill, 999px);
}

.bt-foot__colophon {
	margin: 0;
	max-width: 62ch;
	font-size: var(--bt-t-sm, 0.875rem);
	color: var(--bt-ink-2, oklch(30% 0.013 78));
}

.bt-foot__mail {
	display: inline-block;
	padding-block: 3px;
	font-weight: 700;
	color: var(--bt-ink, oklch(21% 0.011 81));
}

@media (max-width: 60rem) {
	.bt-foot__in > .bt-wordmark,
	.bt-foot__nav,
	.bt-foot__search,
	.bt-foot__colophon {
		grid-column: 1 / -1;
		grid-row: auto;
	}
}

/* ---------------------------------------------------------------- pages without a template here
   The parent's templates and the plugin's screens keep their own markup. These rules only swap the
   parent's button and field shapes for the shop's. */

.bt .skc-btn,
.bt .wp-element-button,
.bt .woocommerce a.button,
.bt .woocommerce button.button {
	border-radius: var(--bt-r-pill, 999px);
	font-family: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	font-weight: 700;
}

/* The parent prints a cart line's name as a heading in its display face. In Bowlby that is a
   headline inside a table row, so the name takes the text face at a row's size. */
.bt .skc-cart__title {
	font-family: var(--bt-ff-text, "Sofia Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: var(--bt-t-lg, 1.25rem);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0;
}

.bt .woocommerce-checkout-review-order-table .skc-cart__title {
	font-size: var(--bt-t-md, 1rem);
}

/* The name starts the row; the parent sends every cell of this table to the right. */
.bt .woocommerce-checkout-review-order-table td.product-name {
	text-align: left;
}

/* WooCommerce clears the two checkout columns with a ::before and an ::after. The parent lays the
   pair out as a grid, where those two count as cells: the first took the left column and pushed the
   billing fields to the right. */
.bt.woocommerce-checkout .col2-set::before,
.bt.woocommerce-checkout .col2-set::after {
	content: none;
}

.bt #skc-main a:not([class]) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
}

@media (prefers-reduced-motion: reduce) {
	.bt *,
	.bt *::before,
	.bt *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.bt-btn--primary:hover {
		translate: none;
		rotate: none;
	}
}
