/**
 * Grade Level Bundle card — inc/bundle-claim.php
 *
 * 🔴 EVERY BOX SETS ITS OWN box-sizing. THIS THEME HAS NO GLOBAL RESET.
 * At 1.0.253 a `width:100%` button with 24px padding rendered 608px wide
 * inside a 488px dialog, and at 1.0.216 the inputs overflowed their panel by
 * ~10px for the same reason. A standalone stylesheet in this theme must
 * declare it per element. Do not "tidy" these away.
 *
 * 🔴 THE CLAIMED/UNCLAIMED SWITCH IS PURE CSS, driven by .hft-fc-claimed on
 * <html> (set by an inline script in wp_head before first paint). Both states
 * are always present in the HTML — see hft_bc_render(). That is what lets a
 * teacher who has already claimed load ZERO JavaScript.
 *
 * SIZE: ~10KB raw, ~2.5KB over the wire once Cloudflare gzips it, cached for a
 * year off the HFT_VERSION query string. It is the ONLY thing this feature
 * costs a visitor who never touches the card — the script is lazy and the
 * markup is precomputed. Keep it that way: if this file starts growing, move
 * the new rules behind an interaction rather than shipping them sitewide.
 */

.hft-bc,
.hft-bc *,
.hft-bc *::before,
.hft-bc *::after { box-sizing: border-box; }

/* ── shell ─────────────────────────────────────────────────────────────── */

.hft-bc {
	position: relative;
	overflow: hidden;
	/*
	 * 🔴 CAPPED AND CENTRED. The content column on this site runs ~1750px, and
	 * a full-width card stretched every input to that width — Mark: "The text
	 * fields are very wide." Two columns alone would not have fixed it; the
	 * cap is what brings an input back to a human ~480px.
	 */
	max-width: 1120px;
	margin: 28px auto;
	padding: 26px 26px 22px;
	border: 1.5px solid #E7D6F2;
	border-radius: 18px;
	background: #FBF7FE;
	font-family: var(--hft-font-body, 'Nunito Sans', system-ui, sans-serif);
	color: var(--hft-ink, #231F20);
}

/* Decorative field. Pointer-events off so it can never eat a tap. */
.hft-bc-art { position: absolute; inset: 0; pointer-events: none; }
.hft-bc-blob { position: absolute; border-radius: 50%; }
.hft-bc-blob1 { width: 150px; height: 150px; right: -48px; top: -58px; background: var(--hft-purple, #7A3FA8); opacity: .07; }
.hft-bc-blob2 { width: 96px; height: 96px; left: -34px; bottom: -40px; background: var(--hft-sail-pink, #F0619E); opacity: .08; }
.hft-bc-star { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: var(--hft-sail-yellow, #FBB915); opacity: .75; transform: rotate(18deg); }
.hft-bc-star1 { right: 34px; top: 52px; }
.hft-bc-star2 { right: 74px; top: 24px; width: 5px; height: 5px; opacity: .6; }
.hft-bc-star3 { left: 30px; bottom: 44px; width: 5px; height: 5px; opacity: .5; }

/* ── head ──────────────────────────────────────────────────────────────── */

.hft-bc-head { position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; }
.hft-bc-ico {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--hft-purple, #7A3FA8); color: #fff;
}
.hft-bc-ico svg { width: 20px; height: 20px; }
.hft-bc-headt { min-width: 0; }

.hft-bc-eyebrow {
	margin: 0 0 3px; font-size: 11px; font-weight: 800; letter-spacing: .07em;
	text-transform: uppercase; color: var(--hft-purple, #7A3FA8);
}
.hft-bc-h {
	margin: 0 0 5px;
	font-family: var(--hft-font-display, 'Fredoka', system-ui, sans-serif);
	font-size: 22px; font-weight: 600; line-height: 1.2; color: var(--hft-ink, #231F20);
}
.hft-bc-sub { margin: 0; font-size: 14px; line-height: 1.45; color: #5C5560; }

/* ── fields ────────────────────────────────────────────────────────────── */

.hft-bc-row { display: flex; gap: 10px; }
.hft-bc-row .hft-bc-f { flex: 1 1 0; min-width: 0; }
.hft-bc-f { position: relative; margin: 0 0 10px; }
.hft-bc-lab { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 800; color: #6B6472; }

.hft-bc input[type="text"],
.hft-bc input[type="email"],
.hft-bc select {
	box-sizing: border-box; display: block; width: 100%; min-height: 46px;
	margin: 0; padding: 11px 13px;
	border: 1.5px solid #E4D6EE; border-radius: 11px; background: #fff;
	font-family: inherit; font-size: 15px; font-weight: 600; color: var(--hft-ink, #231F20);
	appearance: none; -webkit-appearance: none;
}
.hft-bc input::placeholder { color: #B3A9BC; font-weight: 600; }
.hft-bc input:focus, .hft-bc select:focus {
	outline: none; border-color: var(--hft-purple, #7A3FA8);
	box-shadow: 0 0 0 3px rgba(122, 63, 168, .14);
}

.hft-bc-sel { position: relative; }
.hft-bc-sel select { padding-right: 38px; cursor: pointer; }
.hft-bc-caret {
	position: absolute; right: 15px; top: 50%; width: 9px; height: 9px;
	margin-top: -6px; border-right: 2.2px solid var(--hft-purple, #7A3FA8);
	border-bottom: 2.2px solid var(--hft-purple, #7A3FA8);
	transform: rotate(45deg); pointer-events: none;
}

.hft-bc-err { display: none; margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--hft-error, #C9584E); }
.hft-bc-f.is-bad input, .hft-bc-f.is-bad select { border-color: var(--hft-error, #C9584E); background: #FDF6F5; }
.hft-bc-f.is-bad .hft-bc-err { display: block; }

.hft-bc-formerr { display: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
	background: #FDF6F5; border: 1.5px solid #F0CFCB; font-size: 13.5px; font-weight: 700; color: #A4453C; }
.hft-bc-formerr.is-on { display: block; }

/* Honeypot — off-screen, never display:none (bots skip hidden fields). */
.hft-bc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ── the peek ──────────────────────────────────────────────────────────── */

.hft-bc-peek { position: relative; margin: 4px 0 14px; padding: 12px 13px;
	border: 1.5px dashed #E0CEF0; border-radius: 13px; background: rgba(255,255,255,.7); }
.hft-bc-peek-l { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: #6B6472; }
.hft-bc-peek-r { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; align-items: center; }
.hft-bc-peek-r li { flex: 0 0 auto; margin: 0; padding: 0; line-height: 0; }
.hft-bc-peek-r img {
	display: block; width: 44px; height: 57px; object-fit: cover;
	border-radius: 6px; border: 1px solid #EDE3F5; background: #fff;
}
.hft-bc-peek-more {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 57px; border-radius: 6px;
	background: var(--hft-purple, #7A3FA8); color: #fff;
	font-size: 14px; font-weight: 800; line-height: 1;
}
.hft-bc-peek-mix { margin: 9px 0 0; font-size: 12px; font-weight: 700; color: #8A8194; }
.hft-bc-peek.is-busy { opacity: .55; }

/* ── button ────────────────────────────────────────────────────────────── */

.hft-bc-btn {
	box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 9px;
	width: 100%; min-height: 52px; margin: 2px 0 0; padding: 14px 20px;
	border: 0; border-radius: 999px; cursor: pointer;
	background: var(--hft-cta, #D6337B); color: #fff;
	font-family: inherit; font-size: 15.5px; font-weight: 800; line-height: 1.15;
	box-shadow: 0 3px 0 rgba(0, 0, 0, .09);
	transition: background .15s ease, transform .1s ease;
}
.hft-bc-btn:hover { background: var(--hft-cta-hover, #B62A67); }
.hft-bc-btn:active { transform: translateY(1px); }
.hft-bc-btn[disabled] { opacity: .68; cursor: default; transform: none; }

.hft-bc-spin { display: none; width: 16px; height: 16px; border-radius: 50%;
	border: 2.4px solid rgba(255,255,255,.45); border-top-color: #fff; animation: hft-bc-sp .6s linear infinite; }
.hft-bc.is-busy .hft-bc-spin { display: block; }
@keyframes hft-bc-sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hft-bc-spin { animation-duration: 2s; } }

.hft-bc-fine { margin: 11px 0 0; font-size: 11.5px; line-height: 1.45; color: #8A8194; }

/* ── states ────────────────────────────────────────────────────────────── */

/* Default: offer visible, membership CTA hidden. */
.hft-bc-used { display: none; }

/* Already claimed (cookie) → swap. */
html.hft-fc-claimed .hft-bc .hft-bc-offer { display: none; }
html.hft-fc-claimed .hft-bc .hft-bc-used { display: block; }

/* Success, set by JS after a claim. */
.hft-bc.is-done .hft-bc-offer { display: none; }
.hft-bc.is-done .hft-bc-done { display: block; }

.hft-bc-done { display: none; position: relative; text-align: center; padding: 6px 0 2px; }
.hft-bc-pop {
	display: inline-flex; align-items: center; justify-content: center;
	width: 54px; height: 54px; margin: 0 0 12px; border-radius: 50%;
	background: var(--hft-green-deep, #1F8551); color: #fff;
	animation: hft-bc-pop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}
.hft-bc-pop svg { width: 27px; height: 27px; }
@keyframes hft-bc-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hft-bc-pop { animation: none; } }

.hft-bc-done-h { margin: 0 0 6px; font-family: var(--hft-font-display, 'Fredoka', sans-serif);
	font-size: 20px; font-weight: 600; color: var(--hft-ink, #231F20); }
.hft-bc-done-p { margin: 0; font-size: 14px; line-height: 1.5; color: #5C5560; }

/* Membership CTA patch. */
.hft-bc-used-h { margin: 0 0 7px; font-family: var(--hft-font-display, 'Fredoka', sans-serif);
	font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--hft-ink, #231F20); }
.hft-bc-used-p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: #5C5560; }
.hft-bc-used-cta {
	box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 7px;
	width: 100%; min-height: 52px; padding: 14px 20px;
	border-radius: 999px; background: var(--hft-cta, #D6337B); color: #fff !important;
	font-size: 15.5px; font-weight: 800; line-height: 1.15; text-decoration: none;
	box-shadow: 0 3px 0 rgba(0, 0, 0, .09);
}
.hft-bc-used-cta:hover { background: var(--hft-cta-hover, #B62A67); color: #fff !important; }

/* ── narrow ────────────────────────────────────────────────────────────── */

/*
 * 360px, not 380px. At 1.0.249 a 380px breakpoint fired on 375px-wide phones
 * (iPhone SE and mini) and stripped copy off them.
 */
@media (max-width: 360px) {
	.hft-bc { padding: 18px 15px 16px; }
	.hft-bc-h { font-size: 19px; }
	.hft-bc-row { display: block; }
	.hft-bc-btn { font-size: 14.5px; padding: 15px 14px; gap: 6px; }
	.hft-bc-peek-r img, .hft-bc-peek-more { width: 38px; height: 49px; }
}

/* ──────────────────────────────────────────────────────────────────────────
   Disclosure variant — the listing placement, ABOVE the grid.
   Desktop: full card. Phone: a bar that opens it in place.

   🔴🔴 VISIBILITY IS DECIDED HERE AND NOWHERE ELSE.
   1.0.265 used <details open> plus a script that closed it under 760px. On a
   viewport that started narrow and then widened, the attribute stayed closed
   while the CSS hid the summary — card present, laid out, and UNREACHABLE.
   An attribute must never share ownership of a layout a media query controls.
   Above 760px there is no state at all: the bar is gone and the card is shown.
   ────────────────────────────────────────────────────────────────────────── */

.hft-bc-d { margin: 0 0 18px; }
.hft-bc-d > .hft-bc { margin-top: 0; }

/* Desktop default: no bar, card always visible. No class, no attribute. */
.hft-bc-d-bar { display: none; }
.hft-bc-d > .hft-bc { display: block; }

@media (max-width: 760px) {
	.hft-bc-d-bar {
		box-sizing: border-box; width: 100%; text-align: left;
		display: flex; align-items: center; gap: 11px;
		padding: 13px 14px; cursor: pointer; font: inherit; color: inherit;
		border: 1.5px solid #E7D6F2; border-radius: 14px; background: #FBF7FE;
	}
	.hft-bc-d-bar:focus-visible { outline: 3px solid rgba(122, 63, 168, .35); outline-offset: 2px; }

	/* Collapsed by default on phones — the interstitial rule. */
	.hft-bc-d > .hft-bc { display: none; }
	.hft-bc-d.is-open > .hft-bc {
		display: block; margin: 0;
		border-radius: 0 0 18px 18px; border-top: 0;
	}
	.hft-bc-d.is-open > .hft-bc-d-bar { border-radius: 14px 14px 0 0; border-bottom: 0; }
	.hft-bc-d.is-open > .hft-bc-d-bar .hft-bc-d-go { display: none; }
	.hft-bc-d.is-open > .hft-bc .hft-bc-head { display: none; }

	.hft-bc-d-ico {
		flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
		width: 34px; height: 34px; border-radius: 50%;
		background: var(--hft-purple, #7A3FA8); color: #fff;
	}
	.hft-bc-d-ico svg { width: 18px; height: 18px; }

	.hft-bc-d-t { flex: 1 1 auto; min-width: 0; display: block; }
	.hft-bc-d-t b {
		display: block;
		font-family: var(--hft-font-display, 'Fredoka', sans-serif);
		font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--hft-ink, #231F20);
	}
	.hft-bc-d-t i {
		display: block; margin-top: 2px; font-style: normal;
		font-size: 12px; line-height: 1.3; color: #7C7486;
	}

	.hft-bc-d-go {
		flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
		background: var(--hft-cta, #D6337B); color: #fff;
		font-size: 12.5px; font-weight: 800; white-space: nowrap;
	}

	@media (max-width: 360px) {
		.hft-bc-d-go { padding: 7px 11px; font-size: 12px; }
		.hft-bc-d-t b { font-size: 14px; }
	}
}

/*
 * Already claimed: never the bar (its text offers something she has taken), and
 * the panel must be visible at EVERY width so the membership CTA is reachable.
 */
html.hft-fc-claimed .hft-bc-d-bar { display: none !important; }
html.hft-fc-claimed .hft-bc-d > .hft-bc {
	display: block !important;
	border-radius: 18px !important; border-top-width: 1.5px !important; margin: 0 !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   Two columns: form left, the actual bundle right.
   See hft_bc_art_column() for why the right side is the argument, not decor.
   ────────────────────────────────────────────────────────────────────────── */

.hft-bc-grid { position: relative; display: block; }
.hft-bc-cform { min-width: 0; }
.hft-bc-cart { display: none; }

@media (min-width: 900px) {
	.hft-bc-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
		gap: 34px;
		align-items: center;
	}
	.hft-bc-cart { display: block; text-align: center; }
}

/* The fan. Flat and solid — no backdrop-filter, no gradients. See the docblock. */
.hft-bc-fan { position: relative; height: 210px; margin: 0 0 14px; }

.hft-bc-sheet {
	position: absolute; top: 12px; left: 50%;
	width: 116px; height: 150px; margin-left: -58px;
	border-radius: 9px; overflow: hidden; background: #fff;
	border: 2px solid #fff;
	box-shadow: 0 6px 16px rgba(35, 31, 32, .16);
}
.hft-bc-sheet img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Back to front, so the centre sheet reads as the hero. */
.hft-bc-sheet1 { transform: translateX(-96px) rotate(-11deg); z-index: 1; }
.hft-bc-sheet2 { transform: translateX(-50px) rotate(-5.5deg); z-index: 2; }
.hft-bc-sheet3 { transform: translateX(0) rotate(0deg); z-index: 4; }
.hft-bc-sheet4 { transform: translateX(50px) rotate(5.5deg); z-index: 2; }
.hft-bc-sheet5 { transform: translateX(96px) rotate(11deg); z-index: 1; }

/* The video tile — the 10th item, and the one a worksheet stack cannot show. */
.hft-bc-play {
	position: absolute; left: 50%; bottom: -2px; z-index: 5;
	display: inline-flex; align-items: center; gap: 6px;
	transform: translateX(-50%);
	padding: 7px 13px 7px 9px; border-radius: 999px;
	background: var(--hft-ink, #231F20); color: #fff;
	box-shadow: 0 5px 14px rgba(35, 31, 32, .26);
}
.hft-bc-play svg { width: 16px; height: 16px; }
.hft-bc-play i { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .01em; }

/* The count. Solid yellow, huge numeral — the popup's own vocabulary. */
.hft-bc-badge {
	position: absolute; right: -4px; top: -6px; z-index: 6;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	width: 72px; height: 72px; border-radius: 50%;
	background: var(--hft-sail-yellow, #FBB915); color: var(--hft-ink, #231F20);
	transform: rotate(-9deg);
	box-shadow: 0 5px 14px rgba(35, 31, 32, .2);
}
.hft-bc-badge b {
	font-family: var(--hft-font-display, 'Fredoka', sans-serif);
	font-size: 27px; font-weight: 600; line-height: 1;
}
.hft-bc-badge i {
	font-style: normal; font-size: 8.5px; font-weight: 800; line-height: 1.12;
	text-transform: uppercase; letter-spacing: .04em; text-align: center; margin-top: 1px;
}

.hft-bc-cart-l { margin: 0 0 2px; font-size: 13px; color: #6B6472; }
.hft-bc-cart-l b { color: var(--hft-purple, #7A3FA8); font-weight: 800; }
.hft-bc-cart-mix { margin: 0; font-size: 11.5px; font-weight: 700; color: #97909F; }
.hft-bc-cart.is-busy { opacity: .5; }

@media (prefers-reduced-motion: no-preference) {
	.hft-bc-sheet, .hft-bc-badge { transition: transform .25s ease; }
	.hft-bc:hover .hft-bc-sheet1 { transform: translateX(-104px) rotate(-13deg); }
	.hft-bc:hover .hft-bc-sheet5 { transform: translateX(104px) rotate(13deg); }
	.hft-bc:hover .hft-bc-badge  { transform: rotate(-3deg) scale(1.04); }
}

/* The head sits above both columns on narrow screens; keep the sub readable. */
@media (min-width: 900px) {
	.hft-bc-sub { max-width: 52ch; }
	.hft-bc-fine { max-width: 62ch; }
}

/* ──────────────────────────────────────────────────────────────────────────
   Desktop height trim (1.0.270)

   The card was 475px tall and pushed the first product row to 786 of a 900px
   viewport — above the fold, but only just, so a laptop visitor saw a header,
   a title, a big form and a sliver of products. The height came from the FORM
   column, not the art: four stacked field rows.

   Two rows instead of four:  Grade | First | Last  /  Email | Send
   ⚠️ Desktop only. Below 900px everything stacks as before, because three
   inputs side by side on a phone is unusable.
   ────────────────────────────────────────────────────────────────────────── */

/*
 * 🔴 MOBILE FIRST, BECAUSE `.hft-bc-row` IS ALREADY `display:flex`.
 *
 * The 1.0.271 trim put these two wrappers on the existing `.hft-bc-row` class
 * and scoped the new layout to >=900px only. But `.hft-bc-row` is flex at every
 * width — the base rule was written for the two name fields — so between 360px
 * and 900px a phone got Grade | First | Last crammed into one row with the
 * inputs cut off ("First nam", "2nd G") and the email field squeezed to a
 * ~40px stub beside the button.
 *
 * 📌 Adding a modifier to a class that already carries layout means you inherit
 * that layout everywhere you did not override it. State the small-screen case
 * explicitly rather than assuming the base is neutral.
 *
 * Phone: grade full width (it keeps its label), first and last side by side —
 * which is what the card did before the trim and what fits 375px.
 */
.hft-bc-row--3 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	align-items: start;
}
.hft-bc-row--3 > .hft-bc-f { min-width: 0; }
.hft-bc-row--3 > .hft-bc-f--grade { grid-column: 1 / -1; }

/* Email above a full-width button — never beside it. */
.hft-bc-row--send { display: block; }

@media (max-width: 360px) {
	.hft-bc-row--3 { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
	.hft-bc-row--3,
	.hft-bc-row--send { display: flex; gap: 10px; align-items: flex-start; }

	.hft-bc-row--3 > .hft-bc-f { flex: 1 1 0; min-width: 0; }
	.hft-bc-row--3 > .hft-bc-f--grade { grid-column: auto; }

	/*
	 * The grade select keeps its accessible label but loses the visible one, so
	 * all three fields in the row share a baseline. The headline already says
	 * "Pick your grade", and the select shows the grade itself, so nothing is
	 * ambiguous. min-width:0 lets them actually shrink — a flex item defaults
	 * to min-width:auto and refuses to, which is the same trap that overflowed
	 * the dashboard widget.
	 */
	.hft-bc-row--3 .hft-bc-lab {
		position: absolute; width: 1px; height: 1px; overflow: hidden;
		clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
	}

	.hft-bc-row--send > .hft-bc-f--email { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
	.hft-bc-row--send > .hft-bc-btn { flex: 0 0 auto; width: auto; margin: 0; padding: 14px 26px; }

	.hft-bc-h { font-size: 21px; }
	.hft-bc-head { margin-bottom: 14px; }
	.hft-bc-fine { margin-top: 9px; }
}
