/* Allera program blocks: finder, cards, badges, facts. Colours follow the theme presets with safe fallbacks. */
.allera-finder,
.allera-facts,
.allera-program-kicker,
.allera-closed-note {
	--a-ink: var(--wp--preset--color--ink, #111);
	--a-navy: var(--wp--preset--color--navy, #0B2545);
	--a-muted: var(--wp--preset--color--muted, #4B5563);
	--a-line: var(--wp--preset--color--line, #D5DCE5);
	--a-surface: var(--wp--preset--color--surface, #F6F8FB);
}

/* Accent per sport (cards + tags) */
.allera-accent-green  { --a-accent: var(--wp--preset--color--green, #007A38);  --a-accent-text: var(--wp--preset--color--green-dark, #007A38); --a-tint: var(--wp--preset--color--green-tint, #E8F5EC); }
.allera-accent-blue   { --a-accent: var(--wp--preset--color--blue, #1C75BC);   --a-accent-text: var(--wp--preset--color--blue-dark, #135A92);  --a-tint: var(--wp--preset--color--blue-tint, #E6F0F9); }
.allera-accent-red    { --a-accent: var(--wp--preset--color--red, #BE1E2D);    --a-accent-text: var(--wp--preset--color--red, #BE1E2D);        --a-tint: #FBE9EB; }
.allera-accent-violet { --a-accent: var(--wp--preset--color--violet, #662D91); --a-accent-text: var(--wp--preset--color--violet, #662D91);     --a-tint: var(--wp--preset--color--violet-tint, #F2EBF8); }
.allera-accent-gold   { --a-accent: var(--wp--preset--color--gold, #FBB040);   --a-accent-text: #7A4A00;                                       --a-tint: var(--wp--preset--color--gold-tint, #FFF5DE); }
.allera-accent-orange { --a-accent: var(--wp--preset--color--orange, #F7941D); --a-accent-text: #A33400;                                       --a-tint: #FFEDE4; }

/* Filters */
.allera-finder__filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
	gap: 1rem;
	align-items: end;
	padding: 1.25rem;
	margin-bottom: 1.25rem;
	background: var(--a-surface);
	border: 1px solid var(--a-line);
	border-radius: 16px;
}
.allera-finder__field label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--a-navy); }
.allera-finder__field select {
	width: 100%;
	min-height: 44px;
	padding: .5rem .75rem;
	border: 1px solid #6B7280;
	border-radius: 10px;
	background: #fff;
	color: var(--a-ink);
	font: inherit;
	font-size: max(1rem, 16px);
}
.allera-finder__check label { display: inline-flex; gap: .5rem; align-items: center; min-height: 44px; font-weight: 600; }
.allera-finder__check input { width: 1.25rem; height: 1.25rem; accent-color: var(--wp--preset--color--green-dark, #007A38); }
.allera-finder__actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.allera-finder__count { font-weight: 700; color: var(--a-muted); margin: 0 0 1rem; }

/* Card grid */
.allera-finder__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.allera-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .75rem;
	padding: 1.25rem 1.25rem 1rem;
	background: #fff;
	border: 1px solid var(--a-line);
	border-top: 6px solid var(--a-accent, #1C75BC);
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 8px 24px rgba(11, 37, 69, .08);
	transition: transform .18s ease, box-shadow .18s ease;
}
.allera-card:hover, .allera-card:focus-within { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11, 37, 69, .08), 0 16px 40px rgba(11, 37, 69, .14); }
.allera-card__top { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.allera-card__title { margin: 0; font-size: 1.3125rem; line-height: 1.2; font-weight: 800; color: var(--a-navy); }
.allera-card__title a { color: inherit; text-decoration: none; }
.allera-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; } /* whole card clickable */
.allera-card__title a:focus-visible { outline: none; }
.allera-card__title a:focus-visible::after { outline: 3px solid var(--wp--preset--color--blue, #1C75BC); outline-offset: 3px; }
.allera-card__facts { margin: 0; display: grid; gap: .35rem; }
.allera-card__facts div { display: grid; grid-template-columns: 4.25rem 1fr; gap: .5rem; }
.allera-card__facts dt { font-weight: 700; color: var(--a-muted); font-size: .9375rem; }
.allera-card__facts dd { margin: 0; }
.allera-card__bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: .75rem; border-top: 1px dashed var(--a-line); }
.allera-card__price { font-weight: 800; font-size: 1.25rem; color: var(--a-navy); }
.allera-card__cta { font-weight: 700; color: var(--a-accent-text, #135A92); }
.allera-card--sold-out, .allera-card--in-session { background: #FCFCFD; }

/* Tags & badges */
.allera-sport-tag {
	display: inline-block;
	padding: .2rem .7rem;
	border-radius: 999px;
	background: var(--a-tint, #E6F0F9);
	color: var(--a-accent-text, #135A92);
	font-weight: 800;
	font-size: .875rem;
	letter-spacing: .02em;
}
.allera-badge {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .2rem .65rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: .875rem;
	border: 1px solid currentColor;
}
.allera-badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.allera-badge--open        { color: #00612C; background: #E8F5EC; }
.allera-badge--coming-soon { color: #5A2880; background: #F2EBF8; }
.allera-badge--sold-out    { color: #A21826; background: #FBE9EB; }
.allera-badge--in-session  { color: #374151; background: #F3F4F6; }
.allera-badge--ended       { color: #374151; background: #F3F4F6; }
.allera-badge--external    { color: #135A92; background: #E6F0F9; }

.allera-program-kicker { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .5rem; }

/* "61 days until class starts" under the badge at the top of a program */
.allera-countdown {
	display: inline-block;
	margin: 0 0 1rem;
	padding: .4rem .9rem;
	border-radius: 12px;
	background: #00612C;
	color: #fff;
	font-weight: 800;
	font-size: 1.125rem;
	line-height: 1.25;
}

/* Facts list on the program page */
.allera-facts {
	margin: 1.25rem 0 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
	gap: .75rem;
}
.allera-facts__row {
	padding: .85rem 1rem;
	background: var(--a-surface);
	border: 1px solid var(--a-line);
	border-radius: 12px;
}
.allera-facts dt { font-size: .875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a-muted); }
.allera-facts dd { margin: .2rem 0 0; font-weight: 600; font-size: 1.0625rem; color: var(--a-ink); }

.allera-closed-note {
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	border-radius: 12px;
	background: var(--wp--preset--color--gold-tint, #FFF5DE);
	border: 1px solid #F1D08A;
}
.allera-closed-note p { margin: 0 0 .75rem; }
.allera-closed-note p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
/* The theme gives buttons min-height: 44px; with the default content-box that made this one 71px tall with its
   label stuck at the top. Border-box + centred label keeps it a clean 44px capsule. */
.allera-closed-note .wp-element-button,
.allera-finder__empty .wp-element-button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	text-align: center;
	white-space: nowrap;
	text-decoration: none;
}

.allera-finder__empty { padding: 2rem; text-align: center; background: var(--a-surface); border-radius: 16px; }

@media (prefers-reduced-motion: reduce) {
	.allera-card { transition: none; }
	.allera-card:hover, .allera-card:focus-within { transform: none; }
}

.allera-program-title { margin: .25rem 0 0; }
.allera-program-subtitle { margin: .35rem 0 0; color: var(--wp--preset--color--muted, #4B5563); font-size: 1rem; }

/* External registration (district sites): the button label is long ("Register at Campbell Union School District"),
   so let it wrap on phones instead of inheriting nowrap and pushing the page sideways. */
.allera-closed-note .allera-external-button,
.wp-block-button .allera-external-button {
	white-space: normal;
	max-width: 100%;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}
.allera-card--external { background: #FCFCFD; }
/* Same green capsule as the header button (theme: .is-style-green). */
.allera-external-note .allera-external-button { background: var(--wp--preset--color--green-dark, #007A38); color: #fff; }
.allera-external-note .allera-external-button:hover { background: #00612C; }
/* 44px tap target for the contact link beside it. */
.allera-external-note .allera-external-contact { display: inline-flex; align-items: center; min-height: 44px; }

/* Keep a time range, date, grade range or class count on one line (Arex's proof, 2026-11-18).
   Each piece is short enough to fit a 375px card, so this can't push the page sideways. */
.allera-nowrap { white-space: nowrap; }

/* Finder groups (task 622): "Open and coming soon" first, then "In session now", so a running class
   isn't read as an open one. Section headings use the theme's H2 face at a smaller size; the in-session
   cards trade the gold top stripe for the neutral line colour. */
.allera-finder__jump { margin: -.5rem 0 1rem; }
.allera-finder__jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--wp--preset--color--blue-dark, #135A92); }
.allera-finder__group + .allera-finder__group { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--a-line); }
.allera-finder__group-title { margin: 0 0 .25rem; color: var(--a-navy); font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.2; }
.allera-finder__group-count { color: var(--a-muted); font-weight: 600; }
.allera-finder__group-note { margin: 0 0 1.25rem; color: var(--a-muted); }
.allera-finder__group--in-session { scroll-margin-top: 6rem; }
.allera-finder__group--in-session .allera-card,
.allera-v2 .allera-finder__group--in-session .allera-card { border-top-color: var(--a-line); }
