:root {
	/* ==========================================
	   Color palette — Figma token names
	   ========================================== */

	/* Neutral */
	--neutral-white: #ffffff;
	--neutral-100: #e9ebed;
	--neutral-300: #bec2c8;
	--neutral-500: #9299a3;
	--neutral-600: #757a82;
	--neutral-800: #3a3d41;
	--neutral-800-footer: #3a3d41;
	--neutral-900: #1d1e21;
	--neutral-black: #000000;

	/* Navy */
	--navy-50: #f1effc;
	--navy-100: #e6e3f4;
	--navy-200: #a399d3;
	--navy-300: #7666bc;
	--navy-400: #4833a6;
	--navy-500: #1a0090;
	--navy-600: #150073;

	/* Red */
	--red-500: #ed1c24;
	--red-600: #be161d;
	--red-650: #a41419;
	--red-700: #8e1116;

	/* ==========================================
	   Functional aliases (used throughout codebase)
	   ========================================== */
	--color-white: var(--neutral-white);
	--color-white-permanent: #ffffff; /* stały biały — tekst na tłach które nie zmieniają się w dark mode */
	--color-black: var(--neutral-black);
	--color-dark: var(--neutral-800);
	--color-dark-bg: var(--neutral-900);
	--color-border: #e0e0e0;
	--color-hover-bg: #f5f5f5;
	--color-gray: var(--neutral-500);
	--color-primary: var(--navy-600);
	--color-primary-dark: var(--navy-500);
	--color-accent: var(--navy-300);
	--color-link: #5046e5;
	--color-cta: var(--red-600);
	--color-cta-hover: #a01218;

	/* Alpha colors */
	--color-white-alpha-10: rgba(255, 255, 255, 0.1);
	--color-white-alpha-15: rgba(255, 255, 255, 0.15);
	--color-white-alpha-20: rgba(255, 255, 255, 0.2);
	--color-white-alpha-30: rgba(255, 255, 255, 0.3);

	/* Typography */
	--font-family: 'IBM Plex Sans', sans-serif;

	/* Border radius */
	--corner-l: 40px;
	--corner-s: 12px;
	--corner-xs: 4px;
	--radius-dropdown-trigger: var(--corner-s) var(--corner-s) var(--corner-xs) var(--corner-s);
	--radius-dropdown-panel: var(--corner-s) var(--corner-xs) var(--corner-s) var(--corner-s);
	--radius-option-default: var(--corner-s) var(--corner-s) var(--corner-xs) var(--corner-s);
	--radius-option-active: var(--corner-s) var(--corner-xs) var(--corner-s) var(--corner-s);

	/* Layout */
	--container-width: 1376px;
	--container-padding: 32px;

	/* Effects */
	--shadow-dropdown: 0 8px 32px rgba(0, 0, 0, 0.12);
	--gradient-header: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);

	/* Z-index */
	--z-navbar: 1000;
	--z-mobile-menu: 1001;
}

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

html {
	overflow-x: clip;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-family);
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	overflow-x: clip;
}

main {
	flex: 1;
}

/* --- Subpage decorative shapes --- */
body:not(.home):not(.page-on-front) #main {
	position: relative;
	overflow: clip;
	isolation: isolate;
}

body:not(.home):not(.page-on-front) #main::before,
body:not(.home):not(.page-on-front) #main::after {
	content: "";
	position: absolute;
	pointer-events: none;
	z-index: -1;
	border-radius: var(--corner-xl, 40px) var(--corner-xl, 40px) var(--corner-xl, 40px) var(--corner-s, 12px);
}

/* Left — navy */
body:not(.home):not(.page-on-front) #main::before {
	width: 267px;
	height: 202px;
	background: var(--navy-400, #4833A6);
	top: calc(80px + 600px);
	left: -192px;
}

/* Right — red */
body:not(.home):not(.page-on-front) #main::after {
	width: 496px;
	height: 202px;
	background: var(--red-650, #A41419);
	transform: rotate(90deg);
	top: calc(80px + 267px + 670px);
	right: -248px;
}

/* Pages with no-decor-shapes body class hide decorative shapes */
body.no-decor-shapes #main::before,
body.no-decor-shapes #main::after {
	display: none;
}

@media (max-width: 1300px) {
	body:not(.home):not(.page-on-front) #main::before,
	body:not(.home):not(.page-on-front) #main::after {
		display: none;
	}
}

/* --- WP core block overrides --- */
.wp-block-columns {
	max-width: 900px;
	margin: 0 auto;
	padding: 32px 0;
	color: var(--neutral-black);
}

@media (max-width: 768px) {
	.wp-block-columns {
		padding: 16px;
		flex-direction: column !important;
	}
}

/* --- WP core: Media & Text --- */
.wp-block-media-text {
	max-width: 900px;
	margin: 0 auto;
	padding: 0;
	color: var(--neutral-black);
	gap: 32px;
}

.wp-block-media-text .wp-block-media-text__media img {
	border-radius: var(--corner-s);
}

.wp-block-media-text .wp-block-media-text__content {
	font-family: var(--font-family);
	font-size: 20px;
	line-height: 1.4;
	padding: 0;
}

.wp-block-media-text .wp-block-media-text__content p {
	margin: 0 0 1em;
}

.wp-block-media-text .wp-block-media-text__content a {
	color: var(--color-link);
	text-decoration: underline;
}

@media (max-width: 768px) {
	.wp-block-media-text {
		padding: 0 16px;
	}
}

/* --- WP core: Image --- */
.wp-block-image {
	max-width: 900px;
	margin: 32px auto;
}

.wp-block-image img {
	border-radius: var(--corner-s);
}

.wp-block-image figcaption {
	font-family: var(--font-family);
	font-size: 14px;
	color: var(--neutral-500);
	text-align: center;
	margin-top: 8px;
}

/* --- Separator (dashed) --- */
.separator {
	border: none;
	border-top: 3px dashed var(--color-accent);
	margin: 0;
	width: 100%;
}

/* WordPress core separator - dashed style */
.wp-block-separator.is-style-dashed {
	border: none;
	border-top: 3px dashed var(--color-accent, #7666bc);
	margin: 0;
	width: 100%;
	opacity: 1;
}

/* ==========================================
   Dark mode — palette overrides
   Functional aliases (--color-*) auto-update
   because they reference palette tokens.
   ========================================== */
html.mode-dark {
	/* Neutral */
	--neutral-white: #1d1e21;
	--neutral-100: #1d1e21;
	--neutral-300: #585c62;
	/* --neutral-500 unchanged (#9299a3) */
	--neutral-600: #a8adb5;
	--neutral-800: #898e95;
	--neutral-800-footer: #111113;
	--neutral-900: #e9ebed;
	--neutral-black: #f1f2f4;

	/* Navy */
	--navy-50: #0a1055;
	--navy-100: #161b5b;
	--navy-200: #2d337c;
	--navy-300: #727be4;
	--navy-400: #8189e4;
	--navy-500: #abb0ed;
	--navy-600: #d5d8f6;

	/* Red */
	--red-500: #cb352a;
	--red-600: #e5574c;
	--red-650: #9c281e;
	--red-700: #ec8179;

	/* Functional overrides (non-palette) */
	--color-border: #585c62;
	--color-hover-bg: #2a2b2e;
	--color-link: #8189e4;
	--color-cta-hover: #cb352a;
}

/* --- Base --- */
html.mode-dark body {
	background-color: var(--neutral-white);
}

/* --- Hero --- */
html.mode-dark .block-hero {
	background: var(--neutral-white);
}

/* --- Programs --- */
html.mode-dark .block-programs__dot {
	background-color: rgba(255, 255, 255, 0.3);
}

/* --- Elements using --navy-500 as text (invisible on dark bg) --- */
html.mode-dark .block-statistics__value,
html.mode-dark .block-statistics__label,
html.mode-dark .block-news__cta,
html.mode-dark .block-calendar__btn,
html.mode-dark .block-statistics__cta {
	color: var(--navy-500);
}

/* --- Buttons with navy borders --- */
html.mode-dark .block-news__cta,
html.mode-dark .block-calendar__btn,
html.mode-dark .block-statistics__cta,
html.mode-dark .block-statistics__card {
	border-color: var(--navy-200);
}

html.mode-dark .block-news__cta:hover,
html.mode-dark .block-calendar__btn:hover,
html.mode-dark .block-statistics__cta:hover {
	background-color: var(--navy-200);
	color: #ffffff;
}


/* --- Footer --- */
html.mode-dark .site-footer {
	background-color: var(--neutral-800-footer);
}

/* --- Decorative shapes --- */
html.mode-dark #main::before {
	background: var(--navy-400);
}

html.mode-dark #main::after {
	background: var(--red-650);
}
