/* /flight-schools/ hub on phones (< 768 px), owner INBOX #346. Markup: inc/fsf-schools-hub-phone.php; behaviour:
   assets/js/fsf-schools-hub-phone.js. Desktop unchanged: the new blocks are hidden from 768 px up; the legacy blocks
   they replace are hidden only below 768 px. Colours / type: AVCENTRAL-DESIGN-GUIDE.md (schools accent #ffb547). */

.fsh-hero, .fsh-stage, .fsh-dim { display: none; }
.fsh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 767px) {
	/* ── Legacy blocks replaced on phones ── */
	body .fsf-hero-search-mobile, body .fsf-hero-school-link, body .fsf-hero-sub, body .fsf-hero-scroll-hint,
	body .fsf-hero-radar, body .fsf-hero-overlay,
	body #fsf-hubdir-prov-title, body .fsf-hubdir-prov, body .fsf-hubdir-cities, body .fsf-feature-row { display: none !important; }
	/* #355.5: no swipe-row school sections and no A-Z section on phones. The A-Z list opens only when a link asks for
	   it (#provinces is the URL target: the "A-Z list" link under the search and "All N schools A-Z" on the board). */
	body .fsf-mobile-sections { display: none !important; }
	body .fsf-hubdir { display: none !important; }
	body .fsf-hubdir:target { display: block !important; scroll-margin-top: 110px; }

	/* ── Stage 1: the hero (one screen under the header + ATIS band) ── */
	/* #355.1: 40 px between the ATIS bar and the eyebrow. The hero starts 50 px under the bar (the fixed header + the
	   ATIS band sit over its top), so its top padding is 50 + 40; it is as tall as its content (no longer centred in a
	   full screen, which put the eyebrow 130+ px down). */
	body .fsf-hero {
		display: block; box-sizing: border-box; min-height: 0 !important;
		padding: 90px 20px 48px !important; background: #060f1e !important; text-align: center;
	}
	body .fsf-hero-content { width: 100%; max-width: none; padding: 0; margin: 0; }
	body .fsf-hero-tag {
		display: block; margin: 0 0 16px; padding: 0; border: 0 !important; background: none !important; border-radius: 0;
		color: #ffb547; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; line-height: 1.4;
		letter-spacing: .24em; text-transform: uppercase;
	}
	/* Bebas, white; "IN CANADA" schools gold. ~58 px, never wider than the screen ("FLIGHT SCHOOL" is ~5.3 em). */
	body .fsf-hero-title {
		margin: 0; color: #fff; font-family: 'Bebas Neue', sans-serif; font-weight: 400; text-transform: uppercase;
		font-size: min(58px, calc((100vw - 40px) / 5.5)); line-height: .95; letter-spacing: .02em;
	}
	body .fsf-hero-title br { display: none; }
	body .fsf-hero-title .fsh-l { display: block; }
	body .fsf-hero-title .fsf-hero-highlight { color: #5aa9ff; } /* #355.4: "IN CANADA" in blue (was schools gold) */
	.fsh-hero { display: block; }
	.fsh-sub { margin: 18px auto 24px; max-width: 360px; color: #94a7be; font-family: 'DM Sans', sans-serif; font-size: 16px; line-height: 1.5; }

	/* Search field (guide: not a button) */
	.fsh-search { position: relative; margin: 0; text-align: left; }
	.fsh-search-icon { position: absolute; left: 18px; top: 19px; color: #e8eef5; pointer-events: none; } /* #355.3: white magnifier */
	body .fsh-search input.fsh-input[type="search"] {
		display: block; width: 100%; height: 58px; margin: 0; box-sizing: border-box; padding: 0 16px 0 50px !important;
		background: #0c1a30 !important; border: 1px solid #2a4266 !important; border-radius: 12px !important; box-shadow: none !important;
		color: #fff !important; font-family: 'DM Sans', sans-serif; font-size: 17px; -webkit-appearance: none; appearance: none;
		transition: border-color .15s, box-shadow .15s; text-overflow: ellipsis;
	}
	body .fsh-search input.fsh-input[type="search"]::placeholder { color: #7d93ad !important; opacity: 1; }
	body .fsh-search input.fsh-input[type="search"]:focus { outline: none; border-color: #e8a020 !important; box-shadow: 0 0 0 3px rgba(232, 160, 32, .18) !important; }
	.fsh-suggest {
		position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; overflow: hidden;
		background: #0f1e38; border: 1px solid #1f3354; border-radius: 12px; box-shadow: 0 12px 32px rgba(6, 15, 30, .6);
	}
	.fsh-suggest[hidden] { display: none; }
	.fsh-sg { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 8px 16px; box-sizing: border-box;
		border-top: 1px solid #1f3354; text-decoration: none; font-family: 'DM Sans', sans-serif; }
	.fsh-sg:first-child { border-top: 0; }
	.fsh-sg.is-act, .fsh-sg:hover { background: #13274a; }
	.fsh-sg-n { color: #e8eef5; font-size: 15px; font-weight: 600; }
	.fsh-sg-p { color: #7d93ad; font-size: 12px; }
	.fsh-sg-none { padding: 14px 16px; color: #7d93ad; font-family: 'DM Sans', sans-serif; font-size: 14px; }
	.fsh-counts { margin: 16px 0 0; color: #7d93ad; font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.6;
		letter-spacing: .14em; text-transform: uppercase; }
	.fsh-counts .fsh-quiet { margin-left: 8px; }
	.fsh-quiet { display: inline-flex; align-items: center; min-height: 28px; color: #7d93ad; font-family: 'DM Sans', sans-serif;
		font-size: 13px; letter-spacing: 0; text-transform: none; text-decoration: none; }
	.fsh-quiet:hover, .fsh-quiet:focus-visible { color: #e8eef5; text-decoration: none; }

	/* ── Shared stage parts ── */
	.fsh-stage { display: block; box-sizing: border-box; padding: 56px 20px 24px; background: #060f1e; }
	.fsh-h2 { margin: 0; padding: 0; border: 0; color: #fff; text-align: center; font-family: 'Bebas Neue', sans-serif; font-weight: 400;
		font-size: 36px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
	.fsh-stage a:focus-visible, .fsh-stage button:focus-visible, .fsh-quiet:focus-visible { outline: 2px solid #e8a020; outline-offset: 2px; }

	/* ── Stage 2: "Start close to home" ── */
	/* Standard secondary button (#343) with a pin icon */
	.fsh-btn {
		display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; margin: 22px 0 0; padding: 0 16px;
		box-sizing: border-box; background: transparent !important; border: 1px solid #2a4266 !important; border-radius: 10px !important; color: #fff !important; box-shadow: none !important; /* #418: neutral */
		font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer;
		transition: border-color .15s; -webkit-tap-highlight-color: transparent;
	}
	.fsh-btn svg { color: #e8eef5; flex: 0 0 auto; }
	@media (hover: hover) and (pointer: fine) { .fsh-btn:hover { background: transparent !important; border-color: #7d93ad !important; color: #fff !important; } } /* #418 */
	.fsh-btn[aria-busy="true"] { opacity: .7; }
	.fsh-near-msg { margin: 14px 0 0; color: #94a7be; font-family: 'DM Sans', sans-serif; font-size: 14px; text-align: center; }
	.fsh-near-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid #16294a; }
	.fsh-near-list li { margin: 0; padding: 0; border-bottom: 1px solid #16294a; }
	.fsh-near-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 2px; text-decoration: none; font-family: 'DM Sans', sans-serif; }
	.fsh-near-name { grid-column: 1; color: #e8eef5; font-size: 15px; font-weight: 600; }
	.fsh-near-place { grid-column: 1; color: #7d93ad; font-size: 12px; }
	.fsh-near-km { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #ffb547; font-family: 'JetBrains Mono', monospace; font-size: 13px; }

	/* Split-flap board */
	.fsh-board { margin: 28px 0 0; background: #0c1a30; border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; overflow: hidden; }
	.fsh-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid #16294a; }
	.fsh-board-title { color: #ffb547; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
	.fsh-switch { display: flex; flex: 0 0 auto; border: 1px solid #2a4266; border-radius: 999px; padding: 2px; }
	.fsh-switch-btn {
		min-height: 40px; padding: 0 12px; margin: 0; border: 0 !important; border-radius: 999px !important; background: transparent !important; color: #7d93ad !important; box-shadow: none !important; cursor: pointer;
		font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	}
	.fsh-switch-btn.is-on { background: #ffb547 !important; color: #060f1e !important; }
	.fsh-rows { list-style: none; margin: 0; padding: 0; perspective: 800px; }
	.fsh-rows[hidden] { display: none; }
	.fsh-rows li { margin: 0; padding: 0; border-top: 1px solid #16294a; transform-origin: 50% 0; backface-visibility: hidden; }
	.fsh-rows li:first-child { border-top: 0; }
	.fsh-row {
		display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 14px; align-items: center; column-gap: 10px; height: 48px; padding: 0 16px;
		box-sizing: border-box; text-decoration: none; font-family: 'JetBrains Mono', monospace; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
	}
	.fsh-code, .fsh-n { color: #ffb547; }
	.fsh-name { color: #e8eef5; line-height: 1.15; overflow-wrap: anywhere; } /* a long name ("Vancouver & Lower Mainland") wraps to 2 lines inside the 48 px row */
	.fsh-n { text-align: right; }
	.fsh-go { color: #7d93ad; text-align: right; font-family: 'DM Sans', sans-serif; font-size: 18px; }
	.fsh-row:hover .fsh-name { color: #fff; }
	.fsh-board-az { display: flex; justify-content: center; min-height: 48px; border-top: 1px solid #16294a; }

	/* ── Stage 3: "Plan your training" + the feature-card stack ── */
	.fsh-plan { padding-bottom: 32px; }
	.fsh-plan-sub { margin: 12px auto 0; max-width: 340px; color: #94a7be; text-align: center; font-family: 'DM Sans', sans-serif; font-size: 16px; line-height: 1.5; }
	.fsh-stack { display: block; margin: 28px 0 0; }
	.fsh-card {
		position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
		height: 200px; /* #358: 200 px (was 248) */ box-sizing: border-box; margin: 0 0 12px; padding: 20px; border-radius: 18px; overflow: hidden; text-decoration: none;
		border: 1px solid rgba(255, 255, 255, .07); color: var(--fsh-c);
		background: linear-gradient(to top, rgba(var(--fsh-rgb), .4) 0%, rgba(var(--fsh-rgb), .1) 40%, rgba(var(--fsh-rgb), 0) 75%), #0a1628;
		transform-origin: 50% 0;
	}
	.fsh-card:last-child { margin-bottom: 0; }
	.fsh-icon { display: block; width: 64px; height: 64px; /* #358: 64 px (was 88) */ color: var(--fsh-c); }
	.fsh-card-t { margin: 12px 0 0; color: #e8eef5; font-family: 'DM Sans', sans-serif; font-size: 20px; /* #358: 20 px (was 22) */ font-weight: 600; line-height: 1.2; }
	.fsh-card-d { margin: 6px 0 0; color: #94a7be; font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.45; }
	.fsh-dim { display: block; position: absolute; inset: 0; background: #060f1e; opacity: 0; pointer-events: none; z-index: 2; }

	/* hub content after the stack: school rows + A-Z list keep the page's navy */
	body .fsf-mobile-sections { position: relative; z-index: 1; }
}

/* ── Motion (phones, motion allowed): play-in, flip, stack, icon draw-in ── */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
	html.fsh-anim [data-fsh-in] { transition: opacity .9s cubic-bezier(.33, 1, .68, 1), transform .7s cubic-bezier(.33, 1, .68, 1); }
	html.fsh-anim [data-fsh-in]:not(.is-in) { opacity: 0; transform: translateY(30px); }

	.fsh-rows.is-flip li { animation: fsh-flip .45s cubic-bezier(.33, 1, .68, 1) both; }
	@keyframes fsh-flip { from { transform: rotateX(-88deg); opacity: 0; } to { transform: none; opacity: 1; } }

	.fsh-card {
		position: sticky; top: calc(var(--fsh-top, 56px) + var(--fsh-k, 0) * 12px);
		box-shadow: 0 -12px 24px rgba(6, 15, 30, .55); transition: top .25s ease;
	}
	.fsh-icon * { stroke-dasharray: 1; stroke-dashoffset: 0; }
	/* #359: hidden (not a row of stray round-cap dots) until drawn */
	html.fsh-anim .fsh-card:not(.is-drawn) .fsh-icon * { stroke-dashoffset: 1; opacity: 0; }
	html.fsh-anim .fsh-card.is-drawn .fsh-icon * { transition: stroke-dashoffset 1.4s cubic-bezier(.33, 1, .68, 1), opacity .15s linear; }
}

/* ── #355.5: closing section (the home #338/#341/#343 pattern), phones only. It is the card stack's room to finish:
   one screen - (header 56 + 3 x 12 px + the 200 px card, #358) - the bottom row (~110 px) + 120 px to scroll away. ── */
@media (max-width: 767px) {
	.fsh-close { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 0; /* #359.3: the stack spacer gives the room now */ padding: 56px 20px; text-align: center; }
	.fsh-close .fsh-h2 { font-size: min(44px, calc((100vw - 40px) / 7)); line-height: .98; text-wrap: balance; }
	.fsh-close-sub { margin: 14px auto 0; max-width: 340px; color: #94a7be; font-family: 'DM Sans', sans-serif; font-size: 15px; line-height: 1.5; }
	.fsh-close .fsh-btn { margin-top: 24px; text-decoration: none !important; }
}
/* #359.3: the stack's hold: a spacer ELEMENT after the last card (sticky ignores padding), about one card high, so the
   last card lands and holds before the stack scrolls away. Phones with motion only. */
.fsh-stack-hold { display: none; }
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
	.fsh-stack-hold { display: block; height: 200px; pointer-events: none; }
	.fsh-card:nth-last-child(2) { margin-bottom: 0; }
}
