/*!
 * Summit Taekwondo Lugano — design system
 * @layer tokens, base, layout, components, sections, utilities
 */

@layer tokens, base, layout, components, sections, utilities;

/* =========================================================================
   TOKENS
   ========================================================================= */
@layer tokens {
	:root {
		/* Colors — mirror theme.json's palette so non-block markup (header,
		   footer, forms, patterns' custom classNames) can use the same values. */
		--color-base: #FFFFFF;
		--color-ink: #111111;
		--color-gray-700: #4A4A4A;
		--color-gray-100: #F5F6F7;
		--color-line: #E4E6E8;
		--color-blue: #207CB0;
		--color-blue-hover: #1A6591;
		--color-red: #C9242B;
		--color-red-hover: #A31E26;
		--color-yellow: #EABE28;
		--color-green: #0E9546;
		--color-blue-text: #1B6A97;
		--color-green-text: #0B7538;
		--color-yellow-text: #8F6E0A;
		--color-navy-dark: #12303F;
		--color-error: #B71C22;

		--font-display: 'September-Heavy', 'Arial Black', 'Helvetica Neue', sans-serif;
		--font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

		--fs-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
		--fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
		--fs-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
		--fs-xl: clamp(1.375rem, 1.25rem + 0.6vw, 1.625rem);
		--fs-2xl: clamp(1.75rem, 1.5rem + 1.25vw, 2.25rem);
		--fs-display: clamp(2.25rem, 1.4rem + 4.5vw, 4.25rem);

		--space-10: 0.25rem;
		--space-20: 0.5rem;
		--space-30: 0.75rem;
		--space-40: 1rem;
		--space-50: 1.5rem;
		--space-60: clamp(2rem, 1.6rem + 2vw, 3rem);
		--space-70: clamp(3rem, 2.2rem + 4vw, 5rem);
		--space-80: clamp(4rem, 3rem + 5vw, 7rem);

		--container-wide: 1200px;
		--container-narrow: 720px;
		--container-pad: clamp(1.25rem, 4vw, 2.5rem);
		--header-h: 84px;
		--radius: 8px;
	}

	@media (max-width: 39.99em) {
		:root { --header-h: 60px; }
	}
}

/* =========================================================================
   BASE
   ========================================================================= */
@layer base {
	@font-face {
		font-family: 'September-Heavy';
		src: url('../fonts/september-heavy.woff2') format('woff2');
		font-weight: 400;
		font-style: normal;
		font-display: swap;
	}

	@font-face {
		font-family: 'Figtree';
		src: url('../fonts/figtree-var.woff2') format('woff2-variations');
		font-weight: 300 900;
		font-style: normal;
		font-display: swap;
	}

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

	html {
		-webkit-text-size-adjust: 100%;
		scroll-padding-top: calc(var(--header-h) + 16px);
		/* Reserves the scrollbar gutter consistently so viewport-edge insets
		   (the mobile drawer's `inset: … 0 0 0`) size against the same box
		   the page actually renders in — without this, browsers with a
		   space-reserving scrollbar (classic Windows Chrome/Firefox) make
		   fixed 0/0 insets ~15-20px wider than the visible page.
		   NOT overflow-x:hidden here — on the root <html> element that
		   breaks .site-header's `position: sticky` in most engines (it stops
		   being sticky relative to the viewport). That guard lives on body. */
		scrollbar-gutter: stable;
	}

	body {
		margin: 0;
		max-width: 100%;
		overflow-x: hidden;
		background: var(--color-base);
		color: var(--color-ink);
		font-family: var(--font-body);
		font-size: 1.0625rem;
		line-height: 1.65;
		-webkit-font-smoothing: antialiased;
		text-rendering: optimizeLegibility;
	}

	img, picture, video, svg { max-width: 100%; display: block; }
	button, input, textarea, select { font: inherit; color: inherit; }
	table { border-collapse: collapse; width: 100%; }
	figure { margin: 0; }

	h1, h2, h3, h4, h5, h6 { margin: 0 0 0.6em; font-weight: 400; }
	h1, h2 {
		font-family: var(--font-display);
		text-transform: uppercase;
		letter-spacing: 0.01em;
		font-weight: 400;
		line-height: 1.08;
	}
	h1 { font-size: var(--fs-display); }
	h2 { font-size: var(--fs-2xl); }
	h3 { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-xl); line-height: 1.3; }
	h4, h5, h6 { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-lg); line-height: 1.35; }

	p { margin: 0 0 1em; }
	p:last-child { margin-bottom: 0; }

	a {
		color: var(--color-ink);
		text-underline-offset: 0.15em;
		text-decoration-thickness: 1px;
		transition: background-color .12s ease, color .12s ease, box-shadow .12s ease;
	}
	/* Hover = blue highlight chip with WHITE text, sitewide (owner: nothing
	   may hover to red/dark text; white-on-color everywhere, matching the
	   nav treatment). :where() keeps specificity at zero so components with
	   their own hover styling stay in charge; the :not() list excludes the
	   contexts that must keep their own treatment (buttons, nav, social,
	   dark footer/sections, admin bar, logo and skip links).
	   color !important: see the note at the top of @layer components — WP's
	   unlayered global link-color rule otherwise wins over @layer rules. */
	/* NB: the :not() chain must stay ONE unbroken compound — a line break
	   inside :where() is a descendant combinator and changes the meaning. */
	a:where(:not(.btn):not(.wp-block-button__link):not(.primary-nav__link):not(.social-btn):not(.social-icons__link):not(.subnav__link):not(.skip-link):not(.site-header__logo):not(.contatti-map__directions):not(#wpadminbar *):not(.site-footer *):not(.section--dark *):not(.hero *)):hover {
		color: #fff !important;
		background: var(--color-blue);
		box-shadow: 0 0 0 3px var(--color-blue);
		border-radius: 3px;
		text-decoration: none;
	}

	ul, ol { padding-left: 1.25em; margin: 0 0 1em; }

	.screen-reader-text {
		position: absolute !important;
		width: 1px; height: 1px;
		margin: -1px; padding: 0; overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.skip-link {
		/* !important on both: WP core ALSO prints an inline, unlayered
		   `.screen-reader-text:focus{background-color:#ddd;color:#444}` — and
		   this link carries both classes — which otherwise beats this
		   layered rule on both properties (same root cause as the note at
		   the top of @layer components, here from a second unlayered
		   source, not just the global link-color rule). Without both
		   !importants the focused skip-link came out light-gray-on-gray
		   instead of white-on-ink. */
		background: var(--color-ink) !important;
		color: #fff !important;
		padding: 0.9rem 1.5rem;
		border-radius: 0 0 8px 0;
		font-weight: 700;
		text-decoration: none;
		z-index: 10000;
	}
	.skip-link:focus {
		position: fixed;
		top: 0; left: 0;
		width: auto; height: auto;
		margin: 0; overflow: visible;
		clip: auto;
		white-space: normal;
	}

	:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
		outline: 2px solid var(--color-ink);
		outline-offset: 2px;
		border-radius: 4px;
	}
	.site-footer :where(a, button):focus-visible,
	.section--dark :where(a, button, input, textarea, select):focus-visible,
	.hero :where(a, button):focus-visible {
		outline-color: #fff;
	}
}

/* =========================================================================
   LAYOUT
   ========================================================================= */
@layer layout {
	.container {
		width: 100%;
		max-width: var(--container-wide);
		margin-inline: auto;
		padding-inline: var(--container-pad);
	}
	.container--narrow { max-width: var(--container-narrow); }

	.site-main { display: block; }

	/* Minimal resets for WP's own block wrappers, used sparingly in patterns
	   and freely by the owner when editing content. */
	.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; list-style: none; }
	.wp-block-button { margin: 0; }
	.wp-block-group { display: block; }
}

/* =========================================================================
   COMPONENTS
   ========================================================================= */
@layer components {
	/* NOTE on `color … !important` throughout this file (components +
	   sections layers): WordPress core prints an UNLAYERED
	   `a:where(:not(.wp-element-button)){color:var(--wp--preset--color--ink)}`
	   rule (from this theme's theme.json) in `global-styles-inline-css`. Per
	   the CSS Cascade Layers spec, ANY unlayered author rule beats ANY
	   `@layer`-scoped rule for normal-weight declarations, regardless of
	   specificity — so every plain `color` set on an <a> anywhere in this
	   @layer-wrapped stylesheet was silently losing to that global ink
	   color (confirmed live: .btn--primary, the nav-cta pill, and footer
	   links were all rendering ink-black text despite `color: #fff` in
	   source). `!important` is the standard, minimal countermeasure —
	   flips the comparison to the important tier, where unlayered is
	   LOWEST priority, so our declarations win. Applied ONLY to `color` on
	   real <a> elements whose intended color is visibly non-ink (never to
	   `background`, which isn't affected, and never to non-anchor
	   elements like <svg>/<button>, which the WP selector doesn't match). */

	/* Buttons ------------------------------------------------------------ */
	.btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.5rem;
		padding: 0.85rem 1.75rem;
		border-radius: var(--radius);
		font-weight: 700;
		font-size: var(--fs-base);
		text-decoration: none;
		border: 2px solid transparent;
		cursor: pointer;
		transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
	}
	.btn--primary { background: var(--color-red); color: #fff !important; }
	.btn--primary:hover { background: var(--color-red-hover); color: #fff !important; }

	.btn--blue { background: var(--color-blue); color: #fff !important; }
	.btn--blue:hover { background: var(--color-blue-hover); color: #fff !important; }

	.btn--ghost { background: transparent; border-color: var(--color-ink); color: var(--color-ink); }
	.btn--ghost:hover { background: var(--color-ink); color: #fff !important; }
	/* Dark contexts (hero scrim, navy sections, footer): white outline instead. */
	.hero .btn--ghost,
	.section--dark .btn--ghost {
		border-color: #fff;
		color: #fff !important;
	}
	.hero .btn--ghost:hover,
	.section--dark .btn--ghost:hover {
		background: #fff;
		color: var(--color-ink);
	}

	/* Gutenberg's core/button block puts a custom className on the *wrapper*
	   (.wp-block-button), not the inner .wp-block-button__link — so "btn
	   btn--primary/ghost" set as a button block's className needs a
	   descendant selector to actually reach the visible link. The extra
	   compound specificity (0,3,0) also reliably beats the `:root :where()`
	   (0,1,0) global button-element style theme.json generates, regardless
	   of stylesheet load order. */
	.wp-block-button.btn--primary .wp-block-button__link,
	.wp-block-button.btn--blue .wp-block-button__link,
	.wp-block-button.btn--ghost .wp-block-button__link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0.85rem 1.75rem;
		border-radius: var(--radius);
		font-weight: 700;
		font-size: var(--fs-base);
		border: 2px solid transparent;
		transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	}
	.wp-block-button.btn--primary .wp-block-button__link { background: var(--color-red); color: #fff !important; }
	.wp-block-button.btn--primary .wp-block-button__link:hover { background: var(--color-red-hover); color: #fff !important; }
	.wp-block-button.btn--blue .wp-block-button__link { background: var(--color-blue) !important; color: #fff !important; }
	.wp-block-button.btn--blue .wp-block-button__link:hover { background: var(--color-blue-hover) !important; color: #fff !important; }
	.wp-block-button.btn--ghost .wp-block-button__link { background: transparent !important; border-color: var(--color-ink); color: var(--color-ink) !important; }
	.wp-block-button.btn--ghost .wp-block-button__link:hover { background: var(--color-ink) !important; color: #fff !important; }
	.hero .wp-block-button.btn--ghost .wp-block-button__link,
	.section--dark .wp-block-button.btn--ghost .wp-block-button__link {
		border-color: #fff !important;
		color: #fff !important;
	}
	.hero .wp-block-button.btn--ghost .wp-block-button__link:hover,
	.section--dark .wp-block-button.btn--ghost .wp-block-button__link:hover {
		background: #fff !important;
		color: var(--color-ink) !important;
	}

	.button-group { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }

	/* Age chips (editorial belt-stripe label) -------------------------------- */
	.age-chip {
		display: inline-flex;
		align-items: center;
		gap: 0.6rem;
		font-size: 0.8125rem;
		font-weight: 800;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--color-gray-700);
	}
	.age-chip::before {
		content: '';
		width: 22px;
		height: 4px;
		border-radius: 2px;
		background: var(--chip-accent, var(--color-blue));
	}

	/* Orari table ---------------------------------------------------------- */
	.orari-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
	.orari-table thead th {
		text-align: left;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		font-weight: 700;
		font-size: var(--fs-sm);
		padding: 0.75rem 1rem;
		border-bottom: 2px solid var(--color-ink);
	}
	.orari-table tbody td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--color-line); }
	.orari-table tbody td:first-child { font-weight: 700; }
	.orari-table tbody tr:nth-child(odd) { background: var(--color-gray-100); }
	/* Heavier top border wherever a new "Giorno" group starts. Tuned to the
	   fixed 9-row order (Lun x2, Mar x2, Mer x1, Gio x3, Ven x1) — revisit if
	   the table's row order/count ever changes. */
	.orari-table tbody tr:nth-child(1) td,
	.orari-table tbody tr:nth-child(3) td,
	.orari-table tbody tr:nth-child(5) td,
	.orari-table tbody tr:nth-child(6) td,
	.orari-table tbody tr:nth-child(9) td {
		border-top: 2px solid var(--color-ink);
	}
	@media (max-width: 29.99em) {
		.orari-table thead th, .orari-table tbody td { padding: 0.45rem 0.5rem; font-size: 0.8125rem; }
	}
	/* Dark variant, applied automatically inside a .section--dark band. */
	.section--dark .orari-table thead th { color: #fff; border-bottom-color: #fff; }
	.section--dark .orari-table tbody td { color: #E7EBEE; border-bottom-color: rgba(255,255,255,.15); }
	.section--dark .orari-table tbody td:first-child { color: #fff; }
	.section--dark .orari-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.06); }
	.section--dark .orari-table tbody tr:nth-child(1) td,
	.section--dark .orari-table tbody tr:nth-child(3) td,
	.section--dark .orari-table tbody tr:nth-child(5) td,
	.section--dark .orari-table tbody tr:nth-child(6) td,
	.section--dark .orari-table tbody tr:nth-child(9) td {
		border-top-color: #fff;
	}

	/* Orari weekly grid ------------------------------------------------------
	   Replaces .orari-table above (kept as dead code) with a day-columns /
	   half-hour-rows color grid, modeled on the owner's spreadsheet. Group
	   colors match the site's course colors (Piccoli/Medi/Grandi/Adulti);
	   Agonisti groups only exist in this timetable. */
	.orari-grid { overflow-x: auto; }
	.orari-grid table {
		width: 100%;
		min-width: 640px;
		border-collapse: separate;
		border-spacing: 4px;
		font-size: var(--fs-sm);
	}
	.orari-grid thead th {
		text-align: center;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		font-weight: 700;
		font-size: var(--fs-sm);
		padding: 0.75rem 1rem;
		border-bottom: 2px solid var(--color-ink);
	}
	/* !important x2: WP core's unlayered .wp-block-table styles draw a 3px
	   currentColor border under the whole thead (a white line on the dark
	   band) and a 1px border on every th, corner included. */
	.orari-grid table thead { border-bottom: none !important; }
	.orari-grid thead th.orari-grid__corner { border: none !important; }
	.orari-grid__time {
		text-align: right;
		white-space: nowrap;
		color: var(--color-gray-700);
		font-size: 0.8125rem;
		width: 1%;
		padding: 0.4rem 0.6rem;
	}
	/* Owner: every grid cell gets a black edge (spreadsheet-style gridlines).
	   !important: WP's unlayered .wp-block-table td/th border beats @layer
	   (same gotcha as the anchor colors, see the note at the top of this layer). */
	.orari-grid thead th:not(.orari-grid__corner),
	.orari-grid__time,
	.orari-grid__block,
	.orari-grid__empty { border: 2px solid var(--color-ink) !important; }
	.orari-grid__block {
		text-align: center;
		vertical-align: middle;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.02em;
		line-height: 1.25;
		padding: 0.5rem 0.75rem;
		color: #fff;
	}
	.orari-grid__block--grandi { background: var(--color-blue); }
	.orari-grid__block--piccoli { background: var(--color-yellow); color: var(--color-ink); }
	.orari-grid__block--medi { background: var(--color-green); }
	.orari-grid__block--adulti { background: var(--color-red); }
	.orari-grid__block--agonisti { background: var(--color-navy-dark); }
	.orari-grid__block--agonisti-tecnica {
		background: color-mix(in srgb, var(--color-red) 24%, white);
		color: var(--color-ink);
	}
	.orari-grid__empty { background: var(--color-gray-100); }
	@media (max-width: 29.99em) {
		.orari-grid thead th, .orari-grid__time, .orari-grid__block { padding: 0.45rem 0.5rem; }
		.orari-grid thead th, .orari-grid__block { font-size: 0.8125rem; }
	}
	/* Dark variant, applied automatically inside a .section--dark band. */
	.section--dark .orari-grid thead th { color: #fff; border-bottom-color: #fff; }
	.section--dark .orari-grid__time { color: rgba(255,255,255,.75); }
	.section--dark .orari-grid__empty { background: rgba(255,255,255,.06); }
	/* .section--dark's own background IS var(--color-navy-dark), so the
	   --agonisti block needs a lighter navy-blue here or it disappears into
	   the band; --agonisti-tecnica is a light tinted block and stays legible
	   as-is on the dark band. */
	.section--dark .orari-grid__block--agonisti { background: color-mix(in srgb, var(--color-blue) 40%, var(--color-navy-dark)); }

	/* Orari, phones (D23): the 6-column grid needs ~640px, so below 48em it is
	   replaced by this stacked per-day list — no horizontal scrolling. Same
	   group colors and black edges as the grid. */
	.orari-days { display: none; }
	@media (max-width: 47.99em) {
		.orari-grid { display: none; }
		.orari-days { display: grid; gap: 1.1rem; }
	}
	.orari-days__day { border: 2px solid var(--color-ink); background: #fff; }
	.orari-days__title {
		margin: 0;
		padding: 0.5rem 0.85rem;
		font-size: 0.8125rem;
		font-weight: 800;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		border-bottom: 2px solid var(--color-ink);
	}
	.orari-days__slot {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		margin: 0;
		padding: 0.6rem 0.85rem;
		font-size: var(--fs-sm);
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.02em;
		line-height: 1.25;
		color: #fff;
	}
	.orari-days__slot + .orari-days__slot { border-top: 2px solid var(--color-ink); }
	.orari-days__time {
		flex: 0 0 auto;
		min-width: 92px;
		font-weight: 600;
		font-variant-numeric: tabular-nums;
		text-transform: none;
		letter-spacing: 0;
	}
	.orari-days__slot--grandi { background: var(--color-blue); }
	.orari-days__slot--piccoli { background: var(--color-yellow); color: var(--color-ink); }
	.orari-days__slot--medi { background: var(--color-green); }
	.orari-days__slot--adulti { background: var(--color-red); }
	.orari-days__slot--agonisti { background: var(--color-navy-dark); }
	.orari-days__slot--agonisti-tecnica { background: color-mix(in srgb, var(--color-red) 24%, #fff); color: var(--color-ink); }
	/* Dark home band variant (mirrors the grid's dark treatment). */
	.section--dark .orari-days__day { background: transparent; }
	.section--dark .orari-days__title { color: #fff; background: rgba(255, 255, 255, 0.06); }
	.section--dark .orari-days__slot--agonisti { background: color-mix(in srgb, var(--color-blue) 40%, var(--color-navy-dark)); }

	/* Social icons ----------------------------------------------------------
	   Light-context default (used on the Contatti page info column); the
	   footer overrides to a dark-context look below. */
	.social-icons { list-style: none; display: flex; gap: 0.75rem; margin: 1.25rem 0 0; padding: 0; }
	.social-icons__link {
		width: 38px; height: 38px;
		border-radius: 50%;
		display: flex; align-items: center; justify-content: center;
		background: var(--color-gray-100);
		color: var(--color-ink);
		transition: background-color .15s ease, color .15s ease;
	}
	.social-icons__link:hover { background: var(--color-blue); color: #fff !important; }

	/* Social buttons (labeled pills, replace bare icon circles in most markup) */
	.social-btns { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.75rem; }
	.social-btn {
		display: inline-flex;
		align-items: center;
		gap: 0.6rem;
		padding: 0.7rem 1.35rem;
		border-radius: 999px;
		border: 1.5px solid var(--color-line);
		background: #fff;
		color: var(--color-ink);
		font-weight: 700;
		text-decoration: none;
		font-size: 1rem;
		transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	}
	.social-btn svg { width: 22px; height: 22px; }
	/* Subtle brand cue on the icon at rest; hover fills the whole pill and
	   forces the icon white too (specificity: the :hover/:focus-visible
	   variants below beat these on the svg's `color`). */
	.social-btn--instagram svg { color: #C13584; }
	.social-btn--tiktok svg { color: var(--color-ink); }
	.social-btn--instagram:hover,
	.social-btn--instagram:focus-visible { background: #C13584; border-color: #C13584; color: #fff !important; }
	.social-btn--instagram:hover svg,
	.social-btn--instagram:focus-visible svg { color: #fff; }
	.social-btn--tiktok:hover,
	.social-btn--tiktok:focus-visible { background: #111; border-color: #111; color: #fff !important; }
	.social-btn--tiktok:hover svg,
	.social-btn--tiktok:focus-visible svg { color: #fff; }

	/* Dark-context variant for the footer. */
	.site-footer .social-btn { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff !important; }
	/* var(--color-ink) is nearly the same near-black as the navy footer bg —
	   swap the TikTok glyph's resting tint to white so it stays legible;
	   Instagram's pink cue already reads fine on navy, left as-is. */
	.site-footer .social-btn--tiktok svg { color: #fff; }

	/* Page header band ------------------------------------------------------ */
	.page-header { background: var(--color-gray-100); padding-block: var(--space-60); margin-bottom: var(--space-60); }
	.page-header__title { margin-bottom: 0.4rem; }
	.page-header__intro { font-size: var(--fs-lg); color: var(--color-gray-700); max-width: 60ch; margin-bottom: 0; }

	/* "Il Taekwondo" section nav: sticky sidebar list on desktop (the old
	   site's sidebar layout, refreshed), horizontal scroller on small screens.
	   color !important vs WP's unlayered link rule (see @layer components). */
	.subnav--sidebar { background: #fff; border: 1px solid var(--color-line); border-radius: 16px; padding: 0.75rem 0; }
	.subnav__title { margin: 0; padding: 0.5rem 1.25rem 0.75rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-gray-700); }
	.subnav__list { list-style: none; margin: 0; padding: 0; }
	.subnav__item + .subnav__item { border-top: 1px solid var(--color-line); }
	.subnav__link {
		display: block;
		padding: 0.8rem 1.25rem;
		border-left: 3px solid transparent;
		font-weight: 600;
		color: var(--color-ink) !important;
		text-decoration: none;
		transition: color .15s ease, background-color .15s ease, border-color .15s ease;
	}
	.subnav__link:hover,
	.subnav__link:focus-visible { color: var(--color-blue) !important; background: rgba(32, 124, 176, 0.07); border-left-color: var(--color-blue); }
	.subnav__link.is-current { color: var(--color-blue) !important; border-left-color: var(--color-blue); background: rgba(32, 124, 176, 0.07); font-weight: 700; }
	@media (max-width: 63.99em) {
		.subnav--sidebar { border: 0; border-radius: 0; padding: 0; border-bottom: 1px solid var(--color-line); }
		.subnav__title { display: none; }
		.subnav__scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
		.subnav__list { display: flex; gap: 0.5rem; padding: 0.75rem 0; white-space: nowrap; }
		.subnav__item + .subnav__item { border-top: 0; }
		.subnav__link { border-left: 0; border-radius: 999px; padding: 0.5rem 1.1rem; background: var(--color-gray-100); font-size: var(--fs-sm); }
		.subnav__link:hover,
		.subnav__link:focus-visible,
		.subnav__link.is-current { background: var(--color-blue); color: #fff !important; border-left: 0; }
	}

	/* Taekwondo pages: sidebar + content. The page's full-width bands become
	   column-wide panels (tinted ones rounded) inside the content column. */
	.tkd-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: var(--space-70); }
	/* min-width:0 — grid items default to min-width:auto, so the nowrap pill
	   list's intrinsic width (~750px) propagated up and forced phones to zoom
	   out to a 768px layout viewport. This lets the scroller actually scroll. */
	.tkd-layout > * { min-width: 0; }
	@media (min-width: 64em) {
		.tkd-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 3rem; align-items: start; }
		.subnav--sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
	}
	.tkd-layout .section { padding-block: var(--space-50); }
	.tkd-layout .section > .container { max-width: none; padding-inline: 0; }
	.tkd-layout .section--tint { padding: var(--space-50); border-radius: 16px; }
	.tkd-layout__content > .section:first-child { padding-top: 0; }
	.tkd-layout__content > .section--tint:first-child { padding-top: var(--space-50); }

	/* Prose (inner-page content) --------------------------------------------- */
	.prose { max-width: var(--container-narrow); }
	.prose > :first-child { margin-top: 0; }
	.prose :where(h2, h3, h4) { margin-top: 1.8em; }
	.prose img { border-radius: 16px; }
	.prose .lead { font-size: var(--fs-lg); color: var(--color-gray-700); }
	.prose .wp-block-quote {
		border-left: 4px solid var(--color-red);
		margin: 1.5em 0;
		padding-left: 1.25rem;
		font-style: normal;
		font-size: var(--fs-lg);
	}
	.prose .alignright, .prose .alignleft { float: none; margin: 1.5rem 0; }
	@media (min-width: 48em) {
		.prose .alignright { float: right; width: 45%; margin: 0.25rem 0 1.5rem 2rem; }
		.prose .alignleft { float: left; width: 45%; margin: 0.25rem 2rem 1.5rem 0; }
	}

	/* Contact form 7 ---------------------------------------------------------
	   Field/label layout the theme controls itself (wpcf7_autop_or_not is off
	   and wpcf7_load_css is off — see inc/cf7.php). */
	.wpcf7-form { display: grid; gap: 1.15rem; margin-top: 1rem; max-width: 32rem; }
	.wpcf7-form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
	/* CF7 renders its hidden bookkeeping inputs inside a fieldset that would
	   otherwise paint the browser's default border as an empty strip. */
	.wpcf7-form .hidden-fields-container { display: none; }

	.wpcf7-form input[type="text"],
	.wpcf7-form input[type="email"],
	.wpcf7-form input[type="tel"],
	.wpcf7-form textarea {
		width: 100%;
		padding: 12px 14px;
		border: 1px solid #C9CDD1;
		border-radius: 8px;
		background: #fff;
		font: inherit;
		color: var(--color-ink);
	}
	.wpcf7-form textarea { min-height: 140px; resize: vertical; }
	.wpcf7-form input:focus-visible,
	.wpcf7-form textarea:focus-visible {
		outline: none;
		border-color: var(--color-ink);
		box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.15);
	}
	.wpcf7-form .wpcf7-acceptance { font-size: var(--fs-sm); font-weight: 400; }
	.wpcf7-form .wpcf7-list-item { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0; }
	.wpcf7-form .wpcf7-list-item-label { font-weight: 400; }
	.wpcf7-form input[type="checkbox"] { margin-top: 0.3em; width: 1.1em; height: 1.1em; flex: 0 0 auto; }
	.wpcf7-form .wpcf7-submit {
		justify-self: start;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0.85rem 1.75rem;
		border-radius: var(--radius);
		font-weight: 700;
		font-size: var(--fs-base);
		background: var(--color-red);
		color: #fff;
		border: 2px solid transparent;
		cursor: pointer;
	}
	.wpcf7-form .wpcf7-submit:hover { background: var(--color-red-hover); }
	/* Idle CF7 chrome must not show: the spinner only during submission, and
	   the response box only once it actually carries a message. */
	.wpcf7-form .wpcf7-spinner { margin-inline-start: 0.75rem; visibility: hidden; }
	.wpcf7-form.submitting .wpcf7-spinner { visibility: visible; }
	.wpcf7-form.init .wpcf7-response-output,
	.wpcf7-form .wpcf7-response-output:empty { display: none; }
	.wpcf7-not-valid-tip { display: block; color: var(--color-error); font-size: var(--fs-sm); font-weight: 600; margin-top: 0.35rem; }
	.wpcf7-form-control-wrap { display: block; }
	.wpcf7-response-output {
		margin: 0.25rem 0 0;
		padding: 0.85rem 1rem;
		border-radius: 8px;
		border: 1px solid var(--color-line);
		font-size: var(--fs-sm);
	}
	.wpcf7-mail-sent-ok { border-color: var(--color-green); background: color-mix(in srgb, var(--color-green) 12%, white); color: var(--color-green-text); }
	.wpcf7-validation-errors, .wpcf7-acceptance-missing, .wpcf7-mail-sent-ng {
		border-color: var(--color-error);
		background: rgba(183, 28, 34, 0.08);
		color: var(--color-error);
	}
}

/* =========================================================================
   SECTIONS
   ========================================================================= */
@layer sections {
	/* Some `color … !important` below — see the note at the top of
	   @layer components for why (WP's unlayered global link-color rule
	   otherwise wins over any @layer-scoped `color` on an <a>). */

	/* Header ---------------------------------------------------------------- */
	.site-header__sentinel { position: absolute; top: 0; width: 1px; height: 1px; }

	.site-header {
		position: sticky;
		top: 0;
		z-index: 500;
		height: var(--header-h);
		display: flex;
		align-items: center;
		background: var(--color-base);
		transition: box-shadow .2s ease;
	}
	.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(17, 17, 17, 0.1); }

	.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }

	.site-header__logo { display: flex; align-items: center; line-height: 0; }
	.site-header__logo-img--horizontal { height: 52px; width: auto; }
	.site-header__logo-img--mark { height: 36px; width: auto; display: none; }
	@media (max-width: 39.99em) {
		.site-header__logo-img--horizontal { display: none; }
		.site-header__logo-img--mark { display: block; }
	}

	/* Primary nav: the old site's menu, refreshed. Items span the full
	   header height; the current section (and hover) gets brand-blue text and
	   a 3px bar along the TOP edge of the header (the old Avada "highlight
	   border"); hover adds a light blue tint. WP marks the open section with
	   current-menu-item, and its parent with current-menu-ancestor/-parent on
	   sub-pages. color !important: WP's unlayered link rule (see @layer
	   components note). */
	.primary-nav { align-self: stretch; display: flex; }
	.primary-nav__list { list-style: none; display: flex; align-items: stretch; gap: 0.15rem; margin: 0; padding: 0; }
	.primary-nav__link {
		display: flex;
		align-items: center;
		height: var(--header-h);
		padding: 0 0.95rem;
		font-weight: 700;
		font-size: var(--fs-base);
		color: #333 !important;
		text-decoration: none;
		border-top: 3px solid transparent;
		border-radius: 0;
		transition: color .15s ease, border-color .15s ease, background-color .15s ease;
	}
	.primary-nav__link:hover,
	.primary-nav__link:focus-visible {
		color: var(--color-blue) !important;
		border-top-color: var(--color-blue);
		background: rgba(32, 124, 176, 0.07);
	}
	.primary-nav__list > li.current-menu-item > .primary-nav__link,
	.primary-nav__list > li.current-menu-ancestor > .primary-nav__link,
	.primary-nav__list > li.current-menu-parent > .primary-nav__link {
		color: var(--color-blue) !important;
		border-top-color: var(--color-blue);
	}

	.primary-nav__list li.menu-item-has-children { position: relative; }
	.primary-nav__list .sub-menu {
		list-style: none;
		margin: 0;
		padding: 0.5rem;
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 220px;
		background: #fff;
		border-radius: 10px;
		box-shadow: 0 16px 36px rgba(17, 17, 17, 0.16);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity .15s ease, transform .15s ease, visibility .15s;
	}
	.primary-nav__list li.menu-item-has-children:hover > .sub-menu,
	.primary-nav__list li.menu-item-has-children:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
	.sub-menu .primary-nav__link { height: auto; padding: 0.6rem 0.85rem; border-top: 0; border-radius: 6px; font-weight: 600; }
	.sub-menu .primary-nav__link:hover,
	.sub-menu .primary-nav__link:focus-visible,
	.sub-menu li.current-menu-item > .primary-nav__link {
		background: rgba(32, 124, 176, 0.08);
		color: var(--color-blue) !important;
	}

	/* "Contatti" stays a red pill CTA (owner: more noticeable), vertically
	   centred in the full-height row, exempt from the top-bar treatment. */
	.primary-nav__list li.nav-cta { display: flex; align-items: center; margin-left: 0.5rem; }
	.primary-nav__list li.nav-cta .primary-nav__link,
	.primary-nav__list > li.nav-cta.current-menu-item > .primary-nav__link {
		height: auto;
		padding: 0.6rem 1.35rem;
		border-top: 0;
		border-radius: 999px;
		background: var(--color-red);
		color: #fff !important;
	}
	.primary-nav__list li.nav-cta .primary-nav__link:hover,
	.primary-nav__list li.nav-cta .primary-nav__link:focus-visible {
		background: var(--color-red-hover);
		color: #fff !important;
		border-top: 0;
	}

	.menu-toggle {
		display: none;
		position: relative;
		width: 44px; height: 44px;
		align-items: center; justify-content: center;
		background: transparent;
		border: 0;
		color: var(--color-ink);
		cursor: pointer;
	}
	.menu-toggle__icon { position: absolute; inset: 0; margin: auto; }
	.menu-toggle__icon--close { display: none; }
	.menu-toggle[aria-expanded="true"] .menu-toggle__icon--open { display: none; }
	.menu-toggle[aria-expanded="true"] .menu-toggle__icon--close { display: block; }

	@media (max-width: 63.99em) {
		.menu-toggle { display: flex; }

		.primary-nav__list {
			position: fixed;
			inset: var(--header-h) 0 0 0;
			z-index: 400;
			flex-direction: column;
			align-items: stretch;
			gap: 0;
			background: #fff;
			padding: 1.5rem var(--container-pad) 2rem;
			overflow-y: auto;
			transform: translateX(100%);
			transition: transform .3s ease;
		}
		.primary-nav__list.is-open { transform: translateX(0); }

		.primary-nav { display: block; }
		.primary-nav__link { height: auto; padding: 0.9rem 0.85rem; border-top: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--color-line); border-radius: 0; }
		.primary-nav__link:hover,
		.primary-nav__link:focus-visible,
		.primary-nav__list > li.current-menu-item > .primary-nav__link,
		.primary-nav__list > li.current-menu-ancestor > .primary-nav__link,
		.primary-nav__list > li.current-menu-parent > .primary-nav__link {
			border-left-color: var(--color-blue);
			border-top-color: transparent;
		}

		.primary-nav__list li.nav-cta { margin: 1.25rem 0 0; }
		.primary-nav__list li.nav-cta .primary-nav__link {
			display: inline-flex;
			justify-content: center;
			padding: 0.7rem 1.5rem;
			border: 0;
		}

		.primary-nav__list .sub-menu {
			position: static;
			opacity: 1; visibility: visible; transform: none;
			box-shadow: none;
			background: transparent;
			padding: 0 0 0 1rem;
		}
		.sub-menu .primary-nav__link { border-bottom: 1px dashed var(--color-line); }


		body.nav-is-open { overflow: hidden; }
	}

	/* Hero -------------------------------------------------------------------- */
	.hero {
		position: relative;
		min-height: min(calc(100svh - var(--header-h)), 860px);
		display: flex;
		align-items: flex-end;
		overflow: hidden;
		color: #fff;
			background: linear-gradient(160deg, #16384A 0%, var(--color-navy-dark) 55%, #0A1A23 100%);
}
	/* Owner (D23): on phones the video band must not swallow the screen. */
	@media (max-width: 47.99em) {
		.hero { min-height: min(58svh, 480px); }
	}
	/* No poster image (owner request): the brand-navy gradient is the backdrop
	   until the video's first frame renders. */
	.hero__video {
		position: absolute; inset: 0; z-index: 1;
		display: block;
		width: 100%; height: 100%;
		object-fit: cover;
		opacity: 1;
		transition: opacity .8s ease;
	}
	.hero__video.is-playing { opacity: 1; }
	.hero__scrim {
		position: absolute; inset: 0; z-index: 2;
		background: linear-gradient(180deg, rgba(9, 19, 26, .35) 0%, rgba(9, 19, 26, .55) 55%, rgba(9, 19, 26, .88) 100%);
	}
	.hero__content { position: relative; z-index: 3; width: 100%; padding-block: var(--space-70) var(--space-60); }
	.hero__title { display: flex; flex-direction: column; gap: 0.05em; margin-bottom: 1.1rem; }
	.hero__title-line { font-size: var(--fs-display); line-height: 0.95; }
	.hero__tagline { font-size: var(--fs-lg); max-width: 46ch; color: rgba(255, 255, 255, 0.94); margin-bottom: 1.85rem; }
	.hero__ctas { display: flex; flex-wrap: wrap; gap: 1rem; }

	/* Section rhythm ------------------------------------------------------------ */
	.section { padding-block: var(--space-70); }
	.section--tint { background: var(--color-gray-100); }
	.section--dark { background: var(--color-navy-dark); color: #fff; }
	.section--dark h2, .section--dark h3 { color: #fff; }
	.section--dark a:not(.btn) { color: #fff !important; text-decoration: underline; text-underline-offset: .2em; }
	.section--dark a:not(.btn):hover { color: var(--color-yellow) !important; }

	.eyebrow {
		display: block;
		font-size: var(--fs-sm);
		font-weight: 600;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--color-red);
		margin-bottom: 0.6rem;
	}
	.section--dark .eyebrow { color: var(--color-yellow); }

	.section__head { max-width: 640px; margin-bottom: var(--space-50); }
	.section__head p { color: var(--color-gray-700); }
	.section--dark .section__head p { color: rgba(255, 255, 255, 0.82); }

	/* Chi siamo (2-col, 5/7) ------------------------------------------------------ */
	.chi-siamo__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
	@media (min-width: 64em) { .chi-siamo__grid { grid-template-columns: 5fr 7fr; gap: 4.5rem; } }
	.chi-siamo__media img { border-radius: 16px; }

	/* Valori (3 tinted-icon cards) -------------------------------------------------- */
	.valori__grid { display: grid; grid-template-columns: 1fr; gap: 2.25rem; }
	@media (min-width: 48em) { .valori__grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
	.valori-card { text-align: center; }
	.valori-card__icon {
		width: 64px; height: 64px;
		margin: 0 auto 1.25rem;
		border-radius: 50%;
		display: flex; align-items: center; justify-content: center;
		background: color-mix(in srgb, var(--v-accent, var(--color-blue)) 14%, white);
	}
	.valori-card__icon svg { width: 26px; height: 26px; color: var(--v-accent, var(--color-blue)); }
	/* Photo variant (replaced the tinted icons per owner request): small round
	   portrait with a soft accent ring; faces sit in the upper third of these
	   action shots, so bias the crop upward. */
	.valori-card__photo {
		width: 112px;
		height: 112px;
		margin: 0 auto 1.25rem;
		border-radius: 50%;
		overflow: hidden;
		border: 3px solid color-mix(in srgb, var(--v-accent, var(--color-blue)) 35%, white);
	}
	.valori-card__photo figure { margin: 0; height: 100%; }
	/* height !important: WP's unlayered global-styles img{height:auto} beats
	   any layered rule (see the layer note at the top of @layer components). */
	.valori-card__photo img { width: 100%; height: 100% !important; object-fit: cover; object-position: 50% 28%; }
	.valori-card--perseveranza { --v-accent: var(--color-blue); }
	.valori-card--autocontrollo { --v-accent: var(--color-green); }
	.valori-card--indomito { --v-accent: var(--color-red); }

	/* Cosa facciamo (gray band, checklist + photo duo) ------------------------------ */
	.cosa-facciamo__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
	@media (min-width: 64em) { .cosa-facciamo__grid { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
	.checklist { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; gap: 0.85rem; }
	.checklist li {
		position: relative;
		padding-left: 1.75rem;
	}
	.checklist li::before {
		content: '';
		position: absolute;
		left: 0; top: 0.2em;
		width: 20px; height: 20px;
		background-color: var(--color-green-text);
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19.5 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19.5 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	}
	/* Even side-by-side pair; both crops share the same 3:4 shape. */
	.photo-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
	.photo-duo img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
	.photo-duo__landscape img,
	.photo-duo__portrait img { aspect-ratio: 3 / 4; }

	/* Corsi (4-card grid) ------------------------------------------------------------ */
	.corsi__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
	.corsi-card {
		--card-accent: var(--color-blue);
		display: flex;
		flex-direction: column;
		background: #fff;
		border: 1px solid var(--color-line);
		border-top: 4px solid var(--card-accent);
		border-radius: 12px;
		overflow: hidden;
		transition: transform .2s ease, box-shadow .2s ease;
	}
	.corsi-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(17, 17, 17, .1); }
	.corsi-card--piccoli { --card-accent: var(--color-yellow); }
	.corsi-card--medi { --card-accent: var(--color-green); }
	.corsi-card--grandi { --card-accent: var(--color-blue); }
	.corsi-card--adulti { --card-accent: var(--color-red); }
	.corsi-card--piccoli .age-chip { --chip-accent: var(--color-yellow); }
	.corsi-card--medi .age-chip { --chip-accent: var(--color-green); }
	.corsi-card--grandi .age-chip { --chip-accent: var(--color-blue); }
	.corsi-card--adulti .age-chip { --chip-accent: var(--color-red); }
	.corsi-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
	/* The figure between the 4:3 box and the img has auto height, which made
	   percentage heights on the img resolve to auto (natural ratio): landscape
	   photos sat 26px short of the box while portrait ones filled it, so the
	   cards never cropped uniformly. Definite heights all the way down fix it.
	   margin !important: WP's unlayered figure margin (same gotcha as the
	   article-page kit, D19). */
	.corsi-card__media figure { height: 100% !important; margin: 0 !important; }
	/* !important: WP unlayered img{height:auto} beats @layer (see note above) */
	.corsi-card__media img { width: 100%; height: 100% !important; object-fit: cover; }
	/* Owner: the training pair sits left in this shot; bias the 4:3 window left so they
	   read further right, and zoom in so the pair fills the card (round 3.2). */
	.corsi-card--adulti .corsi-card__media img { object-position: 25% 50%; transform: scale(1.25); transform-origin: 57% 60%; }
	/* Owner round 3.3: the tight zoom read as "bigger than the others"; show the
	   full figure instead, head to the balance dome (band picked visually, P=62). */
	.corsi-card--medi .corsi-card__media img { object-position: 50% 62%; }
	.corsi-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
	.corsi-card__body h3 { margin-bottom: 0; }
	.corsi-card__schedule { font-size: var(--fs-sm); color: var(--color-gray-700); margin: 0; }
	.corsi-card__link { margin-top: auto; padding-block: 0.4rem; font-weight: 700; text-decoration: none; }
	/* Hover styling comes from the global blue-highlight link rule. */

	/* Corsi page (alternating detail sections, one per age group) --------------------- */
	.corsi-group { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; padding-block: var(--space-60); scroll-margin-top: calc(var(--header-h) + 16px); }
	.corsi-group + .corsi-group { border-top: 1px solid var(--color-line); }
	@media (min-width: 64em) {
		.corsi-group { grid-template-columns: 5fr 7fr; gap: 3.5rem; }
		.corsi-group--reverse { grid-template-columns: 7fr 5fr; }
		.corsi-group--reverse .corsi-group__media { order: 2; }
	}
	/* Uniform landscape frame for every group photo (the piccoli/medi source
	   files are portrait): 3:2 matches the landscape files' native ratio, so
	   those stay uncropped and the portraits crop to a face-biased band. */
	.corsi-group__media img { border-radius: 16px; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 35%; }
	/* Adulti group photo is the vertical fist-overhead pose: keep the raised fist
	   and face inside the 3:2 band (round 3.2). */
	.corsi-group--adulti .corsi-group__media img { object-position: 50% 12%; }
	.corsi-group__schedule {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		margin-top: 1rem;
		font-weight: 700;
		font-size: var(--fs-sm);
		color: var(--color-ink);
	}
	.corsi-group__schedule svg { width: 18px; height: 18px; }

	/* Galleria (scroll-snap strip) ----------------------------------------------------- */
	.galleria__wrap { position: relative; }
	.galleria__wrap::before, .galleria__wrap::after {
		content: '';
		position: absolute; top: 0; bottom: 0;
		width: 48px;
		pointer-events: none;
		z-index: 2;
	}
	.galleria__wrap::before { left: 0; background: linear-gradient(to right, var(--color-base), transparent); }
	.galleria__wrap::after { right: 0; background: linear-gradient(to left, var(--color-base), transparent); }
	.galleria__scroller {
		display: flex;
		gap: 1rem;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 0.5rem var(--container-pad) 1.5rem;
		margin-inline: calc(-1 * var(--container-pad));
	}
	.galleria__item {
		flex: 0 0 380px;
		aspect-ratio: 3 / 4;
		scroll-snap-align: start;
		border-radius: 16px;
		overflow: hidden;
	}
	.galleria__item img { width: 100%; height: 100%; object-fit: cover; }
	@media (max-width: 39.99em) { .galleria__item { flex-basis: 280px; } }
	.galleria__item--instagram {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.85rem;
		background: var(--color-gray-100);
		color: var(--color-ink);
		text-align: center;
		text-decoration: none;
		padding: 1.5rem;
	}
	.galleria__item--instagram svg { width: 32px; height: 32px; color: var(--color-red); }
	.galleria__item--instagram strong { font-size: var(--fs-lg); }

	/* Galleria page: uniform tile grid (3 per row on desktop, 2 on tablet,
	   1 on phones), grouped by theme. Equal 3:2 tiles so rows fill cleanly
	   regardless of source orientation; portraits crop with a face bias. */
	.galleria-page__intro { max-width: 60ch; }
	.galleria-page__group-title { margin: 2.75rem 0 1.25rem; }
	.galleria-page__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
	@media (max-width: 63.99em) { .galleria-page__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
	@media (max-width: 39.99em) { .galleria-page__grid { grid-template-columns: 1fr; } }
	.galleria-page__item { margin: 0; border-radius: 16px; overflow: hidden; background: var(--color-gray-100); }
	.galleria-page__item figure { margin: 0; }
	.galleria-page__item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 30%; display: block; }

	/* Orari (navy band) note ------------------------------------------------------------ */
	.orari-note {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		margin-top: var(--space-50);
		padding: 0.6rem 1.1rem;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.1);
		font-size: var(--fs-sm);
		font-weight: 600;
	}
	/* CTA button that replaces .orari-note above in the current pattern. Sits
	   in this same .section--dark band; the .btn--primary red-bg/white-text
	   !important pair (@layer components) already wins over .section--dark
	   a:not(.btn)'s yellow hover !important (components is declared before
	   sections, and !important reverses layer priority — see the layer note
	   at the top of @layer components), so no extra contrast override is
	   needed here. */
	.orari-cta { display: flex; justify-content: center; margin-top: 1.75rem; }
	/* Owner (D23): the CTA must unmistakably read as a pressable button —
	   elevation shadow, tactile bottom edge, hover lift, press-down. */
	.orari-cta .wp-block-button__link {
		/* !important: WP's unlayered :where(.wp-block-button__link){box-shadow:none} beats @layer (documented gotcha). */
		box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38), inset 0 -3px 0 rgba(0, 0, 0, 0.22) !important;
		transition: transform 0.15s ease, box-shadow 0.15s ease;
	}
	.orari-cta .wp-block-button__link:hover,
	.orari-cta .wp-block-button__link:focus-visible {
		transform: translateY(-2px);
		box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.22) !important;
	}
	.orari-cta .wp-block-button__link:active {
		transform: translateY(1px);
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.28) !important;
	}

	/* Contatti (2-col) ------------------------------------------------------------------ */
	.contatti__grid { display: grid; grid-template-columns: 1fr; gap: 2.75rem; }
	/* min-width:0 — the CF7 controls' intrinsic size/cols widths (~600px)
	   propagated through the min-width:auto grid items and made phones zoom
	   out to a 601px layout viewport. */
	.contatti__grid > * { min-width: 0; }
	@media (min-width: 64em) { .contatti__grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
	/* Contatti page: welcoming photo as a banner crop.
	   aspect-ratio governs the height even against WP's img{height:auto}. */
	.contatti-hero { margin-block: 1.75rem 2.5rem; }
	.contatti-hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 16px; }
	@media (max-width: 47.99em) { .contatti-hero img { aspect-ratio: 4 / 3; } }
	/* Full-bleed variant: sits directly inside the alignfull section, edge to
	   edge of the viewport, with the lead text below it inside the container. */
	/* Cancel the page-header band's bottom margin so the full-bleed banner
	   sits flush against it (no white gap); margin collapse pulls the whole
	   section up by exactly that amount. */
	.contatti-page { padding-top: 0; margin-top: calc(-1 * var(--space-60)); }
	.contatti-hero--bleed { margin: 0 0 var(--space-50); }
	.contatti-hero--bleed img { aspect-ratio: 21 / 8; object-position: 50% 30%; border-radius: 0; }
	@media (max-width: 63.99em) { .contatti-hero--bleed img { aspect-ratio: 16 / 9; } }
	@media (max-width: 47.99em) { .contatti-hero--bleed img { aspect-ratio: 4 / 3; } }
	.contatti-page .lead { max-width: 60ch; margin-bottom: 2.25rem; }
	/* Map lives in the info column (under the social buttons, beside the
	   form) rather than as a page-long band at the bottom. The column is a
	   flex stack and the map grows to the grid-stretched column bottom, so
	   its lower edge lines up with the form beside it. */
	.contatti-info { display: flex; flex-direction: column; }
	/* Fixed height tuned so the map's bottom edge lands level with the bottom
	   of the form's Messaggio textarea beside it (owner-drawn guide line) —
	   not with the checkbox/submit below it. Coupled to the form column's
	   desktop layout; retune if fields or type sizes change. */
	.contatti-info .contatti-map--embed { margin-top: 2rem; flex: none; aspect-ratio: auto; height: 363px; }
	@media (max-width: 63.99em) {
		.contatti-info { display: block; }
		/* height:auto — with the desktop 363px height still applying, the
		   16/10 aspect-ratio forced width to 581px and made phones zoom out. */
		.contatti-info .contatti-map--embed { aspect-ratio: 16 / 10; min-height: 0; height: auto; }
	}

	.contatti-info__row { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.75rem; }
	.contatti-info__icon {
		flex: 0 0 auto;
		width: 44px; height: 44px;
		border-radius: 12px;
		background: var(--color-gray-100);
		display: flex; align-items: center; justify-content: center;
	}
	.contatti-info__icon svg { width: 20px; height: 20px; color: var(--color-ink); }
	/* Transitional compat: the CURRENT (pre-reseed) markup still puts a bare
	   <svg> with no width/height attrs directly inside .contatti-info__row
	   (no .contatti-info__icon wrapper yet). Without an explicit size that
	   falls back to the browser's 300x150 default replaced-element size —
	   a real visual break. `>` (direct child) scopes this ONLY to that old
	   shape, so it's automatically inert once the reseed adds the
	   .contatti-info__icon wrapper (svg is no longer a direct child then). */
	.contatti-info__row > svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 0.2em; color: var(--color-ink); }
	.contatti-info__label {
		display: block;
		font-size: 0.75rem;
		font-weight: 800;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--color-gray-700);
		margin-bottom: 0.15rem;
	}
	.contatti-info__row p { margin: 0; }
	.contatti-info__text p { font-weight: 600; margin: 0; }
	.contatti-map { margin-top: 1.75rem; border-radius: 16px; overflow: hidden; border: 1px solid var(--color-line); background: #fff; }
	.contatti-map img { width: 100%; }
	.contatti-map figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.9rem; font-size: var(--fs-sm); color: var(--color-gray-700); }

	/* New full-width map embed, sibling AFTER .contatti__grid. Declared after
	   .contatti-map above so it wins on shared properties (margin-top,
	   border-radius, border) when an element carries both classes — same
	   specificity (one class each), so source order decides. */
	.contatti-map--embed {
		margin-top: 3rem;
		border-radius: 16px;
		overflow: hidden;
		border: 1px solid var(--color-line);
		aspect-ratio: 16 / 7;
	}
	@media (max-width: 47.99em) {
		.contatti-map--embed { aspect-ratio: 4 / 3; }
	}
	.contatti-map--embed iframe { width: 100%; height: 100%; border: 0; display: block; }
	/* Directions: a real pill button, centered under the map (width fits the
	   label, never a full row — its hover is scoped here, and the class is
	   excluded from the global link-hover chip). color !important: WP's
	   unlayered link rule (see @layer components note). */
	.contatti-map__directions {
		display: flex;
		width: fit-content;
		margin: 1.25rem auto 0;
		align-items: center;
		gap: 0.4rem;
		padding: 0.85rem 1.75rem;
		border-radius: 999px;
		background: var(--color-blue);
		color: #fff !important;
		font-weight: 700;
		text-decoration: none;
		transition: background-color .15s ease;
	}
	.contatti-map__directions:hover {
		background: var(--color-blue-hover);
		color: #fff !important;
		box-shadow: none;
		border-radius: 999px;
		text-decoration: none;
	}

	/* Chi siamo page (wide: alternating text/photo bands + instructor cards) ------------ */
	.chi-siamo-page .lead { font-size: var(--fs-lg); color: var(--color-gray-700); }
	.chi-siamo-page p { max-width: 62ch; }
	.chi-siamo-page__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
	@media (min-width: 64em) {
		.chi-siamo-page__grid { grid-template-columns: 7fr 5fr; gap: 4rem; }
		.chi-siamo-page__grid--even { grid-template-columns: 1fr 1fr; }
	}
	.chi-siamo-page__media figure { margin: 0; }
	.chi-siamo-page__media img { width: 100%; border-radius: 16px; }
	/* Two stacked landscape photos (obiettivi band) fill the column height. */
	.chi-siamo-page__media--stack { display: grid; gap: 1rem; }
	.chi-siamo-page .checklist { margin-bottom: 2rem; }
	.chi-siamo-page h3 { margin-top: 0.5rem; }
	/* Instructors: photo column stays in view while the four bios scroll. */
	.istruttori__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; margin-top: 2rem; }
	@media (min-width: 64em) {
		.istruttori__grid { grid-template-columns: 5fr 7fr; gap: 4rem; }
		.istruttori__media { position: sticky; top: calc(var(--header-h) + 24px); }
	}
	.istruttori__media figure { margin: 0; }
	.istruttori__media img { width: 100%; border-radius: 16px; }
	/* Founders-only variant (no photo column): the two cards sit side by side. */
	.istruttori__list--duo { display: grid; grid-template-columns: 1fr; gap: 2.75rem; margin-top: 2rem; }
	@media (min-width: 64em) {
		.istruttori__list--duo { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
	}
	.istruttori__list--duo .istruttore + .istruttore { margin-top: 0; }
	.istruttore { padding-top: 1.5rem; border-top: 4px solid var(--i-accent, var(--color-blue)); }
	.istruttore + .istruttore { margin-top: 2.75rem; }
	.istruttore h3 { margin: 0 0 0.25rem; }
	.istruttore__role {
		margin: 0 0 0.85rem;
		font-size: var(--fs-sm);
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--color-gray-700);
	}
	.istruttore--1 { --i-accent: var(--color-blue); }
	.istruttore--2 { --i-accent: var(--color-red); }
	.istruttore--3 { --i-accent: var(--color-green); }
	.istruttore--4 { --i-accent: var(--color-yellow); }

	/* Corsi page (wide: intro band, alternating age-group rows, CTA band) --------------- */
	.corsi-page .lead { font-size: var(--fs-lg); color: var(--color-gray-700); }
	.corsi-page p { max-width: 62ch; }
	.corsi-page__intro { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
	@media (min-width: 64em) { .corsi-page__intro { grid-template-columns: 7fr 5fr; gap: 4rem; } }
	.corsi-page__media figure { margin: 0; }
	.corsi-page__media img { width: 100%; border-radius: 16px; }
	.corsi-page .section__head { margin-bottom: 0; }
	.corsi-page .corsi-group:first-of-type { border-top: 0; }
	.corsi-group .age-chip { margin: 0 0 0.85rem; }
	.corsi-group__body h3 { font-size: var(--fs-2xl); margin-bottom: 0.6rem; }
	.corsi-group--piccoli { --chip-accent: var(--color-yellow); }
	.corsi-group--medi { --chip-accent: var(--color-green); }
	.corsi-group--grandi { --chip-accent: var(--color-blue); }
	.corsi-group--adulti { --chip-accent: var(--color-red); }
	/* Closing CTA band: centered copy + two buttons. */
	.corsi-page__cta { text-align: center; }
	.corsi-page__cta p { margin-inline: auto; }
	.corsi-page__cta .wp-block-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1.75rem; }

	/* Article pages: shared wide band kit used by every inner page --------------------- */
	.article-page .lead { font-size: var(--fs-lg); color: var(--color-gray-700); }
	.article-page p, .article-page li { max-width: 62ch; }
	.article-page .section__head { margin-bottom: 2rem; }
	.article-page__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
	@media (min-width: 64em) {
		.article-page__grid { grid-template-columns: 7fr 5fr; gap: 4rem; }
		.article-page__grid--reverse { grid-template-columns: 5fr 7fr; }
		.article-page__grid--reverse > .article-page__media { order: -1; }
		.article-page__grid--even { grid-template-columns: 1fr 1fr; }
	}
	/* !important: WP's unlayered figure.wp-block-image margin otherwise wins and
	   leaves a gap under every stacked photo. */
	.article-page__media figure { margin: 0 !important; }
	.article-page__media img { width: 100%; border-radius: 16px; }
	.article-page__media--stack { display: grid; gap: 1rem; }
	/* Portrait slot: a vertical photo cropped to 3:4 so the band stays compact. */
	.article-page__media--portrait img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; }
	/* Landscape slot: a portrait source cropped to 3:2 beside a short text block. */
	.article-page__media--landscape img { aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 45%; }
	/* Fill variants: the photo column follows the TEXT column's own height.
	   The images are absolutely positioned inside their figures so their
	   natural height never inflates the grid row (which would stretch the
	   text cell instead); the row is sized by the text, the stretched photo
	   column splits that height, and each image covers its slot.
	   height !important vs WP's unlayered img{height:auto}. */
	.article-page__grid--fill,
	.article-page__grid:has(> .article-page__media--fill),
	.article-page__grid:has(> .article-page__media--fill-first) { align-items: stretch; }
	.article-page__media--fill,
	.article-page__media--fill-first { min-height: 0; }
	.article-page__media--fill > figure,
	.article-page__media--fill-first > figure:first-child { position: relative; min-height: 0; }
	.article-page__media--fill:not(.article-page__media--stack) > figure { height: 100%; }
	.article-page__media--fill > figure > img,
	.article-page__media--fill-first > figure:first-child > img {
		position: absolute; inset: 0;
		width: 100%; height: 100% !important;
		object-fit: cover; object-position: 50% 30%;
	}
	/* Stack + fill: the photos share the text height equally. */
	.article-page__media--stack.article-page__media--fill { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1rem; }
	/* Stack where only the FIRST photo flexes and the last keeps its natural
	   ratio, so the stack still ends level with the text. */
	.article-page__media--stack.article-page__media--fill-first { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1rem; }
	@media (max-width: 63.99em) {
		.article-page__media--fill > figure,
		.article-page__media--fill-first > figure:first-child { height: auto; }
		.article-page__media--fill > figure > img,
		.article-page__media--fill-first > figure:first-child > img { position: static; height: auto !important; aspect-ratio: 3 / 2; }
		.article-page__media--stack.article-page__media--fill,
		.article-page__media--stack.article-page__media--fill-first { grid-auto-rows: auto; grid-template-rows: none; }
	}
	.article-page__prose { max-width: 72ch; }
	.article-page__prose p { max-width: none; }
	.article-page__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
	.article-card { --card-accent: var(--color-blue); background: #fff; border: 1px solid var(--color-line); border-top: 4px solid var(--card-accent); border-radius: 12px; padding: 1.5rem; }
	.article-card :is(h3, h4) { margin: 0 0 0.6rem; }
	.article-card p { max-width: none; }
	.article-card p:last-child { margin-bottom: 0; }
	.article-card--blue { --card-accent: var(--color-blue); }
	.article-card--red { --card-accent: var(--color-red); }
	.article-card--yellow { --card-accent: var(--color-yellow); }
	.article-card--green { --card-accent: var(--color-green); }
	.article-page .orari-table { margin-top: 1.5rem; }

	/* Footer ------------------------------------------------------------------------------ */
	.site-footer { background: var(--color-navy-dark); color: #fff; padding-top: var(--space-70); }
	.site-footer a { color: #fff !important; }
	.site-footer a:hover { color: var(--color-yellow) !important; }
	.site-footer__grid {
		display: grid;
		grid-template-columns: 1fr;
		gap: 2.5rem;
		padding-bottom: var(--space-60);
		border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	}
	@media (min-width: 56em) { .site-footer__grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 3rem; } }
	.site-footer__badge { margin-bottom: 1rem; }
	.site-footer__tagline { color: rgba(255, 255, 255, 0.75); max-width: 30ch; margin-bottom: 0; }
	/* Google Maps embed under the brand tagline (owner request). */
	.footer-map {
		margin-top: 1.25rem;
		max-width: 420px;
		aspect-ratio: 16 / 10;
		border-radius: 12px;
		overflow: hidden;
		border: 1px solid rgba(255, 255, 255, 0.18);
	}
	.footer-map iframe { width: 100%; height: 100%; border: 0; display: block; }
	.site-footer__heading {
		font-family: var(--font-body);
		font-size: var(--fs-sm);
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: rgba(255, 255, 255, 0.6);
		margin-bottom: 1rem;
	}
	.site-footer__address { font-style: normal; }
	.site-footer__address p { margin: 0 0 0.5rem; }
	.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
	.site-footer .social-icons__link { background: rgba(255, 255, 255, 0.1); color: #fff !important; }
	.site-footer .social-icons__link:hover { background: var(--color-blue); color: #fff !important; }

	.site-footer__legal { padding-block: 1.25rem; }
	.site-footer__legal-inner {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem 1.5rem;
		font-size: var(--fs-sm);
		color: rgba(255, 255, 255, 0.65);
	}
	.site-footer__copy { margin: 0; }
	.footer-legal__list { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
	.footer-legal__list a, .footer-legal__cookie-link {
		color: rgba(255, 255, 255, 0.65) !important;
		text-decoration: underline;
		text-underline-offset: 0.2em;
	}
	.footer-legal__list a:hover, .footer-legal__cookie-link:hover { color: #fff !important; }
	/* Comfortable thumb targets for the dense footer link lists on touch layouts. */
	@media (max-width: 63.99em) {
		.site-footer__links a,
		.footer-legal__list a,
		.footer-legal__cookie-link,
		.site-footer__brand p a,
		.site-footer address a { display: inline-block; padding-block: 0.4rem; }
	}

	/* 404 ------------------------------------------------------------------------------------ */
	.error-404 { text-align: left; }
}

/* =========================================================================
   UTILITIES
   ========================================================================= */
@layer utilities {
	@media (prefers-reduced-motion: reduce) {
		*, *::before, *::after {
			animation-duration: 0.001ms !important;
			animation-iteration-count: 1 !important;
			transition-duration: 0.001ms !important;
			scroll-behavior: auto !important;
		}
		html { scroll-behavior: auto; }
		.corsi-card:hover { transform: none; }
		.primary-nav__list { transition: none !important; }
		.hero__video { transition: none !important; }
		.skip-link { transition: none !important; }
	}

	@media print {
		.site-header, .menu-toggle, .hero__video, .hero__scrim,
		.site-footer, .subnav, .skip-link, .cmplz-manage-consent {
			display: none !important;
		}
		.hero { min-height: auto; color: var(--color-ink); }
		body { background: #fff; color: #000; }
		a { color: #000; text-decoration: underline; }
	}
}
