/* =========================================================
   TomatoCat Digital — main stylesheet
   All design decisions live in the custom properties below.
   Swap the :root block when the real brand template arrives.
   ========================================================= */

:root {
	/* Brand */
	--tc-tomato: #e0503c;
	--tc-tomato-dark: #b93b2a;
	--tc-ink: #1c1b1a;
	--tc-ink-soft: #5a5754;
	--tc-line: #e7e3df;
	--tc-surface: #ffffff;
	--tc-surface-alt: #faf7f4;

	/* Semantic */
	--tc-accent: var(--tc-tomato);
	--tc-accent-hover: var(--tc-tomato-dark);
	--tc-text: var(--tc-ink);
	--tc-text-muted: var(--tc-ink-soft);
	--tc-bg: var(--tc-surface);
	--tc-bg-alt: var(--tc-surface-alt);
	--tc-border: var(--tc-line);

	/* Type — everything is relative, so changing the root size in
	   TomatoCat Settings scales the whole site in proportion.
	   Default font is Prompt; the Customizer / TomatoCat Settings can swap it. */
	--tc-font-body: "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Sarabun", sans-serif;
	--tc-font-heading: var(--tc-font-body);
	--tc-fs-base: 1em;
	--tc-fs-lede: 1.125em;
	--tc-fs-h1: clamp(2em, 1.4em + 2.4vw, 3.25em);
	--tc-fs-h2: clamp(1.5em, 1.2em + 1.2vw, 2.125em);
	--tc-fs-h3: clamp(1.25em, 1.1em + 0.6vw, 1.5em);
	--tc-lh-body: 1.75;
	--tc-lh-heading: 1.2;

	/* Layout */
	--tc-container: 1200px;
	--tc-container-narrow: 760px;
	--tc-course-aside: 320px;
	--tc-sidebar: 300px;
	--tc-gutter: clamp(1rem, 4vw, 2.5rem);
	--tc-space-xs: 0.5rem;
	--tc-space-sm: 0.75rem;
	--tc-space-md: 1.5rem;
	--tc-space-lg: 3rem;
	--tc-space-xl: clamp(3rem, 8vw, 6rem);

	/* Distance from the header to the first thing on an inner page. Held apart
	   from --tc-space-xl, which also spaces blocks *within* a page: the two look
	   alike but want different numbers, and tying them together is why the top
	   of every page sat so far below the header. */
	--tc-page-top: clamp(1.25rem, 3vw, 2.5rem);

	/* Overridable from Appearance > Customize > Theme Settings */
	--tc-logo-height: 44px;
	--tc-footer-bg: var(--tc-ink);
	--tc-edge: 0px;

	/* Menu typography — size is a share of the body text, not a fixed pixel
	   value, so it tracks the root scale like everything else. */
	--tc-menu-size: 0.95em;
	--tc-menu-weight: 500;
	--tc-menu-transform: none;
	--tc-menu-spacing: 0;
	--tc-menu-gap: 24px;

	/* Dropdown panel. Held apart from the menu bar above so the panel can read
	   as a light card even while the bar sits in white over a video hero — the
	   case where inheriting the bar's colour made the panel unreadable. */
	--tc-sub-bg: #ffffff;
	--tc-sub-text: #1c1b1a;
	--tc-sub-hover-bg: #f6f2ee;
	--tc-sub-hover-text: #e0503c;
	--tc-sub-border: #e8e2db;
	--tc-sub-radius: 12px;
	--tc-sub-size: 0.9em;
	--tc-sub-width: 220px;
	--tc-sub-shadow: 0 12px 28px rgba(28, 27, 26, 0.12);

	/* Header "Courses" button */
	--tc-hbtn-bg: #f2c063;
	--tc-hbtn-edge: #c8983f;
	--tc-hbtn-hover: #eeb54a;
	--tc-hbtn-color: #1c1b1a;

	/* Hero text. Written inline per hero by template-parts/hero-video.php;
	   these are the fallbacks. */
	--tc-hero-title-scale: 1;
	--tc-hero-sub-scale: 1;

	/* Misc */
	--tc-radius: 14px;
	--tc-radius-sm: 8px;
	--tc-radius-pill: 999px;
	--tc-shadow: 0 1px 2px rgba(28, 27, 26, 0.05), 0 12px 32px rgba(28, 27, 26, 0.07);
	--tc-shadow-hover: 0 2px 6px rgba(28, 27, 26, 0.07), 0 20px 48px rgba(28, 27, 26, 0.12);
	--tc-transition: 200ms ease;
}

/* ---------- Reset ---------- */

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

body { margin: 0; }

/* The single knob every em and rem on the site hangs off. A percentage rather
   than a px value so the visitor's own browser font preference still counts. */
html {
	font-size: var(--tc-fs-root, 100%);
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--tc-font-body);
	font-size: var(--tc-fs-base);
	line-height: var(--tc-lh-body);
	color: var(--tc-text);
	background: var(--tc-bg);
	-webkit-font-smoothing: antialiased;

	/* Optional frame between the site and the browser edge. Off by default;
	   set it in Appearance > Customize > Theme Settings > Brand & colours. */
	padding: var(--tc-edge);

	/* `clip` — not `hidden` — so nothing can scroll sideways while every
	   position:sticky element keeps working. `hidden` would turn body into a
	   scroll container and break the sticky header and sidebars. */
	overflow-x: clip;
}

/* Keep the sticky header inside the frame instead of covering it. */
.site-header--sticky { top: var(--tc-edge); }

.widget-area__inner,
.course-aside { --tc-sticky-offset: calc(72px + var(--tc-edge) + var(--tc-space-md)); }

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--tc-font-heading);
	line-height: var(--tc-lh-heading);
	color: var(--tc-text);
	margin: 0 0 var(--tc-space-sm);
	font-weight: 700;
	letter-spacing: -0.015em;
}

p { margin: 0 0 var(--tc-space-md); }

a { color: var(--tc-accent); text-decoration: none; }
a:hover { color: var(--tc-accent-hover); }

:focus-visible {
	outline: 2px solid var(--tc-accent);
	outline-offset: 3px;
	border-radius: var(--tc-radius-sm);
}

/* ---------- Utilities ---------- */

.container {
	width: 100%;
	max-width: var(--tc-container);
	margin-inline: auto;
	padding-inline: var(--tc-gutter);
}

.container--narrow { max-width: var(--tc-container-narrow); }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999;
	padding: 0.75rem 1.25rem;
	background: var(--tc-accent);
	color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Buttons & badges ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--tc-radius-pill);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1;
	cursor: pointer;
	transition: background var(--tc-transition), color var(--tc-transition), border-color var(--tc-transition), transform var(--tc-transition);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--tc-accent); color: #fff; }
.btn--primary:hover { background: var(--tc-accent-hover); color: #fff; }

.btn--ghost { border-color: var(--tc-border); color: var(--tc-text); background: transparent; }
.btn--ghost:hover { border-color: var(--tc-accent); color: var(--tc-accent); }

/* Flat fill, no relief. */
.btn--solid {
	background: var(--tc-hbtn-bg);
	color: var(--tc-hbtn-color);
	border-color: transparent;
}
.btn--solid:hover { background: var(--tc-hbtn-hover); color: var(--tc-hbtn-color); }

/*
 * Raised. The relief is four stacked shadows, not a gradient: a light inner top
 * edge, a dark inner bottom edge, a solid offset that reads as the side of a
 * physical key, and a soft cast shadow underneath. Because they are shadows the
 * button keeps one flat fill colour, so a single colour picker drives the whole
 * effect and it cannot be set to a combination that looks wrong.
 */
.btn--raised {
	background: var(--tc-hbtn-bg);
	color: var(--tc-hbtn-color);
	border-color: transparent;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		inset 0 -2px 0 rgba(0, 0, 0, 0.12),
		0 3px 0 var(--tc-hbtn-edge),
		0 5px 12px rgba(28, 27, 26, 0.22);
	transition:
		background var(--tc-transition),
		box-shadow var(--tc-transition),
		transform var(--tc-transition);
}

.btn--raised:hover,
.btn--raised:focus-visible {
	background: var(--tc-hbtn-hover);
	color: var(--tc-hbtn-color);
	transform: translateY(-2px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.6),
		inset 0 -2px 0 rgba(0, 0, 0, 0.12),
		0 5px 0 var(--tc-hbtn-edge),
		0 9px 18px rgba(28, 27, 26, 0.26);
}

/* Pressing it collapses the relief, so the click feels physical. */
.btn--raised:active {
	transform: translateY(2px);
	box-shadow:
		inset 0 2px 4px rgba(0, 0, 0, 0.22),
		0 1px 0 var(--tc-hbtn-edge);
}

@media (prefers-reduced-motion: reduce) {
	.btn--raised:hover,
	.btn--raised:focus-visible,
	.btn--raised:active { transform: none; }
}

.badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: var(--tc-radius-pill);
	background: var(--tc-bg-alt);
	color: var(--tc-text-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	position: relative;
	z-index: 2;
}
.badge:hover { background: var(--tc-accent); color: #fff; }

.term-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--tc-space-md); }

.card__badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.badge--sticky { background: var(--tc-accent); color: #fff; }
.badge--sticky:hover { background: var(--tc-accent-hover); color: #fff; }

/* ---------- Header ---------- */

.site-header {
	position: relative;
	z-index: 100;
	background: var(--tc-bg);
	border-bottom: 1px solid var(--tc-border);
}

.site-header--sticky {
	position: sticky;
	top: 0;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: saturate(150%) blur(12px);
}

/* Sits over the hero video until the visitor scrolls past it. */
.site-header--transparent {
	position: absolute;
	top: var(--tc-edge);
	left: 0;
	right: 0;
	background: transparent;
	backdrop-filter: none;
	border-bottom-color: transparent;
	color: #fff;
	transition: background 260ms ease, backdrop-filter 260ms ease, border-color 260ms ease;
}

.site-header--transparent .site-title a,
.site-header--transparent .site-tagline,
.site-header--transparent .main-navigation a,
.site-header--transparent .nav-toggle__bar,
.site-header--transparent .nav-toggle__bar::before,
.site-header--transparent .nav-toggle__bar::after { color: #fff; }

.site-header--transparent .nav-toggle {
	border-color: rgba(255, 255, 255, 0.5);
}
.site-header--transparent .nav-toggle__bar,
.site-header--transparent .nav-toggle__bar::before,
.site-header--transparent .nav-toggle__bar::after { background: #fff; }

.site-header--transparent .btn--ghost {
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
}
.site-header--transparent .btn--ghost:hover {
	background: #fff;
	border-color: #fff;
	color: var(--tc-ink);
}

.site-header--transparent .custom-logo { filter: brightness(0) invert(1); }

/* Scrolled past the hero — behave like the normal sticky header again. */
.site-header--transparent.is-solid {
	position: fixed;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(150%) blur(12px);
	border-bottom-color: var(--tc-border);
	color: var(--tc-text);
	animation: tc-header-drop 280ms ease;
}

.site-header--transparent.is-solid .site-title a,
.site-header--transparent.is-solid .main-navigation a { color: var(--tc-text); }
.site-header--transparent.is-solid .site-tagline { color: var(--tc-text-muted); }
.site-header--transparent.is-solid .nav-toggle { border-color: var(--tc-border); }
.site-header--transparent.is-solid .nav-toggle__bar,
.site-header--transparent.is-solid .nav-toggle__bar::before,
.site-header--transparent.is-solid .nav-toggle__bar::after { background: var(--tc-text); }
.site-header--transparent.is-solid .btn--ghost { border-color: var(--tc-border); color: var(--tc-text); }
.site-header--transparent.is-solid .custom-logo { filter: none; }

@keyframes tc-header-drop {
	from { transform: translateY(-100%); }
	to { transform: none; }
}

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

.hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--tc-hero-h, 78svh);
	overflow: hidden;
	background: var(--tc-ink);
	isolation: isolate;
}

/* Alignment — one axis each, set from the Customizer. */
.hero--v-top { align-items: flex-start; }
.hero--v-center { align-items: center; }
.hero--v-bottom { align-items: flex-end; }

.hero--align-left { text-align: left; }
.hero--align-center { text-align: center; }
.hero--align-right { text-align: right; }

/* svh is not everywhere yet; vh is close enough as a fallback. */
@supports not (height: 1svh) {
	.hero { min-height: 78vh; }
}

.hero__media,
.hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.hero__poster,
.hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The iframe is scaled to cover rather than letterboxed. 16:9 either way:
   too narrow -> grow by width, too tall -> grow by height. */
.hero__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100vw;
	height: 56.25vw;          /* 100 / (16/9) */
	min-width: 177.78svh;     /* 100 * (16/9) */
	min-height: 100svh;
	transform: translate(-50%, -50%);
	border: 0;
	pointer-events: none;
}

@supports not (height: 1svh) {
	.hero__video iframe { min-width: 177.78vh; min-height: 100vh; }
}

.hero__video { opacity: 0; transition: opacity 700ms ease; }
.hero.is-playing .hero__video { opacity: 1; }

/* The tint is stored as an "r, g, b" triplet so one colour can be reused at
   several alpha values inside the gradient. */
.hero__scrim {
	--tc-tint: var(--tc-hero-tint, 0, 0, 0);
	--tc-a: var(--tc-hero-overlay, 0.45);

	background: linear-gradient(
		to bottom,
		rgba(var(--tc-tint), calc(var(--tc-a) * 1.1)) 0%,
		rgba(var(--tc-tint), calc(var(--tc-a) * 0.45)) 45%,
		rgba(var(--tc-tint), calc(var(--tc-a) * 1.25)) 100%
	);
	backdrop-filter: blur(var(--tc-hero-blur, 0px));
	-webkit-backdrop-filter: blur(var(--tc-hero-blur, 0px));
}

.hero--overlay-solid .hero__scrim {
	background: rgba(var(--tc-tint), var(--tc-a));
}

.hero--overlay-none .hero__scrim {
	background: none;
}

.hero__content {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-block: clamp(2.5rem, 8vh, 6rem);
	color: #fff;
}

/*
 * Size is a scale factor over the fluid clamp rather than a fixed value, so the
 * headline still shrinks on a phone whatever number is entered. Setting a flat
 * font-size here would have thrown that away.
 */
.hero__title {
	margin: 0;
	color: var(--tc-hero-title-color, #fff);
	font-size: calc(clamp(2.25em, 1.4em + 3.6vw, 4.25em) * var(--tc-hero-title-scale, 1));
	line-height: var(--tc-hero-title-lh, 1.1);
	font-weight: var(--tc-hero-title-weight, 800);
	letter-spacing: var(--tc-hero-title-spacing, 0);
	max-width: var(--tc-hero-title-width, 18ch);
	text-shadow: 0 2px 24px rgba(0, 0, 0, var(--tc-hero-shadow, 0.45));
}

.hero__sub {
	margin: var(--tc-space-sm) 0 0;
	max-width: var(--tc-hero-sub-width, 52ch);
	color: var(--tc-hero-sub-color, rgba(255, 255, 255, 0.88));
	font-size: calc(clamp(1em, 0.95em + 0.4vw, 1.25em) * var(--tc-hero-sub-scale, 1));
	line-height: var(--tc-hero-sub-lh, 1.7);
	font-weight: var(--tc-hero-sub-weight, 400);
	text-shadow: 0 1px 16px rgba(0, 0, 0, calc(var(--tc-hero-shadow, 0.45) * 1.1));
}

/* The max-widths above would otherwise pin the text to the left whatever the
   alignment says, so the block has to be nudged too. */
.hero--align-center .hero__title,
.hero--align-center .hero__sub { margin-inline: auto; }

.hero--align-right .hero__title,
.hero--align-right .hero__sub { margin-inline: auto 0; }

.hero__btn { margin-top: var(--tc-space-md); }

.hero__mute {
	position: absolute;
	right: clamp(16px, 3vw, 32px);
	bottom: clamp(16px, 3vw, 32px);
	z-index: 2;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background 200ms ease, transform 200ms ease;
}
.hero__mute:hover { background: rgba(0, 0, 0, 0.6); transform: scale(1.06); }

/* Hero content should clear the floating buttons on desktop. */
@media (min-width: 861px) {
	.hero__mute { right: calc(clamp(16px, 2.5vw, 28px) + 74px); }
}

@media (max-width: 700px) {
	.hero { min-height: min(var(--tc-hero-h, 78svh), 72svh); }
	/* The mute control sits clear of the sticky bar on phones. */
	.hero__mute { bottom: calc(var(--tc-sticky-h, 84px) + 16px); }
}

/* Only reduced-motion drops the video — the poster stands in for it. */
@media (prefers-reduced-motion: reduce) {
	.hero__video { display: none; }
	.hero__mute { display: none; }
	.site-header--transparent.is-solid { animation: none; }
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tc-space-md);
	min-height: 72px;
}

.site-title { font-size: 1.25rem; margin: 0; line-height: 1.25; }
.site-title a { color: var(--tc-text); }

.site-tagline {
	margin: 0.15rem 0 0;
	font-size: 0.8125rem;
	color: var(--tc-text-muted);
}

.custom-logo { max-height: var(--tc-logo-height); width: auto; }

.site-header__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.site-header__cta { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 860px) {
	.site-header__actions { order: 2; margin-left: auto; margin-right: 0.5rem; }
	/* Only the strongest call to action survives the squeeze — but if the
	   Courses button is the only one, it stays. */
	/* Targets the button by role, not by its style class — the Courses button's
	   appearance is now a Customizer choice, so keying off btn--ghost would stop
	   working the moment someone switched it to raised. */
	.site-header__actions .site-header__cta--courses:not(:last-child) { display: none; }
}
@media (max-width: 520px) {
	.site-header__actions { display: none; }
}

.main-navigation .menu {
	display: flex;
	align-items: center;
	gap: var(--tc-menu-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-navigation a {
	color: var(--tc-text);
	font-weight: var(--tc-menu-weight);
	font-size: var(--tc-menu-size);
	text-transform: var(--tc-menu-transform);
	letter-spacing: var(--tc-menu-spacing);
	padding: 0.5rem 0;
	position: relative;
}
.main-navigation a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background: var(--tc-accent);
	transition: width var(--tc-transition);
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after { width: 100%; }

/* ---------- Dropdown panel ---------- */

/*
 * Shown by flipping visibility rather than display, because display cannot be
 * transitioned — an animated open needs the panel to stay in the box tree.
 * visibility: hidden also takes the links out of the tab order, which display:
 * none did for free and opacity alone would not.
 */
.main-navigation .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	min-width: var(--tc-sub-width);
	background: var(--tc-sub-bg);
	border: 1px solid var(--tc-sub-border);
	border-radius: var(--tc-sub-radius);
	box-shadow: var(--tc-sub-shadow);
	list-style: none;
	margin: 0;
	padding: 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition:
		opacity 180ms ease,
		transform 180ms ease,
		visibility 180ms;
}

.main-navigation li { position: relative; }

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/*
 * The panel is its own surface, so its links must not inherit the bar's colour.
 * Without this the white-text-over-hero rule below turned every dropdown item
 * white on a white panel — invisible.
 */
.main-navigation .sub-menu a,
.site-header--transparent .main-navigation .sub-menu a,
.site-header--transparent.is-solid .main-navigation .sub-menu a {
	display: block;
	padding: 0.55rem 0.75rem;
	border-radius: calc(var(--tc-sub-radius) - 5px);
	color: var(--tc-sub-text);
	font-size: var(--tc-sub-size);
	line-height: 1.45;
	text-transform: none;
	letter-spacing: normal;
	transition: background var(--tc-transition), color var(--tc-transition);
}

.main-navigation .sub-menu a:hover,
.main-navigation .sub-menu a:focus-visible,
.main-navigation .sub-menu .current-menu-item > a {
	background: var(--tc-sub-hover-bg);
	color: var(--tc-sub-hover-text);
}

/* The bar's underline sweep belongs to the top level only. */
.main-navigation .sub-menu a::after { display: none; }

/* A caret tells people the item opens something before they hover it. */
.main-navigation .menu-item-has-children > a::before {
	content: "";
	display: inline-block;
	width: 0.34em;
	height: 0.34em;
	margin-inline-end: 0.45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.15em) rotate(45deg);
	transition: transform var(--tc-transition);
}

.main-navigation .menu-item-has-children:hover > a::before,
.main-navigation .menu-item-has-children:focus-within > a::before {
	transform: translateY(0.05em) rotate(225deg);
}

/*
 * Animation variants. "fade" is the base style above, so tc-sub-anim-fade
 * deliberately has no rule of its own — the body class is still emitted so the
 * chosen setting is visible in the markup.
 */
.tc-sub-anim-none .main-navigation .sub-menu {
	transition: none;
	transform: none;
}

.tc-sub-anim-slide .main-navigation .sub-menu { transform: translateY(-14px); }

.tc-sub-anim-scale .main-navigation .sub-menu {
	transform: scale(0.96);
	transform-origin: top left;
}
.tc-sub-anim-scale .main-navigation li:hover > .sub-menu,
.tc-sub-anim-scale .main-navigation li:focus-within > .sub-menu { transform: scale(1); }

/* A panel that would run off the right edge opens leftwards instead. */
.main-navigation .menu-item:last-child .sub-menu,
.main-navigation .menu-item:nth-last-child(2) .sub-menu { left: auto; right: 0; }

.tc-sub-anim-scale .main-navigation .menu-item:last-child .sub-menu,
.tc-sub-anim-scale .main-navigation .menu-item:nth-last-child(2) .sub-menu { transform-origin: top right; }

@media (prefers-reduced-motion: reduce) {
	.main-navigation .sub-menu,
	.main-navigation .menu-item-has-children > a::before { transition: none; }
	.main-navigation .sub-menu { transform: none; }
}

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius-sm);
	background: transparent;
	cursor: pointer;
	position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
	position: absolute;
	left: 50%;
	width: 18px;
	height: 2px;
	background: var(--tc-text);
	transform: translateX(-50%);
	transition: transform var(--tc-transition), opacity var(--tc-transition);
}
.nav-toggle__bar { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle__bar::before { content: ""; top: -6px; left: 0; transform: none; }
.nav-toggle__bar::after { content: ""; top: 6px; left: 0; transform: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: rotate(-45deg) translate(4px, -4px); }

@media (max-width: 860px) {
	.nav-toggle { display: block; order: 3; }
	.main-navigation { display: none; }
	.site-header__inner { flex-wrap: wrap; }
}

/* ---------- Full-screen mobile menu ---------- */

.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	background: var(--tc-bg);
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--tc-transition), visibility var(--tc-transition);
}

.mobile-menu[hidden] { display: none; }

.mobile-menu.is-open { opacity: 1; visibility: visible; }

.mobile-menu__inner {
	display: flex;
	flex-direction: column;
	gap: var(--tc-space-lg);
	width: 100%;
	max-width: 640px;
	margin-inline: auto;
	padding: var(--tc-space-md) var(--tc-gutter) var(--tc-space-xl);
}

.mobile-menu__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tc-space-md);
	min-height: 72px;
}

.mobile-menu__brand { display: flex; align-items: center; min-width: 0; }

.mobile-menu__logo img,
.mobile-menu__logo .custom-logo { max-height: 48px; width: auto; }

/* Menu straight under the logo, buttons straight under the menu — pushing the
   nav down the screen only sent the buttons out of reach. */
.mobile-menu__nav { flex: 0 0 auto; }
.mobile-menu__inner > .mobile-menu__actions { margin-top: calc(var(--tc-space-lg) * -0.45); }
.mobile-menu__social { margin-top: auto; padding-top: var(--tc-space-lg); }

.mobile-menu__title { font-size: 1.25rem; font-weight: 700; color: var(--tc-text); }

.mobile-menu__close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--tc-border);
	border-radius: 50%;
	background: transparent;
	color: var(--tc-text);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: background var(--tc-transition), color var(--tc-transition), border-color var(--tc-transition);
}
.mobile-menu__close:hover {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}

.mobile-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-menu__list > li + li { border-top: 1px solid var(--tc-border); }

.mobile-menu__list a {
	display: block;
	padding: 0.9rem 0;
	color: var(--tc-text);
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
}
.mobile-menu__list a:hover { color: var(--tc-accent); }

.mobile-menu__list .sub-menu {
	list-style: none;
	margin: 0 0 0.5rem;
	padding-left: 1rem;
	border-left: 2px solid var(--tc-border);
}
.mobile-menu__list .sub-menu a { font-size: 1rem; font-weight: 500; padding: 0.5rem 0; }
.mobile-menu__list .sub-menu li + li { border-top: 0; }

.mobile-menu__actions {
	display: flex;
	flex-direction: column;
	gap: var(--tc-space-xs);
}
.mobile-menu__cta { justify-content: center; padding-block: 1rem; font-size: 1rem; }

.mobile-menu__social { justify-content: center; margin: 0; }
.mobile-menu__social .social-links__item {
	border-color: var(--tc-border);
	color: var(--tc-text-muted);
}
.mobile-menu__social .social-links__item:hover {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}

/* Never show the overlay on desktop, even if a stale class survives a resize. */
@media (min-width: 861px) {
	.mobile-menu { display: none !important; }
}

/* Stop the page behind the overlay from scrolling. */
body.tc-menu-open { overflow: hidden; }

/* ---------- Hero / archive header ---------- */

.page-hero {
	padding-block: var(--tc-page-top) var(--tc-space-lg);
	background: var(--tc-bg-alt);
	border-bottom: 1px solid var(--tc-border);
	margin-bottom: var(--tc-space-lg);
}

.page-hero__eyebrow {
	margin: 0 0 var(--tc-space-xs);
	color: var(--tc-accent);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.page-hero__title { font-size: var(--tc-fs-h1); margin: 0 0 var(--tc-space-sm); max-width: 20ch; }

.page-hero__desc { color: var(--tc-text-muted); max-width: 62ch; font-size: var(--tc-fs-lede); }
.page-hero__desc p:last-child { margin-bottom: 0; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: var(--tc-crumb-justify, flex-start);
	gap: 0.5rem;
	/* 0.81em, not 0.8125em, so it matches the 81% stored default exactly and the
	   Customizer's "only emit when different" check stays honest. */
	font-size: var(--tc-crumb-size, 0.81em);
	font-weight: var(--tc-crumb-weight, 400);
	text-transform: var(--tc-crumb-transform, none);
	letter-spacing: var(--tc-crumb-spacing, 0);
	color: var(--tc-crumb-current, var(--tc-text-muted));
	margin-bottom: var(--tc-space-md);
}

.breadcrumbs a {
	position: relative;
	color: var(--tc-crumb-link, var(--tc-text-muted));
	text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible { color: var(--tc-crumb-hover, var(--tc-accent)); }

/*
 * An underline that wipes in from the left on hover. Drawn with a pseudo
 * element rather than text-decoration because Thai descenders — the tails on
 * ฤ ฎ ฏ — collide with an underline sitting on the baseline.
 */
.breadcrumbs a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -3px;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumbs a:hover::after,
.breadcrumbs a:focus-visible::after { transform: scaleX(1); }

.breadcrumbs__sep {
	color: var(--tc-crumb-sep, currentColor);
	opacity: var(--tc-crumb-sep-opacity, 0.5);
}

.breadcrumbs--left { --tc-crumb-justify: flex-start; }
.breadcrumbs--center { --tc-crumb-justify: center; }
.breadcrumbs--right { --tc-crumb-justify: flex-end; }

/* Boxed variant — a soft chip behind the whole trail. */
.breadcrumbs--boxed {
	padding: 0.5em 0.9em;
	border-radius: var(--tc-radius-pill);
	background: var(--tc-crumb-bg, var(--tc-bg-alt));
	width: fit-content;
}

.breadcrumbs--boxed.breadcrumbs--center { margin-inline: auto; }
.breadcrumbs--boxed.breadcrumbs--right { margin-inline: auto 0; }

@media (prefers-reduced-motion: reduce) {
	.breadcrumbs a::after { transition: none; }
}

/* ---------- Scroll reveal ---------- */

/*
 * Nothing is hidden by the stylesheet alone. JS adds .tc-r to each element it
 * is about to watch, so if the script never runs — blocked, errored, an old
 * browser — the page is simply visible rather than permanently blank. That is
 * the failure mode worth designing for.
 */

.tc-r {
	opacity: 0;
	transition:
		opacity var(--tc-r-ms, 620ms) cubic-bezier(0.16, 1, 0.3, 1) var(--tc-r-delay, 0ms),
		transform var(--tc-r-ms, 620ms) cubic-bezier(0.16, 1, 0.3, 1) var(--tc-r-delay, 0ms);
}

.tc-r-up .tc-r { transform: translateY(28px); }
.tc-r-fade .tc-r { transform: none; }
.tc-r-zoom .tc-r { transform: scale(0.94); }
.tc-r-side .tc-r { transform: translateX(-32px); }

/* A drum school gets a little bounce: the item overshoots, then settles. */
.tc-r-beat .tc-r { transform: translateY(22px) scale(0.97); }
.tc-r-beat .tc-r.is-in {
	animation: tc-beat-in var(--tc-r-ms, 620ms) cubic-bezier(0.22, 1.4, 0.36, 1) var(--tc-r-delay, 0ms) both;
}

.tc-r.is-in {
	opacity: 1;
	transform: none;
}

@keyframes tc-beat-in {
	0% { opacity: 0; transform: translateY(22px) scale(0.97); }
	60% { opacity: 1; transform: translateY(-4px) scale(1.012); }
	100% { opacity: 1; transform: none; }
}

/*
 * Motion is a decoration, so it is dropped entirely rather than shortened when
 * the visitor has asked their system to reduce it.
 */
@media (prefers-reduced-motion: reduce) {
	.tc-r,
	.tc-r.is-in {
		opacity: 1;
		transform: none;
		transition: none;
		animation: none;
	}
}

/* ---------- Beat pulse ---------- */

/*
 * A ring that expands out of the button and fades, on the rhythm of a slow
 * pulse. Drawn on ::after so it needs no extra markup, and pointer-events are
 * off so it can never swallow the click.
 */
.tc-pulse .btn--primary,
.tc-pulse .sticky-cta__btn {
	position: relative;
	isolation: isolate;
}

.tc-pulse .btn--primary::after,
.tc-pulse .sticky-cta__btn::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	box-shadow: 0 0 0 0 var(--tc-accent);
	opacity: 0.55;
	animation: tc-pulse-ring 2.4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
	pointer-events: none;
}

/* Stop the ring while the button is being used — it competes with the hover
   state and looks busy under the cursor. */
.tc-pulse .btn--primary:hover::after,
.tc-pulse .btn--primary:focus-visible::after,
.tc-pulse .sticky-cta__btn:hover::after { animation-play-state: paused; opacity: 0; }

@keyframes tc-pulse-ring {
	0% { box-shadow: 0 0 0 0 var(--tc-accent); opacity: 0.5; }
	70% { box-shadow: 0 0 0 14px var(--tc-accent); opacity: 0; }
	100% { box-shadow: 0 0 0 0 var(--tc-accent); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.tc-pulse .btn--primary::after,
	.tc-pulse .sticky-cta__btn::after { animation: none; opacity: 0; }
}

/* ---------- Filter bar ---------- */

/* One row that turns into a horizontal slider as soon as the chips no longer
   fit. Deliberately no negative margins — those were what pushed the bar past
   the viewport on narrow screens. */
.filter-bar {
	position: relative;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.5rem;
	max-width: 100%;
	margin-bottom: var(--tc-space-lg);
	padding-bottom: var(--tc-space-xs);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-bar__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius-pill);
	color: var(--tc-text-muted);
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
	transition: background var(--tc-transition), color var(--tc-transition), border-color var(--tc-transition);
}
.filter-bar__item:hover { border-color: var(--tc-accent); color: var(--tc-accent); }
.filter-bar__item.is-active {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}
.filter-bar__count { font-size: 0.75rem; opacity: 0.65; }

/* Nothing inside a container may exceed it. Long Thai words, wide tables and
   embeds are the usual culprits. */
.container > *,
.content-layout__main > * { max-width: 100%; }

.entry-content { overflow-wrap: break-word; }
.entry-content pre,
.entry-content table { max-width: 100%; }

/* ---------- Content + sidebar layout ---------- */

.content-layout {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: start;
}

.content-layout--right { grid-template-columns: minmax(0, 1fr) var(--tc-sidebar, 300px); }
.content-layout--left  { grid-template-columns: var(--tc-sidebar, 300px) minmax(0, 1fr); }
.content-layout--none  { grid-template-columns: minmax(0, 1fr); }

/* Keep the sidebar markup order sane for screen readers when it sits left. */
.content-layout--left .content-layout__aside { grid-column: 1; grid-row: 1; }
.content-layout--left .content-layout__main  { grid-column: 2; grid-row: 1; }

.content-layout__main { min-width: 0; }

@media (max-width: 980px) {
	.content-layout--right,
	.content-layout--left { grid-template-columns: minmax(0, 1fr); }
	.content-layout--left .content-layout__aside,
	.content-layout--left .content-layout__main { grid-column: 1; grid-row: auto; }
	.content-layout__aside { order: 2; }
	.content-layout__main { order: 1; }
}

.widget-area__inner { position: sticky; top: var(--tc-sticky-offset); }

@media (max-width: 980px) {
	.widget-area__inner {
		position: static;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
		gap: var(--tc-space-md);
		padding-top: var(--tc-space-lg);
		border-top: 1px solid var(--tc-border);
	}
	.widget-area .widget { margin-bottom: 0; }
}

/* ---------- Sidebar widgets ---------- */

.widget-area .widget {
	padding: var(--tc-space-md);
	background: var(--tc-bg-alt);
	border-radius: var(--tc-radius);
}
.widget-area .widget_search { padding: 0; background: transparent; }
.widget-area .search-form { margin-bottom: 0; }

.widget__title {
	font-size: 0.9375rem;
	letter-spacing: 0.02em;
	margin-bottom: var(--tc-space-sm);
	padding-bottom: var(--tc-space-xs);
	border-bottom: 1px solid var(--tc-border);
}

.widget ul { list-style: none; margin: 0; padding: 0; }

/* Recent posts */

.recent-posts__item + .recent-posts__item {
	margin-top: var(--tc-space-sm);
	padding-top: var(--tc-space-sm);
	border-top: 1px dashed var(--tc-border);
}

.recent-posts__link {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	color: var(--tc-text);
}
.recent-posts__link:hover .recent-posts__title { color: var(--tc-accent); }

.recent-posts__thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: var(--tc-radius-sm);
	overflow: hidden;
	background: var(--tc-bg);
}
.recent-posts__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.recent-posts__text { min-width: 0; }

.recent-posts__title {
	display: block;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	transition: color var(--tc-transition);
}

.recent-posts__date {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.75rem;
	color: var(--tc-text-muted);
}

/* Categories */

.cat-list__item + .cat-list__item { border-top: 1px dashed var(--tc-border); }

.cat-list__item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.5rem 0;
	color: var(--tc-text);
	font-size: 0.9375rem;
}
.cat-list__item a:hover { color: var(--tc-accent); }

.cat-list__count {
	flex: 0 0 auto;
	min-width: 1.75rem;
	padding: 0.1rem 0.45rem;
	border-radius: var(--tc-radius-pill);
	background: var(--tc-bg);
	color: var(--tc-text-muted);
	font-size: 0.75rem;
	text-align: center;
}

.widget_tag_cloud .term-list { margin-bottom: 0; }
.widget_tag_cloud .badge { background: var(--tc-bg); }

/* ---------- Author box ---------- */

.author-box {
	display: flex;
	gap: var(--tc-space-md);
	align-items: flex-start;
	margin-top: var(--tc-space-lg);
	padding: var(--tc-space-md);
	background: var(--tc-bg-alt);
	border-radius: var(--tc-radius);
}

.author-box__avatar { flex: 0 0 auto; }
.author-box__img { border-radius: 50%; }

.author-box__label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--tc-text-muted);
}

.author-box__name { font-size: 1.125rem; margin: 0.15rem 0 0.5rem; }

.author-box__bio {
	margin: 0 0 0.5rem;
	color: var(--tc-text-muted);
	font-size: 0.9375rem;
	line-height: 1.7;
}

.author-box__link { font-size: 0.875rem; font-weight: 600; }

@media (max-width: 520px) {
	.author-box { flex-direction: column; }
}

/* ---------- Filter groups (course archive) ---------- */

.filter-groups {
	display: flex;
	flex-direction: column;
	gap: var(--tc-space-sm);
	margin-bottom: var(--tc-space-lg);
}

.filter-group {
	display: flex;
	align-items: center;
	gap: var(--tc-space-sm);
	flex-wrap: wrap;
}

.filter-group__label {
	flex: 0 0 auto;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--tc-text-muted);
	min-width: 6.5rem;
}

.filter-groups .filter-bar { margin-bottom: 0; flex: 1 1 300px; }

/* Chips keep their natural size regardless of how tall or wide the row gets. */
.filter-bar__item {
	align-self: center;
	flex: 0 0 auto;
	scroll-snap-align: start;
}

@media (max-width: 640px) {
	.filter-group { flex-direction: column; align-items: stretch; gap: 0.35rem; }
	.filter-group__label { min-width: 0; }

	/* The group flips to a column here, so `flex: 1 1 300px` would be read as
	   a 300px *height* basis and stretch every chip into a tall pill. */
	.filter-groups .filter-bar { flex: 0 0 auto; }
}

/* ---------- Course list rows ---------- */

.course-list {
	display: flex;
	flex-direction: column;
	gap: var(--tc-space-md);
	margin-bottom: var(--tc-space-xl);
}

.course-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tc-space-lg);
	padding: clamp(1.25rem, 3vw, 2.5rem);
	background: var(--tc-bg-alt);
	border: 1px solid transparent;
	border-radius: var(--tc-radius);
	transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
}

.course-row:hover {
	border-color: var(--tc-border);
	box-shadow: var(--tc-shadow);
}

.course-row__body { flex: 1 1 auto; min-width: 0; }

/*
 * The thumbnail is decorative: the title next to it is already a link to the
 * same course, so this anchor is hidden from screen readers and taken out of
 * the tab order rather than repeating the destination twice.
 */
.course-row__media {
	flex: 0 0 auto;
	width: clamp(120px, 18vw, 220px);
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--tc-radius-sm);
	background: var(--tc-bg);
}

.course-row__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms var(--tc-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.course-row:hover .course-row__img { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
	.course-row__img,
	.course-row:hover .course-row__img { transition: none; transform: none; }
}

.course-row .badge { background: var(--tc-bg); margin-bottom: var(--tc-space-xs); }

.course-row__title {
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
	margin: 0 0 var(--tc-space-sm);
}
.course-row__title a { color: var(--tc-text); }
.course-row__title a:hover { color: var(--tc-accent); }

.course-row__facts {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.75rem;
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	color: var(--tc-text-muted);
}

.course-row__excerpt {
	margin: var(--tc-space-sm) 0 0;
	color: var(--tc-text-muted);
	font-size: 0.9375rem;
	max-width: 60ch;
}

.course-row__actions {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 200px;
}
.course-row__actions .btn { justify-content: center; width: 100%; }

@media (max-width: 780px) {
	.course-row { flex-direction: column; align-items: stretch; gap: var(--tc-space-md); }
	.course-row__actions { flex-direction: row; width: auto; }
	.course-row__actions .btn { flex: 1 1 0; }

	/* Stacked, the thumbnail becomes a banner across the top of the row. */
	.course-row__media { width: 100%; aspect-ratio: 16 / 9; }
}

/* ---------- Course cover (single) ---------- */

/*
 * Full-bleed rather than inside the container, so the image reaches both edges
 * of the browser. Measured against the root element's width, not 100vw, which
 * would be wider by the scrollbar and force a horizontal scroll.
 */
.course-cover {
	--tc-vw: var(--tc-viewport, 100vw);

	position: relative;
	width: var(--tc-vw);
	margin-inline: calc(50% - var(--tc-vw) / 2);
	margin-bottom: var(--tc-space-lg);
	height: var(--tc-cover-h, 44svh);
	overflow: hidden;
	background: var(--tc-bg-alt);
}

@supports not (height: 1svh) {
	.course-cover { height: 44vh; }
}

.course-cover__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 700px) {
	/* Capped so a tall cover cannot push the course details off the screen. */
	.course-cover { height: min(var(--tc-cover-h, 44svh), 62svh); }
}

.course-figure {
	margin: 0;
	overflow: hidden;
	border-radius: var(--tc-radius);
	background: var(--tc-bg-alt);
}

.course-figure__img { width: 100%; height: auto; }

/* Flat hero used by the course archive */

.page-hero--flat {
	background: transparent;
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: var(--tc-space-lg);
}
.page-hero--flat .page-hero__title { max-width: none; }

/* ---------- Card grid ---------- */

.card-grid {
	display: grid;
	gap: var(--tc-space-md);
	margin-bottom: var(--tc-space-xl);
}
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--tc-bg);
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
	overflow: hidden;
	transition: transform var(--tc-transition), box-shadow var(--tc-transition), border-color var(--tc-transition);
}
.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--tc-shadow-hover);
	border-color: transparent;
}

.card__link { position: absolute; inset: 0; z-index: 1; }

.card__media { aspect-ratio: 3 / 2; background: var(--tc-bg-alt); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card:hover .card__media img { transform: scale(1.04); }

.entry-thumb__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--tc-bg-alt), var(--tc-border));
}

.card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--tc-space-xs);
	padding: var(--tc-space-md);
	flex: 1;
}

.card__title { font-size: var(--tc-fs-h3); margin: 0; }

.card__excerpt { color: var(--tc-text-muted); font-size: 0.9375rem; line-height: 1.65; margin: 0; }

.card__meta {
	margin-top: auto;
	padding-top: var(--tc-space-xs);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--tc-text-muted);
	font-size: 0.8125rem;
}
.card__meta-sep { opacity: 0.5; }

.card__facts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	font-size: 0.8125rem;
	color: var(--tc-text-muted);
}
.card__facts li { position: relative; padding-left: 0.9rem; }
.card__facts li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--tc-accent);
}

.card__cta {
	margin-top: auto;
	padding-top: var(--tc-space-xs);
	color: var(--tc-accent);
	font-weight: 600;
	font-size: 0.9375rem;
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
}
.card:hover .card__cta span { transform: translateX(3px); }
.card__cta span { transition: transform var(--tc-transition); }

/* ---------- Single post ---------- */

.entry-header { padding-block: var(--tc-page-top) var(--tc-space-md); }

.entry-title { font-size: var(--tc-fs-h1); margin-bottom: var(--tc-space-md); }

.entry-lede {
	font-size: var(--tc-fs-lede);
	color: var(--tc-text-muted);
	line-height: 1.65;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	color: var(--tc-text-muted);
	font-size: 0.875rem;
}
.entry-meta__author { display: inline-flex; align-items: center; gap: 0.5rem; }
.entry-meta__avatar { border-radius: 50%; }
.entry-meta__sep { opacity: 0.5; }

.entry-hero { margin: 0 0 var(--tc-space-lg); }
.entry-hero__img { width: 100%; border-radius: var(--tc-radius); }
.entry-hero__caption {
	margin-top: var(--tc-space-xs);
	font-size: 0.8125rem;
	color: var(--tc-text-muted);
	text-align: center;
}

.entry-content { font-size: 1.0625rem; }
.entry-content > * + * { margin-top: var(--tc-space-md); }
.entry-content h2 { font-size: var(--tc-fs-h2); margin-top: var(--tc-space-lg); }
.entry-content h3 { font-size: var(--tc-fs-h3); margin-top: var(--tc-space-lg); }
.entry-content img,
.entry-content figure img { border-radius: var(--tc-radius); }
.entry-content figcaption { font-size: 0.8125rem; color: var(--tc-text-muted); text-align: center; margin-top: 0.5rem; }
.entry-content ul,
.entry-content ol { padding-left: 1.35rem; }
.entry-content li + li { margin-top: 0.35rem; }
.entry-content blockquote {
	margin: var(--tc-space-lg) 0;
	padding: var(--tc-space-md) var(--tc-space-md) var(--tc-space-md) var(--tc-space-lg);
	border-left: 3px solid var(--tc-accent);
	background: var(--tc-bg-alt);
	border-radius: 0 var(--tc-radius-sm) var(--tc-radius-sm) 0;
	font-size: 1.125rem;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content pre {
	background: var(--tc-ink);
	color: #f5f2ef;
	padding: var(--tc-space-md);
	border-radius: var(--tc-radius-sm);
	overflow-x: auto;
	font-size: 0.875rem;
}
.entry-content code { font-size: 0.9em; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.entry-content th,
.entry-content td { border: 1px solid var(--tc-border); padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--tc-bg-alt); }

.entry-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--tc-space-sm);
	margin-top: var(--tc-space-lg);
	padding-top: var(--tc-space-md);
	border-top: 1px solid var(--tc-border);
}
.entry-footer__label { font-size: 0.8125rem; color: var(--tc-text-muted); font-weight: 600; }
.entry-footer .term-list { margin-bottom: 0; }

.post-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--tc-space-md);
	margin-block: var(--tc-space-lg);
}
.post-nav__item {
	padding: var(--tc-space-md);
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
	transition: border-color var(--tc-transition);
}
.post-nav__item:hover { border-color: var(--tc-accent); }
.post-nav__item--next { text-align: right; }
.post-nav__label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--tc-text-muted);
	margin-bottom: 0.35rem;
}
.post-nav__item a { color: var(--tc-text); font-weight: 600; }
.post-nav__item a:hover { color: var(--tc-accent); }

/* ---------- Single course (single-service.php) ---------- */

.single-course { padding-block: var(--tc-page-top) var(--tc-space-xl); }

/* A full-width cover is its own top spacing — the page must not also pad above
   it, or the image floats away from the header. */
.single-course:has(> .course-cover) { padding-top: 0; }

.course-layout {
	display: grid;
	grid-template-columns: var(--tc-course-aside, 320px) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 4rem);
	align-items: start;
}

@media (max-width: 980px) {
	.course-layout { grid-template-columns: 1fr; }
}

/* Left card */

/* Desktop: the card follows you down the page. Mobile: it just sits at the top. */
@media (min-width: 981px) {
	.course-aside { position: sticky; top: var(--tc-sticky-offset); }
}

.course-card {
	padding: var(--tc-space-md);
	background: var(--tc-bg-alt);
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
}

.course-card .term-list { margin-bottom: var(--tc-space-sm); }
.course-card .badge { background: var(--tc-bg); }

.course-card__title {
	font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
	margin: 0 0 var(--tc-space-md);
}

.course-card__subtitle {
	font-size: 1.125rem;
	margin: 0 0 var(--tc-space-sm);
	padding-top: var(--tc-space-sm);
	border-top: 1px solid var(--tc-border);
}

.course-facts { list-style: none; margin: 0 0 var(--tc-space-md); padding: 0; }

.course-facts__item {
	padding: 0.55rem 0;
	font-size: 0.9375rem;
	color: var(--tc-text-muted);
	border-bottom: 1px dashed var(--tc-border);
}
.course-facts__item:last-child { border-bottom: 0; }

.course-card__actions { display: flex; flex-wrap: wrap; gap: var(--tc-space-xs); }
.course-card__actions .btn { flex: 1 1 auto; justify-content: center; }

/* Right column */

.course-main > * + * { margin-top: var(--tc-space-lg); }

.course-description {
	font-size: 1.0625rem;
	color: var(--tc-text);
	line-height: 1.9;
}
.course-description p:last-child { margin-bottom: 0; }

/* ---------- Course gallery ---------- */

.course-gallery { position: relative; }

.course-gallery__viewport { overflow: hidden; }

.course-gallery__track {
	display: flex;
	gap: var(--tc-space-md);
	list-style: none;
	margin: 0;
	padding: 0;
}

.course-gallery__item {
	flex: 0 0 calc((100% - var(--tc-space-md) * 2) / 3);
	margin: 0;
}

.course-gallery__img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--tc-radius-sm);
	background: var(--tc-bg-alt);
}

/* Loop variant: horizontal scroller */

.course-gallery.is-loop .course-gallery__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.course-gallery.is-loop .course-gallery__viewport::-webkit-scrollbar { display: none; }
.course-gallery.is-loop .course-gallery__item { scroll-snap-align: start; }

.course-gallery__controls {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: var(--tc-space-sm);
}

.course-gallery__nav {
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--tc-border);
	border-radius: 50%;
	background: var(--tc-bg);
	color: var(--tc-text);
	font-size: 1rem;
	cursor: pointer;
	transition: background var(--tc-transition), color var(--tc-transition), border-color var(--tc-transition);
}
.course-gallery__nav:hover {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}

@media (max-width: 700px) {
	.course-gallery__item { flex-basis: calc((100% - var(--tc-space-md)) / 2); }
}

@media (max-width: 480px) {
	.course-gallery__item { flex-basis: 85%; }
	.course-gallery__viewport {
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}
	.course-gallery__viewport::-webkit-scrollbar { display: none; }
	.course-gallery__item { scroll-snap-align: start; }
}

/* ---------- Related ---------- */

.related {
	padding-block: var(--tc-space-xl);
	border-top: 1px solid var(--tc-border);
	background: var(--tc-bg-alt);
}
.related__title { font-size: var(--tc-fs-h2); margin-bottom: var(--tc-space-lg); }
.related .card-grid { margin-bottom: 0; }
.related .card { background: var(--tc-bg); }

/* ---------- Pagination ---------- */

.pagination { margin-bottom: var(--tc-space-xl); }
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding-inline: 0.75rem;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius-sm);
	color: var(--tc-text);
	font-size: 0.9375rem;
	font-weight: 500;
}
.pagination .page-numbers:hover { border-color: var(--tc-accent); color: var(--tc-accent); }
.pagination .page-numbers.current {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}
.pagination .dots { border-color: transparent; }

/* ---------- Search / empty ---------- */

.search-form { display: flex; gap: 0.5rem; margin-bottom: var(--tc-space-lg); flex-wrap: wrap; }
.search-form__input {
	flex: 1 1 220px;
	padding: 0.75rem 1rem;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius-pill);
	font: inherit;
	font-size: 0.9375rem;
	background: var(--tc-bg);
	color: var(--tc-text);
}
.search-form__input:focus { border-color: var(--tc-accent); outline: none; }

.no-results {
	padding-block: var(--tc-space-xl);
	text-align: center;
	color: var(--tc-text-muted);
}
.no-results__title { font-size: var(--tc-fs-h2); color: var(--tc-text); }
.no-results .search-form { justify-content: center; max-width: 420px; margin-inline: auto; }

.error-404 { padding-block: var(--tc-page-top) var(--tc-space-xl); text-align: center; }

/* ---------- Comments ---------- */

.comments-area { margin-block: var(--tc-space-xl); }
.comments-area__title { font-size: var(--tc-fs-h3); }
.comment-list, .comment-list .children { list-style: none; padding-left: 0; }
.comment-list .children { padding-left: var(--tc-space-md); border-left: 2px solid var(--tc-border); }
.comment-list li { margin-bottom: var(--tc-space-md); }
.comment-body { padding: var(--tc-space-md); border: 1px solid var(--tc-border); border-radius: var(--tc-radius); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius-sm);
	font: inherit;
	background: var(--tc-bg);
	color: var(--tc-text);
}
.comment-form label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
.comment-form p { margin-bottom: var(--tc-space-sm); }

/* ---------- Footer ---------- */

.site-footer {
	margin-top: var(--tc-space-xl);
	padding-block: var(--tc-space-xl) var(--tc-space-md);
	background: var(--tc-footer-bg);
	color: #cfcac5;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--tc-accent); }
.site-footer h2, .site-footer .widget__title {
	color: #fff;
	font-size: 1rem;
	border-bottom: 0;
	padding-bottom: 0;
}
.site-footer .widget { background: transparent; padding: 0; margin-bottom: 0; }

/* ---------- Footer columns ---------- */

.footer-cols {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1.2fr 1.6fr;
	gap: var(--tc-space-lg);
	padding-bottom: var(--tc-space-lg);
}

@media (max-width: 1080px) {
	.footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.footer-cols { grid-template-columns: minmax(0, 1fr); gap: var(--tc-space-md); }
}

.footer-col { min-width: 0; }

.footer-col__title {
	margin: 0 0 var(--tc-space-sm);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.footer-col__desc {
	margin: var(--tc-space-sm) 0 0;
	max-width: 40ch;
	font-size: 0.9375rem;
	line-height: 1.75;
	color: #cfcac5;
}

.footer-col--brand .custom-logo {
	filter: brightness(0) invert(1);
	margin-bottom: var(--tc-space-xs);
}

.site-footer__name { font-size: 1.125rem; font-weight: 700; margin: 0 0 var(--tc-space-sm); }

.footer-col__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
}

.footer-col__list li + li { margin-top: 0.45rem; }

.footer-col__list a {
	color: #cfcac5;
	transition: color var(--tc-transition), padding-left var(--tc-transition);
}
.footer-col__list a:hover { color: #fff; padding-left: 4px; }

.footer-col__more {
	display: inline-flex;
	gap: 0.35rem;
	margin-top: var(--tc-space-sm);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--tc-accent);
}
.footer-col__more:hover { color: #fff; }

.footer-contact {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.footer-contact__item + .footer-contact__item { margin-top: 0.45rem; }
.footer-contact__item--address { color: #cfcac5; max-width: 34ch; }
.footer-contact a { color: #fff; }
.footer-contact a:hover { color: var(--tc-accent); }

.footer-map {
	margin-top: var(--tc-space-md);
	border-radius: var(--tc-radius-sm);
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
	aspect-ratio: 16 / 10;
}

.footer-map iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	filter: grayscale(0.35) contrast(1.05);
	transition: filter var(--tc-transition);
}
.footer-map:hover iframe { filter: none; }

.footer-col--brand .social-links { margin-top: var(--tc-space-md); }

/* Contact block */

.site-contact { font-size: 0.9375rem; line-height: 1.7; }
.site-contact p { margin: 0 0 0.35rem; }
.site-contact__address { color: #cfcac5; }

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: var(--tc-space-sm) 0 0;
	padding: 0;
}

.social-links__item {
	display: inline-block;
	padding: 0.3rem 0.8rem;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--tc-radius-pill);
	font-size: 0.8125rem;
	transition: background var(--tc-transition), border-color var(--tc-transition);
}
.social-links__item:hover {
	background: var(--tc-accent);
	border-color: var(--tc-accent);
	color: #fff;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--tc-space-sm);
	padding-top: var(--tc-space-md);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.875rem;
}
.site-footer__copy p { margin: 0; }
.menu--footer { display: flex; flex-wrap: wrap; gap: var(--tc-space-md); list-style: none; margin: 0; padding: 0; }

/* ---------- Widgets ---------- */

.widget { margin-bottom: var(--tc-space-lg); }
.widget__title { font-size: 1rem; margin-bottom: var(--tc-space-sm); }

/* ---------- Elementor interop ---------- */

.tc-built-with-elementor .page-default .entry-content > * + * { margin-top: 0; }
.tc-built-with-elementor .site-content { overflow-x: clip; }

/* Elementor Canvas / Full Width templates already strip header + footer. */

/* ---------- Sticky bottom call to action ---------- */

.sticky-cta {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 150;
	display: none;
	padding: 0.75rem var(--tc-gutter) calc(0.75rem + env(safe-area-inset-bottom, 0px));
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(160%) blur(12px);
	border-top: 1px solid var(--tc-border);
	transform: translateY(0);
	transition: transform 280ms var(--tc-transition, ease), opacity 200ms ease;
}

.sticky-cta__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	max-width: 520px;
	margin-inline: auto;
	padding: 1rem 1.5rem;
	border-radius: var(--tc-radius-pill);
	background: var(--tc-accent);
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	transition: background var(--tc-transition), transform var(--tc-transition);
}

.sticky-cta__btn:hover { background: var(--tc-accent-hover); color: #fff; }
.sticky-cta__btn:active { transform: scale(0.985); }

/* A long label truncates rather than stretching the bar past the screen. */
.sticky-cta__label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sticky-cta__arrow { flex: 0 0 auto; transition: transform var(--tc-transition); }
.sticky-cta__btn:hover .sticky-cta__arrow { transform: translateX(3px); }

/* Slides away while the reader scrolls down, comes back on the way up. */
.sticky-cta.is-hidden { transform: translateY(115%); }

/* Never sit on top of the full-screen menu. */
body.tc-menu-open .sticky-cta { transform: translateY(115%); }

/* The bar is a phone pattern; desktop gets the floating contact cluster. */
@media (max-width: 860px) {
	.sticky-cta { display: block; }
}

@media print {
	.sticky-cta { display: none !important; }
}

/* ---------- Floating contact cluster ---------- */

.tc-fab {
	position: fixed;
	right: clamp(16px, 2.5vw, 28px);
	bottom: clamp(16px, 2.5vw, 28px);
	z-index: 160;
	display: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;

	--tc-fab-size: 54px;
	--tc-fab-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop by default; the phone gets the sticky bar instead. */
@media (min-width: 861px) {
	.tc-fab { display: flex; }
}

/* Opt-in on phones — sits above the sticky bar. */
@media (max-width: 860px) {
	body.tc-fab-mobile .tc-fab {
		display: flex;
		bottom: calc(var(--tc-sticky-h, 84px) + 16px);
	}
}

.tc-fab__list {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tc-fab__item {
	opacity: 0;
	transform: translateY(14px) scale(0.8);
	pointer-events: none;
	transition:
		opacity 260ms var(--tc-fab-ease),
		transform 260ms var(--tc-fab-ease);
	/* Closing runs top-down, opening runs bottom-up. */
	transition-delay: calc((5 - var(--tc-i, 1)) * 24ms);
}

.tc-fab.is-open .tc-fab__item {
	opacity: 1;
	transform: none;
	pointer-events: auto;
	transition-delay: calc(var(--tc-i, 1) * 45ms);
}

.tc-fab__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tc-fab-size);
	height: var(--tc-fab-size);
	border-radius: 50%;
	background: var(--tc-ink);
	color: #fff;
	box-shadow: 0 6px 18px rgba(28, 27, 26, 0.28);
	transition: transform 200ms var(--tc-fab-ease), box-shadow 200ms var(--tc-fab-ease), filter 200ms ease;
}

.tc-fab__btn:hover {
	color: #fff;
	transform: scale(1.08);
	box-shadow: 0 10px 26px rgba(28, 27, 26, 0.34);
}

.tc-fab__btn:active { transform: scale(0.96); }

/* Brand colours so each channel is recognisable at a glance. */
.tc-fab__btn--facebook { background: #1877f2; }
.tc-fab__btn--messenger { background: linear-gradient(45deg, #0695ff 10%, #a334fa 60%, #ff6969 100%); }
.tc-fab__btn--line { background: #06c755; }
.tc-fab__btn--phone { background: var(--tc-accent); }
.tc-fab__btn--map { background: #34a853; }

.tc-fab__icon { display: flex; }

/* Label slides out on hover. */
.tc-fab__tip {
	position: absolute;
	right: calc(100% + 10px);
	white-space: nowrap;
	padding: 0.4rem 0.8rem;
	border-radius: var(--tc-radius-sm);
	background: var(--tc-ink);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
	opacity: 0;
	transform: translateX(8px);
	pointer-events: none;
	transition: opacity 180ms var(--tc-fab-ease), transform 180ms var(--tc-fab-ease);
}

.tc-fab__btn:hover .tc-fab__tip,
.tc-fab__btn:focus-visible .tc-fab__tip {
	opacity: 1;
	transform: none;
}

/* Trigger */

.tc-fab__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--tc-fab-size) + 6px);
	height: calc(var(--tc-fab-size) + 6px);
	border: 0;
	border-radius: 50%;
	background: var(--tc-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(224, 80, 60, 0.42);
	transition: transform 240ms var(--tc-fab-ease), background 200ms ease, box-shadow 240ms var(--tc-fab-ease);
}

.tc-fab__toggle:hover { background: var(--tc-accent-hover); transform: scale(1.06); }
.tc-fab.is-open .tc-fab__toggle { background: var(--tc-ink); transform: rotate(90deg); }

.tc-fab__toggle-icon {
	position: absolute;
	display: flex;
	transition: opacity 200ms var(--tc-fab-ease), transform 200ms var(--tc-fab-ease);
}

.tc-fab__toggle-icon--close { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.tc-fab.is-open .tc-fab__toggle-icon--open { opacity: 0; transform: scale(0.5); }
.tc-fab.is-open .tc-fab__toggle-icon--close { opacity: 1; transform: rotate(-90deg); }

/* Gentle nudge on load so it gets noticed once, then stops. */
@keyframes tc-fab-in {
	from { opacity: 0; transform: translateY(16px) scale(0.7); }
	to { opacity: 1; transform: none; }
}

.tc-fab__toggle { animation: tc-fab-in 420ms var(--tc-fab-ease) 600ms both; }

/* Out of the way of the full-screen menu. */
body.tc-menu-open .tc-fab { opacity: 0; pointer-events: none; }

@media print {
	.tc-fab { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.tc-fab__item,
	.tc-fab__btn,
	.tc-fab__toggle,
	.tc-fab__toggle-icon,
	.tc-fab__tip { transition: none; }

	.tc-fab__toggle { animation: none; }
	.tc-fab__btn:hover,
	.tc-fab__toggle:hover { transform: none; }
	.tc-fab.is-open .tc-fab__toggle { transform: none; }
}

/* ---------- Performance grid ---------- */

.perf-group { margin-bottom: var(--tc-space-xl); }

.perf-group__head { margin-bottom: var(--tc-space-lg); }

.perf-group__title {
	margin: 0;
	font-size: var(--tc-fs-h2);
}

.perf-group__desc {
	margin: var(--tc-space-xs) 0 0;
	max-width: 62ch;
	color: var(--tc-text-muted);
}

.perf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--tc-space-md) var(--tc-space-md);
}

.perf-card { display: flex; flex-direction: column; }

.perf-card__player {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--tc-radius-sm);
	overflow: hidden;
	background: #000;
}

.perf-card__play {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.perf-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 400ms var(--tc-transition), filter 260ms ease;
}

.perf-card__play:hover .perf-card__thumb { transform: scale(1.04); filter: brightness(0.85); }

.perf-card__badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.perf-card__badge-bg { fill: #212121; fill-opacity: 0.82; transition: fill-opacity 200ms ease; }

.perf-card__play:hover .perf-card__badge { transform: translate(-50%, -50%) scale(1.1); }
.perf-card__play:hover .perf-card__badge-bg { fill: #f00; fill-opacity: 1; }

.perf-card__play:focus-visible {
	outline: 3px solid var(--tc-accent);
	outline-offset: -3px;
}

/* Swapped in on click. */
.perf-card__player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.perf-card__body {
	padding-top: var(--tc-space-sm);
	text-align: center;
}

.perf-card__name {
	margin: 0;
	font-size: 1.0625em;
	font-weight: 700;
}

.perf-card__age {
	margin: 0.35rem 0 0;
	color: var(--tc-text-muted);
	font-size: 0.9375em;
}

@media (max-width: 600px) {
	.perf-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.perf-card__thumb,
	.perf-card__badge { transition: none; }
	.perf-card__play:hover .perf-card__thumb { transform: none; }
	.perf-card__play:hover .perf-card__badge { transform: translate(-50%, -50%); }
}

/* ---------- Preloader ---------- */

.tc-preloader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	opacity: 1;
	transition: opacity 420ms ease, visibility 420ms ease;
}

.tc-preloader.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.tc-preloader__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
}

.tc-preloader__logo {
	width: clamp(88px, 16vw, 130px);
	height: auto;
	animation: tc-pre-logo 1.6s cubic-bezier(0.45, 0, 0.15, 1) infinite;
}

/* A slow heartbeat rather than a spinner — it reads as brand, not as waiting. */
@keyframes tc-pre-logo {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(0.9); opacity: 0.6; }
}

.tc-preloader__bar {
	position: relative;
	display: block;
	width: 120px;
	height: 3px;
	border-radius: 999px;
	background: rgba(28, 27, 26, 0.1);
	overflow: hidden;
}

.tc-preloader__bar i {
	position: absolute;
	inset: 0;
	display: block;
	border-radius: inherit;
	background: var(--tc-accent);
	transform: translateX(-100%);
	animation: tc-pre-bar 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes tc-pre-bar {
	0% { transform: translateX(-100%); }
	60%, 100% { transform: translateX(100%); }
}

/* The page underneath does not scroll while the cover is up. */
body.tc-loading { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.tc-preloader__logo,
	.tc-preloader__bar i { animation: none; }
	.tc-preloader__bar i { transform: none; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
