/**
 * The learning pathway.
 *
 * Drawn in the home page's own design language, measured from its "STEM Clubs &
 * Pathways" block and its hero card: the #F2F8F4 page ground, the dark-green
 * gradient hero with a white dot pattern, white section cards (32px radius), the
 * soft green Code Club container (#EBF3EA, 26px), numbered white stage cards
 * (18px) with coloured icon circles, the "Then branch into" pill, and the pink
 * NextGen and purple Robotics Lab cards. Outfit headings, Figtree text, DM Sans
 * links, the amber eyebrow (the home page's #B8791C, deepened to #946112 to pass
 * contrast).
 *
 * Always light, like the site. It never follows the browser's dark mode: a
 * WordPress front-end page keeps one fixed design.
 *
 * Every class is prefixed kpw- so nothing collides with the theme.
 */

/* --------------------------------------------------------------------------
   Page shell: the site's pale green ground and the 1120px column
   -------------------------------------------------------------------------- */

.kpw-shell {
	background: #F2F8F4;
	padding-block: 28px 56px;
}

.kpw-shell-inner {
	display: grid;
	gap: 20px;
	max-width: 1120px;
	margin: 0 auto;
	padding-inline: 20px;
}

.kpw-shell,
.kpw-shell *,
.kpw,
.kpw * {
	box-sizing: border-box;
}

/* The theme underlines links inside page content; cards and buttons here are
   components, not inline links. The doubled class outranks the theme rule. */
.kpw-shell.kpw-shell a,
.kpw.kpw a {
	text-decoration: none;
}

.kpw-svg {
	display: block;
	width: 1em;
	height: 1em;
	flex: none;
}

/* --------------------------------------------------------------------------
   Hero card, like the home page's green hero
   -------------------------------------------------------------------------- */

.kpw-hero {
	position: relative;
	overflow: hidden;
	padding: 32px 34px;
	border-radius: 32px;
	background: #2E5A3F;
	background: linear-gradient(135deg, #1F3D2E 0%, #2E5A3F 40%, #7A9070 100%);
	box-shadow: 0 8px 24px -12px rgba(35, 48, 31, .14);
	color: #fff;
	font-family: "Figtree", ui-sans-serif, system-ui, sans-serif;
}

.kpw-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(255, 255, 255, .2) 1px, transparent 1.5px);
	background-size: 20px 20px;
	pointer-events: none;
}

.kpw-hero > * {
	position: relative;
}

.kpw-hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #E8A93C;
	color: #fff;
	font-family: "Outfit", "Figtree", sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
}

.kpw-hero-badge .kpw-svg {
	font-size: 11px;
}

.kpw-shell .kpw-hero-title {
	margin: 16px 0 8px;
	font-family: "Outfit", "Figtree", sans-serif;
	font-size: 34px;
	font-weight: 600;
	line-height: 1.25;
	color: #fff;
}

.kpw-shell .kpw-hero-lede {
	margin: 0;
	max-width: 62ch;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
	color: rgba(255, 255, 255, .88);
}

.kpw-hero-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-top: 20px;
}

.kpw-hero-row:empty {
	display: none;
}

.kpw-hero-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 36px;
	background: rgba(255, 255, 255, .15);
	font-size: 13px;
	font-weight: 600;
	color: #fff;
}

.kpw-hero-chip .kpw-svg {
	font-size: 11px;
}

.kpw-hero-note {
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, .8);
}

.kpw-shell .kpw-hero-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 12px 24px;
	border-radius: 999px;
	background: #E8A93C;
	color: #fff;
	font-family: "DM Sans", "Figtree", sans-serif;
	font-size: 14px;
	font-weight: 700;
	transition: transform .15s ease, box-shadow .15s ease;
}

.kpw-shell .kpw-hero-btn:hover,
.kpw-shell .kpw-hero-btn:focus-visible {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .35);
}

.kpw-hero-btn .kpw-svg {
	font-size: 12px;
}

/* --------------------------------------------------------------------------
   The pathway itself. On a page it is a white section card, like the home
   page's; inside the dashboard it sits without extra chrome.
   -------------------------------------------------------------------------- */

.kpw {
	color: #1b1f2a;
	font-family: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	line-height: 1.55;
}

.kpw[data-layout="page"],
.kpw[data-layout="section"] {
	padding: 28px 30px;
	border: 1px solid #E4E2D6;
	border-radius: 32px;
	background: #fff;
	box-shadow: 0 8px 24px -12px rgba(35, 48, 31, .14);
}

.kpw p,
.kpw h2,
.kpw ol,
.kpw li {
	margin: 0;
	padding: 0;
}

/* ---- block headings (eyebrow, title, one line) ---- */

.kpw-block-head {
	margin-bottom: 18px;
}

.kpw .kpw-eyebrow {
	margin: 0 0 6px;
	font-family: "Outfit", "Figtree", sans-serif;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1.1px;
	text-transform: uppercase;
}

.kpw .kpw-eyebrow-green {
	color: #3F6B52;
}

.kpw .kpw-eyebrow-amber {
	/* The home page's #B8791C is 3.6:1 on white, under the 4.5:1 small text
	   needs; this is the same amber, deepened until it passes on every ground. */
	color: #946112;
}

.kpw .kpw-block-title {
	margin: 0 0 6px;
	font-family: "Outfit", "Figtree", sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	color: #23301F;
}

.kpw .kpw-block-text {
	max-width: 72ch;
	font-family: "Figtree", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	color: #5F6A5A;
}

/* ---- the Kasa Code Club container ---- */

.kpw-stages {
	padding: 22px 24px 24px;
	border: 1px solid rgba(122, 144, 112, .25);
	border-radius: 26px;
	background: #EBF3EA;
}

/* ---- tracks ---- */

.kpw-track {
	list-style: none;
}

.kpw-spine {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

.kpw-item {
	position: relative;
	list-style: none;
}

/* A small arrow in the gap between stages, so the order reads left to right. */
.kpw-spine .kpw-item:not(:last-child)::after {
	content: "\203A";
	position: absolute;
	z-index: 3;
	top: 50%;
	right: -26px;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin-top: -12px;
	border: 1px solid #9CAF88;
	border-radius: 999px;
	background: #fff;
	color: #3F6B52;
	font-family: "Outfit", sans-serif;
	font-size: 17px;
	font-weight: 800;
	line-height: 1;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.kpw-node {
	--kpw-c: #4E6B44;
	--kpw-c-rgb: 78, 107, 68;

	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	height: 100%;
	color: inherit;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Stage card: white, 18px, a border in the stage's own colour. */
.kpw-node-stage {
	padding: 18px 16px 16px;
	border: 1px solid rgba(var(--kpw-c-rgb), .33);
	border-radius: 18px;
	background: #fff;
}

/* Branch card: a whisper of the programme colour, 22px. */
.kpw-node-branch {
	padding: 22px 22px 20px;
	border: 1px solid rgba(var(--kpw-c-rgb), .25);
	border-radius: 22px;
	background: rgba(var(--kpw-c-rgb), .05);
}

a.kpw-node:hover,
a.kpw-node:focus-visible {
	color: inherit;
	transform: translateY(-3px);
	border-color: rgba(var(--kpw-c-rgb), .6);
	box-shadow: 0 16px 30px -18px rgba(var(--kpw-c-rgb), .6);
}

/* ---- icon circle and stage number ---- */

.kpw-icon {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	margin-bottom: 8px;
	border-radius: 999px;
}

.kpw-node-stage .kpw-icon {
	width: 48px;
	height: 48px;
	border: 3px solid #fff;
	background: var(--kpw-c);
	box-shadow: 0 0 0 1px rgba(var(--kpw-c-rgb), .3), 0 6px 14px -6px rgba(var(--kpw-c-rgb), .7);
	color: #fff;
	font-size: 19px;
}

.kpw-node-branch .kpw-icon {
	width: 54px;
	height: 54px;
	border: 3px solid var(--kpw-c);
	background: #fff;
	color: var(--kpw-c);
	font-size: 21px;
}

.kpw-num {
	position: absolute;
	top: -6px;
	right: -10px;
	display: grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 5px;
	border: 2px solid #fff;
	border-radius: 999px;
	background: #23301F;
	color: #fff;
	font-family: "Outfit", sans-serif;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
}

.kpw-num .kpw-svg {
	font-size: 10px;
}

.is-complete .kpw-num {
	background: #1F7A4C;
}

/* ---- words on the card ---- */

.kpw .kpw-level {
	font-family: "Outfit", sans-serif;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	/* The home page uses the pure programme colour; a light one such as teal is
	   under 3:1 on white, so it is deepened towards the ink while keeping its hue. */
	color: var(--kpw-c);
	color: color-mix(in srgb, var(--kpw-c) 70%, #1b1f2a);
}

.kpw .kpw-node-label {
	font-family: "Outfit", "Figtree", sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: #23301F;
}

.kpw .kpw-node-blurb {
	font-family: "Figtree", sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	color: #5F6A5A;
}

.kpw-node-branch .kpw-node-blurb {
	font-size: 14px;
}

/* ---- footer: status pill and the action ---- */

.kpw-node-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	width: 100%;
	margin-top: auto;
	padding-top: 12px;
}

.kpw .kpw-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 999px;
	font-family: "Figtree", sans-serif;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
}

.kpw-pill .kpw-svg {
	font-size: 11px;
}

.kpw .kpw-go {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: "DM Sans", "Figtree", sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: var(--kpw-c);
	color: color-mix(in srgb, var(--kpw-c) 78%, #1b1f2a);
}

.kpw-go .kpw-svg {
	font-size: 11px;
	transition: transform .15s ease;
}

a.kpw-node:hover .kpw-go .kpw-svg,
a.kpw-node:focus-visible .kpw-go .kpw-svg {
	transform: translateX(3px);
}

/* A short reason, shown only where the learner needs one. */
.kpw .kpw-say {
	display: none;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.45;
	color: #5F6A5A;
}

.is-locked .kpw-say,
.is-closed .kpw-say,
.is-coming_soon .kpw-say,
.is-submitted .kpw-say,
.is-not_accepted .kpw-say {
	display: block;
}

/* ---- status tones ---- */

.kpw-tone-good .kpw-pill {
	background: #DFF0E4;
	color: #1F5C38;
}

.kpw-tone-waiting .kpw-pill {
	background: #FBF0D9;
	color: #7A5F1A;
}

.kpw-tone-open .kpw-pill {
	background: rgba(var(--kpw-c-rgb), .12);
	color: var(--kpw-c);
	color: color-mix(in srgb, var(--kpw-c) 70%, #1b1f2a);
}

.kpw-tone-closed .kpw-pill {
	background: #F3ECE4;
	color: #7A4A1F;
}

.kpw-tone-locked .kpw-pill {
	background: rgba(27, 31, 42, .07);
	color: rgba(27, 31, 42, .64);
}

/* ---- locked: clearly "not yet", still readable ---- */

.kpw-node.is-locked {
	border-style: dashed;
	border-color: rgba(27, 31, 42, .16);
}

.kpw-node-stage.is-locked {
	background: #FAFBF9;
}

.kpw-node-branch.is-locked {
	background: rgba(var(--kpw-c-rgb), .03);
}

.is-locked .kpw-icon {
	filter: grayscale(1);
	opacity: .5;
}

/* Dimmed so a locked stage reads as "not yet", but still at least 4.5:1, since
   a learner has to be able to read what is coming. */
.kpw .is-locked .kpw-node-label {
	color: rgba(35, 48, 31, .72);
}

.kpw .is-locked .kpw-level {
	color: rgba(27, 31, 42, .66);
}

/* ---- you are here ---- */

.kpw-node.is-here {
	border: 2px solid var(--kpw-c);
	box-shadow: 0 0 0 4px rgba(var(--kpw-c-rgb), .16);
}

.kpw .kpw-here {
	position: absolute;
	z-index: 2;
	top: -11px;
	left: 14px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #E8A93C;
	box-shadow: 0 4px 10px -4px rgba(184, 121, 28, .6);
	color: #fff;
	font-family: "Outfit", sans-serif;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   The fork, then the two branches
   -------------------------------------------------------------------------- */

.kpw-fork {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 6px 0 18px;
}

.kpw-fork::before,
.kpw-fork::after {
	content: "";
	width: 2px;
	height: 18px;
	background: #9CAF88;
}

.kpw .kpw-fork-pill {
	padding: 5px 14px;
	border: 1px solid #9CAF88;
	border-radius: 36px;
	background: #fff;
	color: #203F2F;
	font-family: "Outfit", sans-serif;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
}

.kpw-block-head-branch {
	margin-bottom: 16px;
}

.kpw-branches {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.kpw-branch {
	display: grid;
	gap: 20px;
}

/* --------------------------------------------------------------------------
   Keyboard focus
   -------------------------------------------------------------------------- */

.kpw a:focus-visible,
.kpw-shell a:focus-visible {
	outline: 3px solid #203F2F;
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
	.kpw-spine {
		gap: 22px;
	}

	.kpw-spine .kpw-item:not(:last-child)::after {
		right: -23px;
	}
}

@media (max-width: 780px) {
	.kpw-shell {
		padding-block: 16px 40px;
	}

	.kpw-shell-inner {
		gap: 16px;
		padding-inline: 16px;
	}

	.kpw-hero {
		padding: 24px 22px;
		border-radius: 26px;
	}

	.kpw-shell .kpw-hero-title {
		font-size: 26px;
	}

	.kpw-shell .kpw-hero-lede {
		font-size: 15px;
	}

	.kpw[data-layout="page"],
	.kpw[data-layout="section"] {
		padding: 20px 16px;
		border-radius: 26px;
	}

	.kpw-stages {
		padding: 18px 14px 20px;
		border-radius: 22px;
	}

	.kpw .kpw-block-title {
		font-size: 20px;
	}

	/* One card per row; the arrow turns to point down. */
	.kpw-spine,
	.kpw-branches {
		grid-template-columns: minmax(0, 1fr);
	}

	.kpw-spine {
		gap: 30px;
	}

	.kpw-spine .kpw-item:not(:last-child)::after {
		top: auto;
		right: auto;
		bottom: -27px;
		left: 50%;
		margin: 0 0 0 -12px;
		transform: rotate(90deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.kpw-node,
	.kpw-go .kpw-svg,
	.kpw-shell .kpw-hero-btn {
		transition: none;
	}

	a.kpw-node:hover,
	a.kpw-node:focus-visible,
	.kpw-shell .kpw-hero-btn:hover {
		transform: none;
	}
}
