/*
 * SBFC "Matchday" kit: only what Kadence / Forza Blocks can't set.
 *
 * Fonts, sizes, colours, button colours and the menu's hover fill are set in
 * the Customizer (Colors & Fonts, General › Buttons, Header). This file adds
 * shapes and effects on top of them, plus a few classes editors can type
 * into a block's Advanced › Additional CSS class(es) box:
 *
 *   brush         on a heading: the word(s) marked with Highlight get the
 *                 neon brush underline (one word per heading).
 *   paper-bottom  on a Row Layout: torn bottom edge; the next row slides under.
 *   paper-top     on a Row Layout: torn top edge; it slides over the row above.
 *                 Both together tear both edges (green CTA bands).
 *   glow          on a Column (or any box): the tryout field's rotating ring
 *                 on hover / keyboard focus. Add glow-on to keep it lit.
 *                 On an Embed block it also rounds the video's corners.
 *   no-slant      on a Forza button (or its wrapper): keep the plain shape.
 *   sbfc-hero     on the home hero Row Layout: scanlines, green cast, a
 *                 larger video pause button.
 *   sbfc-tile     on a Column with a background photo (add glow too): black
 *                 and white, colour on hover; see "program tiles".
 *
 * Automatic: slanted Forza buttons, slanted menu fill, the glowing Tryouts header
 * button, the footer's torn top, focus rings, reduced motion.
 */

:root {
	--sbfc-neon: var(--global-palette1, #00f17b);
	--sbfc-neon-hi: var(--global-palette2, #11ff8b);
	--sbfc-ink: var(--global-palette3, #000);
	--sbfc-char: #0b0e0f;
	--sbfc-panel: #121618;
	--sbfc-greyblue: #5a8ba0;     /* glow partner colour (the tryout field) */
	--sbfc-skew: -12deg;          /* buttons */
	--sbfc-ease: cubic-bezier(.2, .8, .2, 1);
	--sbfc-radius: 12px;
	--paper-h: 60px;
	--sbfc-brush: url("https://sbfcacademy.com/wp-content/uploads/2025/08/neon-underline-02.png");
	--paper-strip-bottom: url("../images/edges/paper-strip-bottom.webp");
	--paper-stencil-bottom: url("../images/edges/paper-stencil-bottom.webp");
	--paper-strip-top: url("../images/edges/paper-strip-top.webp");
	--paper-stencil-top: url("../images/edges/paper-stencil-top.webp");
}
@media (max-width: 767px) {
	:root { --paper-h: 44px; }
}

@property --sbfc-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}
@keyframes sbfc-spin { to { --sbfc-angle: 360deg; } }

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--sbfc-neon);
	outline-offset: 3px;
}

/* ---------------------------------------------------------- buttons */

/*
 * Slanted buttons: Forza's Advanced Button (kb-button). The button is
 * skewed so its border slants with it, and the label is skewed back. Core
 * WordPress buttons have no inner label element, so they stay square (their
 * corners come from Customizer › General › Buttons); use Forza's button for
 * new buttons. Colours, font and padding stay in the block / Customizer.
 * Kadence's .kb-button uses ::before, so the light sweep is a background
 * layer.
 */
.kb-button:not(.no-slant, .no-slant *) {
	border-radius: 0 !important;
	transform: skewX(var(--sbfc-skew));
	background-image: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / 0.4) 50%, transparent 65%);
	background-size: 250% 100%;
	background-position: 150% 0;
	background-repeat: no-repeat;
	transition: background-position 0.55s var(--sbfc-ease), color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.25s var(--sbfc-ease);
}
.kb-button:not(.no-slant, .no-slant *) > * {
	transform: skewX(calc(var(--sbfc-skew) * -1));
}
.kb-button:not(.no-slant, .no-slant *):is(:hover, :focus-visible) {
	background-position: -50% 0;
	transform: skewX(var(--sbfc-skew)) translateY(-2px);
}

/* ------------------------------------------------- header: Tryouts */

/*
 * The one button with its own look: a dark pill inside the tryout field's
 * rotating neon / grey-blue ring, with a soft bloom behind it. The label and
 * link stay in Customizer › Header › Button.
 */
#masthead :is(.header-button, .mobile-header-button) {
	position: relative;
	isolation: isolate;
	border: 2px solid transparent;
	border-radius: 999px;
	background:
		linear-gradient(var(--sbfc-char), var(--sbfc-char)) padding-box,
		conic-gradient(from var(--sbfc-angle) in oklab, var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon)) border-box;
	color: var(--sbfc-neon);
	box-shadow: none;
	animation: sbfc-spin 4s linear infinite;
	transition: color 0.25s;
}
#masthead :is(.header-button, .mobile-header-button)::after {
	content: "";
	position: absolute;
	inset: -2px;
	z-index: -1;
	border-radius: inherit;
	background: conic-gradient(from var(--sbfc-angle) in oklab, var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon));
	filter: blur(14px);
	opacity: 0.5;
	animation: sbfc-spin 4s linear infinite;
	transition: opacity 0.3s, filter 0.3s;
}
#masthead :is(.header-button, .mobile-header-button):is(:hover, :focus-visible) {
	color: var(--sbfc-neon-hi);
	background:
		linear-gradient(#000, #000) padding-box,
		conic-gradient(from var(--sbfc-angle) in oklab, var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon)) border-box;
}
#masthead :is(.header-button, .mobile-header-button):is(:hover, :focus-visible)::after {
	opacity: 0.95;
	filter: blur(20px);
}
#masthead :is(.header-button, .mobile-header-button):focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
}

/* ------------------------------------------------------ header menu */

/*
 * The menu's hover / current fill is set in Customizer › Header › Primary
 * Navigation (style Standard; background hover/active = palette 1, text
 * hover/active = palette 3). This only slants the fill.
 */
.main-navigation .primary-menu-container > ul > li.menu-item > a {
	clip-path: polygon(0.45em 0, 100% 0, calc(100% - 0.45em) 100%, 0 100%);
	transition: background-color 0.2s, color 0.2s;
}

/*
 * Off-canvas (mobile) menu. The divider colour is Customizer › Header ›
 * Mobile Navigation, but that one setting also draws the line beside the
 * caret, so: no line beside the caret, no line under an open parent, and
 * none between sub-items. The last sub-item keeps its line, closing the
 * group.
 */
.mobile-navigation ul.menu .drawer-nav-drop-wrap .drawer-sub-toggle {
	border-left: 0 !important;
	border-bottom: 0 !important;
}
.mobile-navigation ul.menu li.menu-item-has-children:is(.menu-item--toggled-on, :has(> .sub-menu.show-drawer)) > .drawer-nav-drop-wrap,
.mobile-navigation ul.menu .sub-menu > li:not(:last-child) > a {
	border-bottom: 0;
}

/* ------------------------------------------------------ brush word */

/*
 * Mark the word with the editor's Highlight, then add "brush" to the
 * heading's CSS classes. The mark loses its highlight colour and gets the
 * site's neon stroke under it instead.
 */
.brush mark,
mark.brush {
	background: var(--sbfc-brush) left 92% / 100% 0.24em no-repeat !important;
	color: inherit !important;
	padding: 0 !important;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* ------------------------------------------------------------ glow */

.glow {
	position: relative;
	isolation: isolate;
	border-radius: var(--sbfc-radius);
}
.glow::before,
.glow::after {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: calc(var(--sbfc-radius) + 2px);
	background: conic-gradient(from var(--sbfc-angle) in oklab, var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon), var(--sbfc-greyblue), var(--sbfc-neon));
	animation: sbfc-spin 5s linear infinite;
	opacity: 0;
	transition: opacity 0.35s var(--sbfc-ease);
	pointer-events: none;
}
.glow::before {     /* bloom, behind the box */
	z-index: -1;
	filter: blur(20px);
}
.glow::after {      /* crisp 2px ring */
	z-index: 4;
	padding: 2px;
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glow:is(:hover, :focus-within)::before { opacity: 0.5; }
.glow:is(:hover, :focus-within)::after { opacity: 1; }
.glow.glow-on::before { opacity: 0.25; }
.glow.glow-on::after { opacity: 0.7; }

/* ------------------------------------------------------- home hero */

/*
 * The video, its poster and the vignette (a radial gradient overlay) are
 * Row Layout settings, and so is the pause button (Background › Video ›
 * show buttons). Add "sbfc-hero" to the row for the faint scanlines and a
 * green cast at the bottom, and to size the pause button.
 */
.sbfc-hero::before {
	content: "";
	display: block; /* Kadence's clearfix sets display: table, which shrinks it to 0×0 */
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.18) 0 1px, transparent 1px 4px),
		linear-gradient(to bottom, transparent 55%, rgb(0 60 30 / 0.45));
}
.sbfc-hero > .kt-row-column-wrap {
	position: relative;
	z-index: 2;
}
/* Kadence's pause / play button (WCAG 2.2.2): larger, clear of the paper edge. */
.sbfc-hero.sbfc-hero .kb-blocks-bg-video-container .kb-background-video-buttons-wrapper {
	z-index: 3;
	right: clamp(16px, 4vw, 40px);
	bottom: calc(var(--paper-h) + 1.25rem);
}
.sbfc-hero.sbfc-hero .kb-background-video-buttons-wrapper button.kb-toggle-video-btn {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 2px solid rgb(255 255 255 / 0.5);
	margin: 0;
	border-radius: 50%;
	background: rgb(0 0 0 / 0.5);
	color: #fff;
	opacity: 1;
	transition: border-color 0.2s, color 0.2s;
}
.sbfc-hero.sbfc-hero .kb-background-video-buttons-wrapper button.kb-toggle-video-btn svg {
	width: 1rem;
	height: 1rem;
	fill: currentColor;
}
.sbfc-hero.sbfc-hero .kb-background-video-buttons-wrapper button.kb-toggle-video-btn:is(:hover, :focus-visible) {
	border-color: var(--sbfc-neon);
	color: var(--sbfc-neon);
}

/* ------------------------------------------------------------ video */

/*
 * "glow glow-on" on an Embed block (Vimeo, YouTube): rounded corners inside
 * the lit ring, as in the mockup. A Custom HTML block can't take a class, so
 * videos go in Embed blocks.
 */
.wp-block-embed.glow {
	border-radius: var(--sbfc-radius);
}
.wp-block-embed.glow > .wp-block-embed__wrapper {
	overflow: hidden;
	border-radius: inherit;
	background: var(--sbfc-char);
}

/* --------------------------------------------------- program tiles */

/*
 * "sbfc-tile glow" on a Column: its photo (Column › Background image) shows
 * in black and white and turns to colour on hover or keyboard focus, with
 * the rotating ring from "glow". The dark fade over the photo is the
 * Column's gradient overlay (opacity 100%); this adds the grey and dims it.
 * Put the icon first in the column: everything after it sits at the bottom.
 */
.sbfc-tile {
	transition: transform 0.35s var(--sbfc-ease);
}
.sbfc-tile > .kt-inside-inner-col::before {
	-webkit-backdrop-filter: grayscale(1) brightness(0.6);
	backdrop-filter: grayscale(1) brightness(0.6);
	transition: -webkit-backdrop-filter 0.4s var(--sbfc-ease), backdrop-filter 0.4s var(--sbfc-ease);
}
.sbfc-tile:is(:hover, :focus-within) {
	transform: translateY(-6px);
}
.sbfc-tile:is(:hover, :focus-within) > .kt-inside-inner-col::before {
	-webkit-backdrop-filter: grayscale(0) brightness(0.8);
	backdrop-filter: grayscale(0) brightness(0.8);
}
.sbfc-tile > .kt-inside-inner-col > :first-child {
	margin-bottom: auto;
}
/* Core button in a tile: a small slanted tag, as in the mockup. */
.sbfc-tile .wp-block-button__link {
	transform: skewX(var(--sbfc-skew));
}

/* ------------------------------------------------- phone buttons */

/*
 * Forza buttons on phones: 15px text, 10px / 20px padding, line height 1.2
 * (42px tall instead of 63px), the same as the header Tryouts button. Done
 * through Forza's own tokens (the control font size is only used by
 * buttons; the padding tokens are the Style Library presets), so a button's
 * own Mobile settings in the editor still win.
 */
@media (max-width: 767px) {
	html:root {
		--kb-token--semantic--font-size--control: 15px;
		--kb-token--preset--kadence-singlebtn--default--button-padding: 10px 20px;
		--kb-token--preset--kadence-singlebtn--outline--button-padding: 10px 20px;
		--kb-token--preset--kadence-singlebtn--dark--button-padding: 10px 20px;
		--kb-token--preset--kadence-singlebtn--pill--button-padding: 10px 20px;
		--kb-token--preset--kadence-singlebtn--pill-outline--button-padding: 10px 20px;
	}
	.kb-button {
		line-height: 1.2;
	}
}

/* ------------------------------------------------------ paper edges */

/*
 * Torn paper, the HCAA way: the row is cut along the paper's outer edge
 * (stencil) and the paper strip is laid on the cut. The tear eats
 * var(--paper-h) (60px; 44px on phones) of the block's own background, and
 * the next block slides that far up under it, so give the rows on either
 * side enough padding in their block settings (at least "lg"). Wrapper
 * columns without a background are fine: the cut shows the row inside.
 */
.paper-bottom {
	position: relative;
	z-index: 2;
	-webkit-mask:
		linear-gradient(#000 0 0) left top / 100% calc(100% - var(--paper-h) + 1px) no-repeat,
		var(--paper-stencil-bottom) left bottom / auto var(--paper-h) repeat-x;
	mask:
		linear-gradient(#000 0 0) left top / 100% calc(100% - var(--paper-h) + 1px) no-repeat,
		var(--paper-stencil-bottom) left bottom / auto var(--paper-h) repeat-x;
}
.paper-bottom::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	height: var(--paper-h);
	background: var(--paper-strip-bottom) left bottom / auto var(--paper-h) repeat-x;
	pointer-events: none;
}
.paper-bottom + * {
	position: relative;
	z-index: 1;
	margin-top: calc(var(--paper-h) * -1) !important;
}

.paper-top,
#colophon {
	position: relative;
	z-index: 2;
	margin-top: calc(var(--paper-h) * -1) !important;
	-webkit-mask:
		linear-gradient(#000 0 0) left bottom / 100% calc(100% - var(--paper-h) + 1px) no-repeat,
		var(--paper-stencil-top) 37% top / auto var(--paper-h) repeat-x;
	mask:
		linear-gradient(#000 0 0) left bottom / 100% calc(100% - var(--paper-h) + 1px) no-repeat,
		var(--paper-stencil-top) 37% top / auto var(--paper-h) repeat-x;
}
.paper-top::after,
#colophon::after {   /* shifted 37% so it doesn't mirror the edge above */
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	z-index: 5;
	height: var(--paper-h);
	background: var(--paper-strip-top) 37% top / auto var(--paper-h) repeat-x;
	pointer-events: none;
}

#colophon { padding-top: var(--paper-h); }   /* footer background comes from the Customizer */

/* Both edges (green CTA bands): the top strip moves to ::before. */
.paper-top.paper-bottom {
	-webkit-mask:
		linear-gradient(#000 0 0) left center / 100% calc(100% - 2 * var(--paper-h) + 2px) no-repeat,
		var(--paper-stencil-top) 37% top / auto var(--paper-h) repeat-x,
		var(--paper-stencil-bottom) left bottom / auto var(--paper-h) repeat-x;
	mask:
		linear-gradient(#000 0 0) left center / 100% calc(100% - 2 * var(--paper-h) + 2px) no-repeat,
		var(--paper-stencil-top) 37% top / auto var(--paper-h) repeat-x,
		var(--paper-stencil-bottom) left bottom / auto var(--paper-h) repeat-x;
}
.paper-top.paper-bottom::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	z-index: 5;
	height: var(--paper-h);
	background: var(--paper-strip-top) 37% top / auto var(--paper-h) repeat-x;
	pointer-events: none;
}
.paper-top.paper-bottom::after {
	top: auto;
	bottom: 0;
	background: var(--paper-strip-bottom) left bottom / auto var(--paper-h) repeat-x;
}

/*
 * A torn row right under another torn row (the home page's green CTA band
 * under the hero) keeps a straight bottom edge on phones: the band stacks
 * tall there, and a second tear so close to the first looked busy.
 */
@media (max-width: 767px) {
	.paper-bottom + .paper-bottom:not(.paper-top) {
		-webkit-mask: none;
		mask: none;
	}
	.paper-bottom + .paper-bottom:not(.paper-top)::after {
		content: none;
	}
	.paper-bottom + .paper-bottom:not(.paper-top) + * {
		margin-top: 0 !important;
	}
}

/* -------------------------------------------------- family pages */

/*
 * Little BALR's and Pre-Academy (2026-11-07): Kadence rows and columns,
 * the Style Library presets "Family H1/H2/H3" (headings) and "Pill" /
 * "Pill outline, black" (buttons; add no-slant). Only these need CSS.
 * Built by mockups/tools/build-family-blocks.js.
 */

/* Season details: a core Table with the class "season-facts", label / value. */
.wp-block-table.season-facts {
	margin: 1.25rem 0 1.5rem;
}
.wp-block-table.season-facts table {
	border-collapse: collapse;
	border-block: 1px solid #e3e6e8;
}
.wp-block-table.season-facts :is(th, td) {
	padding: 0.35rem 1.25rem 0.35rem 0;
	border: 0;
	text-align: left;
	vertical-align: top;
}
.wp-block-table.season-facts tr:first-child > * { padding-top: 1rem; }
.wp-block-table.season-facts tr:last-child > * { padding-bottom: 1rem; }
.wp-block-table.season-facts th { font-weight: 700; white-space: nowrap; }
.wp-block-table.season-facts td { color: #4a5257; }

/* Training dates: a core List with the class "dates". Each item is
   "<strong>Oct</strong><span>3</span><span>10</span>…": the month, then
   each date in a circle. */
.wp-block-list.dates {
	display: grid;
	gap: 0.5rem;
	margin: 0.5rem 0 1.5rem;
	padding: 0;
	list-style: none;
}
.wp-block-list.dates li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
}
.wp-block-list.dates strong {
	width: 2.6rem;
	font-size: 0.85rem;
	text-transform: uppercase;
	color: #4a5257;
}
.wp-block-list.dates span {
	display: inline-grid;
	place-items: center;
	min-width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background: #ebf1f4;
	font-size: 0.9rem;
	font-weight: 600;
}

/* A dark last row that runs into the footer (class "footer-flush" on the
   row): the footer drops its torn edge, so there's only one tear. */
body:has(.footer-flush) #colophon {
	margin-top: 0 !important;
	padding-top: 0;
	-webkit-mask: none;
	mask: none;
}
body:has(.footer-flush) #colophon::after { content: none; }

/* ------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	#masthead :is(.header-button, .mobile-header-button),
	#masthead :is(.header-button, .mobile-header-button)::after,
	.glow::before,
	.glow::after {
		animation: none;
	}
	.kb-button {
		transition: none !important;
	}
	.sbfc-tile,
	.sbfc-tile > .kt-inside-inner-col::before {
		transition: none;
	}
	.sbfc-tile:is(:hover, :focus-within) {
		transform: none;
	}
}
