:root {
	--radius: 1rem;

	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

	/* Tailwind's default palette shades used by the schedule category badges
	   (besecureJS.CAT_COLOR_CLASSES in js/main.js) — same oklch values as the
	   real besecure-2026-nowy build output. */
	--color-red-300: oklch(80.8% 0.114 19.571);
	--color-red-400: oklch(70.4% 0.191 22.216);
	--color-red-500: oklch(63.7% 0.237 25.331);
	--color-orange-300: oklch(83.7% 0.128 66.29);
	--color-orange-500: oklch(70.5% 0.213 47.604);
	--color-amber-300: oklch(87.9% 0.169 91.605);
	--color-amber-500: oklch(76.9% 0.188 70.08);
	--color-emerald-300: oklch(84.5% 0.143 164.978);
	--color-emerald-500: oklch(69.6% 0.17 162.48);
	--color-teal-300: oklch(85.5% 0.138 181.071);
	--color-teal-500: oklch(70.4% 0.14 182.503);
	--color-sky-300: oklch(82.8% 0.111 230.318);
	--color-sky-500: oklch(68.5% 0.169 237.323);
	--color-indigo-300: oklch(78.5% 0.115 274.713);
	--color-indigo-500: oklch(58.5% 0.233 277.117);
	--color-fuchsia-300: oklch(83.3% 0.145 321.434);
	--color-fuchsia-500: oklch(66.7% 0.295 322.15);

	--background: oklch(0.14 0.02 240);
	--surface: oklch(0.18 0.025 235);
	--surface-2: oklch(0.22 0.03 230);
	--foreground: oklch(0.97 0.005 240);

	--card: oklch(0.18 0.025 235);
	--card-foreground: oklch(0.97 0.005 240);

	--muted: oklch(0.24 0.02 235);
	--muted-foreground: oklch(0.74 0.03 230);

	--primary: oklch(0.79 0.14 213);
	--primary-foreground: oklch(0.14 0.02 240);
	--primary-glow: oklch(0.86 0.11 200);

	--accent: oklch(0.68 0.16 220);
	--accent-foreground: oklch(0.14 0.02 240);

	--border: oklch(1 0 0 / 8%);
	--ring: oklch(0.79 0.14 213);

	--gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-glow));
	--gradient-hero: radial-gradient(circle at 20% 20%, oklch(0.79 0.14 213 / 0.28), transparent 60%),
		radial-gradient(circle at 80% 80%, oklch(0.68 0.16 220 / 0.22), transparent 55%);
	--shadow-glow: 0 20px 60px -20px oklch(0.79 0.14 213 / 0.55);
	--shadow-elegant: 0 30px 80px -30px oklch(0 0 0 / 0.6);
}

* {
	border-color: var(--border);
}

/* besecure-2026-nowy hardcodes <strong className="text-foreground"> inside
   several text-muted-foreground paragraphs (about/pact/community) to
   brighten specific emphasized phrases. ACF wysiwyg content can't carry that
   utility class per-span, so approximate the same effect for any <strong>
   an editor adds inside these body-copy blocks. */
.text-muted-foreground strong {
	color: var(--foreground);
}

/* Manual fallbacks for hover/group-hover + opacity-modifier utilities on
   custom (var()-indirected) theme colors: the Tailwind CDN's runtime JIT
   (@tailwindcss/browser) fails to generate the color-mix() rule for this
   combo, even though the same utility compiles correctly in a real build
   (besecure-2026-nowy). One rule per class actually used in the theme. */
.hover\:border-primary\/40:hover {
	border-color: color-mix(in oklab, var(--primary) 40%, transparent);
}
.hover\:border-primary\/50:hover {
	border-color: color-mix(in oklab, var(--primary) 50%, transparent);
}
.hover\:bg-primary\/10:hover {
	background-color: color-mix(in oklab, var(--primary) 10%, transparent);
}
.hover\:bg-surface-2\/60:hover {
	background-color: color-mix(in oklab, var(--surface-2) 60%, transparent);
}
.group:hover .group-hover\:bg-primary\/20 {
	background-color: color-mix(in oklab, var(--primary) 20%, transparent);
}
.group:hover .group-hover\:text-primary\/40 {
	color: color-mix(in oklab, var(--primary) 40%, transparent);
}

/* Schedule stage tabs (section-schedule.php + js/main.js besecureJS.schedule):
   ".is-active" is a plain JS hook class, not a Tailwind utility, so it needs
   real CSS to reproduce the gradient active-tab state from the design
   (bg-gradient-to-r from-primary to-accent + shadow-glow). */
.schedule-tab.is-active {
	background: linear-gradient(to right, var(--primary), var(--accent));
	color: var(--primary-foreground);
	box-shadow: var(--shadow-glow);
}

/* Schedule category badges (js/main.js besecureJS.CAT_COLOR_CLASSES): these
   classes are injected dynamically via addClass() after page load, so they
   rely on the Tailwind CDN's MutationObserver-based JIT re-scan rather than
   the initial static-HTML scan — same fragility class as the is-active tab
   fix above, so guard all of them with plain-CSS fallbacks. */
.bg-red-500\/15 {
	background-color: color-mix(in oklab, var(--color-red-500) 15%, transparent);
}
.text-red-300 {
	color: var(--color-red-300);
}
.border-red-500\/30 {
	border-color: color-mix(in oklab, var(--color-red-500) 30%, transparent);
}
.bg-orange-500\/15 {
	background-color: color-mix(in oklab, var(--color-orange-500) 15%, transparent);
}
.text-orange-300 {
	color: var(--color-orange-300);
}
.border-orange-500\/30 {
	border-color: color-mix(in oklab, var(--color-orange-500) 30%, transparent);
}
.bg-amber-500\/15 {
	background-color: color-mix(in oklab, var(--color-amber-500) 15%, transparent);
}
.text-amber-300 {
	color: var(--color-amber-300);
}
.border-amber-500\/30 {
	border-color: color-mix(in oklab, var(--color-amber-500) 30%, transparent);
}
.bg-emerald-500\/15 {
	background-color: color-mix(in oklab, var(--color-emerald-500) 15%, transparent);
}
.text-emerald-300 {
	color: var(--color-emerald-300);
}
.border-emerald-500\/30 {
	border-color: color-mix(in oklab, var(--color-emerald-500) 30%, transparent);
}
.bg-teal-500\/15 {
	background-color: color-mix(in oklab, var(--color-teal-500) 15%, transparent);
}
.text-teal-300 {
	color: var(--color-teal-300);
}
.border-teal-500\/30 {
	border-color: color-mix(in oklab, var(--color-teal-500) 30%, transparent);
}
.bg-sky-500\/15 {
	background-color: color-mix(in oklab, var(--color-sky-500) 15%, transparent);
}
.text-sky-300 {
	color: var(--color-sky-300);
}
.border-sky-500\/30 {
	border-color: color-mix(in oklab, var(--color-sky-500) 30%, transparent);
}
.bg-indigo-500\/15 {
	background-color: color-mix(in oklab, var(--color-indigo-500) 15%, transparent);
}
.text-indigo-300 {
	color: var(--color-indigo-300);
}
.border-indigo-500\/30 {
	border-color: color-mix(in oklab, var(--color-indigo-500) 30%, transparent);
}
.bg-fuchsia-500\/15 {
	background-color: color-mix(in oklab, var(--color-fuchsia-500) 15%, transparent);
}
.text-fuchsia-300 {
	color: var(--color-fuchsia-300);
}
.border-fuchsia-500\/30 {
	border-color: color-mix(in oklab, var(--color-fuchsia-500) 30%, transparent);
}

/* Loading overlay + spinner: toggle the data-loading attribute (values
   "true"/"false") on any relatively-positioned container to show/hide it.
   Originally built for #schedule-app (js/main.js besecureJS.schedule
   fetchAndRender, ported from besecure_old's css/schedule-ext.css) and
   reused for #event-modal (besecureJS.scheduleModal) while its REST call
   is in flight. */
[data-loading]::after {
	content: '';
	opacity: 0;
	background: color-mix(in oklab, var(--background) 85%, transparent);
	position: absolute;
	inset: 0;
	min-height: 200px;
	border-radius: calc(var(--radius) + 8px);
	z-index: -1;
	transition: opacity 0.4s;
}
[data-loading="true"]::after {
	opacity: 1;
	z-index: 991;
}
[data-loading]::before {
	content: '';
	opacity: 0;
	width: 40px;
	height: 40px;
	border: 3px solid color-mix(in oklab, var(--primary) 25%, transparent);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: schedule-spin 0.75s linear infinite;
	position: absolute;
	top: calc(50% - 20px);
	left: calc(50% - 20px);
	z-index: -1;
	transition: opacity 0.4s;
}
[data-loading="true"]::before {
	opacity: 1;
	z-index: 992;
}

/* #page-loader (footer.php) reuses the [data-loading] overlay+spinner above,
   just fixed to the viewport instead of a container — see besecureJS.pageLoader
   (js/main.js), used when the trigger that started the load (e.g. a schedule
   row) can be scrolled out of view. It's pointer-events-none at rest (it's a
   full-viewport div sitting at z-[9999], so without this it would swallow
   every click on the page, loading or not) and only blocks input while
   actually loading. */
#page-loader[data-loading="true"] {
	pointer-events: auto;
}

.event-modal-popup .fancybox__content {
	max-width: 60vw;
	width: 100%;
	padding: 2rem;
	border-radius: calc(var(--radius) + 12px);
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--foreground);
}
.event-modal-popup .event-modal-cat {
	display: inline-flex;
	width: auto;
	flex: none;
}
@keyframes schedule-spin {
	to { transform: rotate(360deg); }
}

/* Generic page/post content (template-parts/content-page.php, content.php):
   the_content() renders bare editor HTML with no utility classes attached,
   and this theme has no typography plugin loaded, so it needs real CSS
   instead of Tailwind — using the same tokens as the rest of the design. */
.entry-content {
	color: var(--muted-foreground);
	font-size: 0.875rem;
	line-height: 1.75;
}
.entry-content > * + * {
	margin-top: 1.25em;
}
.entry-content h2 {
	margin-top: 2em;
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--foreground);
}
.entry-content h3 {
	margin-top: 1.75em;
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--foreground);
}
/* Below sm (640px) inherits the smaller sizes above; restore the original
   sizes from sm and up, same rule as everywhere else in this theme. */
@media (min-width: 640px) {
	.entry-content {
		font-size: 1rem;
	}
	.entry-content h2 {
		font-size: 1.5rem;
	}
	.entry-content h3 {
		font-size: 1.25rem;
	}
}
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	margin-top: 1.5em;
	font-weight: 700;
	color: var(--foreground);
}
.entry-content a {
	color: var(--primary);
	text-decoration: underline;
	text-decoration-color: color-mix(in oklab, var(--primary) 40%, transparent);
	text-underline-offset: 2px;
}
.entry-content a:hover {
	text-decoration-color: var(--primary);
}
.entry-content strong {
	color: var(--foreground);
	font-weight: 600;
}
.entry-content ul,
.entry-content ol {
	padding-left: 1.375em;
}
.entry-content ul {
	list-style: disc;
}
.entry-content ol {
	list-style: decimal;
}
.entry-content li + li {
	margin-top: 0.5em;
}
.entry-content li::marker {
	color: var(--primary);
}
.entry-content blockquote {
	margin-top: 1.5em;
	border-left: 3px solid var(--primary);
	padding-left: 1.25em;
	font-style: italic;
	color: var(--foreground);
}
.entry-content img {
	margin-top: 1.5em;
	border-radius: calc(var(--radius) + 4px);
	border: 1px solid var(--border);
}
.entry-content hr {
	margin-top: 2em;
	border-color: var(--border);
}
.entry-content table {
	margin-top: 1.5em;
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}
.entry-content th,
.entry-content td {
	border: 1px solid var(--border);
	padding: 0.625em 0.875em;
	text-align: left;
}
.entry-content th {
	background: var(--surface);
	color: var(--foreground);
	font-weight: 600;
}

.page-links a {
	display: inline-flex;
	height: 2rem;
	min-width: 2rem;
	align-items: center;
	justify-content: center;
	border-radius: 9999px;
	border: 1px solid var(--border);
	padding: 0 0.5em;
	color: var(--foreground);
}
.page-links a:hover {
	background: var(--surface-2);
}

/* Contact Form 7 (section-contact.php): plain classes instead of Tailwind
   arbitrary variants ([&_input]:... etc) — that approach kept accidentally
   matching the acceptance checkbox too (width, padding, label styling all
   leaked onto it), needing ever-more-specific overrides. Plain CSS with an
   explicit :not([type="checkbox"]) is more robust. */
.cf7-form-wrap input:not([type="checkbox"]),
.cf7-form-wrap textarea,
.cf7-form-wrap select {
	width: 100%;
	border-radius: 1rem;
	border: 1px solid var(--border);
	background: var(--surface-2);
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	color: var(--foreground);
	outline: none;
	transition: border-color 0.15s;
}
.cf7-form-wrap textarea {
	border-radius: 0.625rem;
}
.cf7-form-wrap input::placeholder,
.cf7-form-wrap textarea::placeholder {
	color: var(--muted-foreground);
}
.cf7-form-wrap input:not([type="checkbox"]):focus,
.cf7-form-wrap textarea:focus,
.cf7-form-wrap select:focus {
	border-color: color-mix(in oklab, var(--primary) 60%, transparent);
}
.cf7-form-wrap label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
}
.cf7-form-wrap input[type="submit"] {
	margin-top: 0.5rem;
	width: auto;
	cursor: pointer;
	border-radius: 9999px;
	border: 0;
	background: linear-gradient(to right, var(--primary), var(--primary-glow));
	padding: 1rem 2rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--primary-foreground);
}

/* The acceptance checkbox is deliberately excluded from .cf7-form-wrap's
   general input rules above (:not([type="checkbox"])) — it gets its own
   custom look here instead, kept separate on purpose. */
.wpcf7-form-control.wpcf7-acceptance .wpcf7-list-item {
	/* CF7's own default stylesheet sets display:inline-block + a 1em left
	   margin on this (meant to space out multiple checkboxes in a list) —
	   with only one item it just adds an unwanted indent, and inline-block
	   fights with the label's width:100% below. */
	display: block;
	margin: 0;
}
.wpcf7-form-control.wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	width: 100%;
	margin-bottom: 0;
	text-transform: none;
	font-weight: 400;
	letter-spacing: normal;
	font-size: 0.75rem;
	color: var(--muted-foreground);
}
.wpcf7-form-control.wpcf7-acceptance .wpcf7-list-item-label {
	flex: 1 1 auto;
	min-width: 0;
}
.wpcf7-form-control.wpcf7-acceptance input[type="checkbox"] {
	/* Custom checkbox matching the other form controls (border + surface-2
	   background), instead of the browser-native checkbox. appearance:none
	   also overrides the wrapper's [&_input]:w-full (which matches this
	   checkbox too) — without that override it claims ~100% of the flex
	   row's width and squeezes the consent text into a wrapping sliver. */
	appearance: none;
	-webkit-appearance: none;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	margin-top: 0.1rem;
	flex-shrink: 0;
	position: relative;
	border: 1px solid var(--border);
	border-radius: 0.375rem;
	background: var(--surface-2);
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}
.wpcf7-form-control.wpcf7-acceptance input[type="checkbox"]:hover {
	border-color: color-mix(in oklab, var(--primary) 60%, transparent);
}
.wpcf7-form-control.wpcf7-acceptance input[type="checkbox"]:checked {
	background: var(--primary);
	border-color: var(--primary);
}
.wpcf7-form-control.wpcf7-acceptance input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 45%;
	width: 0.4rem;
	height: 0.75rem;
	border: solid var(--primary-foreground);
	border-width: 0 2px 2px 0;
	transform: translate(-50%, -50%) rotate(45deg);
}
.wpcf7-form-control.wpcf7-acceptance input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}
.wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.75rem;
	color: var(--color-red-400);
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--font-display), ui-sans-serif, system-ui, sans-serif;
	letter-spacing: -0.02em;
}

.text-gradient {
	background: var(--gradient-primary);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.bg-hero-glow {
	background-image: var(--gradient-hero);
}

.grid-bg {
	background-image:
		linear-gradient(oklch(1 0 0 / 0.04) 1px, transparent 1px),
		linear-gradient(90deg, oklch(1 0 0 / 0.04) 1px, transparent 1px);
	background-size: 60px 60px;
}

.grid-bg-faint {
	background-image:
		linear-gradient(oklch(1 0 0 / 0.04) 1px, transparent 1px),
		linear-gradient(90deg, oklch(1 0 0 / 0.04) 1px, transparent 1px);
	background-size: 60px 60px;
}

/* Scroll reveal (see js/main.js) */
.reveal {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity, transform;
}
.reveal.in-view {
	opacity: 1;
	transform: none;
}
.reveal-left {
	transform: translateX(-40px);
}
.reveal-right {
	transform: translateX(40px);
}
.reveal-scale {
	transform: scale(0.94);
}
.reveal.in-view.reveal-left,
.reveal.in-view.reveal-right,
.reveal.in-view.reveal-scale {
	transform: none;
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
}

/* Accessibility (WCAG)
--------------------------------------------- */

/* 2.4.11 Focus Not Obscured: offset anchor jumps (nav, footer, skip-links)
   so the fixed header doesn't cover the target. */
html {
	scroll-padding-top: 6rem;
}
section[id] {
	scroll-margin-top: 6rem;
}

/* Text meant only for screen readers. */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Skip-links: kept in the tab order, revealed on focus. */
.skip-link {
	position: fixed;
	top: 0;
	left: 50%;
	z-index: 100;
	padding: 0.75rem 1.5rem;
	border-radius: 9999px;
	background: var(--foreground);
	color: var(--background);
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	transform: translate(-50%, -150%);
	transition: transform 0.2s ease;
}
.skip-link:focus {
	transform: translate(-50%, 0.75rem);
}

/* Visible keyboard-focus ring, site-wide (mouse clicks don't trigger it). */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 3px;
}

/* Text-size switcher (template-parts/common/text-sizing.php) */
.text-sizing__link.is-active {
	background: var(--surface-2);
	color: var(--foreground);
}
html.text-size-medium {
	font-size: 18px;
}
html.text-size-big {
	font-size: 20px;
}

/* Header nav dropdown (inc/template-functions/nav.php Besecure_Nav_Walker):
   one level of children under a top-level item, toggled by a chevron button.
   Mechanism ported 1:1 from the codeme/event reference themes' nav__collapser
   (see codeme's resources/js/global.js navigationWCAG + mobileHeaderMenu,
   mirrored in besecureJS.navDropdowns in js/main.js): below 1200px, click
   slides the submenu open inline (jQuery slideDown/slideUp); at 1200px+ it's
   a CSS :hover panel — sitting flush against the trigger (top: 100%, no
   margin gap) so the pointer never crosses empty space and loses :hover
   between the link and the panel — plus a JS-driven .is-expanded class for
   keyboard/click activation, since :hover alone isn't reachable by keyboard. */
[data-nav-item] {
	position: relative;
	display: inline-block;
}
.nav-dropdown {
	flex-direction: column;
}
.nav-dropdown-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	margin-left: 0.25rem;
	cursor: pointer;
}
.nav-dropdown-toggle svg {
	transition: transform 0.2s ease;
}
.nav-dropdown-link {
	display: block;
	color: var(--muted-foreground);
	transition: color 0.2s ease;
}
.nav-dropdown-link:hover {
	color: var(--foreground);
}

@media (max-width: 1199.98px) {
	.nav-dropdown {
		display: none;
		margin-top: 0.5rem;
		padding-left: 1rem;
		gap: 0.5rem;
	}
	.nav-dropdown-link {
		padding: 0.375rem 0;
	}
	.nav-dropdown-toggle[aria-expanded="true"] svg {
		transform: rotate(180deg);
	}
}

@media (min-width: 1200px) {
	.nav-dropdown {
		display: flex;
		position: absolute;
		left: 0;
		top: 100%;
		z-index: 20;
		min-width: 14rem;
		gap: 0.25rem;
		padding: 0.5rem;
		border-radius: 1rem;
		border: 1px solid var(--border);
		background: var(--surface);
		box-shadow: var(--shadow-elegant);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-8px);
		transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
	}
	.nav-dropdown-link {
		border-radius: 0.5rem;
		padding: 0.5rem 0.75rem;
		font-size: 0.875rem;
	}
	.nav-dropdown-link:hover {
		background: color-mix(in oklab, var(--primary) 10%, transparent);
	}

	[data-nav-item]:hover > .nav-dropdown,
	[data-nav-item].is-expanded > .nav-dropdown {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}
	[data-nav-item]:hover > .nav-dropdown-toggle svg,
	[data-nav-item].is-expanded > .nav-dropdown-toggle svg {
		transform: rotate(180deg);
	}
}
