/* MKZ Unia Racibórz — style dodatkowe (poza theme.json).
 * Komponenty współdzielone z edytorem znajdują się w components.css. */

/* ====== Przyciski — hover z uniesieniem ====== */
.wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(14, 27, 42, 0.2);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(14, 27, 42, 0.25);
}

/* ====== Nawigacja — animowane podkreślenie ====== */
.wp-block-navigation .wp-block-navigation-item a {
	position: relative;
	transition: color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -4px;
	width: 100%;
	height: 2px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.wp-block-navigation .wp-block-navigation-item a:hover::after,
.wp-block-navigation .wp-block-navigation-item a:focus-visible::after {
	transform: scaleX(1);
}

/* ====== Linki w treści ====== */
.entry-content a:hover {
	text-decoration: underline;
}

/* Przyciski nie podkreślają tekstu na hover (podkreślenie zostaje linkom tekstowym). */
.entry-content a.wp-block-button__link:hover {
	text-decoration: none;
}

/* ====== Sticky nagłówek ====== */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 0 rgba(14, 27, 42, 0.06);
}

/* Gdy zalogowany użytkownik ma przyklejony pasek WordPressa, nagłówek
 * zaczyna się bezpośrednio pod nim. Na telefonach pasek ma position:absolute
 * i przewija się ze stroną, dlatego offset obowiązuje dopiero od 601 px. */
@media (min-width: 601px) {
	body.admin-bar header.wp-block-template-part {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}

/* ====== Tabele w treści ====== */
.wp-block-post-content table,
.entry-content table {
	border-collapse: collapse;
	width: 100%;
}

/* Stare tabele z Joomli miały inline width:555px i stałą wysokość.
 * Na telefonie rozszerzały cały dokument i tworzyły duże puste obszary. */
.wp-block-post-content table.tabel_zew,
.entry-content table.tabel_zew {
	height: auto !important;
	max-width: 100% !important;
	table-layout: fixed;
	width: 100% !important;
}

.wp-block-post-content table.tabel_zew td,
.wp-block-post-content table.tabel_zew th,
.entry-content table.tabel_zew td,
.entry-content table.tabel_zew th {
	max-width: 100%;
	overflow-wrap: anywhere;
	width: auto !important;
}

.wp-block-post-content table.tabel_zew img,
.entry-content table.tabel_zew img {
	display: block;
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: calc(100% - 10px) !important;
	width: auto !important;
}

.wp-block-post-content td,
.wp-block-post-content th,
.entry-content td,
.entry-content th {
	border: 1px solid var(--wp--preset--color--surface-2);
	padding: 0.5rem 0.75rem;
}

.wp-block-post-content tr:nth-child(even),
.entry-content tr:nth-child(even) {
	background: var(--wp--preset--color--surface);
}

/* ====== Obrazki w treści ====== */
.wp-block-post-content img,
.entry-content img {
	height: auto;
	max-width: 100%;
	border-radius: 8px;
}

/* Kontrast WCAG AA: jasny błękit pozostaje kolorem marki i tła,
 * a tekstowe linki oraz drobna meta używają ciemniejszego wariantu. */
.wp-block-post-date.has-primary-color {
	color: var(--wp--preset--color--primary-dark) !important;
}

.wp-block-paragraph.has-primary-color {
	color: var(--wp--preset--color--primary-dark) !important;
}

/* Na jasnych sekcjach wariant "muted" i błękit marki są zbyt jasne
 * dla drobnego tekstu. Ciemniejsze warianty zachowują WCAG AA. */
.wp-block-post-content > .wp-block-group:not(.has-contrast-background-color) .has-muted-color {
	color: #5f6d7d !important;
}

.wp-block-post-content > .wp-block-group:not(.has-contrast-background-color) a:not(.wp-block-button__link):not(.wp-block-file__button) {
	color: var(--wp--preset--color--primary-dark);
}

footer.wp-block-group a {
	color: #e8f4fb;
}

footer.wp-block-group a:hover,
footer.wp-block-group a:focus-visible {
	color: var(--wp--preset--color--accent);
}

footer.wp-block-group .has-muted-color {
	color: #a9b8c7 !important;
}

/* ====== Historia klubu ====== */
.unia-history {
	box-sizing: border-box;
}

.unia-history p,
.unia-history li {
	line-height: 1.75;
}

.unia-history > h2 {
	border-bottom: 2px solid var(--wp--preset--color--surface-2);
	font-size: clamp(1.7rem, 3vw, 2.25rem);
	margin-top: clamp(3.5rem, 7vw, 5rem);
	padding-bottom: 0.75rem;
}

.unia-history > h3 {
	color: var(--wp--preset--color--primary-dark);
	font-size: clamp(1.25rem, 2.2vw, 1.55rem);
	margin-top: 2.75rem;
	margin-bottom: 0.75rem;
}

.unia-history-lead {
	font-size: clamp(1.08rem, 1.4vw, 1.22rem);
	font-weight: 600;
	line-height: 1.7 !important;
}

.unia-history-toc {
	background: var(--wp--preset--color--surface);
	border-left: 5px solid var(--wp--preset--color--primary);
	border-radius: 12px;
	margin-bottom: 3.5rem;
	padding: clamp(1.25rem, 3vw, 2rem);
}

.unia-history-toc__title {
	font-size: 1.15rem;
	margin-top: 0;
}

.unia-history-toc__links,
.unia-history-sponsors {
	display: grid;
	gap: 0.55rem 2rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 0;
	padding-left: 1.25rem;
}

.unia-history-highlight {
	background: var(--wp--preset--color--contrast);
	border-radius: 12px;
	color: #ffffff;
	font-size: 1.08rem;
	font-weight: 600;
	margin-block: 2rem;
	padding: 1.5rem;
}

.unia-history-achievements,
.unia-history-medalists,
.unia-history-timeline,
.unia-history-activists {
	background: var(--wp--preset--color--surface);
	border-radius: 12px;
	padding: 1.25rem 1.25rem 1.25rem 2.5rem;
}

.unia-history-closing {
	border-top: 2px solid var(--wp--preset--color--primary);
	font-size: 1.12rem;
	font-weight: 700;
	margin-top: 3.5rem;
	padding-top: 1.5rem;
}

/* ====== Focus visible (WCAG) ====== */
:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* ====== Nawigacja mobilna ====== */
@media (max-width: 782px) {
	.wp-block-navigation .wp-block-navigation-item {
		padding: 0.25rem 0;
	}

	.unia-page-shell > .wp-block-group:first-child {
		margin-left: 1rem !important;
		margin-right: 1rem !important;
		max-width: calc(100% - 2rem) !important;
	}

	.unia-history {
		font-size: 1rem;
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.unia-history > h2 {
		font-size: 1.65rem;
		margin-top: 3rem;
	}

	.unia-history > h3 {
		font-size: 1.3rem;
		margin-top: 2.25rem;
	}

	.unia-history-toc__links,
	.unia-history-sponsors {
		grid-template-columns: 1fr;
	}
}

/* ====== Paginacja ====== */
.wp-block-query-pagination {
	gap: 0.5rem;
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-query-pagination .page-numbers {
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

.wp-block-query-pagination a.page-numbers:hover {
	background: var(--wp--preset--color--surface-2);
	transform: translateY(-2px);
}

/* ====== Szerokie sekcje (alignfull) ====== */
.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}

/* ====== Animacje pojawiania się sekcji (fade-in on scroll) ====== */
.unia-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.unia-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* Parallax: transform wyłącza background-attachment: fixed,
 * więc cover z .has-parallax nie dostaje przesunięcia — tylko fade-in. */
.unia-reveal.has-parallax {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.unia-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ====== Ograniczenie szerokości mediów osadzonych ====== */
.wp-block-embed {
	max-width: 100%;
}
