/* Rozumiem Biznes — style bazowe, layout, komponenty współdzielone */

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

/*
 * Kotwice z menu (#faq, #o-nas, #kontakt) lądowałyby pod przypiętym headerem —
 * scroll-margin odsuwa je o jego wysokość. Płynne przewijanie wyłącza się
 * automatycznie, gdy użytkownik prosi o ograniczenie ruchu.
 */
html { scroll-behavior: smooth; }
:target { scroll-margin-top: calc(var(--rb-header-height) + var(--rb-space-4)); }
body.admin-bar :target { scroll-margin-top: calc(var(--rb-header-height) + 32px + var(--rb-space-4)); }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body {
	margin: 0;
	font-family: var(--rb-font-sans);
	font-size: var(--rb-fs-body-m);
	line-height: var(--rb-lh-body-m);
	color: var(--rb-color-text);
	background: var(--rb-color-bg);
	-webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5 { color: var(--rb-color-heading); margin: 0 0 var(--rb-space-4); }
h1 { font-size: var(--rb-fs-h1); line-height: var(--rb-lh-h1); font-weight: var(--rb-fw-h1); letter-spacing: -0.02em; }
h2 { font-size: var(--rb-fs-h2); line-height: var(--rb-lh-h2); font-weight: var(--rb-fw-h2); letter-spacing: -0.02em; }
h3 { font-size: var(--rb-fs-h3); line-height: var(--rb-lh-h3); font-weight: var(--rb-fw-h3); }
h4 { font-size: var(--rb-fs-h4); line-height: var(--rb-lh-h4); font-weight: var(--rb-fw-h4); }
h5 { font-size: var(--rb-fs-h5); font-weight: var(--rb-fw-h5); }
p  { margin: 0 0 var(--rb-space-4); }

a { color: var(--rb-color-accent); text-decoration: none; transition: color var(--rb-transition-fast); }
a:hover { color: var(--rb-color-accent-hover); }

:where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid var(--rb-orange-300);
	outline-offset: 2px;
	border-radius: var(--rb-radius-sm);
}

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

/*
 * Atrybut `hidden` musi wygrywać z każdym `display` ustawionym przez motyw.
 * Reguła przeglądarki `[hidden] { display: none }` ma tę samą specyficzność co
 * selektor klasy, więc `.rb-enroll__option { display: grid }` ją nadpisywał —
 * w kreatorze zapisów zostawały widoczne (i klikalne) grupy z innego kursu.
 */
[hidden] { display: none !important; }

.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-only:focus {
	position: fixed; top: var(--rb-space-4); left: var(--rb-space-4);
	width: auto; height: auto; clip: auto; z-index: 999;
	padding: var(--rb-space-3) var(--rb-space-5);
	background: var(--rb-color-brand); color: #fff; border-radius: var(--rb-radius-md);
}

/* ===================== Przyciski ===================== */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--rb-space-2);
	padding: 1rem 1.75rem;
	font-size: var(--rb-fs-btn); font-weight: var(--rb-fw-btn); line-height: 1;
	border-radius: var(--rb-radius-full);
	border: 2px solid transparent;
	cursor: pointer; text-align: center;
	transition: background-color var(--rb-transition-fast), color var(--rb-transition-fast),
	            border-color var(--rb-transition-fast), transform var(--rb-transition-fast),
	            box-shadow var(--rb-transition-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--rb-color-accent); color: #fff; }
.btn--primary:hover { background: var(--rb-color-accent-hover); color: #fff; box-shadow: var(--rb-shadow-md); }

.btn--outline { background: #fff; color: var(--rb-color-heading); border-color: var(--rb-color-accent); }
.btn--outline:hover { background: var(--rb-orange-50); color: var(--rb-color-heading); }

.btn--navy { background: var(--rb-navy-900); color: #fff; }
.btn--navy:hover { background: var(--rb-navy-950); color: #fff; box-shadow: var(--rb-shadow-md); }

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

.btn--sm { padding: 0.75rem 1.35rem; font-size: var(--rb-fs-body-s); }

/* ===================== Header ===================== */

.site-header {
	position: sticky; top: 0; z-index: 100;
	background: transparent;
	border-bottom: 1px solid transparent;
	transition: box-shadow var(--rb-transition-normal), border-color var(--rb-transition-normal);
}

/*
 * Rozmycie tła siedzi na pseudo-elemencie, NIE na .site-header.
 * backdrop-filter na rodzicu tworzy containing block dla position:fixed, przez co
 * wysuwany panel menu i overlay pozycjonowały się względem headera zamiast okna
 * — menu "przeskakiwało" i było przycięte.
 */
.site-header::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgb(255 255 255 / 0.92);
	backdrop-filter: blur(10px);
}
.site-header.is-stuck { box-shadow: var(--rb-shadow-sm); border-bottom-color: var(--rb-color-border); }

.site-header__inner {
	display: flex; align-items: center; gap: var(--rb-space-6);
	min-height: var(--rb-header-height);
}

.site-header__logo { flex: 0 0 auto; margin-right: auto; }
.site-header__logo img { width: auto; max-height: 52px; }

/* --- nawigacja desktop --- */
.site-header__nav { display: flex; align-items: center; }

.primary-menu {
	display: flex; align-items: center; gap: var(--rb-space-1);
	list-style: none; margin: 0; padding: var(--rb-space-1);
	background: var(--rb-gray-100);
	border-radius: var(--rb-radius-full);
}
.primary-menu li { position: relative; }
.primary-menu a {
	display: block; padding: 0.7rem 1.15rem;
	font-size: var(--rb-fs-body-s); font-weight: 600;
	color: var(--rb-color-heading);
	border-radius: var(--rb-radius-full);
	transition: background-color var(--rb-transition-fast), color var(--rb-transition-fast);
}
.primary-menu a:hover { background: #fff; color: var(--rb-color-accent); }
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a { background: #fff; color: var(--rb-color-accent); box-shadow: var(--rb-shadow-sm); }

/* --- submenu --- */
.primary-menu .sub-menu {
	position: absolute; top: calc(100% + 0.5rem); left: 0; min-width: 220px;
	list-style: none; margin: 0; padding: var(--rb-space-2);
	background: #fff; border-radius: var(--rb-radius-lg);
	box-shadow: var(--rb-shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity var(--rb-transition-fast), transform var(--rb-transition-fast), visibility var(--rb-transition-fast);
}
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-menu .sub-menu a { border-radius: var(--rb-radius-md); }

.site-header__cta { flex: 0 0 auto; }

/* --- hamburger --- */
.nav-toggle {
	display: none; flex-direction: column; justify-content: center; gap: 6px;
	width: 44px; height: 44px; padding: 0 6px; margin-left: auto;
	background: transparent; border: 0; border-radius: var(--rb-radius-md); cursor: pointer;
}
.nav-toggle span {
	display: block; height: 3px; width: 100%; border-radius: 2px;
	background: var(--rb-color-accent);
	transition: transform var(--rb-transition-fast), opacity var(--rb-transition-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-overlay {
	position: fixed; inset: 0; z-index: 90;
	background: rgb(15 35 64 / 0.45);
	opacity: 0; visibility: hidden; transition: opacity var(--rb-transition-normal), visibility var(--rb-transition-normal);
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }

/*
 * Samo overflow:hidden na body powoduje skok do góry strony przy otwarciu menu
 * (przeglądarka gubi pozycję przewijania). Body jest więc unieruchamiane na
 * bieżącej pozycji, którą skrypt zapisuje w top i przywraca przy zamknięciu.
 */
body.nav-open {
	position: fixed;
	width: 100%;
	overflow: hidden;
}

.mobile-nav__head, .mobile-nav__foot { display: none; }

@media (max-width: 1023px) {
	.nav-toggle { display: flex; }
	.site-header__cta { display: none; }

	.site-header__nav {
		position: fixed; top: 0; right: 0; z-index: 95;
		width: min(360px, 88vw); height: 100dvh;
		max-height: 100dvh;
		flex-direction: column; align-items: stretch; gap: var(--rb-space-6);
		padding: var(--rb-space-6);
		background: #fff; box-shadow: var(--rb-shadow-lg);
		transform: translateX(100%);
		transition: transform var(--rb-transition-normal);
		overflow-y: auto;
	}
	.site-header__nav[data-open="true"] { transform: translateX(0); }

	.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; }
	.mobile-nav__foot { display: block; margin-top: auto; }
	.mobile-nav__cta { width: 100%; }

	.nav-close {
		width: 44px; height: 44px; display: grid; place-items: center;
		background: transparent; border: 0; border-radius: var(--rb-radius-md);
		color: var(--rb-color-accent); cursor: pointer;
	}

	.primary-menu {
		flex-direction: column; align-items: stretch; gap: var(--rb-space-1);
		background: transparent; padding: 0; border-radius: 0;
	}
	.primary-menu a { padding: 0.9rem 1rem; font-size: var(--rb-fs-body-l); }
	.primary-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; padding: 0 0 0 var(--rb-space-4);
	}
}

/* ===================== Treść stron ===================== */

/*
 * Nagłówek podstrony — ten sam wzorzec, co nadtytuły „FAQ" i „o nas":
 * cienki krój i kreska na całą szerokość kontenera.
 */
.page-hero { padding: var(--rb-space-12) 0 var(--rb-space-8); }
.page-hero__title {
	font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem);
	line-height: 1.2;
	font-weight: 300;
	letter-spacing: 0.01em;
	margin-bottom: 0;
	padding-bottom: var(--rb-space-5);
	border-bottom: 1px solid var(--rb-gray-300);
}
.page-hero__lead {
	font-size: var(--rb-fs-body-l);
	color: var(--rb-color-text-muted);
	max-width: 60ch;
	margin-top: var(--rb-space-5);
}

.entry-content { padding-bottom: var(--rb-space-20); }
.entry-content > *:not(.alignfull):not(.alignwide) {
	max-width: 760px;
}
.entry-content .alignfull { width: 100%; }

/* ---------------------- Strony tekstowe (regulamin, polityka) ------------------- */

/*
 * Treść jest wcięta względem nagłówka, a nie wyśrodkowana — tak jak w projekcie.
 * Poniżej 900 px wcięcie znika, żeby nie zjadać szerokości na telefonie.
 */
.entry-content > *:not(.alignfull):not(.alignwide) {
	margin-inline: 0 auto;
	padding-inline-start: clamp(0px, 6vw, 5rem);
}

/*
 * Selektory potomka (`.entry-content p`) sięgały w głąb bloków ACF i nadpisywały
 * ich własną typografię — blok ma zawsze niższą specyficzność niż reguła z dwoma
 * klasami. Dlatego stylujemy wyłącznie bezpośrednie dzieci: to trafia w treść
 * pisaną w edytorze, a bloki zostawia w spokoju.
 */
.entry-content > h2 {
	font-family: var(--rb-font-sans);
	font-size: var(--rb-fs-body-l);
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: 0.01em;
	margin-top: var(--rb-space-10);
	margin-bottom: var(--rb-space-5);
}
.entry-content > h2:first-child { margin-top: 0; }

.entry-content > h3 {
	font-family: var(--rb-font-sans);
	font-size: var(--rb-fs-body-m);
	font-weight: 700;
	margin-top: var(--rb-space-8);
	margin-bottom: var(--rb-space-4);
}

.entry-content > p {
	font-size: var(--rb-fs-body-s);
	line-height: 1.7;
	color: var(--rb-gray-600);
	margin-bottom: var(--rb-space-5);
}

.entry-content > ul,
.entry-content > ol {
	font-size: var(--rb-fs-body-s);
	line-height: 1.7;
	color: var(--rb-gray-600);
	margin-bottom: var(--rb-space-5);
	padding-inline-start: var(--rb-space-6);
}
.entry-content > ul li,
.entry-content > ol li { margin-bottom: var(--rb-space-2); }

@media (max-width: 900px) {
	.page-hero { padding-block: var(--rb-space-8) var(--rb-space-6); }
	.entry-content > *:not(.alignfull):not(.alignwide) { padding-inline-start: 0; }
	.entry-content { padding-bottom: var(--rb-space-12); }
}

/* Strona główna = same bloki, bez ograniczania szerokości */
.page-template-front .entry-content > * { max-width: none; margin-inline: 0; }
.page-template-front .entry-content { padding-bottom: 0; }

/* ===================== Footer ===================== */

.site-footer {
	background: var(--rb-navy-900);
	color: rgb(255 255 255 / 0.85);
	padding-block: clamp(2.5rem, 5vw, 4rem);
}
.site-footer a { color: rgb(255 255 255 / 0.85); }
.site-footer a:hover { color: #fff; }

.site-footer__brand { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.site-footer__logo { max-height: 64px; width: auto; }
.site-footer__wordmark { font-size: var(--rb-fs-h4); font-weight: 700; color: #fff; }

.site-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(1.5rem, 4vw, 3rem);
}

.site-footer__company,
.site-footer__address {
	font-size: var(--rb-fs-body-s);
	line-height: 1.6;
	margin-bottom: var(--rb-space-4);
}
.site-footer__address { margin-bottom: 0; }

/* --------------------------------- linki formalne -------------------------------- */

.site-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--rb-space-3);
	font-size: var(--rb-fs-body-s);
}
.site-footer__links a { display: inline-flex; align-items: center; gap: var(--rb-space-3); }

.site-footer__link-icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: var(--rb-radius-full);
	background: var(--rb-color-accent);
	color: #fff;
	transition: transform var(--rb-transition-fast);
}
.site-footer__links a:hover .site-footer__link-icon { transform: translateX(2px); }

/* ------------------------------------ social ------------------------------------- */

.site-footer__socials {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--rb-space-4);
}
.site-footer__socials a {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: var(--rb-radius-full);
	transition: transform var(--rb-transition-fast);
}
/* Ikony przychodzą z własnym pomarańczowym kołem — motyw nie dokłada tła. */
.site-footer__socials img { width: 56px; height: 56px; }
.site-footer__socials a:hover { transform: translateY(-2px); }

.site-footer__social-text {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: var(--rb-radius-full);
	background: var(--rb-color-accent);
	color: #fff;
	font-weight: 700;
}

.site-footer__bottom {
	margin-top: clamp(2rem, 4vw, 3rem);
	padding-top: var(--rb-space-5);
	border-top: 1px solid rgb(255 255 255 / 0.12);
	font-size: var(--rb-fs-body-xs);
	color: rgb(255 255 255 / 0.6);
}

@media (max-width: 900px) {
	/* Pion: dane, linki, a ikony w kolumnie po prawej stronie — jak w projekcie. */
	.site-footer__grid {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"company socials"
			"links   socials";
		align-items: start;
		gap: var(--rb-space-6);
	}
	.site-footer__col--company { grid-area: company; }
	.site-footer__col--links   { grid-area: links; }
	.site-footer__col--socials { grid-area: socials; }

	.site-footer__socials { flex-direction: column; gap: var(--rb-space-4); }
	.site-footer__socials a,
	.site-footer__socials img,
	.site-footer__social-text { width: 48px; height: 48px; }

	.site-footer__logo { max-height: 52px; }
}

/* Pasek administracyjny WordPressa jest fixed — panel i overlay muszą zaczynać się pod nim. */
body.admin-bar .site-header__nav { top: 32px; height: calc(100dvh - 32px); }
body.admin-bar .nav-overlay { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar .site-header__nav { top: 46px; height: calc(100dvh - 46px); }
	body.admin-bar .nav-overlay { top: 46px; }
}

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


/* ===================== Nagłówek sekcji (wzorzec powtarzalny) ===================== */

/*
 * Nagłówki sekcji są szeryfowe i mają końcówkę w kolorze akcentu.
 * Używają go bloki: section-intro, reasons, cards-dark.
 */
.rb-heading {
	font-family: var(--rb-font-serif);
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--rb-color-heading);
	margin: 0;
}
.rb-heading__accent { color: var(--rb-color-accent); }

.rb-heading--center { text-align: center; }

/* Link z okrągłą strzałką — powtarza się pod sekcjami. */
.rb-arrow-link {
	display: inline-flex;
	align-items: center;
	gap: var(--rb-space-4);
	font-weight: 700;
	color: var(--rb-color-heading);
}
.rb-arrow-link:hover { color: var(--rb-color-accent); }
.rb-arrow-link__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: var(--rb-radius-full);
	background: var(--rb-color-accent);
	color: #fff;
	transition: transform var(--rb-transition-fast);
}
.rb-arrow-link:hover .rb-arrow-link__icon { transform: translateX(3px); }
