/* Site-wide UI and chrome (not blocks). Page sections are blocks/<name>/style.css.
   BEM naming, theme.json tokens only – baseline to restyle per project. */

/* ── Buttons ─────────────────────────────────────────
   Flat – no shadows, no lift, color-swap on hover (design system, DESIGN.md).
   Base sets shape only; a variant supplies the colors. Arrow icon (inline SVG
   or Phosphor <i>) nudges on hover. Values mirror the prototype 1:1. */
.button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1;
	padding: 0.7rem 1.6rem;
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--md);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.button svg,
.button i { transition: transform 0.25s ease; }
.button:hover svg,
.button:hover i { transform: translateX(3px); }

/* Primary – gold fill, swaps to navy on hover */
.button--primary {
	color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}
.button--primary:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--accent);
}

/* Outline on light bg – fills navy on hover */
.button--outline {
	color: var(--wp--preset--color--primary);
	background: transparent;
	border-color: var(--wp--preset--color--primary);
}
.button--outline:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

/* Outline on dark bg – fills gold on hover */
.button--outline-light {
	color: var(--wp--preset--color--base);
	background: transparent;
	border-color: rgba(255, 255, 255, 0.4);
}
.button--outline-light:hover {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--primary);
}

/* Small variant */
.button--sm {
	padding: 0.5rem 1.15rem;
	font-size: 0.8rem;
}

/* ── Link-arrow ──────────────────────────────────────
   Ghost text link + arrow. Base sets shape; a variant supplies the color. */
.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	transition: color 0.25s ease;
}
.link-arrow svg,
.link-arrow i { transition: transform 0.25s ease; }
.link-arrow:hover svg,
.link-arrow:hover i { transform: translateX(4px); }

.link-arrow--dark { color: var(--wp--preset--color--primary); }
.link-arrow--dark:hover { color: var(--wp--preset--color--accent); }

.link-arrow--light { color: var(--wp--preset--color--accent); }
.link-arrow--light:hover { color: var(--wp--preset--color--base); }

/* ── Eyebrow ─────────────────────────────────────────
   Small uppercase kicker above section headings, with the signature gold bar
   to its left (the prototype's universal section pattern: `h-[3px] w-8 bg-gold`
   + uppercase label). Navy text by default, gold variant for dark sections.
   The bar stays gold in both variants. */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--wp--preset--color--primary);
}
.eyebrow::before {
	content: "";
	flex: none;
	width: 2rem;
	height: 3px;
	background: var(--wp--preset--color--accent);
}
.eyebrow--gold { color: var(--wp--preset--color--accent); }

/* Header, menu mobilne i stopka → assets/css/site-chrome.css (ładowane globalnie). */

.site-main__inner { padding-block: var(--wp--preset--spacing--lg); }

/* ── Aktualności: grid + karta ───────────────────────
   Komponent współdzielony: blok acf/news-teasers (strona główna) ORAZ listingi
   (home.php = strona wpisów, archive.php). Markup w template-parts/news-card.php.
   Karta DZIELONA (UX/WCAG): zdjęcie 16:10 na górze + biały panel treści (tekst NIGDY
   nie leży na foto). Kolory tekstu zdają kontrast (data muted, tytuł navy, zajawka text);
   złoto tylko dekoracyjnie (ramka na hover). Tytuł = nagłówek + stretched-link (cała
   karta klikalna, jeden link). FLAT – elewacja borderem, zero cieni. */
.news-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--sm);
}
@media (min-width: 640px) {
	.news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.news-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--wp--preset--spacing--md);
	}
}

.news-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--wp--custom--radius--lg);
	overflow: hidden;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	transition: border-color 0.25s ease;
}
/* Hover: złoto TYLKO jako element dekoracyjny (ramka) – nie tekst (kontrast). */
.news-card:hover,
.news-card:focus-within { border-color: var(--wp--preset--color--accent); }

/* Zdjęcie – kadr 16:10 na górze; tekst NIGDY nie leży na foto (czytelność/WCAG). */
.news-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background-color: var(--wp--preset--color--surface);
}
.news-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.news-card:hover .news-card__img,
.news-card:focus-within .news-card__img { transform: scale(1.04); }

/* Panel treści na bieli – wszystkie kolory tekstu zdają WCAG (data muted ≈4.7:1 AA,
   tytuł navy ≈9:1 AAA, zajawka text ≈12:1 AAA). */
.news-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.25rem 1.35rem 1.4rem;
}

.news-card__date {
	margin-block-end: 0.6rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
}

.news-card__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wp--preset--color--heading);
	/* clamp 2 linie – równe karty, brak „rozjazdu" wysokości tytułów. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Stretched link – cała karta klikalna, ale w DOM jeden, zwięzły link
   (UC Berkeley/W3C: bez zdublowanych linków, tytuł = nagłówek). BEZ podkreśleń –
   afordancja to ramka (gold) + zoom zdjęcia; focus widoczny globalnie (base.css). */
.news-card__link {
	color: inherit;
	text-decoration: none;
}
.news-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.news-card__excerpt {
	margin-block-start: 0.6rem;
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.6;
	color: var(--wp--preset--color--text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.news-list__empty { color: var(--wp--preset--color--muted); }

/* ── Paginacja (the_posts_pagination) – pigułki, aktywna złota ──────── */
.pagination { margin-block-start: var(--wp--preset--spacing--lg); }
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.65rem;
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--md);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}
.pagination a.page-numbers:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--primary);
}
.pagination .page-numbers.current {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--primary);
}

/* ── Artykuł (single post – wpis aktualności) ─────────
   Wąska kolumna czytelna; typografia treści z .prose (sections.css). */
.article { max-width: 42rem; margin-inline: auto; }

.article__meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-block-end: var(--wp--preset--spacing--md);
}
.article__rule {
	flex: none;
	width: 2rem;
	height: 3px;
	background: var(--wp--preset--color--accent);
}
.article__date {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--wp--preset--color--primary);
}

.article__figure { margin-block: var(--wp--preset--spacing--lg); }
.article__figure:first-of-type { margin-block-start: var(--wp--preset--spacing--sm); }
.article__figure img {
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--lg);
	display: block;
}
.article__figure figcaption {
	margin-block-start: 0.875rem;
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.article__footer {
	margin-block-start: var(--wp--preset--spacing--lg);
	padding-block-start: var(--wp--preset--spacing--md);
	border-top: 1px solid var(--wp--preset--color--border);
}
/* Link „wstecz" – strzałka w lewo, więc nudge w lewo (nadpisuje .link-arrow). */
.article__back:hover svg,
.article__back:hover i { transform: translateX(-4px); }

/* ── 404 ──────────────────────────────────────────────
   Sekcja składa się z .section--dark (tło + rytm pionowy z sections.css);
   tu tylko centrowanie kolumny, duży kod błędu i odstępy między klockami. */
.error-404__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

/* Duży, dekoracyjny kod błędu – Bricolage 800, złoty akcent. Czysto wizualny
   (aria-hidden), więc nie konkuruje semantycznie z H1 z section-header. */
.error-404__code {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: clamp(5rem, 18vw, 11rem);
	line-height: 0.9;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--accent);
}

/* Nagłówek (eyebrow + H1 + lead) trzyma się tuż pod kodem. */
.error-404 .section-header {
	margin-block: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--md);
}

.error-404__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--sm);
	justify-content: center;
}

/* ── „Do góry" – pływający przycisk powrotu na szczyt ─── */
/* Widoczność steruje JS (back-to-top.js) przez data-state="on" – sentinel + IntersectionObserver. */
.back-to-top {
	position: fixed;
	inset-block-end: clamp(1rem, 3vw, 2rem);
	inset-inline-end: clamp(1rem, 3vw, 2rem);
	z-index: 90;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	cursor: pointer;
	/* Ukryty domyślnie – bez interakcji i poza czytnikiem, dopóki nie zjedziemy ekranu. */
	opacity: 0;
	visibility: hidden;
	transform: translateY(0.75rem);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background-color 0.2s ease, border-color 0.2s ease;
}

.back-to-top[data-state="on"] {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s, background-color 0.2s ease, border-color 0.2s ease;
}

.back-to-top:hover {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

.back-to-top:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

.back-to-top__icon { width: 1.35rem; height: 1.35rem; }

@media (prefers-reduced-motion: reduce) {
	.back-to-top { transform: none; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
	.back-to-top[data-state="on"] { transition: opacity 0.2s ease, visibility 0s; }
}

/* ── Search form ────────────────────────────────────── */
.search-form { display: flex; gap: var(--wp--preset--spacing--xs); }

.search-form__input {
	flex: 1;
	padding: 0.6em 0.9em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--sm);
}

/* ── Empty state ─────────────────────────────────────
   Ciepły placeholder „wkrótce / TBA" zamiast gołego akapitu „Brak". Reużywany przez
   archiwa CPT bieżącej edycji (program/filmy/goście), gdy treść jeszcze nieogłoszona –
   markup: template-parts/empty-state.php. Płaski (bez cienia), na tokenach. Kółko ikony
   = odcień `surface`, więc kontrastuje na białej sekcji. */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--wp--preset--spacing--sm);
	max-width: 34rem;
	margin-inline: auto;
	padding-block: var(--wp--preset--spacing--md);
}

.empty-state__icon {
	display: grid;
	place-items: center;
	inline-size: 4rem;
	block-size: 4rem;
	margin-bottom: var(--wp--preset--spacing--sm);
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--accent);
}
.empty-state__icon svg {
	inline-size: 1.75rem;
	block-size: 1.75rem;
}

.empty-state__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	color: var(--wp--preset--color--heading);
}

.empty-state__text {
	margin: 0;
	max-width: 44ch;
	color: var(--wp--preset--color--muted);
}

.empty-state .button {
	margin-top: var(--wp--preset--spacing--sm);
}

/* ── Baner języka (ciepły fallback: treść bez wersji EN) ─ */
.lang-notice {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-block-end: var(--wp--preset--spacing--md);
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--sm);
}

.lang-notice__icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--wp--preset--color--accent);
}

.lang-notice__icon svg {
	inline-size: 1.125rem;
	block-size: 1.125rem;
}
